/* Namoz va Ilm — admin home. Cool slate ground, lapis navigation, turquoise for "prayed",
   brass for highlights, rose for "missed". One memorable element: the daily prayer ring. */
:root {
  --bg: #edf1f5;
  --surface: #ffffff;
  --ink: #172133;
  --muted: #5a687d;
  --line: #d5dde7;
  --side: #17305a;
  --side-ink: #d9e4f5;
  --side-muted: #8fa6c9;
  --teal: #0e7c7b;
  --teal-soft: #d4ecea;
  --brass: #a8741f;
  --brass-soft: #f3e6cc;
  --rose: #bf4b47;
  --rose-soft: #f5dcdb;
  --lapis: #2f5da8;
  --focus: #2f5da8;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1623; --surface: #162132; --ink: #e5ebf3; --muted: #94a3b7; --line: #26354c;
    --side: #0b1322; --side-ink: #d3dff0; --side-muted: #7f93b3;
    --teal: #36b3a7; --teal-soft: #173b3c; --brass: #d6a24a; --brass-soft: #3a3020;
    --rose: #e27b72; --rose-soft: #40262a; --lapis: #7aa2e3; --focus: #9cbcf0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1623; --surface: #162132; --ink: #e5ebf3; --muted: #94a3b7; --line: #26354c;
  --side: #0b1322; --side-ink: #d3dff0; --side-muted: #7f93b3;
  --teal: #36b3a7; --teal-soft: #173b3c; --brass: #d6a24a; --brass-soft: #3a3020;
  --rose: #e27b72; --rose-soft: #40262a; --lapis: #7aa2e3; --focus: #9cbcf0;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- Shell ------------------------------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }

.side {
  background: var(--side);
  color: var(--side-ink);
  padding: 22px 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 19px/1.2 var(--serif); padding: 0 8px; }
.brand-star { width: 26px; height: 26px; fill: var(--brass); flex: none; }
.side nav { display: flex; flex-direction: column; gap: 1px; }
.side nav a {
  text-decoration: none; padding: 7px 10px; border-radius: 8px; color: var(--side-ink);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.side nav a:hover { background: rgba(255, 255, 255, .07); }
.side nav a[aria-current="page"] { background: rgba(255, 255, 255, .12); font-weight: 600; }
.nav-group { margin: 14px 10px 4px; font-size: 12.5px; color: var(--side-muted); }
.pill { background: var(--brass); color: #1b1406; font-size: 12px; border-radius: 999px; padding: 0 7px; font-weight: 700; }
.logout { margin-top: auto; padding: 0 8px; }
.logout button {
  width: 100%; background: transparent; color: var(--side-muted); border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px; padding: 7px; font: inherit; cursor: pointer;
}
.logout button:hover { color: var(--side-ink); }

.main { padding: 26px clamp(16px, 3vw, 40px) 48px; max-width: 1480px; width: 100%; }

/* --- Header ------------------------------------------------------------------------------------ */
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 22px; }
.top h1 { font: 600 clamp(24px, 2.6vw, 32px)/1.15 var(--serif); margin: 0; letter-spacing: -.01em; }
.sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.controls { display: flex; gap: 10px; align-items: center; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button {
  border: 0; background: transparent; color: var(--muted); font: 500 14px var(--sans);
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
}
.seg button[aria-checked="true"] { background: var(--ink); color: var(--surface); }
.theme {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--ink);
}
.theme svg { width: 18px; height: 18px; fill: currentColor; }

/* --- Hero: prayer ring + key numbers --------------------------------------------------------------- */
.hero {
  display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: clamp(16px, 3vw, 36px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  padding: clamp(16px, 2.4vw, 28px); margin-bottom: 18px;
}
.ring-wrap { display: flex; flex-direction: column; align-items: center; }
#ring { width: 100%; max-width: 360px; height: auto; overflow: visible; }
#ring .dial { fill: none; stroke: var(--line); stroke-width: 18; }
#ring .night { fill: none; stroke: var(--lapis); stroke-opacity: .18; stroke-width: 18; }
#ring .day { fill: none; stroke: var(--brass); stroke-opacity: .28; stroke-width: 18; }
#ring .tick { stroke: var(--muted); stroke-width: 1; opacity: .5; }
#ring .hour { fill: var(--muted); font-size: 10px; text-anchor: middle; dominant-baseline: middle; }
#ring .rate-bg { fill: none; stroke: var(--line); stroke-width: 6; stroke-linecap: round; }
#ring .rate { fill: none; stroke: var(--teal); stroke-width: 6; stroke-linecap: round; }
#ring .dot { fill: var(--surface); stroke: var(--ink); stroke-width: 2.5; }
#ring .dot.next { fill: var(--brass); stroke: var(--brass); }
#ring .plabel { font: 600 12px var(--sans); fill: var(--ink); text-anchor: middle; dominant-baseline: middle; }
#ring .ptime { font: 11px var(--sans); fill: var(--muted); text-anchor: middle; dominant-baseline: middle; }
#ring .hand { stroke: var(--rose); stroke-width: 2.5; stroke-linecap: round; opacity: .85; }
#ring .hub { fill: var(--rose); }
#ring .c-label { font: 13px var(--sans); fill: var(--muted); text-anchor: middle; }
#ring .c-name { font: 600 24px var(--serif); fill: var(--ink); text-anchor: middle; }
#ring .c-time { font: 13px var(--sans); fill: var(--muted); text-anchor: middle; }
.ring-note { margin: 6px 0 0; color: var(--muted); font-size: 13px; text-align: center; max-width: 34ch; }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; align-content: center; }
.kpi { padding: 18px clamp(12px, 2vw, 24px); border-left: 1px solid var(--line); }
.kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
.kpi h3 { margin: 0; font: 500 14px var(--sans); color: var(--muted); }
.kpi .num { font: 600 clamp(34px, 4vw, 48px)/1.05 var(--serif); margin: 6px 0 4px; letter-spacing: -.02em; }
.kpi .num small { font: 500 15px var(--sans); color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.kpi .meta { color: var(--muted); font-size: 13.5px; }
.delta { display: inline-block; font-weight: 600; border-radius: 6px; padding: 0 6px; margin-right: 6px; }
.delta.up { color: var(--teal); background: var(--teal-soft); }
.delta.down { color: var(--rose); background: var(--rose-soft); }
.delta.flat { color: var(--muted); background: var(--bg); }
.kpi svg.spark { display: block; width: 100%; height: 34px; margin-top: 8px; }
.spark path { fill: none; stroke: var(--teal); stroke-width: 1.6; }
.spark .area { fill: var(--teal); fill-opacity: .1; stroke: none; }

/* --- Panels ---------------------------------------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
.panel {
  grid-column: span 2; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px 20px; min-width: 0;
}
.panel.wide { grid-column: span 4; }
.panel.half { grid-column: span 3; }
.panel.full { grid-column: 1 / -1; }
.panel > header { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel h2 { margin: 0; font: 600 19px/1.25 var(--serif); }
.panel > header p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; flex-basis: 100%; }
.more { font-size: 13.5px; color: var(--lapis); text-decoration: none; white-space: nowrap; }
.more:hover { text-decoration: underline; }

.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.k::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.k-reg::before { background: var(--brass); }
.k-act::before { background: var(--teal); }
.k-ok::before { background: var(--teal); }
.k-miss::before { background: var(--rose); }

.chart svg { display: block; width: 100%; height: 230px; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .line-act { fill: none; stroke: var(--teal); stroke-width: 2.2; stroke-linejoin: round; }
.chart .area-act { fill: var(--teal); fill-opacity: .1; }
.chart .bar-reg { fill: var(--brass); fill-opacity: .75; }
.chart .bar-ok { fill: var(--teal); }
.chart .bar-miss { fill: var(--rose); }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .guide { stroke: var(--muted); stroke-dasharray: 3 3; }
.empty { color: var(--muted); font-size: 14px; padding: 28px 0; text-align: center; }

/* Horizontal bars (regions, qaza) */
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.bars li { display: grid; grid-template-columns: minmax(84px, 9.5em) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13.5px; }
.bars .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .track { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.bars .fill { height: 100%; background: var(--lapis); border-radius: inherit; }
.bars.qaza .fill { background: var(--brass); }
.bars .val { color: var(--muted); min-width: 3ch; text-align: right; }
#regions { margin-top: 16px; }
.foot { color: var(--muted); font-size: 13.5px; margin: 14px 0 0; }

/* Gender split */
.split { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--bg); }
.split .m { background: var(--lapis); }
.split .f { background: var(--teal); }
.split-legend { display: flex; justify-content: space-between; font-size: 13.5px; margin-top: 8px; color: var(--muted); }
.split-legend b { color: var(--ink); font-weight: 600; }

/* Funnel: widths are the share of users who reached each step */
.funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.funnel li { position: relative; padding: 9px 12px; border-radius: 8px; background: var(--bg); overflow: hidden; }
.funnel .fill { position: absolute; inset: 0 auto 0 0; background: var(--teal-soft); }
.funnel .row { position: relative; display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.funnel b { font: 600 18px var(--serif); }

/* Big figures inside small panels */
.figure { display: flex; align-items: baseline; gap: 10px; margin: 2px 0 12px; }
.figure .n { font: 600 40px/1 var(--serif); }
.figure .l { color: var(--muted); font-size: 14px; }
.meter { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--teal); }

/* Status lists */
.status { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.status li { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.status .state { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.status .state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ok { color: var(--teal); }
.warn { color: var(--brass); }
.bad { color: var(--rose); }
.status .muted { color: var(--muted); font-weight: 400; }

/* Lists: tickets, broadcasts */
.list { list-style: none; margin: 0; padding: 0; }
.list li + li { border-top: 1px solid var(--line); }
.list a { display: grid; gap: 3px; padding: 11px 2px; text-decoration: none; }
.list a:hover .title { text-decoration: underline; }
.list .title { font-weight: 600; display: flex; justify-content: space-between; gap: 10px; }
.list .title time { color: var(--muted); font-weight: 400; font-size: 13px; white-space: nowrap; }
.list .body { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.progress { height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; display: flex; margin-top: 4px; }
.progress .s { background: var(--teal); }
.progress .f { background: var(--rose); }
.progress .b { background: var(--muted); opacity: .5; }
.tag { font-size: 12.5px; border-radius: 6px; padding: 1px 7px; font-weight: 600; }
.tag.done { background: var(--teal-soft); color: var(--teal); }
.tag.sending, .tag.scheduled { background: var(--brass-soft); color: var(--brass); }
.tag.cancelled, .tag.draft { background: var(--bg); color: var(--muted); }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--muted); padding: 0 10px 8px 0; border-bottom: 1px solid var(--line); }
td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td a { text-decoration: none; font-weight: 600; }
td a:hover { text-decoration: underline; }
td.muted { color: var(--muted); }

/* Tooltip */
.tip {
  position: fixed; z-index: 10; pointer-events: none; background: var(--ink); color: var(--surface);
  font-size: 13px; padding: 6px 9px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px));
}

/* --- Responsive ------------------------------------------------------------------------------ */
@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel, .panel.half { grid-column: span 1; }
  .panel.wide { grid-column: span 2; }
  .panel.full { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 12px 16px; gap: 10px; }
  .side nav { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .side nav a { white-space: nowrap; }
  .nav-group { display: none; }
  .logout { display: none; }
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .panel, .panel.half, .panel.wide, .panel.full { grid-column: span 1; }
  .kpis { grid-template-columns: 1fr; }
  .kpi { border-left: 0; }
  .kpi:nth-child(n+2) { border-top: 1px solid var(--line); }
  .top { align-items: flex-start; }
}
@media (prefers-reduced-motion: no-preference) {
  #ring .hand { transition: transform .6s ease; }
}

/* ============================ Panel pages ============================ */
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 20; }
.skip:focus { left: 8px; }
.who { color: var(--side-muted); font-size: 13px; margin: 0 0 8px; overflow: hidden; text-overflow: ellipsis; }
.theme.floating { position: fixed; right: 18px; bottom: 18px; z-index: 5; box-shadow: 0 2px 10px rgba(0, 0, 0, .12); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font: 600 clamp(24px, 2.4vw, 30px)/1.2 var(--serif); margin: 2px 0 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head .sub { max-width: 80ch; }
.back { font-size: 13.5px; color: var(--lapis); text-decoration: none; }
.back::before { content: "‹ "; }
.back:hover { text-decoration: underline; }

.flash { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.flash li { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.flash-success { border-color: var(--teal) !important; background: var(--teal-soft) !important; }
.flash-error { border-color: var(--rose) !important; background: var(--rose-soft) !important; }
.flash-info { border-color: var(--brass) !important; background: var(--brass-soft) !important; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 500 14px var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--rose); border-color: var(--rose); background: transparent; }
.btn.danger:hover { background: var(--rose-soft); }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.wide { width: 100%; }

/* Filters and tabs */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filters input[type="search"] { flex: 1 1 260px; }
input[type="text"], input[type="search"], input[type="password"], input[type="number"], input[type="url"],
input[type="time"], input[type="datetime-local"], select, textarea {
  font: 14.5px/1.4 var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 11px; min-height: 38px; max-width: 100%;
}
textarea { width: 100%; resize: vertical; min-height: 80px; }
textarea[dir="rtl"] { font-size: 20px; line-height: 1.8; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
input.compact { min-height: 32px; padding: 4px 8px; width: 150px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 12px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 14px; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--teal); font-weight: 600; }
.tabs a:hover { color: var(--ink); }

/* Tables */
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush table { margin: 0; }
.panel.flush th, .panel.flush td { padding-left: 16px; }
.panel.flush th { padding-top: 12px; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.ok, b.ok, .ok { color: var(--teal); }
td.bad, b.bad, span.bad { color: var(--rose); }
td.warn { color: var(--brass); }
td .btn { vertical-align: middle; }
.small { font-size: 12.5px; }
.muted { color: var(--muted); }
.tag.bad { background: var(--rose-soft); color: var(--rose); }

/* Lists */
.list.padded > li > a, .list.padded > li.empty { padding-left: 18px; padding-right: 18px; }
.list .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 2px; font-size: 14px; }
.list .row time { color: var(--muted); font-size: 13px; white-space: nowrap; }
.list .empty { padding: 22px 0; }
ul.sources { list-style: none; padding: 6px 0 0; margin: 0; font-size: 12.5px; color: var(--muted); display: grid; gap: 3px; }
details summary { cursor: pointer; }

/* Forms */
.panel.form { max-width: 820px; display: grid; gap: 16px; }
.main > .panel, .main > form.panel, .main > section.panel, .main > details.panel { margin-bottom: 18px; }
.field { display: grid; gap: 6px; }
.field > label, legend { font-weight: 600; font-size: 14px; }
.field .opt { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.field.check { display: flex; align-items: center; gap: 8px; }
.field.check label { font-weight: 500; }
.field input[type="text"], .field input[type="url"], .field input[type="number"], .field select { width: 100%; }
.help { margin: 0; color: var(--muted); font-size: 13px; }
.form-error { margin: 0; color: var(--rose); font-size: 13.5px; font-weight: 500; }
.has-error input, .has-error textarea, .has-error select { border-color: var(--rose); }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.radios { display: flex; flex-wrap: wrap; gap: 8px; }
.radios label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 14px; }
.radios label:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions .push { margin-left: auto; }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; color: var(--muted); font-size: 14px; }

/* Facts (definition list) */
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* Ticket thread */
.thread { display: grid; gap: 12px; margin-bottom: 18px; max-width: 820px; }
.msg { border-radius: 12px; padding: 12px 14px; max-width: 640px; }
.msg p { margin: 0 0 6px; }
.msg.user { background: var(--bg); }
.msg.admin { background: var(--teal-soft); justify-self: end; }
.msg .who { color: var(--muted); font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Broadcast composer and Telegram-like preview */
.compose { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.compose > .panel { grid-column: auto; max-width: none; }
.preview { position: sticky; top: 20px; }
.preview h2 { margin: 0 0 12px; font: 600 17px var(--serif); }
.tg { background: var(--bg); border-radius: 12px; padding: 14px; }
.bubble { background: var(--surface); border-radius: 12px 12px 12px 4px; padding: 10px 12px; font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere; }
.bubble p { margin: 0 0 8px; font-weight: 600; }
.bubble a { color: var(--lapis); }
.tg-buttons { display: grid; gap: 4px; margin-top: 6px; }
.tg-buttons span { background: var(--surface); border-radius: 8px; text-align: center; padding: 7px; font-size: 13.5px; color: var(--lapis); }

/* Stats row */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; padding: 0; margin-bottom: 14px; overflow: hidden; }
.stats-row > div { padding: 14px 18px; border-left: 1px solid var(--line); }
.stats-row > div:first-child { border-left: 0; }
.stats-row .label { margin: 0; color: var(--muted); font-size: 13.5px; }
.stats-row .big { margin: 4px 0 0; font: 600 30px/1.1 var(--serif); }
.big-progress { height: 10px; margin-bottom: 18px; }
.defaults { margin-top: 18px; }
.defaults h3 { font-size: 14px; margin: 14px 0 4px; }
.defaults ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; display: grid; gap: 4px; }

/* Login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--side); }
.login-card { width: min(380px, 100%); background: var(--surface); border-radius: 18px; padding: 28px 26px; display: grid; gap: 4px; }
.login-card h1 { font: 600 26px var(--serif); margin: 6px 0 0; }
.login-card form { display: grid; gap: 8px; margin-top: 14px; }
.login-card label { font-weight: 600; font-size: 14px; margin-top: 6px; }
.login-card input { width: 100%; }
.login-card .btn { margin-top: 12px; }
.login-star { width: 34px; height: 34px; fill: var(--brass); }

@media (max-width: 1000px) {
  .compose { grid-template-columns: 1fr; }
  .preview { position: static; }
}
