
/* ═══════════════════════════════════════════════════════════════
   THEME TOKENS
═══════════════════════════════════════════════════════════════ */

/* ── Titus Dark (default) — black & gold ── */
[data-theme="titus-dark"] {
  --bg:        #0A0A0A;
  --bg2:       #111111;
  --bg3:       #1A1A1A;
  --bg4:       #232323;
  --panel:     #141414;
  --border:    rgba(255,255,255,0.10);
  --border2:   rgba(255,255,255,0.07);
  --ink:       #F0EDE8;
  --ink2:      #D4D0CA;
  --ink3:      #A8A4A0;
  --ink4:      #787470;
  --gold:      #C9963A;
  --gold-lt:   #E0B55A;
  --gold-dim:  rgba(201,150,58,0.15);
  --gold-bg:   rgba(201,150,58,0.08);
  --accent:    #C9963A;
  --accent2:   #E0B55A;
  --profit:    #3DBA7A;
  --loss:      #E05555;
  --blue:      #4A90D9;
  --sidebar:   #080808;
  --topbar:    rgba(10,10,10,0.92);
  --shadow:    0 2px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.7);
  --scrollbar: #2A2A2A;
}

/* ── Titus Light — cream & gold ── */
[data-theme="titus-light"] {
  --bg:        #F5F1EA;
  --bg2:       #EDE8DF;
  --bg3:       #E4DDD3;
  --bg4:       #D8D0C5;
  --panel:     #FFFFFF;
  --border:    rgba(26,23,20,0.12);
  --border2:   rgba(26,23,20,0.07);
  --ink:       #1A1714;
  --ink2:      #3D3831;
  --ink3:      #6B6460;
  --ink4:      #9C9793;
  --gold:      #B8832A;
  --gold-lt:   #D4A040;
  --gold-dim:  rgba(184,131,42,0.12);
  --gold-bg:   rgba(184,131,42,0.07);
  --accent:    #B8832A;
  --accent2:   #D4A040;
  --profit:    #1D7A6B;
  --loss:      #B83232;
  --blue:      #2A5F8F;
  --sidebar:   #1A1714;
  --topbar:    rgba(245,241,234,0.94);
  --shadow:    0 2px 12px rgba(26,23,20,0.08);
  --shadow-lg: 0 8px 40px rgba(26,23,20,0.14);
  --scrollbar: #D0C8BC;
}

/* ── Midnight Blue ── */
[data-theme="midnight"] {
  --bg:        #0D1117;
  --bg2:       #161B22;
  --bg3:       #21262D;
  --bg4:       #2D333B;
  --panel:     #161B22;
  --border:    rgba(255,255,255,0.10);
  --border2:   rgba(255,255,255,0.06);
  --ink:       #E6EDF3;
  --ink2:      #C8D4E0;
  --ink3:      #8E9BAA;
  --ink4:      #5E6B7A;
  --gold:      #C9963A;
  --gold-lt:   #E0B55A;
  --gold-dim:  rgba(201,150,58,0.12);
  --gold-bg:   rgba(201,150,58,0.07);
  --accent:    #58A6FF;
  --accent2:   #79C0FF;
  --profit:    #3FB950;
  --loss:      #F85149;
  --blue:      #58A6FF;
  --sidebar:   #010409;
  --topbar:    rgba(13,17,23,0.92);
  --shadow:    0 2px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.7);
  --scrollbar: #2D333B;
}

/* ── Forest ── */
[data-theme="forest"] {
  --bg:        #0F1A13;
  --bg2:       #162019;
  --bg3:       #1E2D22;
  --bg4:       #263A2C;
  --panel:     #162019;
  --border:    rgba(255,255,255,0.10);
  --border2:   rgba(255,255,255,0.06);
  --ink:       #D4E8D8;
  --ink2:      #BCDBBC;
  --ink3:      #88B090;
  --ink4:      #5A7860;
  --gold:      #C9963A;
  --gold-lt:   #E0B55A;
  --gold-dim:  rgba(201,150,58,0.12);
  --gold-bg:   rgba(201,150,58,0.07);
  --accent:    #56C274;
  --accent2:   #79D993;
  --profit:    #56C274;
  --loss:      #E05555;
  --blue:      #56A0C2;
  --sidebar:   #090F0B;
  --topbar:    rgba(15,26,19,0.92);
  --shadow:    0 2px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.7);
  --scrollbar: #263A2C;
}

/* ── Slate ── */
[data-theme="slate"] {
  --bg:        #F8F9FA;
  --bg2:       #F1F3F5;
  --bg3:       #E9ECEF;
  --bg4:       #DEE2E6;
  --panel:     #FFFFFF;
  --border:    rgba(0,0,0,0.08);
  --border2:   rgba(0,0,0,0.04);
  --ink:       #212529;
  --ink2:      #495057;
  --ink3:      #868E96;
  --ink4:      #ADB5BD;
  --gold:      #C9963A;
  --gold-lt:   #E0B55A;
  --gold-dim:  rgba(201,150,58,0.1);
  --gold-bg:   rgba(201,150,58,0.06);
  --accent:    #4263EB;
  --accent2:   #5C7CFA;
  --profit:    #2F9E44;
  --loss:      #E03131;
  --blue:      #4263EB;
  --sidebar:   #1C2333;
  --topbar:    rgba(248,249,250,0.94);
  --shadow:    0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --scrollbar: #DEE2E6;
}

/* ═══════════════════════════════════════════════════════════════
   BASE
═══════════════════════════════════════════════════════════════ */
:root {
  --radius:    10px;
  --radius-lg: 16px;
  --font:      'Montserrat', 'Inter', system-ui, sans-serif;
  --font-mono: 'DM Mono', 'Courier New', monospace;
  --sidebar-w: 234px;
  --topbar-h:  62px;
  --zoom:      1;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: calc(15px * var(--zoom)); scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  transition: background 0.25s, color 0.25s;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 3px; }
::-webkit-scrollbar-corner { background: transparent; }

/* ═══════════════════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════════════════ */
#layout { display: flex; min-height: 100vh; }

/* Sidebar */
#sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  border-right: 1px solid rgba(255,255,255,0.05);
}
.sb-brand { padding: 24px 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.sb-logo { display: flex; align-items: center; gap: 11px; margin-bottom: 4px; }
.sb-logo-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-lt) 100%);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  border: 1.5px solid rgba(201,150,58,0.55);
  box-shadow: 0 0 0 1px rgba(201,150,58,0.18);
}
.sb-logo-icon svg { width: 20px; height: 20px; }
.sb-logo h1 { font-size: 1.05rem; font-weight: 700; color: #fff; letter-spacing: -0.01em; line-height: 1.1; }
.sb-logo p { font-size: 0.62rem; color: rgba(255,255,255,0.32); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500; margin-top: 2px; }

.sb-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-section {
  font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,0.42); padding: 14px 12px 5px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; cursor: pointer;
  color: rgba(255,255,255,0.65); font-size: 0.87rem; font-weight: 500;
  transition: all 0.15s; border: none; background: none;
  width: 100%; text-align: left; font-family: var(--font); margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.92); }
.nav-item.active { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-lt) 100%); color: #fff; font-weight: 600; }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.75; }
.nav-item.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto; background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.55); font-size: 0.65rem;
  padding: 2px 7px; border-radius: 20px; font-weight: 600;
}
.nav-item.active .nav-badge { background: rgba(255,255,255,0.22); color: #fff; }

.sb-bottom { padding: 12px 10px; border-top: 1px solid rgba(255,255,255,0.06); }
.sb-year-label { font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.45); font-weight: 600; margin-bottom: 7px; padding: 0 4px; }
.year-btns { display: flex; gap: 5px; margin-bottom: 10px; }
.year-btn {
  flex: 1; padding: 7px 0; border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.15); background: transparent;
  color: rgba(255,255,255,0.58); font-size: 0.8rem; font-family: var(--font);
  cursor: pointer; transition: all 0.15s; font-weight: 500;
}
.year-btn:hover { border-color: rgba(255,255,255,0.3); color: rgba(255,255,255,0.85); }
.year-btn.active { background: rgba(255,255,255,0.11); color: #fff; border-color: rgba(255,255,255,0.28); }

.sb-status {
  padding: 8px 11px; border-radius: 8px; background: rgba(255,255,255,0.05);
  font-size: 0.73rem; color: rgba(255,255,255,0.48);
  display: flex; align-items: center; gap: 7px;
}
.sb-status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--profit); flex-shrink: 0; animation: pulse 2.5s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.35} }

/* Main */
#main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; }

.topbar {
  height: var(--topbar-h);
  background: var(--topbar);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 26px;
  position: fixed; top: 0; left: var(--sidebar-w); right: 0; z-index: 50;
  overflow: visible;
}
/* Push page content below fixed topbar */
#page-content { margin-top: var(--topbar-h); }
.topbar-title {
  font-size: 1.1rem; font-weight: 700; color: var(--ink);
  letter-spacing: -0.01em; flex: 1; text-align: left;
}
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.page { padding: 24px; animation: fadeIn 0.18s ease; overflow-x: hidden; }
@keyframes fadeIn { from{opacity:0;transform:translateY(4px)} to{opacity:1;transform:translateY(0)} }

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: 8px; border: none;
  font-family: var(--font); font-size: 0.84rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s; white-space: nowrap; letter-spacing: -0.01em;
}
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-lt) 100%);
  color: #fff; box-shadow: 0 2px 8px rgba(201,150,58,0.3);
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--ink2); }
.btn-ghost:hover { background: var(--bg3); border-color: var(--border); }
.btn-dark { background: var(--bg4); color: var(--ink); border: 1px solid var(--border); }
.btn-dark:hover { background: var(--bg3); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(1.1); }
.btn-sm { padding: 5px 11px; font-size: 0.77rem; }
.btn-danger { background: transparent; border: 1px solid var(--border); color: var(--loss); }
.btn-danger:hover { background: rgba(224,85,85,0.08); }
.btn-icon { padding: 7px; border-radius: 8px; }

/* Privacy mode button highlight */
.btn-privacy-on { background: rgba(224,85,85,0.12) !important; border-color: var(--loss) !important; color: var(--loss) !important; }

/* ═══════════════════════════════════════════════════════════════
   METRIC CARDS
═══════════════════════════════════════════════════════════════ */
.metrics-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; margin-bottom: 22px; width: 100%; }
.metric-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  position: relative; overflow: hidden;
}
.metric-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-lt));
}
.metric-card.acc::after { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.metric-card.pro::after { background: linear-gradient(90deg, var(--profit), #5DD89A); }
.metric-card.red::after { background: linear-gradient(90deg, var(--loss), #E88); }
.metric-label { font-size: 0.68rem; color: var(--ink3); letter-spacing: 0.05em; text-transform: uppercase; font-weight: 600; margin-bottom: 9px; }
.metric-value { font-size: 1.75rem; font-weight: 700; color: var(--ink); line-height: 1; letter-spacing: -0.02em; }
.metric-value.gold { color: var(--gold); }
.metric-value.green { color: var(--profit); }
.metric-value.red { color: var(--loss); }
.metric-sub { font-size: 0.7rem; color: var(--ink4); margin-top: 6px; font-weight: 500; }
.privacy-blur { filter: blur(8px); user-select: none; transition: filter 0.2s; }

/* ═══════════════════════════════════════════════════════════════
   TABLE
═══════════════════════════════════════════════════════════════ */
.table-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow);
}
.table-toolbar {
  padding: 13px 18px; display: flex; align-items: center;
  justify-content: space-between; gap: 10px;
  border-bottom: 1px solid var(--border2); flex-wrap: wrap;
}
.toolbar-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.table-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: visible; box-shadow: var(--shadow);
  /* overflow:visible is required for sticky columns to work */
}
.table-card > .table-toolbar,
.table-card > .table-footer {
  border-radius: inherit;
}
.table-wrap {
  overflow-x: auto; overflow-y: auto; width: 100%;
  max-height: calc(100vh - var(--topbar-h) - 330px);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 1400px; }
thead th {
  text-align: left; padding: 10px 12px;
  font-size: 0.69rem; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--ink3);
  background: var(--bg2); border-bottom: 1px solid var(--border);
  white-space: nowrap; font-family: var(--font);
  position: sticky; top: 0; z-index: 3;
}
/* Sticky photo + watch columns — explicit pixel widths must match photo cell */
/* z-index 5 = sticky both vertically (top) and horizontally (left) — must beat z-index 3 headers */
thead th:nth-child(1) { position: sticky; left: 0; top: 0; z-index: 5; background: var(--bg2); min-width: 76px; max-width: 76px; width: 76px; }
thead th:nth-child(2) { position: sticky; left: 76px; top: 0; z-index: 5; background: var(--bg2); box-shadow: 3px 0 10px rgba(0,0,0,0.22); }
tbody td:nth-child(1) { position: sticky; left: 0; z-index: 2; background: var(--panel); min-width: 76px; max-width: 76px; width: 76px; }
tbody td:nth-child(2) { position: sticky; left: 76px; z-index: 2; background: var(--panel); box-shadow: 3px 0 10px rgba(0,0,0,0.14); }
tbody tr:hover td:nth-child(1),
tbody tr:hover td:nth-child(2) { background: var(--bg2); }
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--bg2); }
.col-name { font-weight: 600; color: var(--ink); min-width: 260px; max-width: 300px; white-space: normal; font-size: 0.9rem; line-height: 1.4; }
.col-mono { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink3); }
.profit-pos { color: var(--profit); font-weight: 600; }
.profit-neg { color: var(--loss); font-weight: 600; }
.profit-pend { color: var(--ink4); font-style: italic; font-size: 0.74rem; }
.table-footer {
  padding: 11px 18px; border-top: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.75rem; color: var(--ink4); font-weight: 500;
}

/* Photo cell */
.watch-photo {
  width: 52px; height: 52px; border-radius: 8px;
  object-fit: cover; display: block;
  border: 1px solid var(--border);
}
.watch-photo-placeholder {
  width: 52px; height: 52px; border-radius: 8px;
  background: var(--bg3); border: 1px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.15s; flex-shrink: 0;
}
.watch-photo-placeholder:hover { border-color: var(--gold); background: var(--gold-bg); }
.watch-photo-placeholder svg { width: 18px; height: 18px; color: var(--ink4); }
.watch-photo-placeholder:hover svg { color: var(--gold); }

/* Badges */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 20px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap;
}
.badge-sold     { background: rgba(61,186,122,0.12); color: var(--profit); }
.badge-incoming { background: rgba(74,144,217,0.12); color: var(--blue); }
.badge-stock    { background: rgba(74,144,217,0.12); color: var(--blue); }
.badge-listed   { background: rgba(201,150,58,0.12); color: var(--gold-lt); }
.badge-reddit  { background: rgba(255,69,0,0.1);   color: #FF6030; }
.badge-ebay    { background: rgba(229,50,56,0.1);   color: #E53238; }
.badge-fb      { background: rgba(24,119,242,0.1);  color: #4A90FF; }
.badge-insta   { background: rgba(200,50,150,0.1);  color: #C83296; }
.badge-chrono  { background: rgba(100,50,200,0.1);  color: #8050E0; }
.badge-friend  { background: var(--bg3); color: var(--ink2); }
.badge-other   { background: var(--bg3); color: var(--ink2); }
.badge-cond-new  { background: rgba(201,150,58,0.15); color: var(--gold-lt); border: 1px solid rgba(201,150,58,0.3); }
.badge-cond-mint { background: rgba(61,186,122,0.1);  color: var(--profit); }
.badge-cond-exc  { background: rgba(74,144,217,0.1);  color: var(--blue); }
.badge-cond-vg   { background: rgba(201,150,58,0.1);  color: var(--gold); }
.badge-cond-good { background: var(--bg3); color: var(--ink2); }
.badge-cond-fair { background: rgba(224,85,85,0.08); color: var(--loss); }
.badge-cond-poor { background: rgba(224,85,85,0.12); color: var(--loss); }

.pip-row { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; color: var(--ink3); font-weight: 500; }
.pip { width: 7px; height: 7px; border-radius: 50%; }
.pip-yes { background: var(--profit); }
.pip-no  { background: var(--bg4); }

/* Search & filter */
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 12px; min-width: 240px;
}
.search-box svg { width: 14px; height: 14px; color: var(--ink4); flex-shrink: 0; }
.search-box input {
  background: none; border: none; outline: none;
  font-family: var(--font); font-size: 0.84rem; color: var(--ink); width: 100%; font-weight: 400;
}
.search-box input::placeholder { color: var(--ink4); }

select.filter-sel {
  font-family: var(--font); font-size: 0.82rem;
  padding: 7px 28px 7px 10px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg2); color: var(--ink2);
  cursor: pointer; appearance: none; font-weight: 500;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888480' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
  transition: border-color 0.15s;
}
select.filter-sel.filter-active {
  border-color: var(--gold); color: var(--gold);
  background-color: var(--gold-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23C9963A' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

/* Zoom control */
.zoom-control {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; padding: 4px 8px;
}
.zoom-control span { font-size: 0.73rem; color: var(--ink3); font-weight: 600; min-width: 34px; text-align: center; }
.zoom-btn {
  width: 24px; height: 24px; border-radius: 5px; border: none;
  background: var(--bg3); color: var(--ink2); font-size: 1rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.12s; font-weight: 600; font-family: var(--font);
}
.zoom-btn:hover { background: var(--gold-dim); color: var(--gold); }

/* ═══════════════════════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(6px);
  z-index: 500; display: flex; align-items: center; justify-content: center;
  padding: 18px; animation: fadeIn 0.15s ease;
}
.modal {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; max-width: 660px;
  max-height: 93vh; overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}
@keyframes slideUp { from{transform:translateY(16px);opacity:0} to{transform:translateY(0);opacity:1} }
.modal-header {
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0;
  background: var(--panel); z-index: 2;
}
.modal-header h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--ink3); display: flex; padding: 4px; border-radius: 6px; }
.modal-close:hover { color: var(--ink); background: var(--bg3); }
.modal-close svg { width: 18px; height: 18px; }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 14px 24px 20px; display: flex; align-items: center;
  justify-content: space-between; border-top: 1px solid var(--border2);
  position: sticky; bottom: 0; background: var(--panel); z-index: 2;
}
.modal-footer-right { display: flex; gap: 9px; }

/* Photo upload in modal */
.photo-upload-area {
  border: 2px dashed var(--border); border-radius: 10px;
  padding: 20px; text-align: center; cursor: pointer; transition: all 0.15s;
  background: var(--bg2);
}
.photo-upload-area:hover,
.photo-upload-area.drag-over { border-color: var(--gold); background: var(--gold-bg); }
.photo-upload-area p { font-size: 0.8rem; color: var(--ink3); margin-top: 6px; font-weight: 500; }
.photo-preview-wrap { position: relative; display: inline-block; }
.photo-preview { width: 120px; height: 120px; border-radius: 10px; object-fit: cover; border: 2px solid var(--gold); }
.photo-remove {
  position: absolute; top: -6px; left: 106px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--loss); color: #fff; border: none;
  cursor: pointer; font-size: 0.9rem; display: flex;
  align-items: center; justify-content: center; font-weight: 700;
}

/* Form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1/-1; }
.form-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink3); }
.form-input, .form-select, .form-textarea {
  font-family: var(--font); font-size: 0.875rem; padding: 9px 11px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg2); color: var(--ink); width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s; font-weight: 400;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim); background: var(--bg3);
}
.form-textarea { resize: vertical; min-height: 72px; }
.form-input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.8) brightness(1);
  cursor: pointer;
}
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888480' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px;
}
.form-checks { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.form-check { display: flex; align-items: center; gap: 7px; font-size: 0.86rem; color: var(--ink2); cursor: pointer; font-weight: 500; }
.form-check input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--gold); cursor: pointer; }
.form-section {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--gold); grid-column: 1/-1;
  padding-top: 6px; border-top: 1px solid var(--border2); margin-top: 4px;
}
.form-section:first-child { border-top: none; padding-top: 0; margin-top: 0; }

/* ═══════════════════════════════════════════════════════════════
   LOADING
═══════════════════════════════════════════════════════════════ */
#loading-screen {
  position: fixed; inset: 0;
  background: #0A0A0A;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 9999; transition: opacity 0.4s ease;
}
#loading-screen.hide { opacity: 0; pointer-events: none; }
.loading-logo {
  width: 64px; height: 64px; border-radius: 16px;
  background: linear-gradient(135deg, #C9963A 0%, #E0B55A 100%);
  display: flex; align-items: center; justify-content: center; margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(201,150,58,0.35);
}
.loading-logo svg { width: 34px; height: 34px; }
.loading-title { font-family: var(--font); font-size: 1.7rem; font-weight: 700; color: #fff; margin-bottom: 4px; letter-spacing: -0.02em; }
.loading-brand { font-size: 0.68rem; color: rgba(255,255,255,0.32); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 28px; }
.loading-bar-track { width: 200px; height: 2px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; }
.loading-bar-fill { height: 100%; background: linear-gradient(90deg, #C9963A, #E0B55A); border-radius: 2px; animation: loadbar 1.4s ease forwards; }
@keyframes loadbar { from{width:0} to{width:100%} }
.loading-error { color: #E05555; font-size: 0.82rem; margin-top: 16px; text-align: center; max-width: 300px; line-height: 1.6; }

/* ═══════════════════════════════════════════════════════════════
   ANALYTICS
═══════════════════════════════════════════════════════════════ */
.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.an-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; }
.an-card h3 { font-size: 0.67rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink3); margin-bottom: 16px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bar-label { font-size: 0.79rem; color: var(--ink2); width: 100px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.bar-track { flex: 1; height: 6px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--gold), var(--gold-lt)); transition: width 0.6s ease; }
.bar-fill.acc { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.bar-val { font-size: 0.79rem; color: var(--ink3); width: 62px; text-align: right; flex-shrink: 0; font-weight: 600; }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border2); }
.lb-row:last-child { border-bottom: none; }
.lb-rank { font-size: 1rem; font-weight: 700; color: var(--ink4); width: 22px; flex-shrink: 0; }
.lb-rank.top { color: var(--gold); }
.lb-info { flex: 1; }
.lb-name { font-size: 0.84rem; font-weight: 600; color: var(--ink); }
.lb-sub { font-size: 0.71rem; color: var(--ink4); margin-top: 2px; }
.lb-val { font-size: 0.87rem; font-weight: 700; color: var(--profit); white-space: nowrap; }
.an-empty { font-size: 0.82rem; color: var(--ink4); font-style: italic; }
.an-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.an-edit-panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 16px; }
.an-edit-title { font-size: 0.67rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink3); margin-bottom: 12px; }
.an-edit-list { display: flex; flex-direction: column; gap: 4px; }
.an-edit-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; background: var(--bg2); }
.an-edit-hidden { opacity: 0.45; }
.an-edit-label { flex: 1; font-size: 0.84rem; font-weight: 500; color: var(--ink); }
.an-edit-btns { display: flex; gap: 4px; }
.an-move-btn { background: var(--bg3); border: 1px solid var(--border); border-radius: 5px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 0.8rem; color: var(--ink2); }
.an-move-btn:disabled { opacity: 0.25; cursor: default; }
.an-move-btn:not(:disabled):hover { background: var(--bg4, var(--border)); }
.an-toggle { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.an-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.an-toggle-track { width: 32px; height: 18px; background: var(--border); border-radius: 9px; transition: background 0.2s; position: relative; }
.an-toggle-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; background: #fff; border-radius: 50%; transition: transform 0.2s; }
.an-toggle input:checked + .an-toggle-track { background: var(--accent); }
.an-toggle input:checked + .an-toggle-track::after { transform: translateX(14px); }

/* ═══════════════════════════════════════════════════════════════
   CROSS-POST
═══════════════════════════════════════════════════════════════ */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 9px; margin-bottom: 20px; }
.post-card {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; cursor: pointer; transition: all 0.14s; background: var(--panel);
}
.post-card:hover { border-color: var(--gold-lt); background: var(--gold-bg); }
.post-card.sel { border-color: var(--gold); background: var(--gold-bg); }
.post-card h4 { font-size: 0.82rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-card p { font-size: 0.72rem; color: var(--ink4); margin-top: 3px; }
.platform-panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 12px; }
.pp-header { display: flex; align-items: center; justify-content: space-between; padding: 13px 17px; border-bottom: 1px solid var(--border2); }
.pp-label { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 0.88rem; }
.pdot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-r{background:#FF4500} .dot-e{background:#E53238} .dot-f{background:#1877F2}
.pp-body { padding: 13px 17px; }
.post-ta {
  width: 100%; min-height: 160px; font-family: var(--font-mono); font-size: 0.77rem;
  line-height: 1.7; color: var(--ink2); background: var(--bg2);
  border: 1px solid var(--border); border-radius: 8px; padding: 12px;
  resize: vertical; margin-bottom: 9px;
}
.spin-row { display: inline-flex; align-items: center; gap: 9px; color: var(--ink4); font-size: 0.82rem; padding: 6px 0; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.75s linear infinite; }
@keyframes spin { to{transform:rotate(360deg)} }

/* ═══════════════════════════════════════════════════════════════
   APPEARANCE MODAL
═══════════════════════════════════════════════════════════════ */
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.theme-card {
  border: 2px solid var(--border); border-radius: 12px;
  padding: 14px 16px; cursor: pointer; transition: all 0.15s; position: relative;
}
.theme-card:hover { border-color: var(--gold-lt); }
.theme-card.sel { border-color: var(--gold); }
.theme-card-swatch { display: flex; gap: 4px; margin-bottom: 8px; }
.swatch { width: 18px; height: 18px; border-radius: 50%; }
.theme-card h4 { font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.theme-card p { font-size: 0.71rem; color: var(--ink4); margin-top: 2px; }
.theme-check {
  position: absolute; top: 10px; right: 10px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--gold); display: none;
  align-items: center; justify-content: center;
}
.theme-card.sel .theme-check { display: flex; }
.theme-check svg { width: 10px; height: 10px; }

.appearance-section { margin-bottom: 18px; }
.appearance-section h3 { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }

/* ═══════════════════════════════════════════════════════════════
   SETUP PAGE
═══════════════════════════════════════════════════════════════ */
.setup-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.setup-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.setup-card-hd { padding: 14px 17px; border-bottom: 1px solid var(--border2); display: flex; align-items: center; gap: 9px; }
.setup-card-hd h3 { font-size: 0.95rem; font-weight: 700; }
.setup-card-bd { padding: 14px 17px; }
.setup-card-bd ol { padding-left: 16px; }
.setup-card-bd li { font-size: 0.82rem; color: var(--ink2); line-height: 1.9; }
.setup-card-bd code { font-family: var(--font-mono); font-size: 0.73rem; background: var(--bg3); padding: 1px 5px; border-radius: 3px; color: var(--gold); }
.notice { background: var(--gold-bg); border: 1px solid rgba(201,150,58,0.18); border-radius: var(--radius); padding: 12px 16px; font-size: 0.82rem; color: var(--ink2); line-height: 1.65; margin-bottom: 18px; }
.notice strong { color: var(--gold-lt); }
.hosting-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 11px; }
.host-card { background: var(--bg2); border-radius: var(--radius); padding: 14px 16px; border: 1px solid var(--border2); }
.host-card-name { font-weight: 700; font-size: 0.88rem; margin-bottom: 3px; }
.host-card-url { font-size: 0.75rem; color: var(--ink3); margin-bottom: 7px; }
.host-card-steps { font-size: 0.77rem; color: var(--ink2); line-height: 1.6; }

/* ═══════════════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════════════ */
#toast {
  position: fixed; bottom: 22px; right: 22px;
  background: var(--bg4); color: var(--ink);
  border: 1px solid var(--border); padding: 11px 18px;
  border-radius: 10px; font-size: 0.84rem; font-weight: 600;
  box-shadow: var(--shadow-lg); transform: translateY(70px);
  opacity: 0; transition: all 0.22s ease; z-index: 9999;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.err { background: rgba(224,85,85,0.15); border-color: var(--loss); color: var(--loss); }
#toast.ok { background: rgba(61,186,122,0.12); border-color: var(--profit); color: var(--profit); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════
   MOBILE WATCH CARDS
═══════════════════════════════════════════════════════════════ */
.watch-cards { display: none; padding: 10px; gap: 10px; flex-direction: column; width: 100%; box-sizing: border-box; }
.watch-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  transition: border-color 0.15s;
  width: 100%; box-sizing: border-box; min-width: 0;
}
.watch-card:active { border-color: var(--gold); }
.watch-card-main {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
}
.watch-card-img {
  width: 60px; height: 60px; border-radius: 8px; object-fit: cover;
  background: var(--bg3); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.watch-card-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.watch-card-info { flex: 1; min-width: 0; }
.watch-card-name {
  font-size: 0.92rem; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}
.watch-card-ref {
  font-size: 0.72rem; color: var(--ink4); font-family: var(--font-mono);
  margin-bottom: 5px;
}
.watch-card-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.watch-card-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border2); padding: 10px 12px;
  gap: 8px;
}
.watch-card-stat { display: flex; flex-direction: column; gap: 2px; }
.watch-card-stat-label {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink4);
}
.watch-card-stat-value {
  font-size: 0.84rem; font-weight: 600; color: var(--ink2);
}
.watch-card-actions {
  display: flex; border-top: 1px solid var(--border2);
}
.watch-card-actions button, .watch-card-actions a {
  flex: 1; padding: 10px; font-size: 0.8rem; font-weight: 600;
  background: none; border: none; cursor: pointer;
  color: var(--ink3); font-family: var(--font);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.15s; text-decoration: none;
}
.watch-card-actions button:first-child, .watch-card-actions a:first-child {
  border-right: 1px solid var(--border2);
}
.watch-card-actions button:hover, .watch-card-actions a:hover {
  background: rgba(255,255,255,0.05); color: var(--ink);
}
.watch-card-actions button.card-edit { color: var(--gold); }
.watch-card-actions button.card-post { color: var(--accent2); }

@media (max-width: 768px) {
  .watch-cards  { display: flex; }
  .table-wrap   { display: none; }
  .table-footer { display: none; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .filter-row-mobile {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important; padding-bottom: 2px;
  }
  .filter-row-mobile > * { flex-shrink: 0; }
  /* Hide text label, show + icon only on Add Watch */
  .hide-mobile { display: none !important; }
  .show-mobile { display: inline-flex !important; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — HAMBURGER + MOBILE NAV
═══════════════════════════════════════════════════════════════ */

/* Hamburger button — hidden on desktop, shown on mobile */
.hamburger {
  display: none; flex-direction: column; justify-content: center;
  gap: 5px; width: 36px; height: 36px; padding: 6px;
  background: none; border: none; cursor: pointer; flex-shrink: 0;
  border-radius: 8px; transition: background 0.15s;
}
.hamburger:hover { background: rgba(255,255,255,0.08); }
.hamburger span {
  display: block; width: 100%; height: 2px;
  background: var(--ink2); border-radius: 2px;
  transition: all 0.22s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav backdrop */
.mobile-nav-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.55); z-index: 149;
  backdrop-filter: blur(2px);
}
.mobile-nav-backdrop.open { display: block; }

/* Desktop defaults — hide mobile-only elements */
.hide-mobile { display: flex; }
.show-mobile { display: none; }

/* ── Tablet (≤900px) ── */
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  #main { margin-left: 0; }

  /* Show hamburger */
  .hamburger { display: flex; }

  /* Sidebar becomes slide-in overlay */
  #sidebar {
    position: fixed; left: -260px; top: 0; bottom: 0;
    width: 260px; z-index: 150;
    transition: left 0.28s cubic-bezier(0.4,0,0.2,1);
    box-shadow: none;
  }
  #sidebar.mobile-open {
    left: 0;
    box-shadow: 4px 0 32px rgba(0,0,0,0.5);
  }

  /* Topbar: full width, fixed, no horizontal overflow */
  .topbar {
    left: 0;
    padding: 0 14px;
    overflow: visible;
    max-width: 100vw;
  }

  /* Title left-aligned, doesn't flex-grow to center */
  .topbar-title {
    flex: 1;
    text-align: left;
  }

  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .setup-cols, .analytics-grid { grid-template-columns: 1fr; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ── Mobile (≤580px) ── */
@media (max-width: 580px) {
  .page { padding: 12px; }

  .topbar { padding: 0 10px; }
  .topbar-title { font-size: 0.95rem; }

  /* User chip — compact */
  .user-chip { padding: 5px 8px; gap: 6px; }
  /* Hide greeting text, keep avatar */
  #user-greeting { display: none; }

  /* Add Watch — square icon button on mobile */
  .add-watch-btn { padding: 8px 10px; }
  .add-watch-btn .hide-mobile { display: none !important; }

  /* User dropdown — full width, anchored below topbar */
  .user-dropdown {
    position: fixed !important; left: 10px !important; right: 10px !important;
    top: calc(var(--topbar-h) + 6px) !important;
    width: auto; min-width: unset;
  }

  /* Modal — centered, fits screen */
  .modal {
    width: calc(100vw - 24px);
    max-width: 100%;
    max-height: 90vh;
    margin: 0;
    border-radius: 16px;
    box-sizing: border-box;
  }
  .modal-overlay { align-items: center; padding: 12px; }

  .table-toolbar { flex-wrap: wrap; gap: 6px; padding: 10px 12px; }
}

/* ═══════════════════════════════════════════════════════════════
   AUTH / LOGIN SCREEN
═══════════════════════════════════════════════════════════════ */
#auth-screen {
  position: fixed; inset: 0; z-index: 10000;
  background: #080808;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  font-family: var(--font);
}
#auth-screen.hide { display: none; }

.auth-card {
  width: 100%; max-width: 420px;
  background: #111111;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.8);
  animation: slideUp 0.28s ease;
}

.auth-header {
  padding: 36px 36px 28px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(180deg, #0A0A0A 0%, #111111 100%);
}
.auth-logo {
  width: 60px; height: 60px; border-radius: 16px;
  background: linear-gradient(135deg, #C9963A 0%, #E0B55A 100%);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 8px 28px rgba(201,150,58,0.35);
}
.auth-logo svg { width: 32px; height: 32px; }
.auth-title { font-size: 1.5rem; font-weight: 700; color: #F0EDE8; letter-spacing: -0.02em; margin-bottom: 4px; }
.auth-subtitle { font-size: 0.78rem; color: rgba(255,255,255,0.32); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; }

.auth-body { padding: 28px 32px 32px; }

/* Tabs */
.auth-tabs {
  display: flex; gap: 0;
  background: rgba(255,255,255,0.04);
  border-radius: 10px; padding: 4px; margin-bottom: 24px;
}
.auth-tab {
  flex: 1; padding: 8px 0; border-radius: 7px; border: none;
  background: transparent; color: rgba(255,255,255,0.38);
  font-family: var(--font); font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: all 0.18s; letter-spacing: 0.01em;
}
.auth-tab.active {
  background: rgba(255,255,255,0.09);
  color: #F0EDE8;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* Form fields */
.auth-field { margin-bottom: 14px; }
.auth-label {
  display: block; font-size: 0.69rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(255,255,255,0.38); margin-bottom: 6px;
}
.auth-input {
  width: 100%; padding: 11px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 10px; color: #F0EDE8;
  font-family: var(--font); font-size: 0.9rem; font-weight: 400;
  transition: border-color 0.15s, box-shadow 0.15s; outline: none;
}
.auth-input:focus {
  border-color: #C9963A;
  box-shadow: 0 0 0 3px rgba(201,150,58,0.14);
  background: rgba(255,255,255,0.07);
}
.auth-input::placeholder { color: rgba(255,255,255,0.2); }

.auth-btn {
  width: 100%; padding: 12px;
  background: linear-gradient(135deg, #C9963A 0%, #E0B55A 100%);
  color: #fff; border: none; border-radius: 10px;
  font-family: var(--font); font-size: 0.92rem; font-weight: 700;
  cursor: pointer; transition: all 0.15s; letter-spacing: -0.01em;
  margin-top: 6px; box-shadow: 0 4px 16px rgba(201,150,58,0.3);
}
.auth-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.auth-btn:active { transform: translateY(0); }
.auth-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.auth-error {
  background: rgba(224,85,85,0.1); border: 1px solid rgba(224,85,85,0.25);
  border-radius: 8px; padding: 10px 13px;
  font-size: 0.8rem; color: #E08080; margin-bottom: 14px; display: none;
  line-height: 1.5;
}
.auth-error.show { display: block; }
.auth-success {
  background: rgba(61,186,122,0.1); border: 1px solid rgba(61,186,122,0.25);
  border-radius: 8px; padding: 10px 13px;
  font-size: 0.8rem; color: #5DD89A; margin-bottom: 14px; display: none;
  line-height: 1.5;
}
.auth-success.show { display: block; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; font-size: 0.72rem; color: rgba(255,255,255,0.18); font-weight: 500;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.07);
}

.auth-footer {
  padding: 16px 32px 20px; text-align: center;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 0.73rem; color: rgba(255,255,255,0.2);
}

/* Textarea for request form */
.auth-textarea {
  width: 100%; padding: 11px 14px; min-height: 80px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 10px; color: #F0EDE8;
  font-family: var(--font); font-size: 0.88rem;
  resize: vertical; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-textarea:focus {
  border-color: #C9963A;
  box-shadow: 0 0 0 3px rgba(201,150,58,0.14);
  background: rgba(255,255,255,0.07);
}
.auth-textarea::placeholder { color: rgba(255,255,255,0.2); }

/* Signed-in user chip + dropdown */
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 8px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 20px; font-size: 0.78rem; font-weight: 600; color: var(--ink2);
  cursor: pointer; position: relative; user-select: none;
}
.user-chip-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), var(--gold-lt));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem; font-weight: 700; color: #fff; overflow: hidden;
}
.user-chip-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.user-chip-caret { width: 12px; height: 12px; color: var(--ink4); transition: transform 0.2s; }
.user-chip.open .user-chip-caret { transform: rotate(180deg); }
/* Dropdown */
.user-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 6px; min-width: 210px;
  box-shadow: var(--shadow-lg); z-index: 600;
  animation: slideUp 0.15s ease;
}
.user-chip.open .user-dropdown { display: block; }
.ud-header {
  padding: 10px 12px 8px; border-bottom: 1px solid var(--border2); margin-bottom: 4px;
}
.ud-name { font-size: 0.88rem; font-weight: 700; color: var(--ink); }
.ud-email { font-size: 0.72rem; color: var(--ink4); margin-top: 2px; word-break: break-all; }
.ud-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px; border-radius: 8px; font-size: 0.82rem;
  font-weight: 500; color: var(--ink2); cursor: pointer;
  transition: background 0.12s; border: none; background: none;
  width: 100%; text-align: left; font-family: var(--font);
}
.ud-item:hover { background: var(--bg3); color: var(--ink); }
.ud-item svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--ink4); }
.ud-item.danger { color: var(--loss); }
.ud-item.danger:hover { background: rgba(224,85,85,0.08); }
.ud-item.danger svg { color: var(--loss); }
.ud-divider { height: 1px; background: var(--border2); margin: 4px 0; }
/* Post photo drag-drop zone */
.photo-drop-zone {
  border: 2px dashed var(--border); border-radius: 10px;
  padding: 14px 16px; background: var(--bg2); transition: all 0.15s;
  margin-bottom: 10px;
}
.photo-drop-zone.active { border-color: var(--gold); background: var(--gold-bg); }
.photo-drop-zone.disabled { opacity: 0.42; pointer-events: none; }
.photo-drop-zone p { font-size: 0.78rem; color: var(--ink4); text-align: center; font-weight: 500; }
.photo-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.photo-thumb {
  position: relative; width: 68px; height: 68px; border-radius: 8px;
  overflow: hidden; cursor: grab; border: 2px solid var(--border);
  transition: border-color 0.12s, opacity 0.12s; flex-shrink: 0;
}
.photo-thumb:active { cursor: grabbing; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.photo-thumb .thumb-order {
  position: absolute; top: 3px; left: 3px;
  background: rgba(0,0,0,0.65); color: #fff;
  font-size: 0.62rem; font-weight: 700; padding: 1px 5px; border-radius: 4px;
}
.photo-thumb .thumb-remove {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--loss); color: #fff; border: none;
  cursor: pointer; font-size: 0.8rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.photo-thumb.drag-over { border-color: var(--gold); opacity: 0.6; }

/* Disabled button with tooltip */
.btn-with-tip { position: relative; display: inline-flex; }
.btn-with-tip .btn-tip {
  display: none; position: absolute; bottom: calc(100% + 8px); right: 0;
  background: var(--bg4); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 11px; font-size: 0.74rem;
  color: var(--ink2); white-space: nowrap; box-shadow: var(--shadow-lg);
  z-index: 300; font-weight: 500; max-width: 240px; white-space: normal;
  line-height: 1.5; text-align: left;
}
.btn-with-tip:hover .btn-tip { display: block; }
.btn-disabled-visual {
  opacity: 0.38; cursor: not-allowed !important; pointer-events: none;
}
.tpl-panel {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 10px; margin-top: 8px; overflow: hidden;
}
.tpl-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px; cursor: pointer; user-select: none;
  font-size: 0.76rem; font-weight: 600; color: var(--ink3);
}
.tpl-header:hover { color: var(--ink2); }
.tpl-header svg { width: 13px; height: 13px; transition: transform 0.18s; }
.tpl-header.open svg { transform: rotate(180deg); }
.tpl-body { padding: 0 14px 12px; display: none; }
.tpl-body.open { display: block; }
.tpl-ta {
  width: 100%; min-height: 110px; font-family: var(--font-mono); font-size: 0.75rem;
  line-height: 1.65; color: var(--ink2); background: var(--panel);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px;
  resize: vertical; margin-bottom: 8px;
}
.tpl-ta:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.tpl-vars {
  font-size: 0.69rem; color: var(--ink4); line-height: 1.8; margin-bottom: 8px;
}
.tpl-vars code { font-family: var(--font-mono); background: var(--bg3); padding: 1px 5px; border-radius: 3px; color: var(--gold); }
