/* プロフィール直接カスタマイズシステム */

/* カスタマイズ可能エリアのラッパー（点線枠は中身に合わせて下に伸ばす） */
.profile-customizable-wrapper {
    position: relative;
    margin-top: 20px;
}

/* 基本情報セクション（他のユーザー向けの表示） */
/* overflow:hidden だと「その他」メニューがカード下端で切れるため visible（バナーは子でクリップ） */
.profile-header-section {
    background: var(--color-surface);
    border-radius: 16px;
    overflow: visible;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    width: 100%;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

/* バナー画像（プレビューと同じ 320:95・同じラッパー方式で表示範囲を完全一致） */
.profile-banner-container {
    position: relative;
    width: 100%;
    aspect-ratio: 320 / 95;
    height: auto;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    background: var(--gradient-header);
}

.profile-banner-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* JS で width/height/left/top を上書きして表示位置を調整 */
}

.profile-banner-inner img,
.profile-banner-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.profile-banner-image {
    position: static;
}

@media (max-width: 768px) {
    /* 極端に低い 320:95 だと人物の頭が切れやすいため、モバイルは少し縦長に */
    .profile-banner-container {
        aspect-ratio: 2 / 1;
        min-height: 112px;
    }

    .profile-banner-inner img,
    .profile-banner-image {
        object-fit: cover;
        object-position: center 28%;
    }

    .profile-header-info {
        margin-top: -68px;
        padding: 0 16px 18px 16px;
    }

    .profile-header-details {
        margin-top: 14px;
    }

    .profile-header-name-row {
        margin-bottom: 10px;
    }

    .profile-header-avatar {
        margin-bottom: 18px;
    }
}

.banner-edit-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.5);
    border: 2px solid white;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.banner-edit-btn:hover {
    background: rgba(0,0,0,0.7);
    transform: scale(1.1);
}

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

/* プロフィール情報（ドロップダウンが下のセクションに隠れないよう重ね順） */
.profile-header-info {
    position: relative;
    z-index: 2;
    padding: 0 20px 20px 20px;
    margin-top: -75px;
    overflow: visible;
}

/* プロフィール画像（バナーの上に重ねて表示） */
.profile-header-avatar {
    position: relative;
    width: 150px;
    height: 150px;
    margin-bottom: 15px;
}

.profile-header-avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 5px solid white;
    object-fit: cover;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

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

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

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

/* ユーザー情報 */
.profile-header-details {
    margin-top: 10px;
}

.profile-header-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
    flex-wrap: wrap;
    gap: 15px;
}

.profile-header-name {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    line-height: 1.25;
}

.profile-private-badge {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 6px;
    color: #666;
}
.profile-private-badge svg {
    display: block;
}
.profile-private-badge-sidebar {
    margin-left: 4px;
}

.profile-header-edit-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--color-surface);
    border: 2px solid var(--color-primary);
    border-radius: 20px;
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.profile-header-edit-btn:hover {
    background: var(--color-primary);
    color: white;
}

.profile-header-edit-btn svg {
    width: 16px;
    height: 16px;
}

.profile-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-header-action-btn {
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.profile-header-action-btn:hover {
    background: #f5f5f5;
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.profile-header-action-btn svg {
    width: 20px;
    height: 20px;
}

/* プロフィールヘッダー「その他」（ブロック／ミュート） */
.profile-header-more-wrap {
    position: relative;
    z-index: 30;
}

/* 既定は absolute。開いたとき JS で position:fixed + top/left を付与して親の overflow から完全に外す */
.profile-header-more-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    padding: 6px 0;
    margin: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 100000;
}
.profile-header-more-menu.profile-header-more-menu--fixed {
    position: fixed;
    right: auto;
    margin: 0;
}

.profile-header-more-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    text-align: left;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background 0.15s ease;
}

.profile-header-more-item:hover {
    background: #f5f5f5;
}

.profile-header-more-item + .profile-header-more-item {
    border-top: 1px solid #eee;
}

.profile-header-follow-btn {
    padding: 10px 24px;
    background: #333;
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.profile-header-follow-btn:hover {
    background: #555;
}

.profile-header-follow-btn.btn-following {
    background: white;
    border: 2px solid #e0e0e0;
    color: #333;
}

.profile-header-follow-btn.btn-following:hover {
    background: #fee;
    border-color: #f44;
    color: #f44;
}

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

.profile-header-follow-btn.btn-request-pending:hover {
    background: #f5f5f5;
    color: #333;
}

.profile-header-username {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #666;
}

.profile-header-bio {
    margin: 0 0 15px 0;
    font-size: 15px;
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* フォロワー・フォロー中 */
.profile-header-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 15px;
}

.header-stat-item {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: opacity 0.3s ease;
}

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

.header-stat-item .stat-number {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

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

/* リンク */
.profile-header-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.profile-header-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-primary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.profile-header-link:hover {
    color: var(--color-primary-strong);
    text-decoration: underline;
}

.profile-header-link svg {
    width: 16px;
    height: 16px;
}

/* カスタマイズ要素コンテナ（中身が増えれば点線が下まで伸びる） */
.profile-custom-sections-container {
    position: relative;
    min-height: 80px;
    width: 100%;
    flex: 0 0 auto;
    height: auto;
    overflow: visible;
}

/* カスタマイズコントロールバー */
.customize-control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.customize-control-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
/* プレビュー：他ユーザー視点で開く */
.customize-preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.customize-preview-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #1e293b;
}
.customize-preview-btn svg {
    width: 18px;
    height: 18px;
}
/* プレビュー中の注意バナー */
.profile-preview-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 12px;
    font-size: 14px;
    color: #78350f;
}
.profile-preview-banner-label {
    font-weight: 800;
    padding: 4px 10px;
    background: #f59e0b;
    color: #fff;
    border-radius: 6px;
    font-size: 12px;
    letter-spacing: 0.04em;
}
.profile-preview-banner-text {
    flex: 1;
    min-width: 200px;
}
.profile-preview-banner-exit {
    padding: 8px 16px;
    background: #fff;
    color: #b45309;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid #f59e0b;
    white-space: nowrap;
}
.profile-preview-banner-exit:hover {
    background: #fffbeb;
}

.customize-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.3);
}

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

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

.customize-action-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.customize-save-btn,
.customize-cancel-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.customize-save-btn {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.3);
}

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

.customize-save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.customize-cancel-btn {
    background: white;
    color: #666;
    border: 2px solid #e0e0e0;
}

.customize-cancel-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
    transform: translateY(-2px);
}

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

.customize-mode-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--color-primary-soft);
    border-radius: 20px;
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 500;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* カスタマイズ可能エリア（要素がある場合、点線枠をその高さに合わせて下に伸ばす） */
.profile-customizable-area {
    min-height: 80px;
    padding: 0;
    background: transparent;
    border-radius: 16px;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    height: auto;
    overflow: visible;
}

/* 自由配置モード */
.profile-customizable-area.free-layout-mode {
    position: relative;
    overflow: visible;
    min-height: 800px;
    /* 要素が追加された時に自動的に高さを広げる */
    height: auto;
}

/* スナップガイドライン */
.snap-guideline {
    position: absolute;
    pointer-events: none;
    z-index: 999;
    background: var(--color-primary);
    opacity: 0.8;
    animation: snapPulse 1.5s ease-in-out infinite;
}

.snap-guideline-x {
    border-left: 2px dashed var(--color-primary);
    background: transparent;
    box-shadow: 0 0 4px rgba(var(--color-primary-rgb), 0.5);
}

.snap-guideline-y {
    border-top: 2px dashed var(--color-primary);
    background: transparent;
    box-shadow: 0 0 4px rgba(var(--color-primary-rgb), 0.5);
}

@keyframes snapPulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* 編集可能エリア（点線＝中身の要素が増えると自動で下に伸びる） */
.profile-customizable-area.editable-area {
    border: 3px dashed #d1d5db;
    background: transparent;
    position: relative;
    padding: 20px;
    min-height: 80px;
    height: auto;
    display: flex;
    flex-direction: column;
}
.profile-customizable-area.editable-area > .profile-custom-sections-container {
    flex: 0 0 auto;
}

/* ーーーー｜カスタマイズ可能エリア｜ーーーー のイメージ（点線の上にラベルが乗り、中央を覆う） */
.profile-customizable-area.editable-area::before {
    content: 'カスタマイズ可能エリア';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-primary);
    background: #f5f5f5;
    border-left: 2px solid #d1d5db;
    border-right: 2px solid #d1d5db;
    pointer-events: none;
    z-index: 1;
    white-space: nowrap;
}

/* 編集モード */
.profile-customizable-area.editing {
    border: 3px solid var(--color-primary);
    background: var(--color-primary-soft);
    box-shadow: 0 4px 20px rgba(var(--color-primary-rgb), 0.2);
}

.profile-customizable-area.editing::before {
    content: '編集モード';
    border-left: 2px solid var(--color-primary);
    border-right: 2px solid var(--color-primary);
    background: #fff;
}

/* 空の状態 */
.empty-customize-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #999;
}

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

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

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

/* 要素追加グリッド（インライン - カスタマイズ可能エリア内に直接表示） */
.element-add-grid-inline {
    width: 100%;
    padding: 40px 30px;
    background: linear-gradient(135deg, #f9faff 0%, #f0f4ff 100%);
    border-radius: 16px;
    border: 3px dashed var(--color-primary);
    animation: fadeIn 0.3s ease;
    box-shadow: 0 4px 20px rgba(var(--color-primary-rgb), 0.1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.element-add-grid-header {
    margin-bottom: 30px;
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e7ff;
}

.element-add-grid-header h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 700;
    color: #333;
    color: var(--color-primary-strong);
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

.element-add-hint {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

.element-add-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    max-width: 100%;
}

.element-add-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 25px 20px;
    background: white;
    border: 2px solid #e0e7ff;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 160px;
}

.element-add-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.06) 0%, rgba(var(--color-primary-rgb), 0.02) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.element-add-card:hover {
    background: white;
    border-color: var(--color-primary);
    border-width: 3px;
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(var(--color-primary-rgb), 0.25);
}

.element-add-card:hover::before {
    opacity: 1;
}

.element-add-icon {
    font-size: 48px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.element-add-card:hover .element-add-icon {
    transform: scale(1.15) rotate(5deg);
}

.element-add-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    position: relative;
    z-index: 1;
    margin-bottom: 8px;
}

.element-add-description {
    font-size: 12px;
    color: #666;
    position: relative;
    z-index: 1;
    line-height: 1.4;
    margin-top: auto;
}

/* プロフィールセクション（編集可能） */
.profile-section {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    border: 1px solid rgba(0, 0, 0, 0.04);
}
.profile-section[data-section-type="current-season"] {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* 自由配置セクション */
.profile-section.free-layout-section {
    position: absolute;
    margin: 0;
    min-width: 200px;
    min-height: 150px;
    z-index: 1;
}

.profile-section.editable {
    border: 2px solid transparent;
}

.profile-section.draggable {
    cursor: move;
}

.profile-section.draggable .section-header,
.profile-section.draggable .section-content {
    cursor: move;
}

.profile-section.draggable .resize-handle {
    cursor: nwse-resize;
}

.profile-section.draggable .resize-handle-nw {
    cursor: nwse-resize;
}

.profile-section.draggable .resize-handle-ne {
    cursor: nesw-resize;
}

.profile-section.draggable .resize-handle-sw {
    cursor: nesw-resize;
}

.profile-section.draggable .resize-handle-se {
    cursor: nwse-resize;
}

.profile-section.draggable .section-actions,
.profile-section.draggable .section-action-btn {
    cursor: pointer;
}

.profile-section.dragging {
    opacity: 0.8;
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(var(--color-primary-rgb), 0.4);
    z-index: 1000;
    cursor: move !important;
}

.profile-section.resizable {
    overflow: visible;
}

.section-header {
    margin-bottom: 15px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

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

.section-name {
    font-size: 18px;
}

.section-content {
    min-height: 100px;
}

/* 今期・視聴中・最後まで見たアニメ：枠に収め、表紙は見やすい大きさで下まで切れず表示 */
.profile-section[data-section-type="current-season"],
.profile-section[data-section-type="watching"],
.profile-section[data-section-type="completed-anime"] {
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}
.profile-section[data-section-type="current-season"] .section-content,
.profile-section[data-section-type="watching"] .section-content,
.profile-section[data-section-type="completed-anime"] .section-content,
.section-content-current-season {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 100%;
    box-sizing: border-box;
    padding-bottom: 20px;
}
/* コンテナをスクロール可能にして表紙の下の行が切れないようにする */
.profile-section[data-section-type="current-season"] .current-season-container,
.profile-section[data-section-type="watching"] .current-season-container,
.profile-section[data-section-type="completed-anime"] .current-season-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}
/* 枠の幅に合わせて列数を自動調節。表紙は最小88pxで見やすい大きさに */
#customSectionsContainer .profile-section[data-section-type="current-season"] .current-season-gallery,
#customSectionsContainer .profile-section[data-section-type="watching"] .current-season-gallery,
#customSectionsContainer .profile-section[data-section-type="completed-anime"] .current-season-gallery,
#customizableArea .profile-section[data-section-type="current-season"] .current-season-gallery,
#customizableArea .profile-section[data-section-type="watching"] .current-season-gallery,
#customizableArea .profile-section[data-section-type="completed-anime"] .current-season-gallery {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)) !important;
    grid-auto-rows: auto !important;
    gap: 10px !important;
    padding: 0;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    align-content: start;
    flex-wrap: wrap;
    margin-bottom: 0;
}
/* 表紙を長方形（2:3）で表示。padding-bottomで縦横比を保ち下まで切れないようにする */
#customSectionsContainer .profile-section[data-section-type="current-season"] .current-season-poster,
#customSectionsContainer .profile-section[data-section-type="watching"] .current-season-poster,
#customSectionsContainer .profile-section[data-section-type="completed-anime"] .current-season-poster,
#customizableArea .profile-section[data-section-type="current-season"] .current-season-poster,
#customizableArea .profile-section[data-section-type="watching"] .current-season-poster,
#customizableArea .profile-section[data-section-type="completed-anime"] .current-season-poster {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 0 !important;
    min-height: 0 !important;
    padding-bottom: 150% !important; /* 2:3 = 高さが幅の1.5倍で長方形 */
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
    background: #1e293b;
}
/* 画像をポスター枠いっぱいに表示（長方形の下まで表示） */
#customSectionsContainer .profile-section[data-section-type="current-season"] .current-season-poster .poster-image-wrapper,
#customSectionsContainer .profile-section[data-section-type="watching"] .current-season-poster .poster-image-wrapper,
#customSectionsContainer .profile-section[data-section-type="completed-anime"] .current-season-poster .poster-image-wrapper,
#customizableArea .profile-section[data-section-type="current-season"] .current-season-poster .poster-image-wrapper,
#customizableArea .profile-section[data-section-type="watching"] .current-season-poster .poster-image-wrapper,
#customizableArea .profile-section[data-section-type="completed-anime"] .current-season-poster .poster-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: block;
    overflow: hidden;
}
#customSectionsContainer .profile-section[data-section-type="current-season"] .current-season-poster .poster-image,
#customSectionsContainer .profile-section[data-section-type="current-season"] .current-season-poster img,
#customSectionsContainer .profile-section[data-section-type="watching"] .current-season-poster .poster-image,
#customSectionsContainer .profile-section[data-section-type="watching"] .current-season-poster img,
#customSectionsContainer .profile-section[data-section-type="completed-anime"] .current-season-poster .poster-image,
#customSectionsContainer .profile-section[data-section-type="completed-anime"] .current-season-poster img,
#customizableArea .profile-section[data-section-type="current-season"] .current-season-poster .poster-image,
#customizableArea .profile-section[data-section-type="current-season"] .current-season-poster img,
#customizableArea .profile-section[data-section-type="watching"] .current-season-poster .poster-image,
#customizableArea .profile-section[data-section-type="watching"] .current-season-poster img,
#customizableArea .profile-section[data-section-type="completed-anime"] .current-season-poster .poster-image,
#customizableArea .profile-section[data-section-type="completed-anime"] .current-season-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}
.profile-section[data-section-type="current-season"] .current-season-title-card,
.profile-section[data-section-type="watching"] .current-season-title-card,
.profile-section[data-section-type="completed-anime"] .current-season-title-card {
    margin-bottom: 12px;
    flex-shrink: 0;
}
.profile-section[data-section-type="current-season"] .current-season-container,
.profile-section[data-section-type="watching"] .current-season-container,
.profile-section[data-section-type="completed-anime"] .current-season-container {
    display: flex;
    flex-direction: column;
}
.profile-section[data-section-type="current-season"] .current-season-gallery,
.profile-section[data-section-type="watching"] .current-season-gallery,
.profile-section[data-section-type="completed-anime"] .current-season-gallery {
    flex-shrink: 0;
}

.section-placeholder {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #e0e0e0;
}

.profile-customizable-area.editing .profile-section.editable {
    border: 2px dashed #cbd5e0;
    cursor: move;
}

.profile-customizable-area.editing .profile-section.editable:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.15);
}

/* セクションアクション（編集モード時のみ表示） */
.section-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: none;
    gap: 8px;
    z-index: 10;
}

.profile-customizable-area.editing .profile-section.editable:hover .section-actions {
    display: flex;
}
/* お気に入りのアニメは設定ボタンを常に表示（設定で作品を選ぶため） */
.profile-customizable-area.editing .profile-section.editable[data-section-type="favorite-anime"] .section-actions {
    display: flex;
}

.section-action-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 6px;
    border: none;
    background: white;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    font-size: 13px;
    white-space: nowrap;
}

.section-action-btn.section-change-btn {
    background: var(--gradient-primary);
    color: #fff;
    font-weight: 600;
}

.section-action-btn.section-change-btn:hover {
    opacity: 0.95;
    transform: scale(1.02);
}

.section-action-btn.section-settings-btn,
.section-action-btn.section-remove-btn {
    width: 32px;
    padding: 0;
}

.section-action-btn:hover {
    background: #f5f5f5;
    color: #333;
    transform: scale(1.1);
}

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

.section-remove-btn {
    background: #fee2e2;
    color: #dc2626;
}

.section-remove-btn:hover {
    background: #fecaca;
}

.section-settings-btn {
    background: #e0f2fe;
    color: #0369a1;
}

.section-settings-btn:hover {
    background: #bae6fd;
}

/* スクショ FAB：常時表示（キャプチャ時は ignoreElements で除外） */
.section-screenshot-fab {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 8;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.2s ease, transform 0.15s ease;
}
/* ホバー時は少し強調（既に常時表示のため） */
.profile-section:hover .section-screenshot-fab .section-screenshot-fab-btn,
.profile-section:focus-within .section-screenshot-fab .section-screenshot-fab-btn {
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}
/* 編集モードでは右上にアクションバーがあるため FAB を左上へ（重なり防止） */
.profile-customizable-area.editing .section-screenshot-fab {
    display: block;
    left: 8px;
    right: auto;
}
.section-screenshot-fab-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.section-screenshot-fab-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
}
.section-action-btn.section-screenshot-btn {
    background: #f0fdf4;
    color: #166534;
    font-weight: 600;
    width: auto;
    min-width: 36px;
    padding: 0 10px;
}
.section-action-btn.section-screenshot-btn:hover {
    background: #dcfce7;
    color: #14532d;
}

/* サイドバー内の要素追加グリッド */
.element-add-grid-sidebar {
    width: 100%;
    padding: 0;
    margin-top: 0;
    animation: fadeIn 0.3s ease;
}

.element-add-grid-header-sidebar {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.element-add-grid-header-sidebar h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.element-add-hint-sidebar {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.element-add-grid-container-sidebar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: calc(100vh - 350px);
    overflow-y: auto;
    padding-right: 4px;
    margin-bottom: 0;
    padding-bottom: 0;
}

.element-add-grid-container-sidebar::-webkit-scrollbar {
    width: 6px;
}

.element-add-grid-container-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.element-add-grid-container-sidebar::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 3px;
}

.element-add-grid-container-sidebar::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

.element-add-card-sidebar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
}

.element-add-card-sidebar:hover {
    background: #f5f5f5;
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.element-add-card-sidebar.dragging {
    opacity: 0.5;
}

.element-add-icon-sidebar {
    font-size: 24px;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.element-add-card-sidebar:hover .element-add-icon-sidebar {
    transform: scale(1.1);
}

.element-add-name-sidebar {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    flex: 1;
    line-height: 1.4;
}

.element-add-card-sidebar:hover .element-add-name-sidebar {
    color: var(--color-primary);
}

.element-add-description-sidebar {
    display: none;
}

/* 今期のアニメセクション（枠を内容に合わせて下に伸ばす） */
.current-season-container {
    padding: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

/* タイトル帯：薄いインディゴ系でタイトル文字（実色）とのコントラストを確保 */
.current-season-title-card {
    background: linear-gradient(135deg, var(--color-primary-soft) 0%, rgba(var(--color-primary-rgb), 0.16) 100%);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(var(--color-primary-rgb), 0.25);
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}
.current-season-title-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--color-primary-strong) 0%, var(--color-primary) 100%);
    border-radius: 4px 0 0 4px;
}

/* グラデーション clip テキストは環境によってほぼ透明になるため、実色＋軽い影で常に読めるようにする */
.current-season-title,
.favorite-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.35;
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: -0.02em;
    color: var(--color-primary-strong);
    /* グラデーション文字は使わない（clip 未対応・合成バグで消えるため） */
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
    text-transform: none;
}
.current-season-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-primary-strong);
    background: rgba(var(--color-primary-rgb), 0.12);
    border: 1px solid rgba(var(--color-primary-rgb), 0.22);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}
.watching-section-title,
.completed-section-title {
    text-transform: none;
}

/* 表紙を5列グリッドで並べる（横4～5個・縦は n 行） */
#customSectionsContainer .current-season-gallery,
#customizableArea .current-season-gallery,
.current-season-gallery {
    display: grid !important;
    grid-template-columns: repeat(5, 72px) !important;
    grid-auto-rows: 108px !important; /* 72 * 1.5 (2:3) */
    gap: 8px !important;
    padding: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    align-content: start;
}

/* ポスター枠: 1マス＝72×108、必ずこのサイズで表示 */
#customSectionsContainer .current-season-poster,
#customizableArea .current-season-poster,
.current-season-poster {
    position: relative;
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    height: 108px !important;
    min-height: 108px !important;
    max-height: 108px !important;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
    contain: layout;
    background: #1e293b;
}

.current-season-poster:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.poster-link {
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: block;
    text-decoration: none;
    color: inherit;
}

.poster-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.current-season-poster .poster-image,
.current-season-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.3s ease;
    display: block;
    max-height: 100%;
}

.current-season-poster:hover .poster-image {
    transform: scale(1.1);
}

.poster-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.6) 45%, transparent 100%);
    padding: 20px 15px 15px;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.current-season-poster .poster-overlay {
    padding: 6px 5px 5px;
}

.current-season-poster:hover .poster-overlay {
    opacity: 1;
}

.poster-info {
    color: white;
}

.poster-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 今期ポスター 72px 用：テキストをコンパクトに */
.current-season-poster .poster-title {
    font-size: 10px;
    margin: 0 0 3px 0;
    -webkit-line-clamp: 2;
}
.current-season-poster .poster-progress,
.current-season-poster .progress-text {
    font-size: 9px;
}

.poster-progress {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.progress-text {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.poster-status-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 5px 10px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.25);
    z-index: 5;
}
.current-season-poster .poster-status-badge {
    top: 5px;
    right: 5px;
    padding: 3px 7px;
    border-radius: 9999px;
    font-size: 8px;
    letter-spacing: 0.03em;
}

.poster-status-badge.status-watching {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.95) 0%, rgba(22, 163, 74, 0.95) 100%);
    border-color: rgba(255, 255, 255, 0.3);
}

.poster-status-badge.status-completed {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95) 0%, rgba(37, 99, 235, 0.95) 100%);
    border-color: rgba(255, 255, 255, 0.3);
}

.poster-status-badge.status-on-hold {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.95) 0%, rgba(245, 158, 11, 0.95) 100%);
    border-color: rgba(255, 255, 255, 0.3);
}

.poster-status-badge.status-plan-to-watch {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.95) 0%, rgba(124, 58, 237, 0.95) 100%);
    border-color: rgba(255, 255, 255, 0.3);
}

.poster-status-badge.status-dropped {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(220, 38, 38, 0.95) 100%);
    border-color: rgba(255, 255, 255, 0.25);
}

.favorite-rank-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* お気に入りアニメ：ランキング表示（順位付きリスト・10位までスクロールなしで表示） */
.favorite-anime-container.favorite-anime-ranked .favorite-ranked-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    overflow-x: hidden;
}

.favorite-anime-container.favorite-anime-ranked .favorite-ranked-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.favorite-anime-container.favorite-anime-ranked .favorite-ranked-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.favorite-anime-container.favorite-anime-ranked .favorite-ranked-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.favorite-anime-container.favorite-anime-ranked .favorite-ranked-item.favorite-rank-1 .favorite-ranked-num {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.favorite-anime-container.favorite-anime-ranked .favorite-ranked-item.favorite-rank-2 .favorite-ranked-num {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

.favorite-anime-container.favorite-anime-ranked .favorite-ranked-item.favorite-rank-3 .favorite-ranked-num {
    background: linear-gradient(135deg, #b45309 0%, #92400e 100%);
}

.favorite-anime-container.favorite-anime-ranked .favorite-ranked-item:not(.favorite-rank-1):not(.favorite-rank-2):not(.favorite-rank-3) .favorite-ranked-num {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
}

.favorite-anime-container.favorite-anime-ranked .favorite-ranked-thumb {
    flex-shrink: 0;
    width: 44px;
    height: 64px;
    border-radius: 6px;
    overflow: hidden;
    background: #f1f5f9;
}

.favorite-anime-container.favorite-anime-ranked .favorite-ranked-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.favorite-anime-container.favorite-anime-ranked .favorite-ranked-title {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* お気に入りランキング：10件表示用にセクションの高さを確保（縦スクロールなし） */
.profile-section[data-section-type="favorite-anime"] .favorite-anime-container.favorite-anime-ranked {
    overflow: visible;
}
.profile-section[data-section-type="favorite-anime"] {
    min-height: 900px;
}

/* お気に入りアニメ：ランキングなし（カードグリッド） */
.favorite-anime-container.favorite-anime-unranked .favorite-unranked-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 10px;
    margin-top: 8px;
    overflow-x: hidden;
}

.favorite-anime-container.favorite-anime-unranked .favorite-unranked-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e2e8f0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.favorite-anime-container.favorite-anime-unranked .favorite-unranked-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.favorite-anime-container.favorite-anime-unranked .favorite-unranked-thumb {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: #f1f5f9;
    overflow: hidden;
}

.favorite-anime-container.favorite-anime-unranked .favorite-unranked-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.favorite-anime-container.favorite-anime-unranked .favorite-unranked-title {
    width: 100%;
    padding: 6px 6px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #334155;
    text-align: center;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.favorite-settings-hint {
    margin: 0 0 8px 0;
    font-size: 0.8rem;
    color: #64748b;
}

.favorite-anime-search-wrap {
    margin-bottom: 10px;
    position: relative;
}

.favorite-anime-search {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
}

.favorite-anime-search:focus {
    outline: none;
    border-color: #94a3b8;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.2);
}

/* 検索予測（サジェスト） */
.element-settings-modal .favorite-anime-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    z-index: 100;
}

.element-settings-modal .favorite-anime-suggestion-item {
    display: block;
    width: 100%;
    padding: 10px 12px;
    text-align: left;
    border: none;
    background: none;
    font-size: 0.9rem;
    color: #334155;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.15s;
}

.element-settings-modal .favorite-anime-suggestion-item:hover {
    background: #f1f5f9;
}

.element-settings-modal .favorite-anime-suggestion-item:first-child {
    border-radius: 8px 8px 0 0;
}

.element-settings-modal .favorite-anime-suggestion-item:last-child {
    border-radius: 0 0 8px 8px;
}

/* お気に入り設定モーダル内：横5個の小さいカードグリッド（幅いっぱいに均等配置して右余白を防ぐ） */
.element-settings-modal .favorite-anime-checkboxes {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(72px, 1fr)) !important;
    gap: 8px !important;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    background: #f8fafc;
    width: 100%;
    box-sizing: border-box;
}

.element-settings-modal .favorite-anime-check-item {
    position: relative;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 6px 0 !important;
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: 8px;
    box-sizing: border-box;
    border: 2px solid transparent;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.element-settings-modal .favorite-anime-check-item:hover {
    background: #f1f5f9;
}

/* 選択中：枠と薄い背景で表示（.is-selected で制御し :has() による負荷を回避） */
.element-settings-modal .favorite-anime-check-item.is-selected {
    border-color: #ec4899;
    background: rgba(236, 72, 153, 0.08);
    box-shadow: 0 0 0 1px rgba(236, 72, 153, 0.15);
}

/* 検索で非表示（!important より優先させるためクラスで制御） */
.element-settings-modal .favorite-anime-check-item.favorite-search-hidden {
    display: none !important;
}

/* ランキング並べ替えエリア */
.favorite-ranking-order-wrap {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.favorite-ranking-list {
    max-height: 220px;
    overflow-y: auto;
    margin-top: 8px;
    contain: layout style;
}

.favorite-ranking-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    margin-bottom: 4px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    cursor: grab;
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.favorite-ranking-item:active {
    cursor: grabbing;
}

/* ドラッグ中：元の行は薄く・少し縮めて「移動中」だと分かるように */
.favorite-ranking-item.favorite-ranking-dragging {
    opacity: 0.35;
    transform: scale(0.98);
    cursor: grabbing;
    pointer-events: none;
}

/* ドロップ先：この行の上に挿入されることを示す線 */
.favorite-ranking-item.favorite-ranking-insert-above {
    position: relative;
}

.favorite-ranking-item.favorite-ranking-insert-above::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -3px;
    height: 4px;
    background: #ec4899;
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(236, 72, 153, 0.5);
    animation: favorite-ranking-insert-line 0.5s ease-in-out infinite alternate;
}

@keyframes favorite-ranking-insert-line {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

/* ドラッグ中に付いてくるゴースト（setDragImage 用） */
.favorite-ranking-drag-ghost {
    position: fixed;
    left: 0;
    top: 0;
    will-change: transform;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    background: #fff;
    opacity: 0.98;
    pointer-events: none;
    border: 2px solid #ec4899;
    z-index: 99999;
}

/* ドロップ直後：ここに着いたことが分かるモーション */
.favorite-ranking-item.favorite-ranking-just-moved {
    animation: favorite-ranking-landed 0.6s ease-out;
}

@keyframes favorite-ranking-landed {
    0% {
        background: rgba(236, 72, 153, 0.25);
        box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.4);
    }
    100% {
        background: #fff;
        box-shadow: none;
    }
}

/* ドラッグ用ハンドル（持つところ） */
.favorite-ranking-handle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 32px;
    margin: -2px 0 -2px -2px;
    padding: 0;
    color: #94a3b8;
    font-size: 14px;
    letter-spacing: -0.2em;
    cursor: grab;
    border-radius: 4px;
    user-select: none;
}

.favorite-ranking-handle:hover {
    color: #64748b;
    background: #f1f5f9;
}

.favorite-ranking-item:active .favorite-ranking-handle {
    cursor: grabbing;
}

.favorite-ranking-num {
    flex-shrink: 0;
    width: 24px;
    font-weight: 700;
    color: #64748b;
    font-size: 0.85rem;
}

.favorite-ranking-thumb {
    flex-shrink: 0;
    width: 36px;
    height: 54px;
    border-radius: 4px;
    overflow: hidden;
    background: #e2e8f0;
}

.favorite-ranking-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

.favorite-ranking-title {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-ranking-up,
.btn-ranking-down {
    flex-shrink: 0;
    width: 32px;
    height: 28px;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    color: #475569;
    line-height: 1;
}

.btn-ranking-up:hover,
.btn-ranking-down:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.element-settings-modal .favorite-anime-poster-thumb {
    flex-shrink: 0 !important;
    width: 100% !important;
    max-width: 120px !important;
    aspect-ratio: 2 / 3 !important;
    height: auto !important;
    min-height: 108px !important;
    border-radius: 6px;
    overflow: hidden;
    background: #e2e8f0;
}

.element-settings-modal .favorite-anime-poster-thumb img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* チェックボックスは非表示（クリックはラベルで受け取り選択状態は枠で表示） */
.element-settings-modal .favorite-anime-check-item input {
    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;
}

.element-settings-modal .favorite-anime-label-text {
    width: 100%;
    box-sizing: border-box;
    padding: 0 4px;
    margin-top: 4px;
    text-align: center;
    font-size: 10px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 480px) {
    .element-settings-modal .favorite-anime-checkboxes {
        grid-template-columns: repeat(4, minmax(64px, 1fr)) !important;
        gap: 6px !important;
    }
    .element-settings-modal .favorite-anime-poster-thumb {
        max-width: 100px !important;
        min-height: 96px !important;
    }
}

/* モーダル外で使う場合のフォールバック（リスト形式） */
.favorite-anime-checkboxes {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    background: #f8fafc;
}

.favorite-anime-check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 6px;
}

.favorite-anime-check-item:hover {
    background: #f1f5f9;
}

.favorite-anime-poster-thumb {
    flex-shrink: 0;
    width: 48px;
    height: 72px;
    border-radius: 6px;
    overflow: hidden;
    background: #e2e8f0;
}

.favorite-anime-poster-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.favorite-anime-check-item input {
    flex-shrink: 0;
}

.favorite-anime-label-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.favorite-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.btn-open-favorite-settings {
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.35);
}

.btn-open-favorite-settings:hover {
    background: linear-gradient(135deg, #db2777 0%, #9d174d 100%);
    transform: scale(1.02);
}

.current-season-empty {
    text-align: center;
    padding: 32px 20px;
    width: 100%;
    box-sizing: border-box;
}

.empty-message {
    margin: 0;
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* レスポンシブ：狭い画面では4列に */
@media (max-width: 768px) {
    #customSectionsContainer .current-season-gallery,
    #customizableArea .current-season-gallery,
    .current-season-gallery {
        grid-template-columns: repeat(4, 64px) !important;
        grid-auto-rows: 96px !important;
        gap: 6px !important;
    }
    /* プロフィール枠内は見やすい大きさを維持（最小72px） */
    .profile-section[data-section-type="current-season"] .current-season-gallery,
    .profile-section[data-section-type="watching"] .current-season-gallery,
    .profile-section[data-section-type="completed-anime"] .current-season-gallery {
        grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)) !important;
        grid-auto-rows: auto !important;
    }
    #customSectionsContainer .current-season-poster,
    #customizableArea .current-season-poster,
    .current-season-poster {
        width: 64px !important;
        min-width: 64px !important;
        max-width: 64px !important;
        height: 96px !important;
        min-height: 96px !important;
        max-height: 96px !important;
    }
    .profile-section[data-section-type="current-season"] .current-season-poster,
    .profile-section[data-section-type="watching"] .current-season-poster,
    .profile-section[data-section-type="completed-anime"] .current-season-poster {
        width: 100% !important;
        height: 0 !important;
        padding-bottom: 150% !important;
    }

    /* カスタマイズ領域：スマホで右端が切れないよう最小幅を解除 */
    .profile-customizable-wrapper,
    .profile-customizable-area,
    .profile-custom-sections-container,
    #customizableArea,
    #customSectionsContainer,
    #customSectionsContainer .profile-section,
    #customizableArea .profile-section,
    .profile-section {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .profile-customizable-area.editable-area {
        padding: 12px !important;
    }

    /* 統計セクションの固定最小幅を解除（320px固定で横はみ出しが発生するため） */
    .profile-section[data-section-type="statistics"] {
        min-width: 0 !important;
    }

    .stats-cards,
    .user-stats-section .stats-cards--user {
        gap: 10px !important;
    }

    .stats-card,
    .user-stats-section .stats-card--reviews,
    .user-stats-section .stats-card--likes,
    .user-stats-section .stats-card--follow-trend {
        min-width: 0 !important;
        width: 100% !important;
        flex: 1 1 100% !important;
    }
}
    .current-season-title-card {
        padding: 18px 20px;
    }
    
    .current-season-title {
        font-size: 1.15rem;
    }
    
    .poster-overlay {
        padding: 15px 10px 10px;
    }
    
    .poster-title {
        font-size: 12px;
    }
}

/* ========== 視聴統計セクション（3項目・グラフ付き） ========== */
.stats-section--profile {
    padding: 0;
    max-width: 100%;
}
/* 編集モードでも通常時と同じレイアウトで表示（見たアニメ数・総視聴時間・期別グラフ） */
.profile-section[data-section-type="statistics"] {
    min-width: 320px;
    min-height: 260px;
}
.profile-section[data-section-type="statistics"] .stats-section--profile {
    overflow: visible;
}
.stats-section-title {
    margin: 0 0 20px 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #334155;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}
.stats-cards {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
}
.stats-card {
    flex: 1 1 0;
    min-width: 180px;
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 14px;
    padding: 18px 20px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
}
.stats-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.stats-card-icon {
    font-size: 1.35rem;
}
.stats-card-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.02em;
}
.stats-card-note {
    margin: 8px 0 0 0;
    font-size: 0.7rem;
    color: #94a3b8;
}
.stats-time-gauge-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90px;
}
.stats-time-gauge {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: conic-gradient(var(--color-primary) 0% calc(var(--gauge-pct, 0) * 1%), #e2e8f0 calc(var(--gauge-pct, 0) * 1%) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.stats-time-gauge::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
}
.stats-time-value {
    position: relative;
    z-index: 1;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--color-primary-strong);
    text-align: center;
    line-height: 1.2;
    max-width: 80px;
}
.stats-count-value-wrap {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}
.stats-count-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-primary-strong);
    line-height: 1.2;
}
.stats-count-unit {
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
}
/* 見たアニメ数：ステータスを上から2列×n行で表示 */
.stats-count-detail {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    font-size: 0.8rem;
    color: #64748b;
    min-width: 0;
}
.stats-count-detail span {
    display: inline-block;
    background: rgba(var(--color-primary-rgb), 0.12);
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
}
.stats-season-note {
    margin: -4px 0 8px 0;
    font-size: 0.75rem;
    color: #475569;
}
.stats-season-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
/* 期ごとグラフ：Y軸とグラフを同じ行にし、点線と数字の高さを完全一致。縦は上から下まで全て表示 */
.stats-season-chart-outer {
    min-height: 140px;
    padding: 8px 4px 4px 4px;
    box-sizing: border-box;
    overflow: visible;
}
.stats-season-chart-rows {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: visible;
}
.stats-season-chart-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
}
.stats-season-chart-row--bars {
    flex-shrink: 0;
    align-items: stretch;
    gap: 6px;
}
/* 1行レイアウト：Y軸＋横スクロール（棒＋年代ラベルを一緒にスクロール） */
.stats-season-chart-row--single {
    flex-shrink: 0;
    align-items: flex-start;
    gap: 6px;
}
.stats-season-chart-row--single .stats-season-yaxis-inner {
    align-self: flex-start;
}
.stats-season-chart-scroll-inner {
    display: flex;
    flex-direction: column;
    width: min-content;
    min-width: 100%;
    gap: 0;
}
.stats-season-chart-row--single .stats-season-chart-scroll {
    flex: 1;
    min-width: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
}
.stats-season-chart-row--single .stats-season-chart-row--labels {
    flex-shrink: 0;
    margin-top: 4px;
    margin-bottom: 0;
}
.stats-season-chart-row--single .stats-season-chart-row--labels .stats-season-chart-labels {
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin-top: 0;
}
/* 値・ラベル行の左余白＝Y軸幅＋数字と点線の間で揃える（二桁対応で幅をやや広め） */
.stats-season-yaxis-spacer {
    flex-shrink: 0;
    width: 32px;
    padding-right: 14px;
}
/* Y軸: グラフと同一行。数字が重ならないよう幅を確保 */
.stats-season-yaxis-inner {
    position: relative;
    flex-shrink: 0;
    width: 32px;
    padding-right: 8px;
}
/* 数字を点線の真横に。改行させず重なりを防ぐ */
.stats-season-yaxis-tick {
    position: absolute;
    left: 0;
    right: 0;
    height: 1.2em;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 0.7rem;
    font-weight: 600;
    color: #475569;
    line-height: 1;
    white-space: nowrap;
    transform: translateY(50%);
}
/* 横スクロールのみ。縦は上から下まで全て表示（クリップしない） */
.stats-season-chart-scroll {
    flex: 1;
    min-width: 0;
    align-self: stretch;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}
.stats-season-chart-row--labels {
    flex-shrink: 0;
    margin-top: 4px;
}
.stats-season-chart-inner {
    display: inline-flex;
    flex-direction: column;
    padding: 0;
    box-sizing: border-box;
}
/* 点線と棒を同じ80pxボックスに収め、座標を完全一致させる */
.stats-season-chart-area {
    position: relative;
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    width: 100%;
}
.stats-season-chart-grid {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border-bottom: 1px dashed #cbd5e1;
    border-top: 1px dashed #cbd5e1;
}
.stats-season-grid-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 0;
    border-top: 1px dashed #cbd5e1;
    /* bottom は JS で目盛り位置に合わせて指定 */
}
.stats-season-chart--vertical {
    flex-direction: row;
    align-items: flex-end;
    gap: 12px;
    position: relative;
    z-index: 1;
    height: 100%;
    min-width: min-content;
}
.stats-season-chart--vertical .stats-season-col--bar {
    flex: 0 0 auto;
    width: 44px;
    display: flex;
    justify-content: center;
}
.stats-season-chart--vertical .stats-season-bar-container {
    width: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.stats-season-chart--vertical .stats-season-bar-wrap--vertical {
    width: 100%;
    min-height: 4px;
    border-radius: 6px 6px 0 0;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.stats-season-chart--vertical .stats-season-bar--vertical {
    width: 100%;
    height: 100%;
    min-height: 4px;
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-header-3) 100%);
    border-radius: 6px 6px 0 0;
    transition: height 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 0;
}
/* 棒内の数字は白で表示（.stats-season-value の紫より優先） */
.stats-season-bar--vertical .stats-season-value--in-bar {
    font-weight: 700;
    font-size: 0.75rem;
    color: #fff !important;
    line-height: 1;
    text-shadow: none;
}
.stats-season-chart-labels {
    display: flex;
    flex-direction: row;
    gap: 12px;
    justify-content: flex-start;
    margin-top: 4px;
}
.stats-season-col--label {
    flex: 0 0 auto;
    width: 44px;
    display: flex;
    justify-content: center;
    font-size: 0.75rem;
}
.stats-season-value {
    font-weight: 700;
    color: var(--color-primary-strong);
    font-size: 0.8rem;
}
.stats-season-label {
    font-weight: 600;
    color: #475569;
    text-align: center;
    line-height: 1.2;
    word-break: keep-all;
    white-space: nowrap;
}

/* iPad: 視聴統計（概要・統計タブ）— 見たアニメ数のはみ出し・期別グラフのラベル重なり */
@media (min-width: 769px) and (max-width: 1366px) {
    .profile-section[data-section-type="statistics"] {
        min-width: 0;
    }

    .stats-section--profile:not(.user-stats-section) > .stats-cards,
    #profileStatisticsViewingSection .stats-cards,
    .profile-overview-stats-wrap .stats-cards {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        flex-wrap: nowrap;
    }

    .stats-section--profile:not(.user-stats-section) .stats-card--seasons,
    #profileStatisticsViewingSection .stats-card--seasons,
    .profile-overview-stats-wrap .stats-card--seasons {
        grid-column: 1 / -1;
    }

    .stats-section--profile:not(.user-stats-section) .stats-card,
    #profileStatisticsViewingSection .stats-card,
    .profile-overview-stats-wrap .stats-card {
        flex: none;
        min-width: 0;
        max-width: none;
        width: auto;
        padding: 14px 16px;
        overflow: hidden;
    }

    .stats-section--profile:not(.user-stats-section) .stats-card--count .stats-count-value,
    #profileStatisticsViewingSection .stats-card--count .stats-count-value,
    .profile-overview-stats-wrap .stats-card--count .stats-count-value {
        font-size: clamp(1.35rem, 3.5vw, 1.85rem);
    }

    .stats-section--profile:not(.user-stats-section) .stats-count-detail,
    #profileStatisticsViewingSection .stats-count-detail,
    .profile-overview-stats-wrap .stats-count-detail {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px 8px;
    }

    .stats-section--profile:not(.user-stats-section) .stats-count-detail span,
    #profileStatisticsViewingSection .stats-count-detail span,
    .profile-overview-stats-wrap .stats-count-detail span {
        display: block;
        width: 100%;
        box-sizing: border-box;
        white-space: normal;
        text-align: center;
        font-size: 0.72rem;
        padding: 5px 6px;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .stats-section--profile:not(.user-stats-section) .stats-count-detail span:last-child:nth-child(odd),
    #profileStatisticsViewingSection .stats-count-detail span:last-child:nth-child(odd),
    .profile-overview-stats-wrap .stats-count-detail span:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .stats-section--profile:not(.user-stats-section) .stats-season-chart-row--single .stats-season-yaxis-inner,
    #profileStatisticsViewingSection .stats-season-yaxis-inner {
        width: 44px;
        min-width: 44px;
        padding-right: 6px;
    }

    .stats-section--profile:not(.user-stats-section) .stats-season-yaxis-tick,
    #profileStatisticsViewingSection .stats-season-yaxis-tick {
        font-size: 0.65rem;
        height: 1em;
    }

    .stats-section--profile:not(.user-stats-section) .stats-season-chart--vertical,
    #profileStatisticsViewingSection .stats-season-chart--vertical {
        gap: 14px;
    }

    .stats-section--profile:not(.user-stats-section) .stats-season-chart--vertical .stats-season-col--bar,
    .stats-section--profile:not(.user-stats-section) .stats-season-col--label,
    #profileStatisticsViewingSection .stats-season-chart--vertical .stats-season-col--bar,
    #profileStatisticsViewingSection .stats-season-col--label {
        width: 52px;
        min-width: 52px;
    }

    .stats-section--profile:not(.user-stats-section) .stats-season-chart-labels,
    #profileStatisticsViewingSection .stats-season-chart-labels {
        gap: 14px;
    }

    .stats-section--profile:not(.user-stats-section) .stats-season-label,
    #profileStatisticsViewingSection .stats-season-label {
        font-size: 0.7rem;
        line-height: 1.3;
        white-space: normal;
        max-width: 52px;
        display: block;
    }

    .stats-section--profile:not(.user-stats-section) .stats-season-note,
    #profileStatisticsViewingSection .stats-season-note {
        font-size: 0.72rem;
        line-height: 1.35;
    }
}

/* ユーザー統計：フォロワーの推移グラフ */
.user-stats-section .stats-cards--user {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.user-stats-section .stats-card--reviews,
.user-stats-section .stats-card--likes {
    flex: 1 1 0;
    min-width: 140px;
}
.user-stats-section .stats-card--follow-trend {
    flex: 1 1 100%;
    min-width: 280px;
}
.stats-follow-chart-outer {
    margin-top: 8px;
}
.stats-follow-chart-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}
.stats-follow-chart {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 6px;
    min-width: min-content;
    padding: 4px 0;
}
.stats-follow-col {
    flex: 0 0 auto;
    width: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.stats-follow-bar-wrap {
    width: 100%;
    min-height: 4px;
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(99, 102, 241, 0.08);
}
.stats-follow-bar {
    width: 100%;
    min-height: 4px;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-header-3) 100%);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2px 0;
    transition: height 0.2s ease;
}
.stats-follow-value {
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}
.stats-follow-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

/* フォロワーの推移：diverging（新規フォロー上 / 解除下） */
.stats-follow-diverging-outer {
    margin-top: 10px;
}
#followTrendDailySeriesJson {
    display: none;
}
.stats-follow-diverging-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-bottom: 10px;
}
.stats-follow-diverging-granularity-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
}
.stats-follow-diverging-granularity {
    display: inline-flex;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(241, 245, 249, 0.8);
}
.stats-follow-gran-btn {
    margin: 0;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-right: 1px solid rgba(148, 163, 184, 0.35);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.stats-follow-gran-btn:last-child {
    border-right: none;
}
.stats-follow-gran-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #334155;
}
.stats-follow-gran-btn.active {
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-strong) 100%);
    color: #fff;
}
.stats-follow-gran-btn.active:hover {
    color: #fff;
}
.stats-follow-diverging-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}
.stats-follow-diverging {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
    min-width: min-content;
    padding: 8px 4px 0;
    --chart-h: 120px;
}
.stats-follow-diverging-col--wide {
    width: 56px;
    min-width: 56px;
}
.stats-follow-diverging-col {
    flex: 0 0 auto;
    width: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
/* 0件の日：バーは出さず列だけ残す（タイムラインの空白・イメージのグリッド感） */
.stats-follow-diverging-col--zero .stats-follow-diverging-bars--axis {
    background: linear-gradient(90deg, transparent 45%, rgba(148, 163, 184, 0.25) 45%, rgba(148, 163, 184, 0.25) 55%, transparent 55%);
    background-size: 100% 100%;
    border-radius: 4px;
}
.stats-follow-diverging-col--zero .stats-follow-diverging-axis {
    opacity: 0.85;
}
.stats-follow-diverging-col--zero .stats-follow-diverging-label {
    color: #94a3b8;
    font-weight: 500;
}
.stats-follow-diverging-bars {
    width: 100%;
    height: var(--chart-h);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
}
/* 中央基準：上=フォロー（上に伸びる）、下=解除（下に伸びる）。高さはPHPで件数×px指定 */
.stats-follow-diverging-bars--axis {
    position: relative;
    display: block;
    height: var(--chart-h);
    flex: none;
}
.stats-follow-diverging-bars--axis .stats-follow-diverging-axis {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    margin-top: -1px;
    height: 2px;
    margin-left: 0;
    margin-right: 0;
    z-index: 1;
}
.stats-follow-diverging-bars--axis .stats-follow-diverging-up {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 50%;
    margin-bottom: 1px;
    width: 100%;
    min-height: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    border-radius: 6px 6px 0 0;
    transition: height 0.2s ease;
    box-sizing: border-box;
}
.stats-follow-diverging-bars--axis .stats-follow-diverging-down {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    margin-top: 1px;
    width: 100%;
    min-height: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    border-radius: 0 0 6px 6px;
    transition: height 0.2s ease;
    box-sizing: border-box;
}
.stats-follow-diverging-up {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.35) 100%);
    border-radius: 6px 6px 0 0;
    transition: height 0.2s ease;
}
.stats-follow-diverging-bars--axis .stats-follow-diverging-up {
    background: linear-gradient(180deg, rgba(var(--color-primary-rgb), 0.6) 0%, var(--color-primary) 100%);
}
.stats-follow-diverging-bars--axis .stats-follow-diverging-up[style*="height: 0px"],
.stats-follow-diverging-bars--axis .stats-follow-diverging-up:not([style*="height:"]) {
    background: transparent;
}
.stats-follow-diverging-bars--axis .stats-follow-diverging-up[style*="height: 0"] {
    background: transparent;
    height: 0 !important;
    overflow: hidden;
}
.stats-follow-diverging-bars--axis .stats-follow-diverging-down {
    background: linear-gradient(180deg, #f87171 0%, #ef4444 100%);
}
.stats-follow-diverging-bars--axis .stats-follow-diverging-down[style*="height: 0px"],
.stats-follow-diverging-bars--axis .stats-follow-diverging-down[style*="height: 0"] {
    background: transparent;
    height: 0 !important;
    overflow: hidden;
}
.stats-follow-diverging-up .stats-follow-diverging-val {
    font-size: 0.65rem;
    font-weight: 700;
    color: #4f46e5;
    padding-bottom: 2px;
}
.stats-follow-diverging-axis {
    height: 2px;
    background: #cbd5e1;
    border-radius: 1px;
    flex-shrink: 0;
    margin: 2px 0;
}
.stats-follow-diverging-bars:not(.stats-follow-diverging-bars--axis) .stats-follow-diverging-down {
    flex: 1 1 0;
}
.stats-follow-diverging-down {
    min-height: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.35) 0%, rgba(239, 68, 68, 0.12) 100%);
    border-radius: 0 0 6px 6px;
    transition: height 0.2s ease;
}
.stats-follow-diverging-down .stats-follow-diverging-val {
    font-size: 0.65rem;
    font-weight: 700;
    color: #b91c1c;
    padding-top: 2px;
}
.stats-follow-diverging-up:has(.stats-follow-diverging-val) {
    background: linear-gradient(180deg, rgba(var(--color-primary-rgb), 0.6) 0%, var(--color-primary) 100%);
}
.stats-follow-diverging-up:has(.stats-follow-diverging-val) .stats-follow-diverging-val {
    color: #fff;
}
.stats-follow-diverging-down:has(.stats-follow-diverging-val) {
    background: linear-gradient(180deg, #f87171 0%, #ef4444 100%);
}
.stats-follow-diverging-down:has(.stats-follow-diverging-val) .stats-follow-diverging-val {
    color: #fff;
}
.stats-follow-diverging-label {
    font-size: 0.6rem;
    font-weight: 600;
    color: #64748b;
    margin-top: 6px;
    white-space: nowrap;
}
/* インライン tooltip はスクロールで切れるため非表示。代わりに固定レイヤー #followTrendChartFloatTip を使用 */
.stats-follow-diverging-tooltip {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
}

/* フォロワー推移：ホバー時の詳細パネル（固定表示・日本語・2枚目イメージに寄せたコントラスト） */
.follow-trend-float-tip {
    display: none;
    position: fixed;
    z-index: 10050;
    min-width: 200px;
    max-width: 320px;
    padding: 12px 14px;
    background: #0f172a;
    color: #f8fafc;
    border-radius: 12px;
    font-size: 0.8rem;
    line-height: 1.45;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06);
    pointer-events: none;
    text-align: left;
}
.follow-trend-float-tip.is-visible {
    display: block;
}
.follow-trend-float-tip-date {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
}
.follow-trend-float-tip-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    color: #e2e8f0;
}
.follow-trend-float-tip-row .tip-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}
.follow-trend-float-tip-row.follow-trend-float-tip-gain .tip-dot {
    background: #818cf8;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}
.follow-trend-float-tip-row.follow-trend-float-tip-loss .tip-dot {
    background: #f87171;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.follow-trend-float-tip-row strong {
    color: #fff;
    font-weight: 800;
    margin-left: 2px;
}
.stats-follow-diverging-tip-date {
    font-weight: 600;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.stats-follow-diverging-tip-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.stats-follow-diverging-tip-row .tip-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}
.stats-follow-diverging-tip-gain .tip-dot {
    background: var(--color-primary);
}
.stats-follow-diverging-tip-loss .tip-dot {
    background: #ef4444;
}
.stats-follow-diverging-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
    font-size: 0.75rem;
    color: #64748b;
}
.stats-follow-diverging-legend .legend-gain::before,
.stats-follow-diverging-legend .legend-loss::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-right: 6px;
    vertical-align: middle;
}
.stats-follow-diverging-legend .legend-gain::before {
    background: linear-gradient(180deg, rgba(var(--color-primary-rgb), 0.6), var(--color-primary));
}
.stats-follow-diverging-legend .legend-loss::before {
    background: linear-gradient(180deg, #f87171, #ef4444);
}
.stats-season-row {
    display: grid;
    grid-template-columns: 72px 1fr 52px;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
}
.stats-season-label {
    font-weight: 600;
    color: #475569;
}
.stats-season-bar-wrap {
    height: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}
.stats-season-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-header-3) 100%);
    border-radius: 10px;
    min-width: 4px;
    transition: width 0.4s ease;
}
.stats-season-value {
    font-weight: 700;
    color: var(--color-primary-strong);
    text-align: right;
}
.stats-empty-note {
    margin: 0;
    font-size: 0.85rem;
    color: #94a3b8;
    text-align: center;
    padding: 12px 0;
}

@media (max-width: 768px) {
    .stats-cards {
        flex-direction: column;
    }
    .stats-card {
        flex: 1 1 auto;
        min-width: 0;
    }
}
@media (max-width: 480px) {
    .stats-season-row {
        grid-template-columns: 60px 1fr 44px;
        font-size: 0.75rem;
    }
    /* 高さはJSで最大値に応じて設定されるため、ここでは最小のみ指定 */
    .stats-season-chart-row--bars,
    .stats-season-chart-row--single .stats-season-chart-area {
        min-height: 64px;
    }
    .stats-season-chart-area {
        min-height: 64px;
    }
    .stats-season-chart-row--single .stats-season-yaxis-inner {
        min-height: 64px;
    }
    .stats-season-yaxis-inner {
        min-height: 64px;
    }
    .stats-season-chart--vertical .stats-season-col--bar,
    .stats-season-col--label {
        width: 38px;
        font-size: 0.7rem;
    }
    .stats-season-chart--vertical .stats-season-bar-container {
        min-height: 64px;
        width: 20px;
    }
    .stats-count-value {
        font-size: 1.6rem;
    }
}

/* ドロップゾーン */
.profile-customizable-area.drop-zone-active {
    border: 3px dashed var(--color-primary);
    background: var(--color-primary-soft);
}

.profile-customizable-area.drag-over {
    border-color: var(--color-primary-strong);
    background: rgba(var(--color-primary-rgb), 0.12);
    box-shadow: 0 0 20px rgba(var(--color-primary-rgb), 0.3);
}

/* リサイズハンドル */
.resize-handles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.profile-section.resizable .resize-handles {
    pointer-events: auto;
}

.resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--color-primary);
    border: 2px solid white;
    border-radius: 50%;
    cursor: nwse-resize;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.2s;
}

.profile-section.resizable:hover .resize-handle {
    opacity: 1;
}

.resize-handle-nw {
    top: -6px;
    left: -6px;
    cursor: nwse-resize;
}

.resize-handle-ne {
    top: -6px;
    right: -6px;
    cursor: nesw-resize;
}

.resize-handle-sw {
    bottom: -6px;
    left: -6px;
    cursor: nesw-resize;
}

.resize-handle-se {
    bottom: -6px;
    right: -6px;
    cursor: nwse-resize;
}


/* 要素設定モーダル */
.element-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.element-settings-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.element-settings-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.element-settings-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.element-settings-modal.active .element-settings-modal-content {
    transform: scale(1);
}

.element-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #f0f0f0;
}

.element-settings-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.element-settings-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.element-settings-close:hover {
    background: #e5e5e5;
    color: #333;
}

.element-settings-body {
    padding: 25px;
}

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

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

.settings-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.settings-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.settings-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-checkboxes label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.element-settings-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 2px solid #f0f0f0;
}

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.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: #666;
}

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

/* レスポンシブ */
@media (max-width: 768px) {
    .element-add-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .element-add-card {
        padding: 20px 10px;
    }
    
    .element-add-icon {
        font-size: 28px;
    }
    
    .element-add-name {
        font-size: 12px;
    }
    
    .element-add-grid-container-sidebar {
        max-height: calc(100vh - 300px);
    }
    
    .element-add-card-sidebar {
        padding: 10px 12px;
    }
    
    .element-add-icon-sidebar {
        font-size: 20px;
        width: 20px;
        height: 20px;
    }
    
    .element-add-name-sidebar {
        font-size: 14px;
    }
}

/* フォロワー/フォロー中一覧モーダル */
.follow-list-content {
    max-height: 70vh;
    overflow-y: auto;
}
.follow-list-loading,
.follow-list-empty {
    text-align: center;
    color: #666;
    padding: 24px 16px;
    margin: 0;
}
.follow-list-retry-btn {
    margin-top: 12px;
    padding: 8px 16px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}
.follow-list-retry-btn:hover {
    opacity: 0.9;
}
.follow-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.follow-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    gap: 12px;
}
.follow-list-item:last-child {
    border-bottom: none;
}
.follow-list-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 0;
}
.follow-list-link:hover {
    color: var(--color-primary);
}
.follow-list-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.follow-list-avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    font-size: 18px;
    font-weight: 600;
}
.follow-list-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.follow-list-follow-btn {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.follow-list-follow-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.follow-list-follow-btn.btn-following {
    background: white;
    border: 2px solid #e0e0e0;
    color: #333;
    font-weight: 600;
}
.follow-list-follow-btn.btn-following:hover {
    background: #f5f5f5;
    border-color: #ddd;
    color: #333;
}

/* ===== Mobile optimization overrides (profile customize) ===== */
@media (max-width: 768px) {
    .profile-header-info {
        margin-top: -58px;
        padding: 0 12px 14px 12px;
    }

    .profile-header-avatar {
        width: 120px;
        height: 120px;
        margin-bottom: 10px;
    }

    .profile-header-name-row {
        gap: 10px;
    }

    .profile-header-actions {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .profile-header-follow-btn {
        min-height: 42px;
        padding: 8px 12px;
    }

    .stats-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* 概要タブの視聴統計のみ: 上段2枚 + 下段1枚 */
    .profile-overview-stats-wrap .stats-cards {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .profile-overview-stats-wrap .stats-card--time,
    .profile-overview-stats-wrap .stats-card--count {
        grid-column: span 1;
    }
    .profile-overview-stats-wrap .stats-card--seasons {
        grid-column: 1 / -1;
    }
    .profile-overview-stats-wrap .stats-card {
        min-width: 0;
        padding: 14px 10px;
    }
    .profile-overview-stats-wrap .stats-card-header {
        min-width: 0;
    }
    .profile-overview-stats-wrap .stats-card-label {
        flex: 1;
        min-width: 0;
        font-size: clamp(0.62rem, 3.15vw, 0.74rem);
        line-height: 1.25;
        white-space: nowrap;
    }
    .profile-overview-stats-wrap .stats-card-icon {
        font-size: 1.05rem;
        flex-shrink: 0;
    }
    .profile-overview-stats-wrap .stats-card--time .stats-card-note {
        white-space: nowrap;
        font-size: clamp(0.55rem, 2.65vw, 0.68rem);
        line-height: 1.2;
        letter-spacing: -0.025em;
        margin-left: auto;
        margin-right: auto;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .profile-overview-stats-wrap .stats-count-detail {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .profile-overview-stats-wrap .stats-count-detail span {
        display: block;
        width: 100%;
        box-sizing: border-box;
        padding: 4px 6px;
        font-size: 0.76rem;
        text-align: left;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.25;
        font-variant-numeric: tabular-nums;
    }
    .profile-overview-stats-wrap .stats-time-value {
        font-size: 1.05rem;
        max-width: 84px;
        white-space: nowrap;
    }
    .profile-overview-stats-wrap .stats-card--time .stats-card-header {
        justify-content: flex-start;
        gap: 5px;
        padding-left: 0;
    }
    .profile-overview-stats-wrap .stats-card--time .stats-card-label {
        font-size: clamp(0.58rem, 2.95vw, 0.72rem);
        letter-spacing: 0;
    }
}

@media (max-width: 430px) {
    .profile-header-name {
        font-size: 20px;
    }

    .profile-header-bio {
        font-size: 13px;
        line-height: 1.5;
    }

    .stats-card {
        padding: 12px;
    }

    .stats-card-label {
        font-size: 12px;
    }
}
