/* Goldmine Admin - white, blue and yellow. */
:root {
  --bg: #ffffff;
  --soft: #f6f8fc;
  --soft-2: #eef2f9;
  --line: #e4e9f2;
  --ink: #0f172a;
  --ink-2: #3b4a63;
  --muted: #7b8aa3;

  --blue: #5244e3;
  --blue-700: #4234c4;
  --blue-50: #eef0ff;
  --blue-100: #e0e2ff;
  --blue-grad: linear-gradient(135deg, #6d5cf5 0%, #4f3fe0 100%);

  --yellow: #f5b700;
  --yellow-600: #d99a00;
  --yellow-50: #fff8dc;
  --yellow-ink: #7a5900;
  --gold-grad: linear-gradient(135deg, #f6c766 0%, #d99a00 100%);

  --navy: #0b1f4d;
  --navy-2: #1b2a63;
  --navy-grad: linear-gradient(185deg, #0b1f4d 0%, #141a4e 52%, #221a5a 100%);

  --green: #15803d;
  --green-50: #e8f7ee;
  --red: #c62828;
  --red-50: #fdecec;
  --amber: #b45309;
  --amber-50: #fff4e5;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 6px 22px rgba(23, 23, 60, 0.07);
  --shadow-lg: 0 18px 44px rgba(23, 23, 60, 0.14);
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden, [hidden] { display: none !important; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--navy-grad); color: #cfd9f2; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 18px; color: #fff; font-weight: 700; font-size: 16px; letter-spacing: 0.2px; }
.brand .logo { width: 32px; height: 32px; border-radius: 10px; background: var(--gold-grad); color: #3c2b07; display: grid; place-items: center; font-weight: 800; box-shadow: 0 3px 10px rgba(217,154,0,.4), inset 0 1px 0 rgba(255,255,255,.4); }
.brand small { display: block; font-weight: 500; font-size: 11px; color: #9fb0d8; letter-spacing: 1.2px; text-transform: uppercase; }
.nav { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: #cfd9f2; font-weight: 500; position: relative; }
.nav a:hover { background: var(--navy-2); color: #fff; text-decoration: none; }
.nav a.on { background: var(--navy-2); color: #fff; }
.nav a.on::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--yellow); }
.nav svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav .sep { height: 1px; background: rgba(255, 255, 255, 0.08); margin: 10px 8px; }
.side-foot { padding: 14px 20px 18px; font-size: 12px; color: #8ea1cf; border-top: 1px solid rgba(255, 255, 255, 0.08); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 5; background: rgba(255, 255, 255, 0.78); backdrop-filter: saturate(170%) blur(16px); -webkit-backdrop-filter: saturate(170%) blur(16px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 14px 28px; }
.top h1 { font-size: 19px; margin: 0; font-weight: 700; flex: 1; min-width: 0; }
.top h1 small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 8px; }
.top .menu-btn { display: none; }
.content { padding: 24px 28px 48px; max-width: 1400px; width: 100%; }

/* ---------- pills, badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--soft-2); color: var(--ink-2); white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill.ok { background: var(--green-50); color: var(--green); } .pill.ok .dot { background: var(--green); }
.pill.warn { background: var(--amber-50); color: var(--amber); } .pill.warn .dot { background: var(--amber); }
.pill.fail { background: var(--red-50); color: var(--red); } .pill.fail .dot { background: var(--red); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--soft-2); color: var(--ink-2); white-space: nowrap; }
.badge.blue { background: var(--blue-50); color: var(--blue); }
.badge.yellow { background: var(--yellow-50); color: var(--yellow-ink); }
.badge.green { background: var(--green-50); color: var(--green); }
.badge.red { background: var(--red-50); color: var(--red); }
.badge.amber { background: var(--amber-50); color: var(--amber); }

/* ---------- buttons, inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: #fff; padding: 8px 15px; border-radius: 10px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, filter .15s, transform .12s; box-shadow: 0 1px 2px rgba(23,23,60,.05); }
.btn:hover { border-color: #cdd6e6; background: var(--soft); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.primary { background: var(--blue-grad); border-color: transparent; color: #fff; box-shadow: 0 4px 12px rgba(82,68,227,.26); }
.btn.primary:hover { filter: brightness(1.08); background: var(--blue-grad); }
.btn.gold { background: var(--yellow); border-color: var(--yellow); color: var(--navy); }
.btn.gold:hover { background: var(--yellow-600); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-50); border-color: #f3c3c3; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.input, select.input { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 8px 12px; min-width: 0; }
.input:focus, .btn:focus-visible { outline: 3px solid var(--blue-100); outline-offset: 0; border-color: var(--blue); }
.seg { display: inline-flex; background: var(--soft-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 600; color: var(--ink-2); cursor: pointer; font-size: 13px; }
.seg button.on { background: #fff; color: var(--blue); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar .grow { flex: 1; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 19px 21px; min-width: 0; transition: box-shadow .18s, transform .18s; }
.card.kpi:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card h3 { margin: 0 0 4px; font-size: 14.5px; font-weight: 700; }
.card .sub { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }
.card h3.section { margin-top: 26px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.section { margin-top: 18px; }

.kpi { position: relative; overflow: hidden; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; }
.kpi .value { font-size: 30px; font-weight: 780; letter-spacing: -0.6px; margin-top: 4px; color: var(--ink); }
.kpi .value small { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 4px; letter-spacing: 0; }
.kpi .foot { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }
.kpi::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--blue-grad); }
.kpi.gold::after { background: var(--gold-grad); }
.meter { height: 8px; background: var(--soft-2); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.meter > i { display: block; height: 100%; background: var(--blue-grad); border-radius: 999px; width: 0; }
.meter.gold > i { background: var(--gold-grad); }
.meter.hot > i { background: var(--red); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px -18px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); font-weight: 700; background: var(--soft); position: sticky; top: 0; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
tbody tr:hover { background: #fafbfe; }
tbody tr.link { cursor: pointer; }
td .strong { font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }

/* ---------- bars list ---------- */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 90px; align-items: center; gap: 10px; font-size: 13px; }
.bar-row .track { height: 10px; background: var(--soft-2); border-radius: 999px; overflow: hidden; }
.bar-row .track > i { display: block; height: 100%; background: var(--blue); border-radius: 999px; width: 0; }
.bar-row .track.gold > i { background: var(--yellow); }

/* ---------- charts ---------- */
/* The window picker on the Overview: presets, then a calendar of your own. */
.range { position: relative; }
.range .seg button { white-space: nowrap; }
.range-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 44px rgba(11, 31, 77, 0.16); padding: 14px; width: 290px; }
.range-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.range-row label { width: 42px; color: var(--muted); font-size: 12.5px; }
.range-row .dtp { flex: 1; }
.range-foot { display: flex; align-items: center; gap: 8px; }
.range-foot .muted { margin-right: auto; }
/* The calendar opens inside a popover that already sits at the right edge of
   the page, so it hangs off the left rather than off the screen. */
.range-pop .dtp-pop { left: auto; right: 0; }
@media (max-width: 700px) {
  .range-pop { right: auto; left: 0; width: min(290px, calc(100vw - 32px)); }
}

.chart-box { position: relative; width: 100%; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .x-label { fill: var(--muted); font-size: 11px; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; }
.chart .base-line { stroke: var(--line); stroke-width: 1; }
.chart .mean-line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 4; opacity: .55; }
.chart .mean-text { fill: var(--muted); font-size: 10.5px; }
.chart .guide { stroke: var(--blue); stroke-width: 1; opacity: .25; }
.chart .guide.hidden, .chart .dot.hidden { display: none; }
.chart .dot { stroke: #fff; stroke-width: 2; }
.chart .hit { cursor: crosshair; }
/* The bars grow in once, which reads as "this is live" rather than "this is a picture". */
.chart .bar { transform-box: fill-box; transform-origin: bottom; animation: bar-grow .42s cubic-bezier(.2,.8,.3,1) both; }
.chart svg.bars .bar-group { transition: opacity .12s ease; }
.chart svg.bars .bar-group.on .bar { filter: brightness(1.08) saturate(1.05); }
.chart svg.bars:hover .bar-group:not(.on) { opacity: .55; }
.chart .area-fill { animation: fade-in .5s ease both; }
.chart .area-line { animation: fade-in .5s ease both; }
@keyframes bar-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .chart .bar, .chart .area-fill, .chart .area-line { animation: none; }
}
.chart-empty { display: grid; place-items: center; height: 150px; color: var(--muted); font-size: 13px; background: var(--soft); border-radius: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 10px; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tip { position: absolute; pointer-events: none; background: var(--navy); color: #fff; padding: 9px 12px; border-radius: 10px; font-size: 12.5px; box-shadow: 0 10px 28px rgba(11, 31, 77, 0.3); white-space: nowrap; z-index: 3; transform: translate(-50%, calc(-100% - 12px)); }
.tip b { color: var(--yellow); font-weight: 700; font-variant-numeric: tabular-nums; }
.tip .tip-head { font-weight: 700; margin-bottom: 5px; opacity: .92; }
.tip .row i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.tip .row.total { margin-top: 4px; padding-top: 4px; border-top: 1px solid rgba(255,255,255,.18); }
.tip .row { display: flex; justify-content: space-between; gap: 16px; }

/* ---------- feed ---------- */
.feed { display: flex; flex-direction: column; }
.feed-item { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: 0; }
.feed-when { color: var(--muted); font-size: 12.5px; }
.feed-q { font-weight: 600; word-break: break-word; }
.feed-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.feed-text { color: var(--ink-2); font-size: 13px; margin-top: 6px; }

/* ---------- checks ---------- */
.checks { display: flex; flex-direction: column; }
.check { display: grid; grid-template-columns: 24px 170px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.check:last-child { border-bottom: 0; }
.check .ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; }
.check.ok .ic { background: var(--green); } .check.warn .ic { background: var(--amber); } .check.fail .ic { background: var(--red); }
.check .name { font-weight: 600; }
.log { max-height: 420px; overflow: auto; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 6px 0; }
.log-line { display: grid; grid-template-columns: 124px 44px 1fr; gap: 10px; padding: 5px 14px; font-family: var(--mono); font-size: 12px; border-bottom: 1px solid #eef1f7; }
.log-line.error { color: var(--red); }
.log-line.warn { color: var(--amber); }

/* ---------- keys ---------- */
.key-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.key-row:last-child { border-bottom: 0; }
.key-slot { width: 30px; height: 30px; border-radius: 8px; background: var(--blue-50); color: var(--blue); display: grid; place-items: center; font-weight: 700; }
.key-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.key-result { margin-top: 4px; font-size: 12.5px; }
.form-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.form-row .input { flex: 1; min-width: 220px; }

/* ---------- profile ---------- */
.profile { display: flex; gap: 16px; align-items: center; }
.avatar { width: 52px; height: 52px; border-radius: 14px; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 700; flex: none; }
.avatar.sm { width: 32px; height: 32px; border-radius: 9px; font-size: 14px; }
.who { display: flex; align-items: center; gap: 10px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ---------- toast, modal ---------- */
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow); z-index: 50; max-width: 380px; }
.toast.err { background: var(--red); }
.modal-back { position: fixed; inset: 0; background: rgba(11, 31, 77, 0.35); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 460px; padding: 22px; box-shadow: 0 20px 60px rgba(11, 31, 77, 0.3); }
.modal h3 { margin: 0 0 8px; }
.modal p { color: var(--ink-2); margin: 0 0 14px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.skeleton { color: var(--muted); padding: 40px 0; text-align: center; }

/* ---------- login ---------- */
.login-body { min-height: 100vh; }
.login-split { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }

.login-side {
  position: relative; overflow: hidden; color: #fff; padding: 56px 52px;
  display: flex; flex-direction: column; justify-content: center;
  background: radial-gradient(120% 110% at 0% 0%, #1b3a8a 0%, var(--navy) 55%, #071539 100%);
}
.login-side::before, .login-side::after { content: ''; position: absolute; border-radius: 50%; }
.login-side::before { width: 520px; height: 520px; right: -190px; top: -190px; background: rgba(245, 183, 0, 0.12); }
.login-side::after { width: 340px; height: 340px; left: -120px; bottom: -140px; background: rgba(255, 255, 255, 0.06); }
.login-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 17px; color: #fff; position: relative; margin-bottom: 44px; }
.login-brand .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--yellow); color: var(--navy); display: grid; place-items: center; font-weight: 800; }
.login-brand small { display: block; font-weight: 500; font-size: 11px; color: #9fb0d8; letter-spacing: 1.2px; text-transform: uppercase; }
.login-side h1 { position: relative; margin: 0 0 26px; font-size: 34px; line-height: 1.22; letter-spacing: -0.02em; font-weight: 750; }
.login-points { position: relative; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; max-width: 420px; }
.login-points li { display: flex; align-items: flex-start; gap: 11px; color: #cfd9f2; font-size: 14.5px; line-height: 1.5; }
.login-points li span { flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; background: rgba(245, 183, 0, 0.18); border: 1px solid rgba(245, 183, 0, 0.5); position: relative; }
.login-points li span::after { content: ''; position: absolute; left: 5px; top: 4px; width: 5px; height: 9px; border: solid var(--yellow); border-width: 0 2px 2px 0; transform: rotate(42deg); }
.login-lede { position: relative; margin: 0; max-width: 420px; color: #cfd9f2; font-size: 15px; line-height: 1.6; }
.login-foot { position: relative; margin-top: 46px; font-size: 12.5px; color: #8ea1cf; letter-spacing: 0.02em; }

.login-main { display: grid; place-items: center; padding: 40px 24px; background: #fff; }
.login-card { width: 100%; max-width: 380px; }
.login-card.shake { animation: shake 0.32s; }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
.login-lock { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--blue-50); margin-bottom: 18px; }
.login-lock svg { width: 23px; height: 23px; fill: none; stroke: var(--blue); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.login-card h2 { margin: 0 0 4px; font-size: 25px; letter-spacing: -0.02em; font-weight: 750; }
.login-sub { margin: 0 0 26px; color: var(--muted); font-size: 14px; }
.login-card label { display: block; font-weight: 600; font-size: 12.5px; color: var(--ink-2); margin: 0 0 6px; }
.login-field { position: relative; margin-bottom: 16px; }
.login-field svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.login-field input { width: 100%; border: 1px solid var(--line); background: var(--soft); border-radius: 12px; padding: 13px 44px 13px 40px; font-size: 15px; transition: border-color 0.12s, background 0.12s, box-shadow 0.12s; }
.login-field input::placeholder { color: #b9c2d2; }
.login-field input:hover { background: #fff; }
.login-field input:focus { outline: 0; background: #fff; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-100); }
.login-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: transparent; border-radius: 9px; cursor: pointer; display: grid; place-items: center; }
.login-eye svg { position: static; transform: none; width: 18px; height: 18px; stroke: var(--muted); pointer-events: none; }
.login-eye:hover { background: var(--soft-2); }
.login-eye.on svg { stroke: var(--blue); }
.login-go { width: 100%; padding: 13px; border-radius: 12px; font-size: 15px; margin-top: 6px; gap: 9px; }
.login-go svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.12s; }
.login-go:hover svg { transform: translateX(3px); }
.login-card .err { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 18px; font-weight: 500; }
.login-note { color: var(--muted); font-size: 12px; margin-top: 4px; }

@media (max-width: 860px) {
  .login-split { grid-template-columns: minmax(0, 1fr); }
  .login-side { padding: 34px 26px 30px; }
  .login-side h1 { font-size: 26px; margin-bottom: 18px; }
  .login-points li:nth-child(n + 3) { display: none; }
  .login-lede { font-size: 14px; }
  .login-foot { margin-top: 24px; }
  .login-main { padding: 30px 22px 44px; }
}

/* ---------- small screens ---------- */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g21, .g3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 30; transform: translateX(-100%); transition: transform 0.2s; }
  .side.open { transform: none; }
  .top .menu-btn { display: inline-flex; }
  .top { padding: 12px 16px; flex-wrap: wrap; }
  .content { padding: 16px 16px 40px; }
  .g2, .g4 { grid-template-columns: minmax(0, 1fr); }
  .bar-row { grid-template-columns: 96px 1fr 70px; }
  .check { grid-template-columns: 24px 1fr; }
  .check .detail { grid-column: 2; }
  .feed-item { grid-template-columns: 1fr; gap: 4px; }
  .kv { grid-template-columns: 110px 1fr; }
  .table-wrap { margin: 0 -20px -18px; }
}

/* ---------- switches, site control ---------- */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #cfd6e4; border-radius: 999px; cursor: pointer; transition: background 0.15s; }
.switch span::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25); transition: transform 0.15s; }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::before { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--blue-100); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.toggle-row:last-child { border-bottom: 0; }
.danger-card { border-color: #f1b7b7; background: #fffafa; }
.danger-card::before { content: 'MAINTENANCE IS ON'; display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 1px; color: #fff; background: var(--red); padding: 3px 8px; border-radius: 6px; margin-bottom: 10px; }
textarea.input { width: 100%; resize: vertical; font: inherit; }
.limits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.limits label { display: flex; flex-direction: column; gap: 4px; }
.limits .input { width: 100%; }

/* ---------- announcements ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.form-grid .input { width: 100%; }
.form-grid .span2 { grid-column: span 2; }
.form-grid label.check { flex-direction: row; align-items: center; gap: 8px; }
.photo-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.ann-thumb { display: block; width: 100%; max-width: 220px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; margin-bottom: 8px; border: 1px solid var(--line); }
.pop-preview-back { background: #7a7a7a; border-radius: 14px; padding: 28px 18px; margin-top: 6px; display: grid; place-items: center; }
.pop-preview { position: relative; width: 100%; max-width: 380px; background: #fff; color: #0d0d0d; border-radius: 18px; overflow: hidden; box-shadow: 0 18px 48px rgba(0, 0, 0, 0.25); font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; text-align: left; }
.pop-preview .x { position: absolute; top: 10px; right: 10px; z-index: 2; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.pop-preview.has-media .x { background: rgba(255, 255, 255, 0.92); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); }
.pop-preview .x svg { width: 14px; height: 14px; fill: none; stroke: #5d5d5d; stroke-width: 2; stroke-linecap: round; }
.pop-preview .media img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.pop-preview .body { padding: 20px 20px 16px; }
.pop-preview .t { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; margin-bottom: 6px; padding-right: 22px; word-break: break-word; }
.pop-preview .b { color: #5d5d5d; font-size: 13.5px; line-height: 1.55; word-break: break-word; }
.pop-preview .b p { margin: 0 0 8px; }
.pop-preview .b ul { list-style: none; margin: 2px 0 8px; padding: 0; }
.pop-preview .b li { position: relative; padding-left: 18px; margin-bottom: 6px; }
.pop-preview .b li::before { content: ''; position: absolute; left: 3px; top: 0.6em; width: 5px; height: 5px; border-radius: 50%; background: #0d0d0d; }
.pop-preview .w { margin-top: 10px; padding: 7px 9px; background: #f7f7f8; border-radius: 8px; font-size: 11.5px; color: #5d5d5d; }
.pop-preview .acts { display: flex; justify-content: flex-end; gap: 6px; margin-top: 14px; }
.pop-preview .pb { border-radius: 999px; height: 32px; display: inline-flex; align-items: center; padding: 0 14px; font-size: 12.5px; font-weight: 600; border: 1px solid #e3e3e3; color: #0d0d0d; }
.pop-preview .pb.primary { background: #0d0d0d; border-color: #0d0d0d; color: #fff; }
.ann-actions { justify-content: flex-start; margin-top: 10px; }
@media (max-width: 820px) {
  .form-grid, .limits { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span2 { grid-column: auto; }
}

/* ---------- date & time picker ---------- */
.dtp { position: relative; }
.dtp-field { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 8px 12px; cursor: pointer; font: inherit; color: var(--ink); }
.dtp-field:hover { border-color: #cdd6e6; }
.dtp.open .dtp-field { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-100); }
.dtp-field.empty .dtp-text { color: var(--muted); }
.dtp-field svg { width: 17px; height: 17px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dtp-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dtp-x { color: var(--muted); font-size: 18px; line-height: 1; padding: 0 2px; border-radius: 6px; }
.dtp-x:hover { color: var(--red); background: var(--red-50); }
.dtp-pop { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: 302px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18); padding: 12px; }
.dtp-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.dtp-chip { border: 1px solid var(--line); background: var(--soft); border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.dtp-chip:hover { background: var(--blue-50); border-color: var(--blue-100); color: var(--blue); }
.dtp-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 13.5px; padding: 2px 2px 8px; }
.dtp-nav { width: 28px; height: 28px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.dtp-nav:hover { background: var(--soft-2); }
.dtp-nav svg { width: 16px; height: 16px; fill: none; stroke: var(--ink-2); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.dtp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dtp-dow span { text-align: center; font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding-bottom: 4px; }
.dtp-day { height: 34px; border: 0; background: transparent; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink); }
.dtp-day:hover { background: var(--soft-2); }
.dtp-day.other { color: #c2cadb; font-weight: 500; }
.dtp-day.today { box-shadow: inset 0 0 0 1.5px var(--blue-100); }
.dtp-day.on { background: var(--blue); color: #fff; }
.dtp-day.on:hover { background: var(--blue-700); }
.dtp-time { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.dtp-label { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-right: auto; }
.dtp-sel { border: 1px solid var(--line); border-radius: 8px; padding: 6px 6px; font-size: 13px; font-weight: 600; background: #fff; cursor: pointer; }
.dtp-colon { font-weight: 700; color: var(--muted); }
.dtp-foot { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.dtp-foot .grow { flex: 1; }
.dtp-foot .primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.dtp-foot .primary:hover { background: var(--blue-700); }
@media (max-width: 820px) { .dtp-pop { width: min(302px, calc(100vw - 48px)); } }

/* ---------- commands, data ---------- */
.cmd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.keep { display: flex; align-items: center; gap: 6px; }
.keep .input { width: 78px; padding: 6px 8px; }
.warn-text { color: var(--amber); font-weight: 700; }
ul.tight { margin: 8px 0 0; padding-left: 18px; }
ul.tight li { margin-bottom: 6px; }
@media (max-width: 900px) { .cmd-grid { grid-template-columns: minmax(0, 1fr); } }

.table-wrap.scroll-360 { max-height: 360px; overflow-y: auto; }

.must-change { border-color: #f3c3c3; background: #fffafa; }
.must-change h3 { color: var(--red); }

/* ---------- the research planner ---------- */

/* A fold. Used for the built-in question and for what the guard rejected -
   both worth having on the page and neither worth the room by default. */
.acc { border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); margin-top: 12px; }
.acc > summary {
  cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: 13px;
  color: var(--ink-2); list-style: none;
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary::before { content: '\25B8'; display: inline-block; width: 14px; color: var(--muted); }
.acc[open] > summary::before { transform: rotate(90deg); }
.acc > summary:hover { color: var(--blue); }
.acc .inner { padding: 0 14px 12px; border-top: 1px solid var(--line); padding-top: 12px; }

/* The template, shown as it is really sent: whitespace is part of a prompt. */
.pre {
  margin: 0; padding: 12px; border-radius: 10px; background: var(--bg);
  border: 1px solid var(--line); font: 12.5px/1.6 var(--mono);
  white-space: pre-wrap; word-break: break-word; color: var(--ink-2);
}

.stat-line { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: baseline; color: var(--ink-2); font-size: 13px; }
.stat-line > span { white-space: nowrap; }

/* ul.tight is already defined above; the numbered one is new. The plan is
   numbered because its lines are an order, not a set. */
ol.tight { margin: 8px 0 0; padding-left: 20px; }
ol.tight li { margin-bottom: 6px; color: var(--ink-2); }

/* ---- Website content editor ---- */
.csave-bar { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: rgba(255,255,255,.82); backdrop-filter: saturate(170%) blur(14px); -webkit-backdrop-filter: saturate(170%) blur(14px);
  border: 1px solid var(--line); border-radius: 14px; padding: 11px 14px 11px 18px; margin-bottom: 18px; box-shadow: var(--shadow); }
.csave-bar .cb-title { font-weight: 750; font-size: 15px; letter-spacing: -0.2px; }
.csave-bar .cb-sub { color: var(--muted); font-size: 12px; margin-top: 1px; }
.csave-bar .cb-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.csave-bar .cb-saved { color: var(--green); font-weight: 650; font-size: 13px; opacity: 0; transition: opacity .2s; }
.csave-bar .cb-saved.show { opacity: 1; }

.cpanel { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.cph { display: flex; align-items: center; gap: 13px; padding: 15px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(82,68,227,.045), transparent); }
.cph .cic { width: 36px; height: 36px; border-radius: 10px; background: var(--blue-grad); display: grid; place-items: center; flex: none; box-shadow: 0 5px 14px rgba(82,68,227,.30); }
.cph .cic svg { width: 19px; height: 19px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cph h3 { margin: 0; font-size: 15px; }
.cph p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.cph .cph-act { margin-left: auto; flex: none; }
.cpb { padding: 18px 20px; }

.cfield { display: block; margin: 0 0 14px; }
.cfield:last-child { margin-bottom: 0; }
.cfield > span { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.cpb .input { background: #fff; }
.cpb .input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(82,68,227,.14); outline: none; }

.cbox { border: 1px solid var(--line); border-radius: 13px; padding: 15px 16px; background: var(--soft); }
.cedit-list { display: flex; flex-direction: column; gap: 14px; }
.sc-rowhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.sc-rowhead > span, .sc-rowhead > b { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.sc-inline { display: inline-flex; align-items: center; gap: 8px; }
.sc-sub { margin: 18px 0 10px; font-size: 13px; color: var(--ink-2); }
.sc-plans { align-items: start; }
.sc-plan { position: relative; border-top: 3px solid var(--line); transition: border-color .15s, box-shadow .15s; }
.sc-plan.on { border-top-color: var(--blue); box-shadow: 0 6px 20px rgba(82,68,227,.12); background: #fff; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn.ghost:hover { background: var(--soft); }

/* ---- Website content: sub-tabs + single-pane layout ---- */
.ctabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.ctab { padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-weight: 600; font-size: 13px; transition: background .14s, color .14s, box-shadow .14s, border-color .14s; }
.ctab:hover { background: var(--soft); text-decoration: none; }
.ctab.on { background: var(--blue-grad); color: #fff; border-color: transparent; box-shadow: 0 5px 14px rgba(82,68,227,.28); }
.cpane { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 8px 24px 22px; }
.cgroup { padding: 20px 0; border-top: 1px solid var(--line); }
.cgroup:first-child { padding-top: 14px; border-top: none; }
.cg-title { margin: 0 0 3px; font-size: 15.5px; letter-spacing: -0.2px; }
.cg-sub { margin: 0 0 15px; color: var(--muted); font-size: 12.5px; max-width: 60ch; }
.cg-body { }
.cpane-foot { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.cadd-wrap { margin-top: 14px; }
.cbox + .cbox, .cedit-list .cbox { margin: 0; }
