/* マイページ専用スタイル - 新レイアウト */

.profile-page-new {
    /* sticky の top 計算用（ヘッダー下のグレー帯の上余白と一致させる） */
    --profile-page-pad-top: 30px;
    min-height: 100vh;
    background: var(--color-bg);
    padding: var(--profile-page-pad-top) 0;
    /* styles.css の overflow-x:hidden は overflow-y を auto 扱いにし sticky の基準が変わる → clip で横だけ隠す */
    overflow-x: clip !important;
    overflow-y: visible !important;
}

/* グリッド＋sticky で DM タブ時に左バーが縦にずれる事例があるため、flex＋上揃えで統一 */
.profile-layout {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    align-content: flex-start;
    justify-content: flex-start;
    gap: 28px;
    overflow: visible;
    width: min(1280px, 100% - 32px);
    margin: 0 auto;
    /* 全タブ共通: 左バー＋メインの上端を同じだけ下げ、タブ切替で縦位置が変わらないようにする */
    padding: 28px 16px 0;
    box-sizing: border-box;
}

.profile-layout > .profile-sidebar {
    flex: 0 0 auto;
    width: min(320px, 100%);
    min-width: 260px;
    max-width: 320px;
    align-self: flex-start;
}

.profile-layout > .profile-main {
    flex: 1 1 0;
    min-width: 0;
    align-self: flex-start;
}

/* 他ユーザービュー等でサイドバー無し・main のみ */
.profile-layout > .profile-main:only-child {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
}

@media (min-width: 1401px) {
    .profile-layout {
        max-width: 1400px;
    }
}

/* 左サイドバー（sticky 廃止: DM 等でタブごとに縦位置がズレるため通常フロー。長いメニューはページと一緒にスクロール） */
.profile-sidebar {
    width: 100%;
    min-width: 260px;
    background: var(--color-surface);
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 30px 20px;
    position: relative;
    top: auto;
    max-height: none;
    overflow-x: visible;
    overflow-y: visible;
    height: auto;
    min-height: fit-content;
}

.profile-sidebar-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* プロフィール画像 */
.profile-image-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.profile-image-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
}

.profile-sidebar-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--color-primary);
    box-shadow: 0 4px 15px rgba(var(--color-primary-rgb), 0.3);
}

/* デフォルトアイコン（data URI SVG）の青固定を避け、季節テーマで塗る */
.profile-sidebar-image[data-is-placeholder="1"] {
    background: var(--gradient-primary);
}

.profile-image-edit-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 3px solid white;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.profile-image-edit-btn:hover {
    background: var(--color-primary-strong);
    transform: scale(1.1);
}

.profile-image-edit-btn svg {
    width: 20px;
    height: 20px;
}

/* ユーザー名 */
.profile-sidebar-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    line-height: 1.25;
}

.profile-sidebar-username {
    font-size: 14px;
    color: #666;
    margin: -10px 0 0 0;
    text-align: center;
}

/* フォロワー・フォロー中 */
.profile-sidebar-stats {
    display: flex;
    gap: 20px;
    width: 100%;
    justify-content: center;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.3s;
}

.sidebar-stat-item:hover {
    opacity: 0.7;
}

.sidebar-stat-item .stat-number {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    line-height: 1;
}

.sidebar-stat-item .stat-label {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* サイドバーメニュー */
.profile-sidebar-menu {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: #666;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
}

.sidebar-menu-item:hover {
    background: #f5f5f5;
    color: var(--color-primary);
}

.sidebar-menu-item.active {
    background: var(--gradient-primary);
    color: white;
}

.sidebar-menu-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.menu-badge {
    margin-left: auto;
    background: rgba(255,255,255,0.3);
    color: inherit;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
}

.sidebar-menu-item.active .menu-badge {
    background: rgba(255,255,255,0.4);
}

/* DM 未読：丸枠内に件数（① のイメージ） */
.menu-badge.dm-unread-menu-badge {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8e53 100%);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(255, 107, 157, 0.35);
}

.sidebar-menu-item:not(.active) .menu-badge.dm-unread-menu-badge {
    background: var(--gradient-primary);
    border-color: rgba(var(--color-primary-rgb), 0.35);
    box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.25);
}

.sidebar-menu-item.active .menu-badge.dm-unread-menu-badge {
    background: rgba(255, 255, 255, 0.95);
    color: var(--color-primary-strong);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: none;
}

/* プロフィール編集ボタン */
.profile-edit-sidebar-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: var(--gradient-primary);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    margin-top: 10px;
}

.profile-edit-sidebar-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.4);
}

.profile-edit-sidebar-btn svg {
    width: 18px;
    height: 18px;
}

.profile-edit-sidebar-btn.btn-following {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #e0e0e0;
}

.profile-edit-sidebar-btn.btn-following:hover {
    background: #e8e8e8;
}

.profile-edit-sidebar-btn.btn-request-pending {
    background: white;
    color: #333;
    border: 2px solid #e0e0e0;
}

.profile-edit-sidebar-btn.btn-request-pending:hover {
    background: #f0f0f0;
    color: #333;
}

/* 右メインエリア */
.profile-main {
    flex: 1;
    min-width: 0;
    min-height: 300px;
    width: 100%;
}

/* タブ表示時はメイン内の表示タブが確実に幅を持つように */
.profile-main > .profile-tab-content.active,
.profile-main > [id^="tab-"].active {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.profile-main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.profile-main-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.profile-main-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

/* 視聴統計：PC/iPad向け「視聴状況システム」切替トグル */
.profile-stats-mode-toggle {
    display: none; /* JSで対象デバイスのみ表示 */
    align-items: center;
    gap: 10px;
    user-select: none;
}
.profile-stats-mode-toggle .toggle-label {
    font-size: 13px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.65);
    white-space: nowrap;
}
.profile-stats-mode-toggle .toggle-switch {
    position: relative;
    width: 46px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid rgba(var(--color-primary-rgb), 0.35);
    background: rgba(var(--color-primary-rgb), 0.14);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    flex: 0 0 auto;
}
.profile-stats-mode-toggle .toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease;
}
.profile-stats-mode-toggle label {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.profile-stats-mode-toggle input[type="checkbox"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    pointer-events: none;
}
.profile-stats-mode-toggle input[type="checkbox"]:checked + .toggle-switch {
    background: rgba(var(--color-primary-rgb), 0.32);
    border-color: rgba(var(--color-primary-rgb), 0.55);
}
.profile-stats-mode-toggle input[type="checkbox"]:checked + .toggle-switch::after {
    transform: translateX(20px);
}
.profile-stats-mode-toggle input[type="checkbox"]:focus-visible + .toggle-switch {
    outline: 2px solid rgba(var(--color-primary-rgb), 0.55);
    outline-offset: 2px;
}
@media (max-width: 767px) {
    /* スマホは一切変えない：トグルを出さない */
    .profile-stats-mode-toggle { display: none !important; }
}

.customize-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: var(--gradient-primary);
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.customize-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.4);
}

.customize-btn svg {
    width: 18px;
    height: 18px;
}

/* プロフィールタブコンテンツ */
.profile-tab-content {
    display: none;
}

.profile-tab-content.active {
    display: block !important;
    min-height: 200px;
    visibility: visible !important;
    opacity: 1 !important;
}

/* タブ切り替え時に確実に表示（JSでactiveを付与した場合の保険） */
#tab-overview.active,
#tab-mylist.active,
#tab-statistics.active,
#tab-dm.active,
#tab-image-creator.active,
#tab-account.active {
    display: block !important;
    min-height: 200px;
}

#tab-statistics {
    min-width: 0;
    overflow-x: hidden;
}

/* カスタマイズ可能エリア */
.profile-customizable-area {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.empty-customize-state {
    background: white;
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.empty-customize-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-customize-state h3 {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
}

.empty-customize-state p {
    font-size: 14px;
    color: #666;
    margin: 0 0 25px 0;
}

/* プロフィールセクション（内容に合わせて枠を下に伸ばす） */
.profile-section {
    background: var(--color-surface);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: relative;
    min-width: 0;
    overflow: visible;
}

.profile-section.editable {
    border: 2px dashed transparent;
    transition: border-color 0.3s;
}

.profile-section.editable:hover {
    border-color: var(--color-primary);
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-actions {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
}

.section-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: #f5f5f5;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.section-action-btn:hover {
    background: #e8e8e8;
    color: #333;
}

.section-action-btn svg {
    width: 16px;
    height: 16px;
}

/* アニメギャラリー */
.anime-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
}

.anime-gallery-item {
    position: relative;
    aspect-ratio: 3/4;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.anime-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.anime-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.anime-gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 15px;
    color: white;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.anime-gallery-item:hover .anime-gallery-overlay {
    transform: translateY(0);
}

.anime-gallery-overlay h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 5px 0;
    line-height: 1.3;
}

.anime-gallery-overlay p {
    font-size: 12px;
    margin: 0;
    opacity: 0.9;
}

/* TOP 10バッジ */
.top10-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* キャラクターギャラリー */
.characters-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
}

.character-item {
    text-align: center;
}

.character-item img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e0e0e0;
    margin-bottom: 10px;
    transition: border-color 0.3s;
}

.character-item:hover img {
    border-color: var(--color-primary);
}

.character-item h3 {
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    color: #333;
}

/* 統計カード */
.statistics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

/* マイリストセクション（統計タブの視聴状況別を含む） */
.mylist-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    min-width: 0;
    overflow-x: hidden;
}

.mylist-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 15px;
}

.mylist-tab {
    padding: 10px 20px;
    background: #f5f5f5;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.mylist-tab:hover {
    background: #e8e8e8;
}

.mylist-tab.active {
    background: var(--gradient-primary);
    color: white;
}

.mylist-tab .count-badge {
    background: rgba(255,255,255,0.3);
    color: inherit;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
}

.mylist-tab.active .count-badge {
    background: rgba(255,255,255,0.4);
}

.mylist-tab-pane {
    display: none;
}

.mylist-tab-pane.active {
    display: block;
}

/* 統計・マイリスト内：視聴状況別は約5列。ポスターは切らず contain（カード幅に合わせて縮小） */
#tab-statistics .anime-cards,
#tab-mylist .anime-cards,
.mylist-section .anime-cards {
    min-width: 0;
    gap: 10px;
    padding: 16px 0;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}
#tab-statistics .anime-cards .anime-card,
#tab-mylist .anime-cards .anime-card,
.mylist-section .anime-cards .anime-card {
    min-width: 0;
}
#tab-statistics .anime-card-image,
#tab-mylist .anime-card-image,
.mylist-section .anime-card-image {
    height: auto;
    min-height: 0;
    max-height: clamp(120px, 18vw, 190px);
    aspect-ratio: 2 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #f0f2f6 0%, #e6e9f0 100%);
    overflow: hidden;
}
#tab-statistics .anime-card-image img,
#tab-mylist .anime-card-image img,
.mylist-section .anime-card-image img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
}

@media (max-width: 1024px) {
    #tab-statistics .anime-cards,
    #tab-mylist .anime-cards,
    .mylist-section .anime-cards {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px;
    }
}
@media (max-width: 768px) {
    #tab-statistics .anime-cards,
    #tab-mylist .anime-cards,
    .mylist-section .anime-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }
}

/* 統計・マイリストの小さいカード：ステータスボタン右の余白を左（スコアとの隙間）と同幅に */
body .profile-main .anime-card .anime-card-content,
body #tab-statistics .anime-card .anime-card-content,
body #tab-mylist .anime-card .anime-card-content,
body .mylist-section .anime-card .anime-card-content {
    padding: 12px 4px 12px 8px !important; /* 上 右 下 左 */
}
#tab-statistics .anime-card .anime-title,
#tab-mylist .anime-card .anime-title,
.mylist-section .anime-card .anime-title {
    padding-left: 4px;
    padding-right: 4px;
}

/* スコアとステータスボタンを自然なバランスで横並びに（ボタン左の余白を確実に詰める） */
#tab-statistics .anime-card .anime-score-row,
#tab-mylist .anime-card .anime-score-row,
.mylist-section .anime-card .anime-score-row {
    flex-wrap: wrap;
    flex-direction: row;
    align-items: center;
    gap: 4px !important;
}
#tab-statistics .anime-card .anime-score-section,
#tab-mylist .anime-card .anime-score-section,
.mylist-section .anime-card .anime-score-section {
    flex: 0 0 auto !important;
    min-width: 0;
    width: min-content;
}
#tab-statistics .anime-card .anime-score,
#tab-mylist .anime-card .anime-score,
.mylist-section .anime-card .anime-score {
    padding: 8px 12px;
    padding-top: 12px;
    gap: 6px;
    font-size: 0.95em;
}
#tab-statistics .anime-card .anime-score-count-badge,
#tab-mylist .anime-card .anime-score-count-badge,
.mylist-section .anime-card .anime-score-count-badge {
    font-size: 10px;
    padding: 3px 8px;
}
#tab-statistics .anime-card .star-icon,
#tab-mylist .anime-card .star-icon,
.mylist-section .anime-card .star-icon {
    font-size: 18px;
}
#tab-statistics .anime-card .anime-score-value,
#tab-mylist .anime-card .anime-score-value,
.mylist-section .anime-card .anime-score-value {
    font-size: 16px;
    min-width: 32px;
}
#tab-statistics .anime-card .status-selector,
#tab-mylist .anime-card .status-selector,
.mylist-section .anime-card .status-selector {
    flex: 1 1 auto;
    min-width: 0;
}
#tab-statistics .anime-card .status-main-btn,
#tab-mylist .anime-card .status-main-btn,
.mylist-section .anime-card .status-main-btn {
    width: 100%;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 14px;
    box-sizing: border-box;
}
#tab-statistics .anime-card .status-icon,
#tab-mylist .anime-card .status-icon,
.mylist-section .anime-card .status-icon {
    font-size: 18px;
}

.anime-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

/* 作成したマイリスト（カード一覧・クリックで中身） */
.profile-custom-mylist-wrap {
    margin-bottom: 32px;
}
.profile-mylist-all-row {
    margin-bottom: 16px;
}
.profile-mylist-all-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.profile-mylist-all-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.4);
}
.profile-sub-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}
.profile-custom-mylist-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}
.profile-custom-mylist-cards > :not(.profile-custom-mylist-card) {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
}
.profile-custom-mylist-card {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #eee;
}
.profile-custom-mylist-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
/* 表紙：2×2 最大4枚（従来レイアウト） */
.profile-custom-mylist-card-covers {
    width: 100%;
    flex: 0 0 auto;
    aspect-ratio: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    background: #f0f0f0;
}
.profile-custom-mylist-card-covers img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.profile-custom-mylist-card-covers .profile-custom-mylist-card-empty {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #999;
}
.profile-custom-mylist-card-name {
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-custom-mylist-empty {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    color: #666;
    font-size: 14px;
    line-height: 1.65;
    padding: 24px 0;
    margin: 0;
    text-align: left;
    overflow-wrap: anywhere;
    word-break: normal;
}
.profile-mylist-detail {
    margin-top: 16px;
}
.profile-mylist-detail.hidden {
    display: none !important;
}
.profile-mylist-detail-back {
    display: inline-block;
    margin-bottom: 16px;
    padding: 8px 14px;
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    color: #333;
}
.profile-mylist-detail-back:hover {
    background: #e0e0e0;
}
.profile-mylist-detail-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    display: block;
}
.profile-user-mylist-detail-animes,
.profile-mylist-detail-animes {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
@media (max-width: 1024px) {
    .profile-user-mylist-detail-animes,
    .profile-mylist-detail-animes {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
@media (max-width: 768px) {
    .profile-user-mylist-detail-animes,
    .profile-mylist-detail-animes {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
.profile-mylist-detail-anime-card {
    display: block;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
}
.profile-mylist-detail-anime-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}
.profile-mylist-detail-anime-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    height: auto;
    object-fit: cover;
    object-position: center center;
    display: block;
    margin: 0;
    background: none;
}
.profile-mylist-detail-anime-title {
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-large {
    max-width: 900px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    text-decoration: none;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.4);
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #e8e8e8;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 画像アップロード */
.image-upload-area {
    text-align: center;
}

.image-upload-preview {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #e0e0e0;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* バナー画像用：横長プレビュー 320×95（選択枠・本番と完全一致させるため border なし・content-box） */
.image-upload-preview-banner {
    box-sizing: content-box;
    width: 320px;
    height: 95px;
    border: none;
    border-radius: 8px;
}

/* ラッパー位置で表示範囲を決めるため、img はラッパーにぴったり fill（cover だと中心固定でずれる） */
.image-upload-preview-banner .image-upload-preview-inner img {
    object-fit: fill;
}

.image-upload-preview-banner .image-upload-placeholder {
    padding-top: 0;
}

.image-upload-preview-inner {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    /* width/height/left/top は JS で設定（上プレビューと下の円の範囲を一致させるため） */
}

.image-upload-preview-inner img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
}

.image-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.image-upload-preview img.show {
    display: block;
}

.image-upload-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    text-align: center;
    padding-top: 4px; /* テキストを視覚的に円の中央に */
}

.image-upload-placeholder.hide {
    display: none;
}

.image-upload-placeholder svg {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.image-upload-placeholder p {
    font-size: 14px;
    margin: 0;
    line-height: 1.4;
}

/* 表示位置の調整（プレビュー設定） */
.image-position-editor {
    display: none;
    margin: 16px 0 20px;
    padding: 12px 0;
    border-top: 1px solid #e8e8e8;
}

.image-position-editor.is-visible {
    display: block;
}

/* バナー用：横長の矩形＝表示枠と同じ形。left/top で左上を指定するため transform は使わない */
.image-positioner-banner .image-positioner-circle {
    left: 0;
    top: 0;
    transform: none;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
    background: transparent;
}
.image-positioner-banner .image-positioner-circle:hover,
.image-positioner-banner .image-positioner-circle:focus {
    border-color: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.5);
}

.image-position-editor-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px;
}

.image-position-editor-desc {
    font-size: 12px;
    color: #666;
    margin: 0 0 12px;
}

.image-positioner {
    position: relative;
    width: 100%;
    max-width: 280px;
    aspect-ratio: 4 / 3;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    background: #2a2a2a;
    border: 1px solid #444;
}

.image-positioner-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
    pointer-events: none;
}

/* 円の外を暗くして、表示されない部分をわかりやすく */
.image-positioner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.image-positioner-circle {
    position: absolute;
    width: 64px;
    height: 64px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
    background: transparent;
    cursor: move;
    cursor: grab;
    touch-action: none;
    z-index: 2;
    transition: box-shadow 0.15s ease;
}

.image-positioner-circle:active {
    cursor: grabbing;
}

.image-positioner-circle:hover {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.6);
}

.image-positioner-circle:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.5);
}

.image-upload-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* カスタマイズパネル */
.customize-panel {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
}

.customize-available h3,
.customize-preview h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #333;
}

.customize-elements {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.customize-element-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.customize-element-btn:hover {
    background: #e8e8e8;
    border-color: var(--color-primary);
    transform: translateX(5px);
}

.element-icon {
    font-size: 24px;
}

.element-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.customize-layout {
    min-height: 400px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #e0e0e0;
}

.customize-section-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: move;
    transition: all 0.3s;
}

.customize-section-item:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.2);
}

.customize-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.section-remove-btn {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.section-remove-btn:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

.customize-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

/* レスポンシブ */
@media (max-width: 1024px) {
    .profile-layout {
        flex-direction: column;
    }

    .profile-layout > .profile-sidebar {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .profile-layout > .profile-main {
        flex: 1 1 auto;
        width: 100%;
    }
    
    .profile-sidebar {
        width: 100%;
        min-width: 0;
        position: static;
        max-height: none;
    }
    
    .profile-sidebar-content {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        justify-content: flex-start;
    }
    
    .profile-sidebar-stats {
        border: none;
        padding: 0;
    }
    
    .profile-sidebar-menu {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }
    
    .customize-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .profile-page-new {
        --profile-page-pad-top: 20px;
        padding: var(--profile-page-pad-top) 0;
    }
    
    .profile-layout {
        padding: 20px 15px 0;
        gap: 20px;
    }
    
    .profile-sidebar {
        padding: 20px 15px;
    }
    
    .profile-main-title {
        font-size: 22px;
    }
    
    .anime-gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 15px;
    }
    
    .anime-list-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    /* マイリスト：作品ポスター・作成リストカードはスマホで3列（.anime-list-grid の auto-fill より優先） */
    #tab-mylist .profile-mylist-detail-animes,
    #tab-mylist .profile-custom-mylist-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    #tab-mylist .profile-mylist-detail-anime-title {
        font-size: 11px;
        padding: 6px 4px;
        line-height: 1.3;
    }

    #tab-mylist .profile-custom-mylist-card-name {
        font-size: 11px;
        padding: 8px 6px;
    }
    
    .statistics-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .modal-content {
        margin: 10px;
    }
}

/* プロフィール内の DM（.dm-embed）：単体 dm.php 用の上余白・max-width 中央寄せを無効化し、左サイドバー＋メイン列の位置を他タブと揃える */
.profile-main .dm-page.dm-embed {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100%;
    box-sizing: border-box;
}

.profile-main .dm-page.dm-embed .dm-layout {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* ---------- DM タブ: 横幅を広げ、チャットを画面に近いサイズで表示（左リスト＋右会話） ---------- */
body[data-active-profile-tab="dm"] .profile-page-new .profile-layout {
    width: 100%;
    max-width: min(1720px, calc(100vw - 20px));
    margin-left: auto;
    margin-right: auto;
    padding-left: 10px;
    padding-right: 10px;
    box-sizing: border-box;
}

@media (min-width: 1401px) {
    body[data-active-profile-tab="dm"] .profile-page-new .profile-layout {
        max-width: min(1720px, calc(100vw - 24px));
    }
}

body[data-active-profile-tab="dm"] .profile-main .profile-main-header {
    margin-bottom: 12px;
}

body[data-active-profile-tab="dm"] .profile-main .dm-page.dm-embed .dm-layout {
    display: grid;
    grid-template-columns: minmax(260px, 34%) minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
    width: 100%;
    /* ヘッダー・マイページ余白・「DM」見出し分を差し引き、チャットを縦に広く */
    height: calc(100dvh - 188px);
    min-height: min(520px, calc(100dvh - 188px));
    max-height: calc(100dvh - 140px);
}

/* dvh 非対応ブラウザ向けフォールバック */
@supports not (height: 100dvh) {
    body[data-active-profile-tab="dm"] .profile-main .dm-page.dm-embed .dm-layout {
        height: calc(100vh - 188px);
        min-height: min(520px, calc(100vh - 188px));
        max-height: calc(100vh - 140px);
    }
}

body[data-active-profile-tab="dm"] .profile-main .dm-page.dm-embed .dm-thread-list,
body[data-active-profile-tab="dm"] .profile-main .dm-page.dm-embed .dm-conversation {
    min-height: 0;
    height: 100%;
    max-height: 100%;
    box-sizing: border-box;
}

body[data-active-profile-tab="dm"] .profile-main .dm-page.dm-embed .dm-thread-list {
    border-radius: 14px 0 0 14px;
    border-right: 1px solid #e4e4ef;
    display: flex;
    flex-direction: column;
}

body[data-active-profile-tab="dm"] .profile-main .dm-page.dm-embed .dm-conversation {
    border-radius: 0 14px 14px 0;
    display: flex;
    flex-direction: column;
}

body[data-active-profile-tab="dm"] .profile-main .dm-page.dm-embed .dm-thread-items {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

body[data-active-profile-tab="dm"] .profile-main .dm-page.dm-embed .dm-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 12px 14px;
    box-sizing: border-box;
}

/* 広い画面では吹き出しも少し読みやすく */
body[data-active-profile-tab="dm"] .profile-main .dm-page.dm-embed .dm-msg-wrap-mine .dm-message.mine {
    max-width: min(560px, 85%);
}
body[data-active-profile-tab="dm"] .profile-main .dm-page.dm-embed .dm-msg-wrap-other .dm-message.other {
    max-width: min(560px, calc(85% - 48px));
}

@media (max-width: 960px) {
    body[data-active-profile-tab="dm"] .profile-page-new .profile-layout {
        max-width: 100%;
        padding-left: 8px;
        padding-right: 8px;
    }
    body[data-active-profile-tab="dm"] .profile-main .dm-page.dm-embed .dm-layout {
        height: auto;
        min-height: 65dvh;
        max-height: none;
        grid-template-columns: 1fr;
        gap: 12px;
    }
    body[data-active-profile-tab="dm"] .profile-main .dm-page.dm-embed .dm-thread-list {
        border-radius: 14px;
        border-right: none;
        max-height: 42dvh;
    }
    body[data-active-profile-tab="dm"] .profile-main .dm-page.dm-embed .dm-conversation {
        border-radius: 14px;
        min-height: 48dvh;
    }
}

/* 単体 dm.php 用の min-height:560px は行全体を押し広げ左バーとの縦バランスを崩すため、プロフィール内は上記 DM タブ用で制御 */
.profile-main .dm-page.dm-embed .dm-thread-list,
.profile-main .dm-page.dm-embed .dm-conversation {
    min-height: 0;
}

/* プロフィール内アニメカード：ステータスボタン右余白を最小化（ファイル末尾で確実に適用） */
body .profile-main .anime-card .anime-card-content {
    padding-right: 4px !important;
}

/* 他ユーザーのプロフィール閲覧：カスタマイズ可能エリアのみ表示（サイドバーなし） */
.profile-page-new.profile-page-other .profile-layout {
    display: block;
    max-width: 900px;
    margin: 0 auto;
}
.profile-page-new.profile-page-other .profile-main {
    width: 100%;
    max-width: 100%;
}
.profile-other-back {
    margin-bottom: 16px;
}
.profile-other-back-link {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 14px;
}
.profile-other-back-link:hover {
    text-decoration: underline;
}

/* ===== Mobile optimization overrides (profile) ===== */
@media (max-width: 1024px) {
    .profile-layout {
        width: min(100%, 100% - 20px);
        gap: 14px;
        padding: 14px 10px 0;
    }

    .profile-layout > .profile-sidebar {
        width: 280px;
        min-width: 240px;
        max-width: 280px;
    }
}

@media (max-width: 768px) {
    .profile-layout {
        flex-direction: column;
        width: 100%;
        padding: 10px 12px 0;
        gap: 12px;
    }

    .profile-layout > .profile-sidebar,
    .profile-layout > .profile-main {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .profile-sidebar {
        padding: 16px 12px;
    }

    .profile-sidebar-menu {
        gap: 6px;
    }

    .sidebar-menu-item {
        padding: 10px 12px;
        font-size: 14px;
    }

    /* 視聴状況タブ：端に詰まりすぎないようグリッド化 */
    .mylist-section {
        padding: 20px 14px;
        box-sizing: border-box;
    }

    .mylist-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding-bottom: 4px;
    }

    .mylist-tab:nth-child(5) {
        grid-column: 1 / -1;
        justify-self: center;
        width: 100%;
        max-width: 320px;
    }

    /* 狭いカードで右端が潰れてステータスと重なるのを防ぐ */
    body .profile-main .anime-card .anime-card-content,
    body #tab-statistics .anime-card .anime-card-content,
    body #tab-mylist .anime-card .anime-card-content,
    body .mylist-section .anime-card .anime-card-content {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
}

/* スマホ：TOPと同様に3列・ポスターは切らず contain */
@media (max-width: 768px) {
    #tab-statistics .anime-cards,
    #tab-mylist .anime-cards,
    .mylist-section .anime-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    #tab-statistics .anime-card-image,
    #tab-mylist .anime-card-image,
    .mylist-section .anime-card-image {
        height: auto !important;
        min-height: 0 !important;
        aspect-ratio: 2 / 3;
        flex: 0 0 auto !important;
        max-height: 150px;
    }

    #tab-statistics .anime-card-image img,
    #tab-mylist .anime-card-image img,
    .mylist-section .anime-card-image img {
        object-fit: contain !important;
        object-position: center center;
        background: linear-gradient(180deg, #f0f2f6 0%, #e6e9f0 100%);
    }

    /* マイリスト統計のカード：ステータスを評価の横に（width:100% 解除） */
    #tab-statistics .anime-card .anime-score-section,
    #tab-mylist .anime-card .anime-score-section,
    .mylist-section .anime-card .anime-score-section {
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
    }

    #tab-statistics .anime-card .anime-score,
    #tab-mylist .anime-card .anime-score,
    .mylist-section .anime-card .anime-score {
        padding: 6px 6px 6px 8px !important;
        padding-top: 11px !important;
        gap: 4px !important;
    }

    #tab-statistics .anime-card .anime-score-count-badge,
    #tab-mylist .anime-card .anime-score-count-badge,
    .mylist-section .anime-card .anime-score-count-badge {
        font-size: 8px !important;
        padding: 2px 5px !important;
    }

    #tab-statistics .anime-card .star-icon,
    #tab-mylist .anime-card .star-icon,
    .mylist-section .anime-card .star-icon {
        font-size: 15px !important;
    }

    #tab-statistics .anime-card .anime-score-value,
    #tab-mylist .anime-card .anime-score-value,
    .mylist-section .anime-card .anime-score-value {
        font-size: 14px !important;
        min-width: 28px !important;
    }

    #tab-statistics .anime-card .status-selector,
    #tab-mylist .anime-card .status-selector,
    .mylist-section .anime-card .status-selector {
        flex: 0 0 auto !important;
    }

    #tab-statistics .anime-card .status-main-btn,
    #tab-mylist .anime-card .status-main-btn,
    .mylist-section .anime-card .status-main-btn {
        width: auto !important;
        max-width: 52px !important;
        min-height: auto !important;
        padding: 3px 4px !important;
    }

    #tab-statistics .anime-card .status-icon,
    #tab-mylist .anime-card .status-icon,
    .mylist-section .anime-card .status-icon {
        font-size: 14px !important;
    }
}

@media (max-width: 430px) {
    .profile-page-new {
        --profile-page-pad-top: 16px;
    }

    .profile-header-name {
        font-size: 20px;
    }

    .profile-header-info {
        padding: 0 12px 12px 12px;
    }

    .mylist-tabs {
        gap: 6px;
    }

    .mylist-tab {
        padding: 8px 10px;
        font-size: 12px;
        min-height: 40px;
    }
}

/* ===== Mobile redesign: own profile sidebar usability ===== */
@media (max-width: 768px) {
    .profile-page-new:not(.profile-page-other) {
        --profile-page-pad-top: 10px;
    }

    .profile-page-new:not(.profile-page-other) .profile-layout {
        padding: 8px 10px 0;
        gap: 10px;
    }

    .profile-page-new:not(.profile-page-other) .profile-sidebar {
        padding: 14px 12px 12px;
        border-radius: 18px;
        border: 1px solid #eceef8;
        box-shadow: 0 6px 22px rgba(22, 28, 54, 0.08);
    }

    .profile-page-new:not(.profile-page-other) .profile-sidebar-content {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        width: 100%;
    }

    .profile-page-new:not(.profile-page-other) .profile-image-wrapper {
        width: 108px;
        height: 108px;
    }

    .profile-page-new:not(.profile-page-other) .profile-sidebar-image {
        width: 108px;
        height: 108px;
        border-width: 3px;
    }

    .profile-page-new:not(.profile-page-other) .profile-image-edit-btn {
        width: 36px;
        height: 36px;
    }

    .profile-page-new:not(.profile-page-other) .profile-sidebar-name {
        font-size: clamp(1.7rem, 7.2vw, 2.15rem);
        line-height: 1.2;
        text-align: center;
        overflow-wrap: anywhere;
    }

    .profile-page-new:not(.profile-page-other) .profile-sidebar-username {
        margin-top: -4px;
        font-size: 15px;
    }

    .profile-page-new:not(.profile-page-other) .profile-sidebar-stats {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        padding: 2px 0 0;
        border: none;
    }

    .profile-page-new:not(.profile-page-other) .sidebar-stat-item {
        border-radius: 12px;
        padding: 10px 6px 9px;
        min-height: 66px;
        background: #f7f8ff;
        border: 1px solid #e8ebfb;
    }

    .profile-page-new:not(.profile-page-other) .sidebar-stat-item .stat-number {
        font-size: 28px;
        line-height: 1;
    }

    .profile-page-new:not(.profile-page-other) .sidebar-stat-item .stat-label {
        margin-top: 6px;
        font-size: 11px;
    }

    .profile-page-new:not(.profile-page-other) .profile-edit-sidebar-btn {
        width: 100%;
        min-height: 48px;
        margin-top: 2px;
        border-radius: 12px;
        font-size: 16px;
        order: 4;
    }

    .profile-page-new:not(.profile-page-other) .profile-sidebar-menu {
        order: 5;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin-top: 0;
        width: 100%;
        flex: 1 1 100%;
        box-sizing: border-box;
    }

    .profile-page-new:not(.profile-page-other) .sidebar-menu-item {
        min-height: 74px;
        padding: 10px 6px;
        border-radius: 12px;
        border: 1px solid var(--color-border);
        background: #fff;
        color: var(--color-text-muted);
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 7px;
        text-align: center;
        font-size: 12px;
        font-weight: 700;
        line-height: 1.25;
    }

    .profile-page-new:not(.profile-page-other) .sidebar-menu-item:hover {
        transform: none;
        background: var(--color-surface-strong);
        color: var(--color-primary-strong);
    }

    .profile-page-new:not(.profile-page-other) .sidebar-menu-item.active {
        border-color: transparent;
        background: var(--gradient-primary);
        color: #fff;
        box-shadow: 0 8px 18px rgba(var(--color-primary-rgb), 0.28);
    }

    .profile-page-new:not(.profile-page-other) .sidebar-menu-item svg {
        width: 18px;
        height: 18px;
    }

    .profile-page-new:not(.profile-page-other) .sidebar-menu-item .menu-badge:not(.dm-unread-menu-badge) {
        display: none !important;
    }

    .profile-page-new:not(.profile-page-other) .sidebar-menu-item .menu-badge.dm-unread-menu-badge {
        position: absolute;
        top: 6px;
        right: 6px;
        margin: 0;
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        font-size: 10px;
        border-width: 1.5px;
    }

    .profile-page-new:not(.profile-page-other) .profile-main {
        min-height: 0;
    }

    .profile-page-new:not(.profile-page-other) .profile-main-header {
        margin-bottom: 14px;
        padding-top: 2px;
    }

    .profile-page-new:not(.profile-page-other) .profile-main-title {
        font-size: clamp(1.45rem, 6vw, 1.9rem);
        line-height: 1.2;
    }
}

@media (max-width: 430px) {
    .profile-page-new:not(.profile-page-other) .profile-sidebar {
        padding: 12px 10px 10px;
    }

    .profile-page-new:not(.profile-page-other) .profile-image-wrapper,
    .profile-page-new:not(.profile-page-other) .profile-sidebar-image {
        width: 100px;
        height: 100px;
    }

    .profile-page-new:not(.profile-page-other) .profile-sidebar-name {
        font-size: clamp(1.55rem, 8vw, 2rem);
    }

    .profile-page-new:not(.profile-page-other) .profile-sidebar-menu {
        gap: 7px;
    }

    .profile-page-new:not(.profile-page-other) .sidebar-menu-item {
        min-height: 70px;
        padding: 9px 6px;
        font-size: 11px;
    }

    .profile-page-new:not(.profile-page-other) .profile-main-title {
        font-size: clamp(1.35rem, 6.8vw, 1.7rem);
    }
}

/* X風プロフィール横タブ（ヘッダーカード直下に一体化） */
.profile-header-section .profile-x-tabs-row {
    margin: 0;
    padding: 0;
    width: 100%;
    border-top: 1px solid rgba(15, 20, 25, 0.08);
    background: var(--color-surface);
}

.profile-x-tabs {
    display: grid;
    grid-template-columns: repeat(var(--profile-tab-count, 4), minmax(0, 1fr));
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: var(--color-surface);
    border-top: 1px solid rgba(15, 20, 25, 0.1);
    box-sizing: border-box;
}
.profile-x-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 48px;
    padding: 10px 6px;
    box-sizing: border-box;
    text-align: center;
    color: #536471;
    text-decoration: none;
    font-size: clamp(11px, 2.9vw, 15px);
    font-weight: 600;
    line-height: 1.25;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-right: 1px solid rgba(15, 20, 25, 0.12);
    border-bottom: 1px solid rgba(15, 20, 25, 0.1);
    background: #fff;
    transition: color 0.15s ease, background 0.15s ease;
}
.profile-x-tab:last-child {
    border-right: none;
}
.profile-x-tab:hover {
    color: #0f1419;
    background: rgba(15, 20, 25, 0.03);
}
.profile-x-tab.active {
    color: var(--color-primary-strong, #0f1419);
    font-weight: 700;
    background: rgba(var(--color-primary-rgb, 102, 126, 234), 0.1);
    box-shadow: inset 0 -2px 0 var(--color-primary, #667eea);
}
.profile-x-tab.active::after {
    display: none;
}
.profile-page-other .profile-x-tabs {
    margin-top: 0;
}

/* 横タブ直下のコンテンツ（並び替え等）がタブに張り付かないよう余白 */
.profile-header-section + .profile-tab-content {
    margin-top: 20px;
    padding-top: 2px;
}

/* レビュータブ */
.profile-reviews-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
    padding-top: 2px;
    flex-wrap: wrap;
}
.profile-reviews-sort-label {
    font-size: 14px;
    color: #536471;
}
.profile-reviews-sort-select {
    min-width: 180px;
    padding: 8px 10px;
    border: 1px solid #cfd9de;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}
.profile-reviews-count {
    margin-left: auto;
    font-size: 14px;
    color: #536471;
}
.profile-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.profile-review-card {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 14px;
    padding: 14px;
    border: 1px solid #eff3f4;
    border-radius: 12px;
    background: #fff;
}
.profile-review-card-poster img {
    width: 72px;
    height: 108px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}
.profile-review-card-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eff3f4;
    min-width: 0;
}
.profile-review-card-meta-row .profile-review-card-anime {
    margin: 0;
    font-size: 16px;
    line-height: 1.35;
    min-width: 0;
    flex: 0 1 auto;
    max-width: 100%;
}
.profile-review-card-meta-row .detail-my-score-value-display {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 2px;
    margin: 0;
    flex-shrink: 0;
    height: auto !important;
    min-height: 0;
    line-height: 1;
    box-sizing: border-box;
}
.profile-review-card-meta-row .detail-my-score-value-display--season-best {
    flex-wrap: nowrap;
    max-width: none;
    justify-content: flex-start;
    align-items: center;
}
.profile-review-card-meta-row .detail-my-score-season-best-badge {
    margin-left: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.profile-review-card-meta-row .detail-my-score-status,
.profile-review-card-meta-row .detail-my-score-episode {
    flex-shrink: 0;
    display: inline-flex !important;
    align-items: center !important;
    font-size: 11px;
    padding: 2px 7px;
    height: auto !important;
    min-height: 0;
    line-height: 1 !important;
    box-sizing: border-box;
    box-shadow: none;
    border-radius: 6px;
    gap: 3px;
    vertical-align: middle;
}
.profile-review-card-meta-row .detail-my-score-status .status-icon,
.profile-review-card-meta-row .detail-my-score-status .status-label,
.profile-review-card-meta-row .detail-my-score-episode .episode-number,
.profile-review-card-meta-row .detail-my-score-episode .episode-max {
    line-height: 1 !important;
}
.profile-review-card-meta-row .detail-my-score-number {
    font-size: 16px;
    line-height: 1;
}
.profile-review-card-meta-row .detail-my-score-max {
    font-size: 12px;
    line-height: 1;
}
.profile-review-card-meta-row .detail-my-score-season-best-badge {
    font-size: 10px;
    line-height: 1;
    display: inline-block;
    width: fit-content;
    max-width: 100%;
}
/* PC：チップ群は親フレックスに参加（横並び維持） */
.profile-review-card-meta-chips {
    display: contents;
}
.profile-review-card-meta-chips > .detail-my-score-value-display,
.profile-review-card-meta-chips > .detail-my-score-status,
.profile-review-card-meta-chips > .detail-my-score-episode {
    align-self: center;
}
.profile-review-card-anime a {
    color: #0f1419;
    text-decoration: none;
    font-weight: 700;
}
.profile-review-card-anime a:hover {
    text-decoration: underline;
}
.profile-review-card-actions {
    margin-top: 6px;
    font-size: 13px;
    color: #536471;
}
.profile-review-card-title {
    margin: 0 0 6px;
    font-weight: 600;
    font-size: 14px;
}
.profile-review-card-text {
    margin: 0 0 8px;
}
.profile-review-card-snippet {
    margin: 0;
    font-size: 14px;
    color: #536471;
    line-height: 1.5;
}
.profile-review-card-snippet--collapsible {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@media (max-width: 768px) {
    .profile-review-card-snippet--collapsible:not(.is-expanded) {
        -webkit-line-clamp: 10;
        line-clamp: 10;
    }
}
@media (min-width: 769px) {
    .profile-review-card-snippet--collapsible:not(.is-expanded) {
        -webkit-line-clamp: 35;
        line-clamp: 35;
    }
}
.profile-review-card-snippet--collapsible.is-expanded {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
    line-clamp: unset;
}
.profile-review-card-more {
    display: inline-block;
    margin-top: 4px;
    padding: 0;
    border: none;
    background: none;
    color: var(--color-primary, #1d9bf0);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.profile-review-card-more:hover {
    text-decoration: underline;
}
.profile-review-card-more[hidden] {
    display: none;
}
.profile-reviews-empty,
.profile-reviews-loading {
    padding: 24px 12px;
    text-align: center;
    color: #536471;
}

/* 返信タブ（マイページのみ） */
.profile-replies-lead {
    margin: 0 0 14px;
    font-size: 14px;
    color: #536471;
}
.profile-replies-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.profile-replies-empty {
    padding: 24px 12px;
    text-align: center;
    color: #536471;
}
.profile-reply-card {
    border: 1px solid #eff3f4;
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
}
.profile-reply-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.profile-reply-kind-label {
    font-size: 13px;
    font-weight: 700;
    color: #0f1419;
}
.profile-reply-time {
    font-size: 13px;
    color: #536471;
}
.profile-reply-delete-btn {
    margin-left: auto;
    border: none;
    background: transparent;
    color: #f4212e;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 999px;
}
.profile-reply-delete-btn:hover {
    background: rgba(244, 33, 46, 0.08);
}
.profile-reply-delete-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.profile-reply-body {
    margin: 0 0 10px;
    font-size: 15px;
    line-height: 1.5;
    color: #0f1419;
    white-space: pre-wrap;
    word-break: break-word;
}
.profile-reply-target,
.profile-reply-quote-embed {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #cfd9de;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    background: #f7f9f9;
}
.profile-reply-target:hover,
.profile-reply-quote-embed:hover {
    background: #eff3f4;
}
.profile-reply-target-author,
.profile-reply-quote-embed-author {
    flex: 1 1 100%;
    font-size: 12px;
    color: #536471;
}
.profile-reply-target-thumb {
    flex: 0 0 auto;
    width: 48px;
    height: 72px;
    border-radius: 6px;
    overflow: hidden;
    background: #e7ecf0;
}
.profile-reply-target-thumb--wide {
    width: 72px;
    height: 48px;
}
.profile-reply-target-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.profile-reply-target-text {
    flex: 1 1 160px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    line-height: 1.4;
}
.profile-reply-target-score {
    font-size: 13px;
    color: #536471;
}
.profile-reply-target-snippet {
    font-size: 13px;
    color: #536471;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 投稿タブ（tab=gallery）— コミュニティと同じカード */
.profile-posts-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.profile-posts-feed .community-card {
    margin-bottom: 12px;
}
.profile-posts-feed .community-card:last-child {
    margin-bottom: 0;
}
.community-card-head .profile-post-delete-btn {
    margin-left: auto;
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: #f4212e;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 999px;
}
.community-card-head .profile-post-delete-btn:hover {
    background: rgba(244, 33, 46, 0.08);
}
.community-card-head .profile-post-delete-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 作成画像（ギャラリー）タブ */
.profile-gallery-lead {
    margin: 0 0 14px;
    font-size: 14px;
    color: #536471;
}
.profile-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.profile-gallery-card {
    position: relative;
}
.profile-gallery-item-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-gallery-item-delete:hover {
    background: rgba(220, 38, 38, 0.92);
}
.profile-gallery-item {
    width: 100%;
    border: 1px solid #eff3f4;
    border-radius: 10px;
    overflow: hidden;
    padding: 0;
    background: #fff;
    cursor: pointer;
    text-align: left;
}
.profile-gallery-item img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
}
.profile-gallery-item-caption {
    display: block;
    padding: 8px 10px 4px;
    font-size: 12px;
    color: #0f1419;
    line-height: 1.35;
    font-weight: 600;
}
.profile-gallery-item-meta {
    display: block;
    padding: 0 10px 8px;
    font-size: 11px;
    color: #536471;
    line-height: 1.3;
}
.profile-gallery-empty-wrap {
    padding: 24px 12px;
    text-align: center;
}
.profile-gallery-empty {
    margin: 0 0 8px;
    color: #536471;
}
.profile-gallery-empty-note {
    margin: 0;
    font-size: 13px;
    color: #8899a6;
}
.profile-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10050;
}
.profile-gallery-lightbox-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.82);
    cursor: pointer;
}
.profile-gallery-lightbox-dialog {
    position: relative;
    z-index: 1;
    max-width: min(960px, 94vw);
    margin: 4vh auto;
    padding: 12px;
}
.profile-gallery-lightbox-close {
    position: absolute;
    top: 0;
    right: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
}
.profile-gallery-lightbox-imgwrap img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}
.profile-gallery-lightbox-caption {
    margin: 10px 0 0;
    color: #fff;
    font-size: 14px;
    text-align: center;
}
.profile-gallery-lightbox-actions {
    padding: 12px 0 0;
    display: flex;
    justify-content: center;
}
.profile-gallery-delete-btn {
    border: 0;
    border-radius: 999px;
    padding: 10px 18px;
    background: rgba(239, 68, 68, 0.92);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.profile-gallery-delete-btn:hover {
    background: #dc2626;
}

.confirm-modal-icon--danger {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}
.confirm-modal-btn-confirm--danger {
    background: #ef4444;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.28);
}
.confirm-modal-btn-confirm--danger:hover {
    background: #dc2626;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
}

/* 他ユーザープロフィール：作成マイリスト閲覧（サイト共通トークンに合わせる） */
.profile-page-other .profile-user-mylist-wrap {
    margin: 0;
    padding: 4px 0 8px;
}
.profile-user-mylist-overview.hidden {
    display: none !important;
}
.profile-user-mylist-head {
    margin: 0 0 14px;
}
.profile-user-mylist-title {
    margin: 0;
    font-size: clamp(1.35rem, 4.2vw, 1.75rem);
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-text);
    letter-spacing: -0.01em;
}
.profile-user-mylist-owner {
    color: var(--color-primary-strong);
}
.profile-user-mylist-title-text {
    color: var(--color-text);
    font-weight: 700;
}
.profile-user-mylist-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(15, 20, 25, 0.08);
    flex-wrap: wrap;
}
.profile-user-mylist-toolbar-label {
    font-size: 14px;
    color: var(--color-text-muted);
    font-weight: 500;
}
.profile-user-mylist-count {
    margin-left: auto;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-muted);
}
.profile-user-mylist-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.profile-user-mylist-row {
    display: grid;
    grid-template-columns: 76px 1fr 22px;
    gap: 14px;
    align-items: center;
    width: 100%;
    padding: 14px;
    border: 1px solid rgba(15, 20, 25, 0.08);
    border-radius: 12px;
    background: var(--color-surface);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.profile-user-mylist-row:hover {
    border-color: rgba(var(--color-primary-rgb), 0.28);
    box-shadow: 0 4px 16px rgba(var(--color-primary-rgb), 0.12);
    transform: translateY(-1px);
}
.profile-user-mylist-row:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}
.profile-user-mylist-row-covers {
    width: 76px;
    height: 76px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--color-surface-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(15, 20, 25, 0.06);
}
.profile-user-mylist-row-cover-single {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.profile-user-mylist-row-covers-grid {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1px;
    background: rgba(15, 20, 25, 0.06);
}
.profile-user-mylist-row-covers-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: var(--color-surface-strong);
}
.profile-user-mylist-row-covers-empty {
    font-size: 13px;
    line-height: 1;
    color: var(--color-text-muted);
    font-weight: 600;
}
.profile-user-mylist-row-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.profile-user-mylist-row-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-user-mylist-row-meta {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-primary-strong);
}
.profile-user-mylist-row-preview {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.profile-user-mylist-row-chevron {
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, transform 0.15s ease;
}
.profile-user-mylist-row:hover .profile-user-mylist-row-chevron {
    color: var(--color-primary-strong);
    transform: translateX(2px);
}
.profile-user-mylist-empty-state,
.profile-user-mylist-loading-inline {
    padding: 28px 12px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 14px;
    line-height: 1.6;
}
.profile-user-mylist-empty-state p,
.profile-user-mylist-loading-inline p {
    margin: 0;
}
.profile-user-mylist-detail.hidden {
    display: none !important;
}
.profile-user-mylist-detail-head {
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(15, 20, 25, 0.08);
}
.profile-user-mylist-detail-title {
    margin: 0 0 4px;
    font-size: clamp(1.2rem, 3.8vw, 1.5rem);
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.35;
}
.profile-user-mylist-detail-count {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary-strong);
}
.profile-user-mylist-loading,
.profile-user-mylist-empty-inline {
    padding: 24px 12px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 14px;
}

@media (max-width: 640px) {
    .profile-page-other .profile-user-mylist-wrap {
        padding: 2px 0 6px;
    }
    .profile-user-mylist-title {
        font-size: clamp(1.25rem, 5.2vw, 1.55rem);
    }
    .profile-user-mylist-toolbar {
        margin-bottom: 14px;
        padding-bottom: 10px;
    }
    .profile-user-mylist-row {
        grid-template-columns: 68px 1fr 18px;
        gap: 12px;
        padding: 12px;
    }
    .profile-user-mylist-row-covers {
        width: 68px;
        height: 68px;
    }
    .profile-user-mylist-row-name {
        font-size: 15px;
    }
}

/* 公開マイリスト（旧・視聴ステータス用・互換） */
.profile-public-mylist-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}
.profile-public-mylist-tab {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid #cfd9de;
    text-decoration: none;
    color: #536471;
    font-size: 14px;
}
.profile-public-mylist-tab.active {
    background: #1d9bf0;
    border-color: #1d9bf0;
    color: #fff;
    font-weight: 600;
}
.profile-public-mylist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
}
.profile-public-mylist-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-decoration: none;
    color: inherit;
}
.profile-public-mylist-score {
    font-size: 12px;
    color: #f59e0b;
    font-weight: 600;
}
.profile-public-mylist-empty {
    grid-column: 1 / -1;
    padding: 24px;
    text-align: center;
    color: #536471;
}

/* プロフィールレビュー：詳細ページ用のスマホ全幅スタイルを打ち消し、コンパクトな横並びを維持 */
@media (max-width: 1024px) {
    .profile-review-card-meta-row {
        row-gap: 4px;
        column-gap: 6px;
        align-items: center;
    }
    .profile-review-card-meta-row .profile-review-card-anime {
        flex: 1 1 100%;
        width: 100%;
        font-size: 15px;
    }
    .profile-review-card-meta-chips {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 5px;
        width: 100%;
        min-width: 0;
    }
    .profile-review-card-meta-chips .detail-my-score-value-display,
    .profile-review-card-meta-row > .detail-my-score-value-display,
    .profile-review-card-meta-chips .detail-my-score-status,
    .profile-review-card-meta-row > .detail-my-score-status,
    .profile-review-card-meta-chips .detail-my-score-episode,
    .profile-review-card-meta-row > .detail-my-score-episode {
        width: auto !important;
        max-width: 100% !important;
        margin: 0 !important;
        text-align: left !important;
        justify-content: flex-start !important;
        align-items: center !important;
        display: inline-flex !important;
        flex-direction: row !important;
        height: auto !important;
        min-height: 0 !important;
        box-sizing: border-box !important;
    }
    .profile-review-card-meta-chips .detail-my-score-season-best-badge,
    .profile-review-card-meta-row > .detail-my-score-season-best-badge {
        width: fit-content !important;
        max-width: 100% !important;
        margin: 0 !important;
        display: inline-block !important;
        flex: 0 0 auto !important;
        height: auto !important;
        min-height: 0 !important;
        box-sizing: border-box !important;
    }
    .profile-review-card-meta-chips .detail-my-score-status,
    .profile-review-card-meta-row > .detail-my-score-status,
    .profile-review-card-meta-chips .detail-my-score-episode,
    .profile-review-card-meta-row > .detail-my-score-episode {
        padding: 2px 6px !important;
        font-size: 10px !important;
        border-radius: 5px !important;
        box-shadow: none !important;
        white-space: nowrap;
        align-self: center !important;
        line-height: 1 !important;
    }
    .profile-review-card-meta-chips .detail-my-score-status .status-icon,
    .profile-review-card-meta-chips .detail-my-score-status .status-label,
    .profile-review-card-meta-chips .detail-my-score-episode .episode-number,
    .profile-review-card-meta-chips .detail-my-score-episode .episode-max,
    .profile-review-card-meta-row > .detail-my-score-status .status-icon,
    .profile-review-card-meta-row > .detail-my-score-status .status-label,
    .profile-review-card-meta-row > .detail-my-score-episode .episode-number,
    .profile-review-card-meta-row > .detail-my-score-episode .episode-max {
        font-size: inherit !important;
        line-height: 1 !important;
    }
    .profile-review-card-meta-chips .detail-my-score-number,
    .profile-review-card-meta-row > .detail-my-score-number {
        font-size: 15px;
    }
    .profile-review-card-meta-chips .detail-my-score-max,
    .profile-review-card-meta-row > .detail-my-score-max {
        font-size: 11px;
    }
    .profile-review-card-meta-chips .detail-my-score-season-best-badge,
    .profile-review-card-meta-row > .detail-my-score-season-best-badge {
        font-size: 9px;
        padding: 1px 5px;
        margin-left: 2px !important;
        flex: 0 0 auto !important;
        width: fit-content !important;
        max-width: 100% !important;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .profile-review-card-meta-chips .detail-my-score-value-display,
    .profile-review-card-meta-row > .detail-my-score-value-display {
        align-items: center !important;
        align-self: center !important;
        line-height: 1 !important;
    }
    .profile-review-card-meta-chips .detail-my-score-value-display--season-best,
    .profile-review-card-meta-row > .detail-my-score-value-display--season-best {
        flex-wrap: nowrap !important;
        row-gap: 0;
        max-width: 100%;
    }
}

/* スマホ：点数・ステータス・話数を1行に収める */
@media (max-width: 768px) {
    .profile-review-card-meta-row {
        flex-direction: column;
        align-items: flex-start;
        row-gap: 3px;
        column-gap: 0;
    }
    .profile-review-card-meta-row .profile-review-card-anime {
        flex: none;
        width: 100%;
    }
    .profile-review-card-meta-chips {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: clamp(2px, 1.2vw, 5px);
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
    .profile-review-card-meta-chips .detail-my-score-value-display {
        flex: 0 1 auto;
        min-width: 0;
        flex-wrap: nowrap !important;
    }
    .profile-review-card-meta-chips .detail-my-score-value-display--season-best {
        flex-wrap: nowrap !important;
    }
    .profile-review-card-meta-chips .detail-my-score-season-best-badge {
        flex: 0 0 auto !important;
        width: fit-content !important;
        max-width: 100% !important;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .profile-review-card-meta-chips .detail-my-score-status,
    .profile-review-card-meta-chips .detail-my-score-episode {
        flex: 0 0 auto;
    }
    .profile-review-card-meta-chips .detail-my-score-number {
        font-size: clamp(11px, 3.4vw, 14px);
    }
    .profile-review-card-meta-chips .detail-my-score-max {
        font-size: clamp(8px, 2.6vw, 10px);
    }
    .profile-review-card-meta-chips .detail-my-score-season-best-badge {
        font-size: clamp(7px, 2.2vw, 9px);
        padding: 2px 3px;
        line-height: 1;
    }
    .profile-review-card-meta-chips .detail-my-score-status,
    .profile-review-card-meta-chips .detail-my-score-episode {
        font-size: clamp(7px, 2.2vw, 9px) !important;
        padding: 2px 5px !important;
        gap: 2px !important;
        align-self: center !important;
        line-height: 1 !important;
    }
    .profile-review-card-meta-chips .detail-my-score-status .status-icon {
        font-size: 0.9em !important;
    }
}

@media (max-width: 640px) {
    .profile-header-section + .profile-tab-content {
        margin-top: 16px;
    }
    .profile-x-tab {
        min-height: 44px;
        padding: 8px 4px;
        font-size: clamp(10px, 2.7vw, 13px);
    }
    .profile-review-card {
        grid-template-columns: 60px 1fr;
        gap: 10px;
        padding: 12px;
    }
    .profile-review-card-poster img {
        width: 60px;
        height: 90px;
    }
    .profile-review-card-meta-row .profile-review-card-anime {
        font-size: 14px;
    }
    .profile-review-card-title {
        font-size: 14px;
    }
    .profile-review-card-snippet {
        font-size: 14px;
    }
}
