/* ============================================================
 * OY.AI — shared.css  v1
 * 全ページ共通のリセット・変数・コンポーネント
 * ============================================================ */

/* ===== 1. Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ===== 2. CSS Variables (Single Source of Truth) ===== */
/* 全ページ共通。個別ページでの上書きは禁止。 */
:root {
    /* Accent */
    --accent-primary:   #6c63ff;
    --accent-secondary: #5a52e6;
    --accent-glow:      rgba(108, 99, 255, 0.12);
    --accent-soft:      rgba(108, 99, 255, 0.06);
    --accent-coral:     #e17055;
    --accent-amber:     #fdcb6e;

    /* Backgrounds */
    --bg-primary:    #f5f5f7;
    --bg-secondary:  #eeeef0;
    --bg-card:       #ffffff;
    --bg-hover:      rgba(0, 0, 0, 0.03);
    --bg-input:      #f5f5f7;

    /* Text */
    --text-primary:   #1d1d1f;
    --text-secondary: #6e6e73;
    --text-muted:     #aeaeb2;

    /* Border */
    --border-color:  rgba(0, 0, 0, 0.06);
    --border-accent: rgba(108, 99, 255, 0.25);

    /* Status */
    --success:    #34c759;
    --danger:     #ff3b30;
    --danger-bg:  rgba(255, 59, 48, 0.08);
    --warning:    #ff9f0a;

    /* Radius */
    --radius-sm: 12px;
    --radius-md: 14px;
    --radius-lg: 18px;

    /* Motion */
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    /* Shadows */
    --shadow-sm:        0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md:        0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.03);
    --shadow-lg:        0 8px 30px rgba(108, 99, 255, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-card:      0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.03);
    --shadow-card-hover:0 8px 30px rgba(108,99,255,0.1), 0 2px 8px rgba(0,0,0,0.06);
}

/* ===== 2b. Dark Mode Variables ===== */
/* data-theme="dark" が html に付与されたとき、または
   data-theme="system" + OS設定がダークのとき適用 */
:root[data-theme="dark"] {
    --accent-glow:      rgba(108, 99, 255, 0.2);
    --accent-soft:      rgba(108, 99, 255, 0.12);

    --bg-primary:    #1c1c1e;
    --bg-secondary:  #2c2c2e;
    --bg-card:       #2c2c2e;
    --bg-hover:      rgba(255, 255, 255, 0.06);
    --bg-input:      #3a3a3c;

    --text-primary:   #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-muted:     #636366;

    --border-color:  rgba(255, 255, 255, 0.08);
    --border-accent: rgba(108, 99, 255, 0.35);

    --danger-bg:  rgba(255, 59, 48, 0.15);

    --shadow-sm:        0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md:        0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg:        0 8px 30px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-card:      0 1px 3px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.2);
    --shadow-card-hover:0 8px 30px rgba(108,99,255,0.15), 0 2px 8px rgba(0,0,0,0.3);

    color-scheme: dark;
}

/* System preference fallback: data-theme="system" + OS dark */
@media (prefers-color-scheme: dark) {
    :root[data-theme="system"] {
        --accent-glow:      rgba(108, 99, 255, 0.2);
        --accent-soft:      rgba(108, 99, 255, 0.12);

        --bg-primary:    #1c1c1e;
        --bg-secondary:  #2c2c2e;
        --bg-card:       #2c2c2e;
        --bg-hover:      rgba(255, 255, 255, 0.06);
        --bg-input:      #3a3a3c;

        --text-primary:   #f5f5f7;
        --text-secondary: #a1a1a6;
        --text-muted:     #636366;

        --border-color:  rgba(255, 255, 255, 0.08);
        --border-accent: rgba(108, 99, 255, 0.35);

        --danger-bg:  rgba(255, 59, 48, 0.15);

        --shadow-sm:        0 1px 2px rgba(0, 0, 0, 0.2);
        --shadow-md:        0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.2);
        --shadow-lg:        0 8px 30px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
        --shadow-card:      0 1px 3px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.2);
        --shadow-card-hover:0 8px 30px rgba(108,99,255,0.15), 0 2px 8px rgba(0,0,0,0.3);

        color-scheme: dark;
    }
}

/* ===== 3. Base body ===== */
body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    /* 日本語の行末孤立文字対策（禁則処理 + 孤立行回避）。
       .modal__text / modal 内 inline テキスト / toast / ヘルプ等の
       説明テキストに一括で適用される。 */
    line-break: strict;
    text-wrap: pretty;
}

/* ===== 4. Ambient background gradients (dashboard / detail) ===== */
body::before {
    content: '';
    position: fixed;
    top: -30%; right: -20%;
    width: 60vw; height: 60vw;
    background: radial-gradient(circle, rgba(108, 99, 255, 0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}
body::after {
    content: '';
    position: fixed;
    bottom: -30%; left: -15%;
    width: 50vw; height: 50vw;
    background: radial-gradient(circle, rgba(52, 199, 89, 0.03) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ===== 4b. Dark mode adjustments for ambient gradients & bottom nav ===== */
:root[data-theme="dark"] body::before {
    background: radial-gradient(circle, rgba(108, 99, 255, 0.08) 0%, transparent 60%);
}
:root[data-theme="dark"] body::after {
    background: radial-gradient(circle, rgba(52, 199, 89, 0.05) 0%, transparent 60%);
}
:root[data-theme="dark"] .bottom-nav {
    background: rgba(28, 28, 30, 0.92);
}
@media (prefers-color-scheme: dark) {
    :root[data-theme="system"] body::before {
        background: radial-gradient(circle, rgba(108, 99, 255, 0.08) 0%, transparent 60%);
    }
    :root[data-theme="system"] body::after {
        background: radial-gradient(circle, rgba(52, 199, 89, 0.05) 0%, transparent 60%);
    }
    :root[data-theme="system"] .bottom-nav {
        background: rgba(28, 28, 30, 0.92);
    }
}

/* ===== 5. Scroll-reveal animation ===== */
.reveal {
    opacity: 0;
    transform: translateY(40px) scale(0.98);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ===== 6. Bottom navigation ===== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 200;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav__notice {
    text-align: center;
    font-size: 10px;
    color: var(--text-muted);
    padding: 4px 16px 2px;
    line-height: 1.4;
}
.bottom-nav__notice a {
    color: var(--text-muted);
    text-decoration: underline;
}
.bottom-nav__inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 56px;
}
.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    height: 100%;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav__item.active              { color: var(--accent-primary); }
.bottom-nav__item:not(.active):hover  { color: var(--text-secondary); }
.bottom-nav__item svg                 { width: 22px; height: 22px; }
.bottom-nav__label                    { font-size: 10px; font-weight: 600; letter-spacing: 0.2px; }

@media (max-width: 768px) {
    .bottom-nav { display: block; }
    /* コンシェルジュ FAB をボトムナビの上に配置 */
    .cj-fab { bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important; }
}

/* ===== 7. Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 28px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Noto Sans JP', sans-serif;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
    letter-spacing: 0.3px;
}
.btn--primary             { background: var(--accent-primary); color: #fff; }
.btn--primary:hover       { background: var(--accent-secondary); transform: scale(1.02); }
.btn--primary:active      { transform: scale(0.98); }
.btn--ghost               { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-color); }
.btn--ghost:hover         { background: var(--bg-hover); color: var(--text-primary); }
.btn--sm                  { padding: 6px 16px; font-size: 11px; }
.btn--edit                { background: var(--accent-soft); color: var(--accent-secondary); border: 1px solid var(--border-accent); }
.btn--edit:hover          { background: var(--accent-glow); }
.btn--danger              { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(255, 59, 48, 0.2); }
.btn--danger:hover        { background: rgba(255, 59, 48, 0.12); }

/* ===== 8. Toast notifications ===== */
.toast {
    position: fixed;
    bottom: 32px; right: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 14px 24px;
    font-size: 13px;
    color: var(--text-primary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}
.toast.show        { transform: translateY(0); opacity: 1; }
.toast--success    { border-color: rgba(52, 199, 89, 0.3); }
.toast--danger     { border-color: rgba(255, 59, 48, 0.3); }
.toast--error,
.toast--warning    {
    color: var(--text-primary);
    max-width: 380px;
    border-radius: 12px;
    align-items: flex-start;
    padding: 14px 18px;
}
.toast--error      { border-color: rgba(255, 59, 48, 0.4); background: rgba(255, 59, 48, 0.04); }
.toast--warning    { border-color: rgba(255, 149, 0, 0.4); background: rgba(255, 149, 0, 0.04); }

/* 構造化 Toast（showToast の opts.label を使う場合） */
.toast__icon {
    flex-shrink: 0;
    font-size: 14px;
    line-height: 1.4;
    margin-top: 2px;
    color: var(--danger);
}
.toast--success .toast__icon { color: var(--success, #34c759); }
.toast--warning .toast__icon { color: var(--warning, #ff9500); }
.toast__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.toast__label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    line-height: 1.4;
}
.toast__message {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
    line-break: strict;
}

/* ===== 9. Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 420px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    transform: scale(0.96) translateY(10px);
    transition: transform 0.3s ease;
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }
.modal__title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}
.modal__text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 28px;
    line-height: 1.7;
}
.modal__actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ===== 10. Empty state ===== */
.empty-state       { text-align: center; padding: 80px 20px; }
.empty-state__icon { font-size: 40px; margin-bottom: 16px; opacity: 0.3; }
.empty-state__text { font-size: 14px; color: var(--text-muted); font-weight: 400; }
.empty-state__subtext { font-size: 12px; color: var(--text-muted); font-weight: 400; margin-top: 8px; line-height: 1.6; max-width: 420px; margin-left: auto; margin-right: auto; }
.empty-state__actions { margin-top: 20px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ===== 10b. Error state (インラインエラー表示) ===== */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    gap: 10px;
    background: rgba(255, 59, 48, 0.03);
    border: 1px solid rgba(255, 59, 48, 0.15);
    border-radius: 12px;
    text-align: center;
}
.error-state--fullscreen {
    min-height: 60vh;
    padding: 48px 24px;
    background: transparent;
    border: none;
}
.error-state__icon {
    width: 36px;
    height: 36px;
    color: var(--danger);
    opacity: 0.75;
    margin-bottom: 4px;
    flex-shrink: 0;
}
.error-state__text {
    font-size: 14px;
    font-weight: 600;
    color: var(--danger);
    line-height: 1.4;
    margin: 0;
}
.error-state__sub {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 360px;
    text-wrap: balance;
    line-break: strict;
    margin: 0;
}
.error-state__actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== 11. Table utilities ===== */
.price { font-variant-numeric: tabular-nums; font-weight: 500; }
.date  { color: var(--text-secondary); font-size: 13px; }

/* ===== 12. Animations ===== */
@keyframes fadeInRow {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.row-enter { animation: fadeInRow 0.4s ease forwards; }

@keyframes slideInNotification {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ===== 13. Account Bottom Sheet ===== */
.account-sheet-overlay {
    position: fixed; inset: 0; z-index: 900;
    background: rgba(0,0,0,0.3); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.account-sheet-overlay.open { opacity: 1; visibility: visible; }

.account-sheet {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 901;
    background: var(--bg-card); border-radius: 20px 20px 0 0;
    padding: 12px 0 calc(16px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
    transform: translateY(100%); transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 70vh; overflow-y: auto;
}
.account-sheet-overlay.open .account-sheet { transform: translateY(0); }

.account-sheet__handle {
    width: 36px; height: 4px; border-radius: 2px;
    background: var(--text-muted); opacity: 0.4;
    margin: 0 auto 16px;
}
.account-sheet__user { padding: 8px 24px 16px; }
.account-sheet__email { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.account-sheet__plan { font-size: 12px; color: var(--accent-primary); font-weight: 600; margin-top: 2px; }
.account-sheet__divider { height: 1px; background: var(--border-color); margin: 4px 16px; }
.account-sheet__item {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 24px;
    font-size: 14px; color: var(--text-secondary); background: none; border: none;
    cursor: pointer; text-decoration: none; font-family: inherit; transition: background 0.2s;
}
.account-sheet__item:hover { background: var(--bg-hover); }
.account-sheet__item--danger { color: var(--danger); }
.account-sheet__item--danger:hover { background: var(--danger-bg); }

/* ===== Account Dropdown Menu (desktop) ===== */
.account-menu-trigger {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--bg-card); border: 1px solid var(--border-color);
    cursor: pointer; color: var(--text-secondary); transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}
.account-menu-trigger:hover { background: var(--bg-hover); color: var(--text-primary); }
.account-dropdown {
    display: none; position: absolute; top: 44px; right: 0; z-index: 500;
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    min-width: 220px; padding: 8px 0; animation: fadeInMenu 0.2s ease;
}
.account-dropdown.open { display: block; }
@keyframes fadeInMenu { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.account-dropdown__user { padding: 12px 16px; }
.account-dropdown__email { font-size: 13px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-dropdown__plan { font-size: 11px; color: var(--accent-primary); font-weight: 600; margin-top: 2px; }
.account-dropdown__divider { height: 1px; background: var(--border-color); margin: 4px 0; }
.account-dropdown__item {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 16px;
    font-size: 13px; color: var(--text-secondary); background: none; border: none;
    cursor: pointer; text-decoration: none; font-family: inherit; transition: all var(--transition);
}
.account-dropdown__item:hover { background: var(--bg-hover); color: var(--text-primary); }
.account-dropdown__item--danger { color: var(--danger); }
.account-dropdown__item--danger:hover { background: var(--danger-bg); }
.account-dropdown__info { padding: 2px 16px; font-size: 10px; color: var(--text-muted); }
.account-dropdown__section { padding: 10px 16px; }
.account-dropdown__section-label { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.account-dropdown__badge {
    display: none; margin-left: auto; background: var(--accent-primary); color: #fff;
    border-radius: 10px; padding: 1px 7px; font-size: 10px; font-weight: 700;
}
.theme-toggle {
    display: flex; gap: 4px; background: var(--bg-input); border-radius: 10px; padding: 3px;
}
.theme-toggle__btn {
    flex: 1; padding: 6px 0; font-size: 11px; font-weight: 600; font-family: inherit;
    border: none; border-radius: 8px; cursor: pointer; transition: all 0.2s;
    background: transparent; color: var(--text-muted);
}
.theme-toggle__btn.active { background: var(--bg-card); color: var(--text-primary); box-shadow: var(--shadow-sm); }
.theme-toggle__icon { vertical-align: -2px; margin-right: 2px; }

/* ===== 14. AI Model Pill Bar ===== */
.cj-model-bar {
    display: flex; gap: 6px; padding: 0 12px 8px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.cj-model-bar::-webkit-scrollbar { display: none; }

.cj-model-pill {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; font-family: inherit; font-weight: 500;
    padding: 5px 14px; border-radius: 999px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-card); color: var(--text-secondary);
    cursor: pointer; transition: all 0.2s; white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.cj-model-pill:active { transform: scale(0.96); }

/* 自動 (Auto) — gradient accent */
.cj-model-pill[data-model="auto"].active {
    background: linear-gradient(135deg, rgba(108,99,255,0.1), rgba(32,178,170,0.1));
    border-color: var(--accent-primary);
    color: var(--accent-primary); font-weight: 600;
}

/* 秘書 (Gemini) — default accent */
.cj-model-pill[data-model="gemini"].active {
    background: rgba(108, 99, 255, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary); font-weight: 600;
}

/* リサーチ (Perplexity) — teal */
.cj-model-pill[data-model="perplexity"].active {
    background: rgba(32, 178, 170, 0.1);
    border-color: #20b2aa;
    color: #20b2aa; font-weight: 600;
}

/* 分析 (Claude) — amber/coral */
.cj-model-pill[data-model="claude"].active {
    background: rgba(225, 112, 85, 0.1);
    border-color: var(--accent-coral);
    color: var(--accent-coral); font-weight: 600;
}

.cj-model-pill__icon { display: inline-flex; align-items: center; vertical-align: -2px; margin-right: 3px; }
.cj-model-pill__icon svg { width: 12px; height: 12px; }

/* ===== 15. Perplexity Citations ===== */
.cj-citations { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-color); }
.cj-citations-title { font-size: 11px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.cj-citations-list { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.cj-citations-list li a {
    display: inline-block; font-size: 11px; padding: 3px 10px;
    border-radius: 999px; background: var(--bg-secondary); color: var(--text-secondary);
    text-decoration: none; transition: all 0.15s;
}
.cj-citations-list li a:hover {
    background: rgba(32, 178, 170, 0.1); color: #20b2aa;
}

/* ===== 16. Verification Level Badges ===== */
.vlv-badge {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 10px; line-height: 1; padding: 2px 6px;
    border-radius: 999px; font-weight: 500; white-space: nowrap;
}
.vlv-badge--self      { color: var(--text-muted); background: transparent; }
.vlv-badge--attached  { color: #5b9bd5; background: rgba(91, 155, 213, 0.12); }
.vlv-badge--verified  { color: #20b2aa; background: rgba(32, 178, 170, 0.12); }
.vlv-badge--api       { color: var(--success); background: rgba(52, 199, 89, 0.12); }

.vlv-badge__dot {
    width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0;
}
.vlv-badge--self .vlv-badge__dot      { background: var(--text-muted); opacity: 0.4; }
.vlv-badge--attached .vlv-badge__dot  { background: #5b9bd5; }
.vlv-badge--verified .vlv-badge__dot  { background: #20b2aa; }
.vlv-badge--api .vlv-badge__dot       { background: var(--success); }

/* ===== 17. Data Type Indicators (Actual / Forecast) ===== */
.dt-actual  { /* default: no special style */ }
.dt-forecast {
    border-bottom: 2px dashed var(--text-muted);
    opacity: 0.7;
}
.dt-forecast-badge {
    display: inline-block; font-size: 9px; padding: 1px 5px;
    border-radius: 4px; background: rgba(255, 159, 10, 0.15);
    color: var(--warning); font-weight: 600; margin-left: 4px;
    vertical-align: middle; line-height: 1.4;
}
.dt-auto-badge {
    display: inline-block; font-size: 9px; padding: 1px 5px;
    border-radius: 4px; background: rgba(32, 178, 170, 0.1);
    color: var(--accent-primary); font-weight: 500; margin-left: 4px;
    vertical-align: middle; line-height: 1.4;
}
.dt-none {
    color: var(--text-muted); font-style: italic;
}

/* ===== 18. Health Score ===== */
.hs-score {
    display: inline-flex; align-items: center; gap: 6px;
    font-weight: 700; font-size: 14px;
    font-variant-numeric: tabular-nums;
}
.hs-score--sm { font-size: 12px; gap: 4px; }

.hs-score__ring {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: #fff;
    position: relative;
}
.hs-score__ring--sm { width: 24px; height: 24px; font-size: 9px; }

.hs-score__ring--green  { background: var(--success); box-shadow: 0 0 8px rgba(52, 199, 89, 0.3); }
.hs-score__ring--yellow { background: var(--warning); box-shadow: 0 0 8px rgba(255, 159, 10, 0.3); }
.hs-score__ring--orange { background: #ff6b35; box-shadow: 0 0 8px rgba(255, 107, 53, 0.3); }
.hs-score__ring--red    { background: var(--danger); box-shadow: 0 0 8px rgba(255, 59, 48, 0.3); }

.hs-score__label { font-size: 11px; font-weight: 400; color: var(--text-secondary); }

.hs-breakdown {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    margin-top: 8px;
}
.hs-breakdown__item {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 11px; color: var(--text-secondary);
    padding: 4px 0;
}
.hs-breakdown__bar {
    width: 48px; height: 4px; border-radius: 2px;
    background: var(--bg-secondary); overflow: hidden; margin-left: 8px;
}
.hs-breakdown__bar-fill {
    height: 100%; border-radius: 2px; transition: width 0.5s ease;
}

/* ===== 19. Confirmation Card (AI Approval Flow) ===== */
.confirm-card {
    background: var(--bg-card); border: 1px solid var(--border-accent);
    border-radius: var(--radius-md); padding: 12px 14px;
    margin: 8px 0;
}
.confirm-card__header {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 600; color: var(--text-primary);
    margin-bottom: 8px;
}
.confirm-card__body {
    font-size: 12px; color: var(--text-secondary);
    line-height: 1.6;
}
.confirm-card__body table {
    width: 100%; border-collapse: collapse; margin: 6px 0;
}
.confirm-card__body td {
    padding: 3px 8px; font-size: 11px;
    border-bottom: 1px solid var(--border-color);
}
.confirm-card__actions {
    display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end;
}
.confirm-card__btn {
    padding: 6px 16px; border-radius: var(--radius-sm);
    font-size: 12px; font-weight: 600; border: none; cursor: pointer;
    transition: var(--transition);
}
.confirm-card__btn--approve {
    background: var(--accent-primary); color: #fff;
}
.confirm-card__btn--approve:hover { opacity: 0.85; }
.confirm-card__btn--reject {
    background: var(--bg-secondary); color: var(--text-secondary);
}
.confirm-card__btn--reject:hover { background: var(--bg-hover); }

/* ===== 21. PL Cell Action Sheet ===== */
.pnl-action-sheet {
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 10000; background: var(--bg-card);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.pnl-action-sheet.open { transform: translateY(0); }
.pnl-action-sheet__backdrop {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.3); opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.pnl-action-sheet__backdrop.open { opacity: 1; pointer-events: auto; }
.pnl-action-sheet__title {
    font-size: 13px; font-weight: 600; color: var(--text-secondary);
    margin-bottom: 12px; text-align: center;
}
.pnl-action-sheet__btn {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 14px 16px; border: none;
    border-radius: var(--radius-md); cursor: pointer;
    font-size: 14px; text-align: left;
    transition: background 0.15s ease;
    margin-bottom: 8px;
}
.pnl-action-sheet__btn:last-child { margin-bottom: 0; }
.pnl-action-sheet__btn--primary {
    background: var(--accent-primary); color: #fff; font-weight: 600;
}
.pnl-action-sheet__btn--primary:hover { opacity: 0.9; }
.pnl-action-sheet__btn--secondary {
    background: var(--bg-secondary); color: var(--text-primary);
}
.pnl-action-sheet__btn--secondary:hover { background: var(--bg-hover); }
.pnl-action-sheet__btn--tertiary {
    background: transparent; color: var(--text-muted); font-size: 13px;
}
.pnl-action-sheet__btn--tertiary:hover { background: var(--bg-secondary); }
.pnl-action-sheet__icon { font-size: 18px; flex-shrink: 0; }
.pnl-action-sheet__cancel {
    display: block; width: 100%; padding: 12px; margin-top: 8px;
    border: none; border-radius: var(--radius-md);
    background: var(--bg-secondary); color: var(--text-secondary);
    font-size: 14px; font-weight: 500; cursor: pointer; text-align: center;
}
.pnl-action-sheet__cancel:hover { background: var(--bg-hover); }
