:root { --bg:#0b0c10; --card:#12141a; --muted:#9aa0aa; --text:#f3f4f6; --accent:#5eead4; --danger:#fb7185; --line:#222531; }
*{box-sizing:border-box;}
body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Helvetica,Arial,sans-serif;background:var(--bg);color:var(--text);}
a{color:var(--accent);text-decoration:none}
.container{max-width:1100px;margin:0 auto;padding:16px;}
.card{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:14px;}
.grid{display:grid;gap:12px;}
.grid-2{grid-template-columns:1fr;}

.nav{display:flex;flex-direction:column;gap:8px;}
.nav a{padding:10px 12px;border-radius:10px;border:1px solid var(--line);background:#0f1117}
.nav a.active{border-color:var(--accent)}
.topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;gap:10px;flex-wrap:wrap;}
.badge{display:inline-block;padding:4px 8px;border:1px solid var(--line);border-radius:999px;color:var(--muted);font-size:12px;}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:10px 12px;border-radius:12px;border:1px solid var(--line);background:#0f1117;color:var(--text);cursor:pointer;}
.btn.primary{border-color:var(--accent);color:#0b0c10;background:var(--accent);}
.btn.danger{border-color:var(--danger);color:var(--danger);background:transparent;}
input,select,textarea{width:100%;padding:10px 12px;border-radius:12px;border:1px solid var(--line);background:#0f1117;color:var(--text);}
label{display:block;margin:10px 0 6px;color:var(--muted);font-size:13px;}
hr{border:none;border-top:1px solid var(--line);margin:12px 0;}
.table{width:100%;border-collapse:collapse;}
.table th,.table td{padding:10px 8px;border-bottom:1px solid var(--line);text-align:left;font-size:14px;vertical-align:top;}
.small{font-size:13px;color:var(--muted);}
.flash{padding:10px 12px;border-radius:12px;border:1px solid var(--line);margin-bottom:12px;}
.flash.info{border-color:var(--accent);}
.flash.error{border-color:var(--danger);color:var(--danger);}
.thumb-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;}

.thumb{display:block;border-radius:12px;overflow:hidden;border:1px solid var(--line);background:#0f1117;}
.thumb img{width:100%;height:100%;object-fit:cover;display:block;aspect-ratio:1/1;}
.pill{display:inline-flex;gap:8px;align-items:center;padding:8px 10px;border-radius:999px;border:1px solid var(--line);background:#0f1117;}
.inline{display:flex;gap:10px;flex-wrap:wrap;align-items:end;}
.inline > *{flex:1 1 220px;}

/* --- UI split: shared base styles --- */
.add-open-btn{width:100%;margin-top:8px;}
.add-box{margin-top:8px;border:1px dashed var(--line);border-radius:12px;padding:12px;background:#0f1117;}
.sticky-status{border:1px solid var(--line);border-radius:14px;background:rgba(18,20,26,.96);backdrop-filter:blur(6px);padding:10px 12px;}
.sticky-status__row{display:flex;gap:10px;align-items:center;justify-content:space-between;}
.sticky-status__text{font-size:13px;color:var(--text);opacity:.95;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:78%;}
.sticky-status__pct{font-size:12px;color:var(--muted);}
.sticky-status__track{height:6px;border-radius:999px;background:#0b0c10;border:1px solid var(--line);overflow:hidden;margin-top:8px;}
.sticky-status__bar{height:100%;border-radius:999px;background:var(--accent);width:0%;}

/* ---------------- Theme toggle (Dark/Light) ----------------
   Default theme uses existing :root variables (dark).
   Light theme overrides variables + a few hard-coded surfaces. */
html[data-theme="light"]{
  --bg:#f3f5f8;
  --card:#ffffff;
  --muted:rgba(15,23,42,.70);
  --text:#0f172a;
  --accent:#0ea5e9;
  --danger:#e11d48;
  --line:rgba(15,23,42,.14);
}

/* Inputs & buttons in base.css use a hard-coded dark surface; override in light */
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea{
  background:#f8fafc;
  color:var(--text);
}

html[data-theme="light"] .btn{
  background:#ffffff;
  color:var(--text);
}

html[data-theme="light"] .btn:hover{
  background:#f1f5f9;
}

/* Light: soften sticky bar */
html[data-theme="light"] #sticky_status_bar{
  background:#ffffff;
  border:1px solid var(--line);
}


/* Light theme: surfaces that were hard-coded dark */
html[data-theme="light"] .add-box{background:#ffffff;}
html[data-theme="light"] .nav a{background:#ffffff; color:var(--text);} 
html[data-theme="light"] .thumb{background:#ffffff;}
html[data-theme="light"] .sticky-status{background:#ffffff;}
html[data-theme="light"] .sticky-status__track{background:#e2e8f0;}
