/* ---------- tokens ---------- */
:root {
  --bg: #16131f;
  --surface: #1e1a2b;
  --surface-2: #272238;
  --surface-3: #302a45;
  --line: #342e4a;
  --text: #efeafb;
  --muted: #a49dbd;
  --faint: #756e90;
  --amethyst: #a98bff;
  --amethyst-soft: rgba(169, 139, 255, 0.14);
  --jade: #4fd1a5;
  --jade-soft: rgba(79, 209, 165, 0.14);
  --rose: #f07a8e;
  --rose-soft: rgba(240, 122, 142, 0.14);
  --amber: #e9c46a;
  --amber-soft: rgba(233, 196, 106, 0.15);
  --sky: #7cb8ff;
  --sky-soft: rgba(124, 184, 255, 0.14);
  --focus: #c9b6ff;
  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 8px;
  --display: 'Unbounded', 'Manrope', system-ui, sans-serif;
  --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --side: 232px;
  color-scheme: dark;
}
:root[data-theme='light'] {
  --bg: #f5f3fa;
  --surface: #ffffff;
  --surface-2: #f1eef8;
  --surface-3: #e7e2f3;
  --line: #e2ddee;
  --text: #1e1830;
  --muted: #625b7c;
  --faint: #8f88a8;
  --amethyst: #6a4bdb;
  --amethyst-soft: rgba(106, 75, 219, 0.1);
  --jade: #0f8f67;
  --jade-soft: rgba(15, 143, 103, 0.1);
  --rose: #cc3d58;
  --rose-soft: rgba(204, 61, 88, 0.1);
  --amber: #a87810;
  --amber-soft: rgba(168, 120, 16, 0.12);
  --sky: #2f6fc7;
  --sky-soft: rgba(47, 111, 199, 0.1);
  --focus: #6a4bdb;
  color-scheme: light;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 14.5px/1.5 var(--body);
  font-feature-settings: 'tnum' 1;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
svg { flex-shrink: 0; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 28px;
  padding: 22px 14px 18px;
  border-right: 1px solid var(--line);
  background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px; }
.brand-gem { width: 32px; height: 32px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font: 600 14px/1.2 var(--display); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-tag { color: var(--muted); font-size: 12.5px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 600;
}
.nav a svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.on { color: var(--text); background: var(--surface-2); }
.nav a.on svg { stroke: var(--amethyst); }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 0 4px; }
.sync { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; padding: 8px; border-radius: 8px; min-width: 0; }
.sync:hover { background: var(--surface); }
.sync span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.dot.ok { background: var(--jade); }
.dot.warn { background: var(--amber); }
.dot.bad { background: var(--rose); }
.theme-btn { border: 0; background: none; padding: 8px; border-radius: 8px; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.theme-btn:hover { background: var(--surface); color: var(--text); }
.theme-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }

main { min-width: 0; padding: 30px clamp(16px, 3.4vw, 44px) 80px; outline: none; }
.page { max-width: 1240px; margin: 0 auto; }

/* ---------- page header ---------- */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.head h1 { margin: 0; font: 600 clamp(22px, 2.6vw, 30px)/1.15 var(--display); letter-spacing: -0.02em; }
.head p { margin: 6px 0 0; color: var(--muted); max-width: 64ch; }
.head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12.5px; font-weight: 600; vertical-align: middle; }
.chip.tag { background: var(--amethyst-soft); color: var(--amethyst); font-family: var(--display); font-weight: 600; font-size: 11.5px; letter-spacing: 0.04em; }
.chip.on { background: var(--jade-soft); color: var(--jade); }

/* ---------- surfaces ---------- */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-wide { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.panel { background: var(--surface); border-radius: var(--radius-lg); padding: 20px; min-width: 0; }
.panel + .panel, .grid + .panel, .panel + .grid, .grid + .grid { margin-top: 16px; }
.grid > .panel, .grid > .grid { margin-top: 0; }
.panel h2 { margin: 0; font: 600 15px/1.3 var(--display); letter-spacing: -0.01em; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head .sub { color: var(--muted); font-size: 13px; }
.flush { padding: 0; overflow: hidden; }
.flush .panel-head { padding: 18px 20px 0; }

.stat { background: var(--surface); border-radius: var(--radius-lg); padding: 18px 20px; min-width: 0; }
.stat .k { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat .v { font: 600 26px/1.15 var(--display); letter-spacing: -0.02em; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .s { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.in { color: var(--jade); }
.out { color: var(--rose); }
.gem { color: var(--amethyst); }
.gold { color: var(--amber); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* ---------- golem hero (the one loud element) ---------- */
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: center;
  padding: 28px; border-radius: 22px;
  background:
    radial-gradient(120% 140% at 100% 0%, var(--amethyst-soft), transparent 55%),
    var(--surface);
}
.hero .state { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; color: var(--muted); }
.hero .state.live { color: var(--amethyst); }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--amethyst); box-shadow: 0 0 0 0 var(--amethyst); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(169, 139, 255, 0.55); } 70% { box-shadow: 0 0 0 12px rgba(169, 139, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(169, 139, 255, 0); } }
.hero .big { font: 700 clamp(48px, 8vw, 92px)/0.95 var(--display); letter-spacing: -0.045em; margin: 14px 0 6px; }
.hero .big small { font-size: 0.26em; letter-spacing: 0; font-weight: 600; color: var(--muted); margin-left: 10px; }
.hero .line { color: var(--muted); font-size: 15px; }
.hero .facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 22px; }
.hero .facts div { min-width: 92px; }
.hero .facts b { display: block; font: 600 19px/1.2 var(--display); letter-spacing: -0.01em; color: var(--text); }
.hero .facts span { color: var(--muted); font-size: 12.5px; }
.gemmeter { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.gemmeter svg { width: 168px; height: 168px; }
.gemmeter .gm-v { font: 600 22px/1.1 var(--display); }
.gemmeter .gm-s { color: var(--muted); font-size: 12.5px; max-width: 24ch; }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.field { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; height: 38px; min-width: 0; }
.field:focus-within { border-color: var(--amethyst); }
.field svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.field input, .field select { border: 0; background: transparent; outline: none; height: 36px; min-width: 0; }
.field select { padding-right: 4px; cursor: pointer; }
.field select option { background: var(--surface); color: var(--text); }
.field.search input { width: 190px; }
.field input[type='date'] { width: 132px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 0 12px; height: 30px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--amethyst); color: #160f2b; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.btn[disabled] { opacity: 0.45; cursor: default; }
.pillset { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { border: 1px solid var(--line); background: none; border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.pill i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.pill.on { color: var(--text); background: var(--surface-2); border-color: var(--surface-3); }
.pill:hover { color: var(--text); }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th .arr { opacity: 0.7; margin-left: 3px; }
td { border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
tr:last-child td { border-bottom: 0; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; }
td.wrap { white-space: normal; min-width: 140px; }
td.msg { white-space: normal; min-width: 260px; color: var(--muted); }
.flush table th:first-child, .flush table td:first-child { padding-left: 20px; }
.flush table th:last-child, .flush table td:last-child { padding-right: 20px; }
.who { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; }
.who .dot { width: 7px; height: 7px; }
.who .alias { color: var(--faint); font-weight: 500; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.b-in { background: var(--jade-soft); color: var(--jade); }
.b-out { background: var(--rose-soft); color: var(--rose); }
.b-move { background: var(--sky-soft); color: var(--sky); }
.b-gem { background: var(--amethyst-soft); color: var(--amethyst); }
.b-warn { background: var(--amber-soft); color: var(--amber); }
.b-mute { background: var(--surface-2); color: var(--muted); }
.share { width: 110px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.share i { display: block; height: 100%; background: var(--amethyst); border-radius: 3px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pager .btns { display: flex; gap: 6px; }

/* ---------- feeds ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.feed li:last-child { border-bottom: 0; }
.feed .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; }
.feed .ic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.feed .t { min-width: 0; }
.feed .t b { font-weight: 700; }
.feed .t .m { color: var(--muted); overflow-wrap: anywhere; }
.feed time { color: var(--faint); font-size: 12.5px; white-space: nowrap; padding-top: 3px; }
.ic.vault-in { background: var(--jade-soft); color: var(--jade); }
.ic.vault-out { background: var(--rose-soft); color: var(--rose); }
.ic.vault-move, .ic.admin { background: var(--sky-soft); color: var(--sky); }
.ic.event { background: var(--amber-soft); color: var(--amber); }
.ic.quest, .ic.other { background: var(--surface-2); color: var(--muted); }
.ic.boss, .ic.gem { background: var(--amethyst-soft); color: var(--amethyst); }
.ic.roster { background: var(--jade-soft); color: var(--jade); }
.ic.warn { background: var(--amber-soft); color: var(--amber); }
.daygroup { margin: 18px 0 4px; color: var(--muted); font-weight: 700; font-size: 13px; position: sticky; top: 0; background: var(--surface); padding: 6px 0; z-index: 1; }
.daygroup:first-child { margin-top: 0; }

/* ---------- bars ---------- */
.dbars { display: flex; flex-direction: column; gap: 10px; }
.dbar { display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr) 84px; gap: 10px; align-items: center; font-size: 13px; }
.dbar .n { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dbar .l, .dbar .r { height: 10px; display: flex; }
.dbar .l { justify-content: flex-end; }
.dbar .l i { background: var(--rose); border-radius: 3px 0 0 3px; display: block; height: 100%; min-width: 0; }
.dbar .r i { background: var(--jade); border-radius: 0 3px 3px 0; display: block; height: 100%; }
.dbar .net { text-align: right; font-weight: 700; white-space: nowrap; }
.dbar-legend { display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr) 84px; gap: 10px; color: var(--faint); font-size: 12px; margin-bottom: 8px; }
.dbar-legend span:nth-child(2) { text-align: right; }
.dbar-legend span:last-child { text-align: right; }

.chart { position: relative; height: 260px; }
.chart.sm { height: 180px; }
.chart.lg { height: 320px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }

/* heatmap */
.heat { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 3px; font-size: 11px; color: var(--faint); }
.heat div { aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); }
.heat .lbl { background: none; aspect-ratio: auto; display: flex; align-items: center; }
.heat .hl { background: none; aspect-ratio: auto; text-align: center; }

/* online list */
.people { display: flex; flex-wrap: wrap; gap: 8px; }
.person { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 999px; background: var(--surface-2); font-weight: 600; font-size: 13px; }
.person small { color: var(--faint); font-weight: 500; }

.strip { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--radius-lg); background: var(--surface); flex-wrap: wrap; }
.strip .gemico { width: 40px; height: 40px; border-radius: 12px; background: var(--amethyst-soft); display: grid; place-items: center; }
.strip .gemico svg { width: 22px; height: 22px; fill: none; stroke: var(--amethyst); stroke-width: 1.7; stroke-linejoin: round; }
.strip .txt { flex: 1; min-width: 200px; }
.strip .txt b { display: block; font-weight: 700; }
.strip .txt span { color: var(--muted); }

.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-weight: 700; margin-bottom: 4px; }
.skeleton { height: 120px; border-radius: var(--radius-lg); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.4s infinite linear; }
@keyframes sk { to { background-position: -200% 0; } }

.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 18px; font-size: 13.5px; }
.kv dt { color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.kv dd { margin: 0; font-weight: 600; text-align: right; white-space: nowrap; }

.reports { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.replist { display: flex; flex-direction: column; gap: 2px; max-height: 70vh; overflow: auto; }
.replist button { text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 9px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-weight: 600; }
.replist button:hover { background: var(--surface-2); color: var(--text); }
.replist button.on { background: var(--surface-3); color: var(--text); }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); opacity: 0; background: var(--surface-3); color: var(--text); padding: 10px 16px; border-radius: 10px; font-weight: 600; pointer-events: none; transition: 0.2s; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-wide, .g3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed; z-index: 20; top: auto; bottom: 0; left: 0; right: 0; height: auto;
    flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); gap: 0;
    border-right: 0; border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px);
  }
  .brand, .side-foot { display: none; }
  .nav { flex-direction: row; flex: 1; justify-content: space-around; }
  .nav a { flex-direction: column; gap: 3px; padding: 6px 4px; font-size: 11px; flex: 1; text-align: center; }
  .nav a.on { background: none; }
  main { padding: 20px 16px 96px; }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: 1fr; padding: 22px; }
  .gemmeter { flex-direction: row; text-align: left; }
  .gemmeter svg { width: 96px; height: 96px; }
  .reports { grid-template-columns: 1fr; }
  .replist { flex-direction: row; overflow-x: auto; max-height: none; }
  .replist button { flex-shrink: 0; }
  .dbar, .dbar-legend { grid-template-columns: 84px minmax(0, 1fr) minmax(0, 1fr) 64px; }
  .field.search input { width: 130px; }
  .mobile-sync { display: flex !important; }
}
@media (max-width: 520px) {
  .g4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .stat { padding: 14px; }
  .stat .v { font-size: 20px; }
  .filters > * { flex: 1 1 auto; }
  .heat { gap: 2px; grid-template-columns: 28px repeat(24, minmax(0, 1fr)); }
}
.mobile-sync { display: none; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }

/* ---------- v2: names, live board, loans, dues ---------- */
.content { min-width: 0; }
.handle { color: var(--faint); font-weight: 500; font-size: 0.86em; margin-left: 2px; }
a.stat { display: block; }
a.stat:hover { background: var(--surface-2); }
tr.hl td { background: var(--amethyst-soft); }
.section-title { font: 600 18px/1.2 var(--display); letter-spacing: -0.01em; margin: 34px 0 14px; }

.livebar {
  position: sticky; top: 0; z-index: 15;
  display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap;
  padding: 10px clamp(16px, 3.4vw, 44px);
  background: color-mix(in srgb, var(--amethyst) 18%, var(--bg));
  border-bottom: 1px solid color-mix(in srgb, var(--amethyst) 40%, transparent);
  font-size: 13.5px; font-weight: 600; color: var(--muted);
}
.livebar[hidden] { display: none; }
.livebar b { color: var(--text); }
.livebar .go { margin-left: auto; color: var(--amethyst); }
.livebar:hover .go { text-decoration: underline; }

.hero.live { background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--amethyst) 26%, transparent), transparent 60%), var(--surface); }
.dropbar { margin-top: 16px; padding: 16px 20px; border-radius: var(--radius-lg); background: var(--rose-soft); border: 1px solid color-mix(in srgb, var(--rose) 45%, transparent); }
.dropbar > b { display: block; color: var(--rose); margin-bottom: 10px; font-weight: 700; }
.dropbar .person { background: var(--surface); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid transparent; min-width: 0; }
.tile:hover { border-color: var(--surface-3); }
.tile.dropped, .tile.offline { border-color: color-mix(in srgb, var(--rose) 55%, transparent); background: color-mix(in srgb, var(--rose) 8%, var(--surface-2)); }
.tile-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tile-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-top .badge { flex-shrink: 0; font-size: 11px; }
.tile-kills { font: 600 26px/1 var(--display); letter-spacing: -0.02em; }
.tile-kills small { font: 600 12px var(--body); color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.tile .bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.tile .bar i { display: block; height: 100%; background: var(--jade); }
.tile.dropped .bar i, .tile.offline .bar i { background: var(--rose); }
.tile-foot { display: flex; justify-content: space-between; gap: 6px; color: var(--muted); font-size: 12px; }

.lootstats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.lootstats div { background: var(--amethyst-soft); border-radius: 12px; padding: 12px 14px; }
.lootstats b { display: block; font: 700 30px/1 var(--display); letter-spacing: -0.02em; }
.lootstats span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 6px; line-height: 1.35; }

.loans { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.loan { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 12px; background: var(--amethyst-soft); border: 1px solid color-mix(in srgb, var(--amethyst) 30%, transparent); min-width: 0; }
a.loan:hover { border-color: var(--amethyst); }
.loan.hl { outline: 2px solid var(--amethyst); }
.loan.plain { background: var(--surface-2); border-color: transparent; }
.loan-item { font-weight: 700; color: var(--amethyst); }
.loan.plain .loan-item { color: var(--text); }
.loan-who { font-weight: 700; }
.loan-meta { color: var(--muted); font-size: 12.5px; }
details.more { margin-top: 14px; }
details.more summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 6px 0; }
details.more summary:hover { color: var(--text); }
details.more .tablewrap { margin: 8px -20px -20px; }

table.dues td.due { text-align: center; font-weight: 700; font-size: 12.5px; }
table.dues th.cur { color: var(--text); }
.due.ok { color: var(--jade); }
.due.part { color: var(--amber); }
.due.none { color: var(--rose); font-weight: 600; }
.due.na { color: var(--faint); }
table.dues td.due.ok { background: var(--jade-soft); }
table.dues td.due.part { background: var(--amber-soft); }
.duesrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; }
.duesrow > div { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 12px; }
.duesrow .due { font: 600 15px var(--display); }

.ranks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rank { padding: 4px 10px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.rank b { color: var(--amethyst); }

/* full-screen live board */
body.tv .side { display: none; }
body.tv .shell { grid-template-columns: 1fr; }
body.tv main { padding-bottom: 30px; }
body.tv .page { max-width: 1800px; }
body.tv .tiles { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
body.tv .tile-kills { font-size: 32px; }
body.tv .tile-name { font-size: 16px; }
@media (max-width: 860px) {
  .livebar { font-size: 12.5px; gap: 4px 12px; }
  .livebar .go { display: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lootstats b { font-size: 24px; }
}


/* ---------- v3: admin, drops ---------- */
.page.narrow { max-width: 460px; }
.login { display: flex; flex-direction: column; gap: 10px; }
.lbl { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.input { width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); outline: none; }
.input:focus { border-color: var(--amethyst); }
select.input option { background: var(--surface); }
.input.num { width: 110px; text-align: right; }
.input.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.err { color: var(--rose); min-height: 1.2em; margin: 0; font-weight: 600; }
.intro { margin: 0 0 14px; max-width: 75ch; }
.small { font-size: 12.5px; margin: 10px 0 0; }
.grpcard .panel-head .input.name { max-width: 280px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 34px; align-items: center; }
.chipx { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 12px; border-radius: 999px; background: var(--amethyst-soft); font-weight: 600; font-size: 13px; }
.chipx small { color: var(--faint); font-weight: 500; }
.chipx button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px; border-radius: 50%; }
.chipx button:hover { color: var(--rose); }
.addrow { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.addrow select.input { flex: 1; min-width: 180px; }
.addrow .input.num { width: 100px; }
.formgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; margin-bottom: 12px; }
.formgrid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.formbtn { display: flex; justify-content: flex-end; }
.sub3 { font: 600 14px var(--display); margin: 18px 0 8px; }
td.rowact { text-align: right; white-space: nowrap; }
td.rowact .btn { height: 32px; padding: 0 10px; }
.btn.danger { color: var(--rose); }
.toggles { display: flex; flex-direction: column; gap: 4px; }
.toggle { display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px; cursor: pointer; border-radius: 8px; }
.toggle:hover { background: var(--surface-2); }
.toggle input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--amethyst); flex-shrink: 0; }
.toggle b { display: block; font-weight: 600; }
.toggle small { display: block; color: var(--muted); font-size: 12.5px; }
.savebar { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; margin-top: 16px; }
.pendbar { margin-top: 16px; padding: 16px 20px; border-radius: var(--radius-lg); background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent); }
.pendbar > b { display: block; color: var(--amber); margin-bottom: 10px; font-weight: 700; }
.pendbar .person { background: var(--surface); }
.grp { display: flex; flex-direction: column; gap: 2px; }
.grp span { font-size: 12px; white-space: normal; max-width: 260px; }
table.dues td.due small { color: var(--muted); font-weight: 500; }
.duesrow small { font-size: 11px; }
@media (max-width: 860px) {
  .nav a.adm { display: none; }
  .formgrid, .formgrid.four { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
