/* =========================================================================
   DeMesy Pricing Dashboard — NYT Theme
   ========================================================================= */

:root {
    --bg: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #fafafa;
    --bg-surface: #f7f7f5;
    --bg-input: #f7f7f5;
    --accent: #d4621a;
    --accent-dim: #b8511a;
    --accent-bg: rgba(212,98,26,0.06);
    --gold: #b8860b;
    --gold-dim: rgba(184,134,11,0.1);
    --text: #121212;
    --text-secondary: #444444;
    --text-muted: #888888;
    --border: #e2e2e2;
    --border-light: #eeeeee;
    --red: #c0392b;
    --red-dim: rgba(192,57,43,0.08);
    --green: #27623a;
    --green-dim: rgba(39,98,58,0.08);
    --font: 'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;
    --serif: 'Playfair Display', Georgia, serif;
    --mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    --topbar-bg: #ffffff;
    --topbar-border: #121212;
}

body.dark {
    --bg: #0f1117;
    --bg-card: #1a1d27;
    --bg-card-hover: #222632;
    --bg-surface: #151820;
    --bg-input: #222632;
    --accent: #e07840;
    --accent-dim: #c4622a;
    --accent-bg: rgba(224,120,64,0.08);
    --gold: #d4a017;
    --text: #e8eaed;
    --text-secondary: #9aa0ac;
    --text-muted: #5f6672;
    --border: #2a2e3a;
    --border-light: #1f222d;
    --red: #ef4444;
    --red-dim: rgba(239,68,68,0.12);
    --green: #4ade80;
    --green-dim: rgba(34,197,94,0.12);
    --topbar-bg: #0f1117;
    --topbar-border: #2a2e3a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    transition: background 0.2s, color 0.2s;
}

.hidden { display: none !important; }

/* =========================================================================
   THEME TOGGLE
   ========================================================================= */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}
.theme-toggle-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}
.toggle-track {
    width: 36px;
    height: 20px;
    background: var(--border);
    border-radius: 10px;
    position: relative;
    transition: background 0.2s;
    border: 1px solid var(--border);
}
body.dark .toggle-track { background: var(--accent); border-color: var(--accent); }
.toggle-thumb {
    position: absolute;
    top: 2px; left: 2px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
body.dark .toggle-thumb { transform: translateX(16px); }

/* =========================================================================
   TOP BAR
   ========================================================================= */
.top-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    background: var(--topbar-bg);
    border-bottom: 2px solid var(--topbar-border);
    transition: background 0.2s, border-color 0.2s;
}
.top-bar-brand {
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: -0.3px;
}
.top-bar-brand:hover { opacity: 0.8; }
.top-bar-brand-thin { font-weight: 400; color: var(--accent); }

.top-bar-search-wrap {
    flex: 1;
    max-width: 500px;
    position: relative;
}
.top-bar-search {
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 0 12px;
    transition: border-color 0.2s;
}
.top-bar-search:focus-within { border-color: var(--text); }
.search-icon { color: var(--text-muted); margin-right: 10px; flex-shrink: 0; }
.top-bar-search input {
    border: none; outline: none; padding: 8px 0; font-size: 13px;
    width: 100%; background: transparent; font-family: var(--font); color: var(--text);
}
.top-bar-search input::placeholder { color: var(--text-muted); }
.search-clear { cursor: pointer; color: var(--text-muted); font-size: 20px; padding: 0 4px; }
.search-clear:hover { color: var(--text); }

.logout-link {
    color: var(--text-muted); text-decoration: none; font-size: 11px; font-weight: 700;
    padding: 5px 12px; border: 1px solid var(--border); margin-left: auto;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.logout-link:hover { color: var(--text); border-color: var(--text); }

/* Search Dropdown */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 2px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 50;
    max-height: 400px;
    overflow-y: auto;
}
body.dark .search-dropdown { box-shadow: 0 8px 30px rgba(0,0,0,0.5); }
.search-result {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--bg-surface); }
.search-result.disabled { opacity: 0.3; cursor: default; }
.search-result.disabled:hover { background: transparent; }
.search-ref { font-family: var(--mono); font-weight: 700; font-size: 14px; color: var(--accent); }
.search-model { font-size: 13px; font-weight: 600; color: var(--text); }
.search-meta { font-size: 11px; color: var(--text-muted); }
.search-right { display: flex; gap: 6px; align-items: center; }
.search-demesy {
    font-size: 10px; padding: 2px 8px;
    background: var(--accent-bg); border: 1px solid rgba(212,98,26,0.2);
    color: var(--accent); font-weight: 700;
}
.search-ddc {
    font-size: 10px; padding: 2px 8px;
    background: var(--gold-dim); border: 1px solid rgba(184,134,11,0.3);
    color: var(--gold); font-weight: 700; font-family: var(--mono);
}
.search-nodata { font-size: 10px; color: var(--text-muted); }
.search-empty { padding: 16px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* =========================================================================
   MASTHEAD (Splash Page — NYT style)
   ========================================================================= */
.masthead {
    background: var(--bg);
    border-bottom: 2px solid var(--topbar-border);
    padding: 0;
    transition: background 0.2s, border-color 0.2s;
    max-width: 1200px;
    margin: 0 auto;
}
.masthead-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 24px;
    border-bottom: 1px solid var(--border);
}
.masthead-date {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}
.brand-tabs {
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-family: var(--serif);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 6px;
    letter-spacing: 0.3px;
    transition: color 0.2s, border-color 0.2s;
}
.brand-tab:hover {
    color: var(--text);
}
.brand-tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}
.brand-tab-sep {
    width: 1px;
    height: 14px;
    background: var(--border);
}
.masthead-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}
.masthead-title-row {
    text-align: center;
    padding: 20px 24px 12px;
}
.masthead-title {
    font-family: var(--serif);
    font-size: 42px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
    line-height: 1.1;
}
.masthead-title-thin {
    font-weight: 400;
    color: var(--accent);
}
.masthead-search-wrap {
    max-width: 440px;
    margin: 0 auto 24px;
    padding: 0 24px;
    position: relative;
}
.masthead-search {
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 0 12px;
    transition: border-color 0.2s;
}
.masthead-search:focus-within { border-color: var(--text); }
.masthead-search input {
    border: none; outline: none; padding: 8px 0; font-size: 13px;
    width: 100%; background: transparent; font-family: var(--font); color: var(--text);
}
.masthead-search input::placeholder { color: var(--text-muted); }

.masthead-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    padding: 0 24px;
    border-top: 1px solid var(--border);
}
.masthead-nav-link {
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.masthead-nav-link:hover {
    color: var(--text);
    border-bottom-color: var(--text-muted);
}
.masthead-nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.masthead-nav-loading {
    padding: 10px 16px;
    font-size: 12px;
    color: var(--text-muted);
}
.masthead-nav-break {
    width: 100%;
    height: 0;
    border-top: 1px solid var(--border);
}

/* Hide normal top bar on splash page */
.splash-page .top-bar { display: none; }
.splash-page .app {
    max-width: 1200px;
    margin: 0 auto;
}

/* =========================================================================
   SPLASH PAGE — Stats
   ========================================================================= */
.splash-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    max-width: 700px;
    margin: 36px auto;
    padding: 0 24px;
    border: 1px solid var(--border);
    border-radius: 2px;
    overflow: hidden;
}
.stat-card {
    background: var(--bg-card);
    padding: 20px 16px;
    text-align: center;
    border-right: 1px solid var(--border);
}
.stat-card:last-child { border-right: none; }
.stat-value {
    font-family: var(--serif);
    font-size: 32px; font-weight: 700;
    color: var(--accent);
}
.stat-label {
    font-size: 11px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.8px; margin-top: 4px;
    font-weight: 600;
}

/* =========================================================================
   SPLASH PAGE — Pricing Review Table
   ========================================================================= */
.attention-section {
    max-width: 1200px;
    margin: 0 auto 40px;
    padding: 24px 24px 0;
}
.attention-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.attention-title {
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}
.attention-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--mono);
}
.signals-info-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    margin-right: 12px;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: color 0.15s, background 0.15s;
}
.signals-info-link:hover,
.signals-info-link.active {
    color: var(--text);
    background: var(--bg-surface);
}
.signals-info-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 20px 24px;
    margin-bottom: 16px;
}
.signals-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 32px;
}
.signals-info-item p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 6px 0 0 0;
    line-height: 1.5;
}
.signals-info-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text);
}
.attention-tabs {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
}
.attention-tab {
    padding: 5px 14px;
    border: none;
    background: var(--bg-surface);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.15s, color 0.15s;
}
.attention-tab:not(:last-child) { border-right: 1px solid var(--border); }
.attention-tab.active { background: var(--text); color: var(--bg); }
.attention-tab:hover:not(.active) { color: var(--text); }

.attention-table-wrap {
    border: 1px solid var(--border);
    overflow: hidden;
    max-height: 600px;
    overflow-y: auto;
}
.attention-table {
    width: 100%;
    border-collapse: collapse;
}
.attention-table thead th {
    padding: 8px 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    background: var(--bg-surface);
    border-bottom: 2px solid var(--border);
    text-align: left;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}
.attention-table tbody tr {
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.1s;
}
.attention-table tbody tr:hover { background: var(--bg-surface); }
.attention-table tbody td {
    padding: 7px 12px;
    font-size: 13px;
}
.att-ref {
    font-family: var(--mono);
    font-weight: 700;
    color: var(--accent);
    font-size: 13px;
}
.att-collection { color: var(--text-secondary); }
.att-ddc code {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-surface);
    padding: 1px 5px;
}
.att-price { font-family: var(--mono); font-size: 12px; font-weight: 600; }
.att-median { font-family: var(--mono); font-size: 12px; color: var(--text-muted); }
.att-at { font-family: var(--mono); font-size: 12px; color: var(--text-muted); }
.attention-loading {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-size: 13px;
}

/* =========================================================================
   REFERENCE LAYOUT — Two Column
   ========================================================================= */
.ref-detail { padding: 20px 24px 40px; }

.ref-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    align-items: start;
}

/* LEFT: Watch Card */
.watch-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    overflow: hidden;
    position: sticky;
    top: 16px;
}

.watch-img-wrap {
    width: 100%; height: 180px;
    background: var(--bg-surface);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    position: relative;
}
.watch-img {
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

/* Pin Button (inline in summary row) */
.summary-row {
    display: flex;
    align-items: center;
    border-top: 1px solid var(--border);
}
.summary-row .summary-line {
    flex: 1;
    border-top: none;
}
.pin-btn-inline {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: none;
    border: none;
    border-left: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-family: var(--font);
    transition: color 0.15s;
    white-space: nowrap;
}
.pin-btn-inline:hover { color: var(--text); }
.pin-btn-inline.pinned { color: var(--accent); }
.pin-btn-inline.pinned:hover { color: var(--accent-dim); }

.watch-info { padding: 14px 16px 8px; }
.watch-ref {
    font-family: var(--mono); font-size: 11px;
    color: var(--accent); font-weight: 700; letter-spacing: 1px;
    text-transform: uppercase;
}
.watch-model {
    font-family: var(--serif);
    font-size: 18px; font-weight: 700;
    color: var(--text); margin: 3px 0 4px;
}
.watch-collection {
    font-size: 12px; color: var(--text-muted);
    margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px;
}

.watch-specs {
    display: grid; grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--border);
}
.spec-item { padding: 7px 0; border-bottom: 1px solid var(--border-light); }
.spec-item:nth-child(odd) { padding-right: 8px; }
.spec-item:nth-child(even) { padding-left: 8px; border-left: 1px solid var(--border-light); }
.spec-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700; }
.spec-value { font-size: 12px; color: var(--text); font-weight: 600; margin-top: 1px; }

/* Controls */
.watch-controls {
    display: flex; gap: 6px; padding: 10px 16px;
    border-top: 1px solid var(--border); align-items: center; flex-wrap: wrap;
}

.toggle-group { display: flex; border: 1px solid var(--border); overflow: hidden; }
.toggle-btn {
    padding: 5px 14px; border: none; background: var(--bg-surface);
    font-size: 11px; cursor: pointer; color: var(--text-muted); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.4px;
}
.toggle-btn:not(:last-child) { border-right: 1px solid var(--border); }
.toggle-btn.active { background: var(--text); color: var(--bg); }
.toggle-btn:hover:not(.active) { color: var(--text); }

#sheet-select {
    padding: 5px 8px;
    border: 1px solid var(--border);
    font-size: 11px;
    background: var(--bg-surface);
    color: var(--text);
    flex: 1;
    font-family: var(--font);
}
#sheet-select:focus { outline: none; border-color: var(--text); }

.summary-line {
    padding: 8px 16px; font-size: 11px;
    color: var(--text-muted); border-top: 1px solid var(--border);
}
.sl-label { color: var(--text-secondary); font-weight: 700; text-transform: uppercase; font-size: 10px; letter-spacing: 0.4px; }
.sl-warn { color: var(--gold); font-weight: 700; }

/* =========================================================================
   RIGHT: Pricing Table
   ========================================================================= */
.table-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    overflow: hidden;
}

.table-panel-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; border-bottom: 2px solid var(--text);
}
.table-panel-title { font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--text); }

.loading-inline { display: flex; align-items: center; }
.spinner {
    width: 16px; height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.table-scroll { overflow-x: auto; }

.analysis-table { width: 100%; border-collapse: collapse; }

.analysis-table thead th {
    padding: 8px 12px; font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.7px;
    color: var(--text-muted); background: var(--bg-surface);
    border-bottom: 1px solid var(--border); text-align: left;
    white-space: nowrap; position: sticky; top: 0;
}
.col-r { text-align: right; }

.analysis-table tbody tr {
    cursor: pointer; border-bottom: 1px solid var(--border-light); transition: background 0.1s;
}
.analysis-table tbody tr:hover { background: var(--bg-surface); }
.analysis-table tbody tr:last-child { border-bottom: none; }

.analysis-table tbody td { padding: 8px 12px; font-size: 13px; }

.analysis-table td:first-child { font-weight: 600; color: var(--text); }
.analysis-table td:nth-child(2) code {
    font-family: var(--mono); font-size: 10px; color: var(--text-muted);
    background: var(--bg-surface); padding: 1px 5px; border-radius: 2px;
}
.analysis-table .col-r { text-align: right; font-family: var(--mono); font-size: 12px; }

.td-median { font-weight: 700; color: var(--text) !important; font-size: 13px !important; }
.td-demesy { color: var(--accent); font-weight: 700; }
.td-pos { color: var(--green); font-weight: 700; }
.td-neg { color: var(--red); font-weight: 700; }
.td-muted { color: var(--text-muted); }
.row-unknown td { opacity: 0.35; }
.row-selected { background: var(--accent-bg) !important; box-shadow: inset 3px 0 0 var(--accent); }

.table-empty { text-align: center; padding: 30px; color: var(--text-muted); }

/* =========================================================================
   DETAIL PANEL
   ========================================================================= */
.detail-panel {
    margin-top: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 16px 20px;
}

.detail-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px;
}
.detail-title { font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--text); }
.detail-close {
    background: none; border: none;
    font-size: 22px; color: var(--text-muted);
    cursor: pointer; padding: 0 4px;
}
.detail-close:hover { color: var(--text); }

/* Price Bar */
.price-ladder { position: relative; height: 52px; margin-bottom: 16px; }
.ladder-label {
    position: absolute; top: -14px;
    font-size: 10px; color: var(--text-muted);
    font-family: var(--mono); transform: translateX(-50%);
}
.ladder-baseline { position: absolute; top: 22px; height: 1px; background: var(--border); }
.ladder-range {
    position: absolute; top: 15px; height: 16px;
    background: linear-gradient(90deg, rgba(39,98,58,0.1), rgba(39,98,58,0.25));
    border-radius: 2px;
}
body.dark .ladder-range { background: linear-gradient(90deg, rgba(74,222,128,0.1), rgba(74,222,128,0.25)); }
.ladder-dot {
    position: absolute; top: 16px; width: 10px; height: 10px;
    border-radius: 50%; cursor: pointer;
    transition: all 0.15s; transform: translateX(-50%); z-index: 1;
}
.ladder-dot:hover { width: 14px; height: 14px; box-shadow: 0 0 0 3px rgba(0,0,0,0.08); z-index: 10; }
body.dark .ladder-dot:hover { box-shadow: 0 0 0 3px rgba(255,255,255,0.1); }
.ladder-dot.below { background: var(--green); border: 2px solid var(--green); }
.ladder-dot.above { background: var(--red); border: 2px solid var(--red); }

.ladder-tooltip {
    position: absolute; bottom: 22px; left: 50%;
    transform: translateX(-50%); background: var(--text);
    color: var(--bg); padding: 6px 10px; border-radius: 2px;
    font-size: 11px; white-space: nowrap; z-index: 20;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2); pointer-events: none;
}
.ladder-tooltip-arrow {
    position: absolute; bottom: -4px; left: 50%;
    transform: translateX(-50%); width: 0; height: 0;
    border-left: 4px solid transparent; border-right: 4px solid transparent;
    border-top: 4px solid var(--text);
}

.ladder-median {
    position: absolute; top: 10px; width: 3px; height: 24px;
    background: var(--text); border-radius: 1px; transform: translateX(-50%);
}
.ladder-median-label {
    position: absolute; top: 36px; font-size: 9px;
    color: var(--text); font-weight: 700;
    transform: translateX(-50%); white-space: nowrap;
}
.ladder-demesy-pin { position: absolute; top: 3px; transform: translateX(-50%); z-index: 5; }
.ladder-demesy-triangle {
    width: 0; height: 0;
    border-left: 6px solid transparent; border-right: 6px solid transparent;
    border-top: 8px solid var(--accent);
}
.ladder-demesy-stem { width: 2px; height: 10px; background: var(--accent); margin: -1px auto 0; }
.ladder-demesy-label {
    position: absolute; top: -14px; font-size: 9px;
    color: var(--accent); font-weight: 700;
    transform: translateX(-50%); white-space: nowrap;
}

/* History Chart */
.detail-chart-wrap {
    margin-bottom: 16px;
    background: var(--bg-surface);
    border-radius: 2px;
    padding: 12px;
    position: relative;
    min-height: 140px;
}
.chart-empty {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 13px;
}

/* Listings */
.listings-title {
    font-size: 13px; font-weight: 700;
    color: var(--text-secondary); margin-bottom: 8px;
    text-transform: uppercase; letter-spacing: 0.4px;
}

.listings-table { width: 100%; border-collapse: collapse; }
.listings-table thead th {
    padding: 6px 8px; font-size: 10px; font-weight: 700;
    color: var(--text-muted); text-align: left;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase; letter-spacing: 0.3px;
}
.listings-table tbody tr { border-bottom: 1px solid var(--border-light); }
.listings-table tbody tr:hover { background: var(--bg-surface); }
.listings-table tbody tr.row-deal { background: var(--green-dim); }

.lt-title {
    max-width: 380px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
    padding: 5px 8px; font-size: 12px;
}
.lt-title a { color: var(--text-secondary); text-decoration: none; }
.lt-title a:hover { color: var(--accent); }

.lt-price { text-align: right; font-family: var(--mono); font-size: 12px; padding: 5px 8px; white-space: nowrap; color: var(--text); }
.price-deal { color: var(--green) !important; font-weight: 700; }
.lt-days { text-align: center; font-size: 11px; color: var(--text-muted); padding: 5px 8px; }
.days-stale { color: var(--red); font-weight: 700; }

.lt-dial { padding: 5px 8px; }
.dial-select {
    padding: 2px 4px; font-size: 11px;
    border: 1px solid var(--border);
    background: var(--bg-surface); color: var(--text);
    max-width: 120px; font-family: var(--font);
}
.dial-select:focus { outline: none; border-color: var(--text); }
.dial-label { font-size: 11px; color: var(--text-muted); }

.lt-action { padding: 5px 4px; width: 28px; }
.exclude-btn {
    width: 22px; height: 22px; border: none; background: none;
    cursor: pointer; font-size: 14px; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
}
.exclude-btn:hover { background: var(--red-dim); color: var(--red); }

/* Excluded */
.excluded-section { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 8px; }
.excluded-header {
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; padding: 4px 0; font-size: 12px;
    color: var(--text-muted); user-select: none;
}
.excluded-header:hover { color: var(--text); }
.excluded-toggle { font-size: 12px; transition: transform 0.2s; }
.excluded-toggle.open { transform: rotate(90deg); }
.excluded-row {
    display: flex; gap: 12px; align-items: center;
    padding: 3px 0; font-size: 12px; opacity: 0.4;
    border-bottom: 1px solid var(--border-light);
}
.ex-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-price { font-family: var(--mono); font-size: 11px; }
.unexclude-btn { background: none; border: none; cursor: pointer; font-size: 14px; color: var(--text-muted); }
.unexclude-btn:hover { color: var(--green); }

.loading-sm { padding: 12px; color: var(--text-muted); font-size: 13px; }

/* =========================================================================
   SETTINGS PANEL
   ========================================================================= */
.settings-toggle {
    background: none; border: 1px solid var(--border);
    width: 28px; height: 28px; font-size: 14px; cursor: pointer;
    color: var(--text-muted); display: flex; align-items: center; justify-content: center;
}
.settings-toggle:hover { color: var(--accent); border-color: var(--accent); }
.settings-toggle.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.settings-panel {
    margin-top: 12px; padding: 16px;
    background: var(--bg-card); border: 1px solid var(--border);
}
.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.settings-label { font-weight: 700; font-size: 12px; color: var(--text); margin-bottom: 4px; }
.settings-select {
    width: 100%; padding: 5px 8px; border: 1px solid var(--border);
    font-size: 12px; background: var(--bg-surface); color: var(--text);
    font-family: var(--font);
}
.settings-select:focus { outline: none; border-color: var(--text); }
.settings-tags, .settings-pairs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; min-height: 22px; }
.settings-tag {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 6px; background: var(--accent-bg);
    border: 1px solid rgba(212,98,26,0.2);
    font-size: 11px; font-family: var(--mono); color: var(--accent);
}
.settings-pair {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 6px; background: var(--gold-dim);
    border: 1px solid rgba(184,134,11,0.3);
    font-size: 11px; font-family: var(--mono); color: var(--gold);
}
.settings-tag-remove { cursor: pointer; color: var(--text-muted); font-size: 13px; line-height: 1; }
.settings-tag-remove:hover { color: var(--red); }
.settings-tag-input, .settings-pair-input { display: flex; gap: 4px; align-items: center; }
.settings-pair-input span { color: var(--text-muted); font-size: 12px; }
.settings-input {
    padding: 3px 6px; border: 1px solid var(--border);
    font-size: 11px; font-family: var(--mono); width: 100%;
    background: var(--bg-surface); color: var(--text);
}
.settings-input-sm { width: 70px; }
.settings-input:focus { outline: none; border-color: var(--text); }
.settings-btn-sm {
    padding: 2px 8px; border: 1px solid var(--accent); background: var(--accent);
    color: #fff; cursor: pointer; font-size: 12px;
    font-weight: 700; flex-shrink: 0;
}
.settings-btn-sm:hover { background: var(--accent-dim); }

/* =========================================================================
   LOGIN PAGE
   ========================================================================= */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: var(--bg);
}
.login-card {
    background: var(--bg-card); border: 1px solid var(--border);
    padding: 40px; width: 360px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08); text-align: center;
}
body.dark .login-card { box-shadow: 0 4px 20px rgba(0,0,0,0.4); }
.login-title { font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--text); margin: 0 0 4px; }
.login-subtitle { font-size: 13px; color: var(--text-muted); margin: 0 0 20px; }
.login-error {
    background: var(--red-dim); border: 1px solid rgba(192,57,43,0.3);
    color: var(--red); padding: 8px 12px;
    font-size: 13px; margin-bottom: 12px;
}
.login-input {
    width: 100%; padding: 10px 14px;
    border: 1px solid var(--border);
    font-size: 14px; margin-bottom: 12px; box-sizing: border-box;
    background: var(--bg-surface); color: var(--text);
    font-family: var(--font);
}
.login-input:focus { outline: none; border-color: var(--text); }
.login-btn {
    width: 100%; padding: 10px; background: var(--text);
    color: var(--bg); border: none;
    font-size: 14px; font-weight: 700; cursor: pointer;
    text-transform: uppercase; letter-spacing: 0.5px;
    font-family: var(--font);
}
.login-btn:hover { opacity: 0.9; }

/* Admin-only */
.admin-only { display: none; }
body.role-admin .admin-only { display: initial; }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 900px) {
    .ref-layout { grid-template-columns: 1fr; }
    .watch-card { position: static; }
    .splash-stats { grid-template-columns: 1fr; }
}

.masthead-brand {
    font-family: 'Caveat', cursive;
    font-size: 22px;
    font-weight: 700;
    color: var(--green);
    margin-left: 4px;
    vertical-align: super;
    letter-spacing: 0.5px;
    transition: color 0.3s;
}
.masthead-brand.brand-rolex   { color: var(--green); }
.masthead-brand.brand-cartier { color: var(--red); }
.masthead-brand.brand-patek   { color: #2c5fa1; }

/* Coming Soon */
.coming-soon {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}
.coming-soon-inner {
    text-align: center;
}
.coming-soon-label {
    font-family: 'Caveat', cursive;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* =========================================================================
   View Tabs (Price Movers / Collections)
   ========================================================================= */
.view-tabs {
    display: flex;
    gap: 0;
}
.view-tab {
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 4px 0;
    margin-right: 24px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.view-tab:hover {
    color: var(--text);
    border-bottom-color: var(--text-muted);
}
.view-tab.active {
    color: var(--text);
    border-bottom-color: var(--text);
}

/* =========================================================================
   Dial Movers — controls, signals, sparklines, streaks
   ========================================================================= */
.attention-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.att-dial { white-space: nowrap; }
.dial-badge { font-size: 12px; font-weight: 500; }
.ddc-code { font-size: 10px; color: var(--text-muted); margin-left: 4px; }
.att-model { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Rise = green, Fall = red */
.att-rise { color: var(--green); font-weight: 600; }
.att-fall { color: var(--red); font-weight: 600; }

/* Streak arrows */
.streak-up { color: var(--green); font-weight: 700; font-size: 12px; }
.streak-down { color: var(--red); font-weight: 700; font-size: 12px; }
.streak-none { color: var(--text-muted); }

/* Sparkline */
.sparkline-cell { padding: 4px 6px !important; }
.sparkline { display: block; }

/* Signal badges */
.signal-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 2px 7px;
    border-radius: 3px;
    text-transform: uppercase;
    white-space: nowrap;
    margin-right: 3px;
}
.signal-trending {
    background: var(--gold-dim);
    color: var(--gold);
    border: 1px solid var(--gold);
}
.signal-breakout {
    background: var(--accent-bg);
    color: var(--accent);
    border: 1px solid var(--accent);
}
.signal-squeeze {
    background: var(--green-dim);
    color: var(--green);
    border: 1px solid var(--green);
}
.signal-flooding {
    background: var(--red-dim);
    color: var(--red);
    border: 1px solid var(--red);
}

/* Supply indicators */
.supply-up { color: var(--text-muted); font-size: 11px; }
.supply-down { color: var(--text-muted); font-size: 11px; }
.supply-flat { color: var(--text-muted); }
