:root {
  --bg: #f6f6f3;
  --panel: #ffffff;
  --panel-2: #fafaf8;
  --ink: #1b1c1a;
  --ink-2: #5d5f59;
  --ink-3: #8d8f88;
  --line: #e7e7e2;
  --line-2: #efefea;
  --accent: #2f6b57;
  --accent-ink: #ffffff;
  --accent-soft: #e5efe9;
  --ok: #2f7d4f;
  --ok-soft: #e6f2ea;
  --warn: #9a6a00;
  --warn-soft: #fbf1d9;
  --bad: #b4382f;
  --bad-soft: #f9e4e1;
  --info-soft: #eceef6;
  --shadow: 0 1px 2px rgba(20, 20, 15, .04), 0 4px 16px rgba(20, 20, 15, .04);
  --radius: 14px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121311; --panel: #1a1b19; --panel-2: #1f201e; --ink: #ecece7; --ink-2: #a9aaa3; --ink-3: #75776f;
    --line: #2b2c29; --line-2: #242522; --accent: #7fc0a5; --accent-ink: #0d1a14; --accent-soft: #1d2c25;
    --ok: #79c495; --ok-soft: #1a2a20; --warn: #e3b552; --warn-soft: #2d2617; --bad: #ef8a80; --bad-soft: #321d1a;
    --info-soft: #20222a; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121311; --panel: #1a1b19; --panel-2: #1f201e; --ink: #ecece7; --ink-2: #a9aaa3; --ink-3: #75776f;
  --line: #2b2c29; --line-2: #242522; --accent: #7fc0a5; --accent-ink: #0d1a14; --accent-soft: #1d2c25;
  --ok: #79c495; --ok-soft: #1a2a20; --warn: #e3b552; --warn-soft: #2d2617; --bad: #ef8a80; --bad-soft: #321d1a;
  --info-soft: #20222a; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 15px; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.mono { font-family: var(--mono); font-size: 13px; }
.small { font-size: 12.5px; }
.hide { display: none !important; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; padding: 22px 14px; display: flex; flex-direction: column; gap: 4px;
  border-right: 1px solid var(--line); background: var(--panel-2);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; font-weight: 600; font-size: 15px; }
.brand .mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--ink); color: var(--bg);
  display: grid; place-items: center;
}
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--ink-2); font-weight: 500;
}
.nav a:hover { background: var(--line-2); color: var(--ink); }
.nav a.on { background: var(--panel); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.nav svg { width: 17px; height: 17px; flex: none; }
.side .me { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.side .me .who { min-width: 0; flex: 1; }
.side .me .who div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main { padding: 32px clamp(16px, 4vw, 48px) 80px; min-width: 0; }
.wrap { max-width: 1120px; margin: 0 auto; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head p { margin: 4px 0 0; color: var(--ink-2); }
.tabbar { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 20px 16px 96px; }
  .tabbar {
    display: flex; position: fixed; inset: auto 0 0 0; z-index: 20; background: var(--panel);
    border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 11px; color: var(--ink-3); }
  .tabbar a.on { color: var(--ink); }
  .tabbar svg { width: 20px; height: 20px; }
  .mobile-top { display: flex !important; }
}
.mobile-top { display: none; align-items: center; justify-content: space-between; margin-bottom: 16px; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 500;
  white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { opacity: .9; }
.btn.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--line-2); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 32px; padding: 0; height: 32px; border-radius: 8px; }
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: .5; cursor: default; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.input, select.input, textarea.input {
  height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel);
  outline: none; width: 100%; min-width: 0;
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; min-height: 90px; line-height: 1.5; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .input { width: auto; }
.search { position: relative; flex: 1; min-width: 200px; }
.search .input { width: 100%; padding-left: 36px; }
.search svg { position: absolute; left: 12px; top: 11px; width: 16px; height: 16px; color: var(--ink-3); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel);
  cursor: pointer; font-size: 13px; color: var(--ink-2);
}
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 20px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
@media (max-width: 400px) { .cards { grid-template-columns: 1fr; } }

.acct { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.acct-top { display: flex; align-items: flex-start; gap: 12px; }
.badge {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none;
  font-weight: 650; font-size: 15px; color: #fff;
}
.acct-title { flex: 1; min-width: 0; }
.acct-title h3 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-title .sub { color: var(--ink-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cred { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 6px 10px; }
.cred .k { color: var(--ink-3); font-size: 12.5px; }
.cred .v { font-family: var(--mono); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cred .v.dots { letter-spacing: 2px; color: var(--ink-2); }
.cred .acts { display: flex; gap: 2px; }
.locked {
  padding: 10px 12px; border-radius: 10px; background: var(--panel-2); color: var(--ink-3); font-size: 12.5px;
  display: flex; align-items: center; gap: 8px;
}
.locked svg { width: 14px; height: 14px; }
.meter { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--ok); }
.meter.warn i { background: var(--warn); }
.meter.bad i { background: var(--bad); }
.credits-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 7px; font-size: 13px; }
.credits-line b { font-weight: 600; font-variant-numeric: tabular-nums; }
.acct-foot { display: flex; gap: 6px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line-2); }

.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--ink-2);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.plain::before { display: none; }
.tag { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { padding: 18px 20px; }
.stat .k { color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.stat .v { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .s { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.stat.warn .v { color: var(--warn); }
.stat.bad .v { color: var(--bad); }

.section { margin-top: 26px; }
.section > .row { margin-bottom: 12px; }
.two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
@media (max-width: 960px) { .two { grid-template-columns: 1fr; } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-3); padding: 12px 16px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.who-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 12px;
}
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.list-row:last-child { border-bottom: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ink-3); }
.dot.pw { background: var(--bad); }
.dot.em { background: #4b6fd6; }
.dot.in { background: var(--ok); }
.dot.cr { background: var(--warn); }
.dot.ch { background: var(--ink-2); }

.empty { padding: 48px 20px; text-align: center; color: var(--ink-2); }
.empty svg { width: 34px; height: 34px; color: var(--ink-3); margin-bottom: 10px; }
.empty h3 { color: var(--ink); margin-bottom: 4px; font-size: 15px; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: 100%; max-width: 400px; padding: 32px 28px; }
.auth .brand { padding: 0 0 26px; }
.auth h1 { margin-bottom: 6px; }
.auth p { color: var(--ink-2); margin: 0 0 22px; }
.error { color: var(--bad); font-size: 13px; min-height: 18px; }

/* ---------- modal ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(15, 15, 12, .38); display: grid; place-items: center;
  padding: 16px; animation: fade .12s ease;
}
.modal {
  width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; background: var(--panel);
  border-radius: 18px; border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
}
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 0; }
.modal-body { padding: 18px 22px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 22px 20px; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }
.fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.fieldset legend { padding: 0 6px; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.pick { max-height: 220px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.secret-box {
  font-family: var(--mono); font-size: 13px; padding: 12px 14px; border-radius: 10px; background: var(--panel-2);
  border: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; max-height: 50vh; overflow: auto;
}
@keyframes fade { from { opacity: 0; } }

/* ---------- toast & banner ---------- */
.toasts { position: fixed; z-index: 60; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; }
@media (max-width: 860px) { .toasts { bottom: 84px; } }
.toast {
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 500;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .2); animation: rise .18s ease;
}
.toast.bad { background: var(--bad); color: #fff; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.banner {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; margin-bottom: 18px;
  background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 500;
}
.banner.info { background: var(--info-soft); color: var(--ink-2); }
.banner svg { width: 16px; height: 16px; flex: none; }

.skeleton { height: 180px; border-radius: var(--radius); background: linear-gradient(90deg, var(--line-2), var(--panel-2), var(--line-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ---------- badges, live usage ---------- */
.count {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff;
  font-size: 11px; font-weight: 600; display: inline-grid; place-items: center; line-height: 1;
}
.tabbar a { position: relative; }
.tabbar .count { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; }
@media (max-width: 860px) {
  .tabbar { overflow-x: auto; scrollbar-width: none; }
  .tabbar a { min-width: 64px; }
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #2fb46c; display: inline-block; box-shadow: 0 0 0 2px var(--panel); }
.avatar { position: relative; }
.avatar .live-dot { position: absolute; right: -1px; bottom: -1px; }
.avatar.grp { border-radius: 9px; background: var(--line-2); color: var(--ink-2); }
.using { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line-2); }
.using .people { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.using.full { border-color: var(--warn-soft); background: var(--warn-soft); }
.who-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; padding: 2px 9px 2px 7px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); }
.who-chip .live-dot { width: 6px; height: 6px; box-shadow: none; }
.seats { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2); min-width: 0; }
.person.on { border-color: var(--line); background: var(--panel-2); }
.person .nm { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person:not(.on) { opacity: .75; }
.more-people summary { cursor: pointer; margin-top: 12px; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---------- screenshot reader ---------- */
.drop {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1.5px dashed var(--line);
  cursor: pointer; background: var(--panel-2); outline: none;
}
.drop:hover, .drop:focus { border-color: var(--accent); }
.drop svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.shot-result { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--ok-soft); font-size: 13px; }
.shot-result.bad { background: var(--bad-soft); color: var(--bad); }
.shot-result img { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); flex: none; }

/* ---------- chat ---------- */
.chat { display: grid; grid-template-columns: 300px 1fr; height: calc(100vh - 64px); min-height: 420px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; box-shadow: var(--shadow); }
.chat-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--panel-2); }
.chat-list-head { display: flex; align-items: center; gap: 6px; padding: 16px 14px 12px; }
.chat-list-head h1 { font-size: 18px; }
#clist { overflow-y: auto; flex: 1; padding: 0 8px 8px; }
.chat-item { display: flex; gap: 10px; align-items: center; width: 100%; padding: 10px; border: 0; background: none; border-radius: 10px; cursor: pointer; }
.chat-item:hover { background: var(--line-2); }
.chat-item.on { background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.chat-item .count { margin-left: 0; }
.chat-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-main > .empty { margin: auto; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-head .back { display: none; }
.msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 3px; }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 78%; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg-who { font-size: 11.5px; color: var(--ink-3); margin: 8px 0 2px 4px; font-weight: 500; }
.bubble { padding: 8px 12px; border-radius: 14px; background: var(--line-2); white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
.msg.mine .bubble { background: var(--accent); color: var(--accent-ink); }
.msg-gap { align-self: center; font-size: 11.5px; color: var(--ink-3); margin: 12px 0 6px; }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { min-height: 40px; height: 40px; resize: none; padding: 9px 12px; }
.composer .btn { height: 40px; width: 40px; flex: none; }
@media (max-width: 860px) {
  .chat { grid-template-columns: 1fr; height: calc(100vh - 170px); }
  .chat.open .chat-list { display: none; }
  .chat:not(.open) .chat-main { display: none; }
  .chat-head .back { display: inline-flex; }
}

/* ---------- dashboard ---------- */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.eyebrow { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin-bottom: 6px; }
.dash-head h1 { font-size: 28px; letter-spacing: -.025em; }
.dash-head p { margin: 6px 0 0; color: var(--ink-2); }
.dash-tools { display: flex; align-items: center; gap: 16px; }
.stack-avatars { display: flex; align-items: center; }
.stack-avatars .avatar { width: 28px; height: 28px; font-size: 11px; margin-left: -8px; box-shadow: 0 0 0 2px var(--bg); }
.stack-avatars .avatar:first-child { margin-left: 0; }
.stack-avatars .faint { margin-left: 10px; display: inline-flex; align-items: center; gap: 6px; }
.stack-avatars .faint::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #2fb46c; }

.low-strip {
  display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px;
  background: var(--bad-soft); color: var(--bad); margin-bottom: 18px; font-size: 13.5px;
}
.low-strip svg { width: 16px; height: 16px; flex: none; }
.low-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.chip-low { border: 0; background: var(--panel); color: var(--ink); border-radius: 99px; height: 28px; padding: 0 12px; font-size: 12.5px; cursor: pointer; font-weight: 500; }

.chart-card { padding: 20px 22px 12px; margin-bottom: 16px; }
.chart-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.chart-head .badge { border-radius: 11px; }
.chart-title { flex: 1; min-width: 0; }
.chart-title h2 { font-size: 16px; }
.chart-title span { font-size: 12.5px; color: var(--ink-3); }
.chart-total { text-align: right; line-height: 1.15; }
.chart-total b { display: block; font-size: 24px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.chart-total span { font-size: 12px; color: var(--ink-3); }

.bars { display: flex; flex-direction: column; }
.bar-row {
  display: grid; grid-template-columns: minmax(110px, 210px) 1fr 104px 78px; align-items: center; gap: 18px;
  padding: 11px 10px; margin: 0 -10px; border: 0; background: none; border-radius: 10px; text-align: left; cursor: pointer; color: inherit;
}
.bar-row:hover { background: var(--panel-2); }
.bar-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.bar-name { min-width: 0; display: flex; flex-direction: column; }
.bar-name b, .bar-name small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-name b { font-weight: 550; }
.bar-name small { color: var(--ink-3); font-size: 12px; }
.bar-track { display: block; height: 10px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 99px; background: var(--ok); transition: width .6s cubic-bezier(.2, .7, .2, 1); }
.lvl-mid .bar-track i, .bar-track.lvl-mid i { background: var(--warn); }
.lvl-low .bar-track i, .bar-track.lvl-low i { background: var(--bad); }
.bar-track.lg { height: 12px; margin: 12px 0 8px; }
.bar-track.sm { height: 5px; width: 100%; max-width: 160px; margin-top: 6px; }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; line-height: 1.2; }
.bar-val b { font-size: 15px; font-weight: 600; }
.bar-val small { display: block; color: var(--ink-3); font-size: 11.5px; }
.lvl-low .bar-val b { color: var(--bad); }
.bar-tag { text-align: right; }
.t-low, .t-best { font-style: normal; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.t-low { background: var(--bad-soft); color: var(--bad); }
.t-best { background: var(--ok-soft); color: var(--ok); }
@media (max-width: 640px) {
  .chart-card { padding: 16px 16px 8px; }
  .chart-total b { font-size: 20px; }
  .bar-row { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .bar-row .bar-track { grid-column: 1 / -1; grid-row: 2; }
  .bar-tag { display: none; }
}

.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
@media (max-width: 400px) { .list-grid { grid-template-columns: 1fr; } }
.list-card { padding: 18px 18px 6px; }
.list-card .chart-head { margin-bottom: 6px; }
.cred-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line-2); }
.cr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; border: 0; background: none; padding: 0; cursor: pointer; text-align: left; color: inherit; }
.cr-main b { font-weight: 550; }
.cr-main .mono { color: var(--ink-2); font-size: 12.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-main .cr-pw { color: var(--ink); background: var(--warn-soft); padding: 1px 7px; border-radius: 6px; margin-top: 4px; }
.cr-acts { display: flex; gap: 2px; flex: none; }
.dash-foot { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 30px; }
.dash-foot svg { width: 13px; height: 13px; }

/* ---------- account sheet ---------- */
.sheet-head { display: flex; align-items: center; gap: 14px; padding: 20px 22px 0; }
.sheet-head .badge { border-radius: 12px; }
.sheet-head h2 { font-size: 17px; }
.sheet-credits { padding: 16px 18px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line-2); }
.sheet-credits .big { font-size: 30px; font-weight: 650; letter-spacing: -.025em; margin-right: 4px; font-variant-numeric: tabular-nums; }
.sheet-credits.lvl-low .big { color: var(--bad); }

/* ---------- admin accounts list ---------- */
.manage-group { margin-bottom: 14px; overflow: hidden; }
.mg-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); background: var(--panel-2); }
.mg-head .badge { border-radius: 8px; }
.mg-row { display: grid; grid-template-columns: 1.3fr 1fr 170px auto; gap: 16px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.mg-row:last-child { border-bottom: 0; }
.mg-row:hover { background: var(--panel-2); }
.mg-name { display: flex; flex-direction: column; min-width: 0; }
.mg-name > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-cred { min-width: 0; }
.mg-acts { display: flex; gap: 2px; }
@media (max-width: 640px) { .mg-row { grid-template-columns: 1fr auto; } .mg-cred, .mg-when { display: none; } }

/* ---------- account editor ---------- */
.switch-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.switch-row input {
  appearance: none; -webkit-appearance: none; width: 36px; height: 20px; border-radius: 99px; background: var(--line); position: relative;
  flex: none; margin: 2px 0 0; cursor: pointer; transition: background .15s;
}
.switch-row input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.switch-row input:checked { background: var(--accent); }
.switch-row input:checked::after { transform: translateX(16px); }
.switch-row input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-row > span { display: flex; flex-direction: column; gap: 2px; }
details.more summary { cursor: pointer; color: var(--ink-2); font-weight: 500; font-size: 13px; width: max-content; }

/* ---------- screenshots ---------- */
.drop.big { padding: 26px; justify-content: center; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.shots { display: flex; flex-direction: column; gap: 10px; }
.shots:empty { display: none; }
.shot { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.shot img { width: 120px; height: 72px; object-fit: cover; object-position: left center; border-radius: 8px; border: 1px solid var(--line-2); flex: none; background: #111; }
.shot-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; justify-content: center; min-height: 72px; }
.shot-fields { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 8px; align-items: end; }
.mini { display: flex; flex-direction: column; gap: 3px; }
.mini span { font-size: 11.5px; color: var(--ink-3); }
@media (max-width: 560px) { .shot-fields { grid-template-columns: 1fr 1fr; } .shot-fields select { grid-column: 1 / -1; } .shot img { width: 64px; height: 48px; } }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin-right: 8px; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- your accounts ---------- */
.section-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.section-title h2 { font-size: 15px; }
.mine { margin-bottom: 26px; }
.mine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.mine-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.mine-card .badge { border-radius: 10px; }
.mine-num { display: flex; align-items: baseline; gap: 6px; margin-bottom: 10px; }
.mine-num b { font-size: 26px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mine-card.lvl-low .mine-num b { color: var(--bad); }
.mine-card .bar-track i { background: var(--ok); }
.mine-card.lvl-mid .bar-track i { background: var(--warn); }
.mine-card.lvl-low .bar-track i { background: var(--bad); }
.t-you { font-style: normal; font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); vertical-align: 1px; margin-left: 4px; }
.bar-row.is-mine { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.bar-row.is-mine:hover { background: var(--accent-soft); }
.cr-acts .faint svg { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------- typed-in credits ---------- */
.shot-typed { width: 120px; height: 72px; border-radius: 8px; border: 1px dashed var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink-3); font-size: 12px; flex: none; }
.shot-typed svg { width: 18px; height: 18px; }
@media (max-width: 560px) { .shot-typed { width: 64px; height: 48px; } .shot-typed span { display: none; } }

/* ---------- assignment pickers ---------- */
.people-pick { display: flex; flex-wrap: wrap; gap: 6px; max-height: 180px; overflow: auto; }
.pp { position: relative; cursor: pointer; }
.pp input { position: absolute; opacity: 0; pointer-events: none; }
.pp span {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--panel); font-size: 13px; color: var(--ink-2); transition: all .12s;
}
.pp span .badge { width: 18px; height: 18px; font-size: 9px; border-radius: 5px; }
.pp input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); font-weight: 500; }
.pp input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--line-2); gap: 3px; width: max-content; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 6px 14px; border-radius: 8px; font-size: 13px; color: var(--ink-2); }
.seg input:checked + span { background: var(--panel); color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }

/* ---------- my accounts (profile) ---------- */
.back-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; color: var(--ink-2); }
.back-link svg { width: 15px; height: 15px; }
.prof-head { display: flex; align-items: center; gap: 18px; padding: 22px 24px; margin-bottom: 26px; flex-wrap: wrap; }
.prof-head h1 { font-size: 22px; }
.avatar.xl { width: 56px; height: 56px; font-size: 20px; }
.prof-stats { display: flex; gap: 10px; }
.prof-stats > div { display: flex; flex-direction: column; align-items: center; min-width: 84px; padding: 10px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); }
.prof-stats b { font-size: 22px; font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; }
.prof-stats span { font-size: 12px; color: var(--ink-3); }
.prof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
@media (max-width: 400px) { .prof-grid { grid-template-columns: 1fr; } }
.prof-acct { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.prof-acct .badge { border-radius: 11px; }
.prof-acct .bar-track i { background: var(--ok); }
.prof-acct.lvl-mid .bar-track i { background: var(--warn); }
.prof-acct.lvl-low .bar-track i { background: var(--bad); }
.prof-acct.lvl-low .mine-num b { color: var(--bad); }
.prof-cred { padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); }
.t-can { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }

/* ---------- people limit ---------- */
.limit { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.limit .input { width: 70px; height: 32px; text-align: center; }
.pp span small { font-size: 11px; color: var(--ink-3); margin-left: 2px; }
.pp input:disabled + span { opacity: .45; cursor: not-allowed; }

/* ---------- sign-in: clear button, calm autofill colour ---------- */
.clearable { position: relative; display: block; }
.clearable .input { padding-right: 38px; }
.clearable .clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--line-2); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.clearable .clear:hover { background: var(--line); color: var(--ink); }
.clearable .clear svg { width: 14px; height: 14px; }
.input:-webkit-autofill, .input:-webkit-autofill:hover, .input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink); -webkit-box-shadow: 0 0 0 40px var(--panel) inset; caret-color: var(--ink); transition: background-color 9999s;
}

.auth-alt { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line-2); text-align: center; color: var(--ink-2); font-size: 13.5px; }
.auth-alt a { font-weight: 600; }

/* ---------- platform chart switch ---------- */
.mini-switch { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.mini-switch input { appearance: none; -webkit-appearance: none; width: 32px; height: 18px; border-radius: 99px; background: var(--line); position: relative; margin: 0; cursor: pointer; transition: background .15s; }
.mini-switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.mini-switch input:checked { background: var(--accent); }
.mini-switch input:checked::after { transform: translateX(14px); }
.mini-switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.t-admin { font-size: 10px; font-weight: 600; padding: 0 6px; border-radius: 99px; background: var(--info-soft); color: var(--ink-2); border: 1px solid var(--line); letter-spacing: .02em; vertical-align: 1px; }

/* a click outside a form nudges it instead of closing it */
.modal.nudge { animation: nudge .28s ease; }
@keyframes nudge { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }

/* ---------- your own accounts glow ---------- */
:root { --glow: color-mix(in srgb, var(--accent) 55%, transparent); --glow-soft: color-mix(in srgb, var(--accent) 22%, transparent); }
.glow {
  position: relative; border-color: transparent;
  background: linear-gradient(165deg, color-mix(in srgb, var(--accent-soft) 85%, var(--panel)) 0%, var(--panel) 55%);
  box-shadow: 0 0 0 1px var(--glow), 0 10px 32px -10px var(--glow), 0 0 0 4px var(--glow-soft);
  animation: glow 3.6s ease-in-out infinite;
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 1px var(--glow), 0 10px 32px -10px var(--glow), 0 0 0 4px var(--glow-soft); }
  50% { box-shadow: 0 0 0 1px var(--accent), 0 14px 44px -8px var(--glow), 0 0 0 6px var(--glow-soft); }
}
.glow.lvl-low { --glow: color-mix(in srgb, var(--bad) 55%, transparent); --glow-soft: color-mix(in srgb, var(--bad) 18%, transparent);
  background: linear-gradient(165deg, color-mix(in srgb, var(--bad-soft) 85%, var(--panel)) 0%, var(--panel) 55%); }
.glow .bar-track { height: 8px; }
.glow .bar-track i { box-shadow: 0 0 14px 1px color-mix(in srgb, var(--ok) 65%, transparent); }
.glow.lvl-mid .bar-track i { box-shadow: 0 0 14px 1px color-mix(in srgb, var(--warn) 65%, transparent); }
.glow.lvl-low .bar-track i { box-shadow: 0 0 14px 1px color-mix(in srgb, var(--bad) 65%, transparent); }
.t-yours { font-style: normal; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); white-space: nowrap; }

/* fade-up on first view, one after another */
.mine-grid.enter .mine-card { animation: rise-in .55s cubic-bezier(.2, .7, .2, 1) both, glow 3.6s ease-in-out .6s infinite; animation-delay: calc(var(--i, 0) * 70ms), calc(var(--i, 0) * 70ms + .6s); }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }

/* in the all-accounts charts and lists: yours stand out, the rest step back */
.bar-row.is-mine, .cred-row.is-mine {
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent-soft) 95%, transparent), transparent 85%);
  box-shadow: inset 3px 0 0 var(--accent);
}
.bar-row.is-mine:hover { background: linear-gradient(90deg, var(--accent-soft), color-mix(in srgb, var(--accent-soft) 30%, transparent)); }
.bar-row.is-mine .bar-track i { box-shadow: 0 0 12px 1px color-mix(in srgb, var(--ok) 60%, transparent); }
.bar-row.is-mine.lvl-low .bar-track i { box-shadow: 0 0 12px 1px color-mix(in srgb, var(--bad) 60%, transparent); }
.cred-row.is-mine { margin: 0 -10px; padding-left: 13px; padding-right: 10px; border-radius: 10px; border-top-color: transparent; }
.bars:has(.is-mine) .bar-row:not(.is-mine), .list-card:has(.is-mine) .cred-row:not(.is-mine) { opacity: .72; transition: opacity .2s; }
.bars:has(.is-mine) .bar-row:not(.is-mine):hover, .list-card:has(.is-mine) .cred-row:not(.is-mine):hover { opacity: 1; }
