/* AngelPanel: shadcn-style (zinc), dark by default; html[data-theme="light"] switches. */
:root, html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09090b; --side: #0f0f11; --panel: #09090b; --muted-bg: #18181b; --hover: #18181b;
  --border: #27272a; --row: #1c1c1f; --fg: #fafafa; --muted: #a1a1aa; --soft: #d4d4d8; --faint: #71717a;
  --primary: #fafafa; --primary-fg: #18181b; --track: #27272a; --bar: #fafafa; --ring: #52525b;
  --ok-bg: #052e22; --ok-fg: #34d399; --ok-dot: #10b981;
  --warn-bg: #2d1f05; --warn-fg: #fbbf24; --warn-dot: #f59e0b;
  --bad-bg: #3b0d0d; --bad-fg: #f87171; --bad-dot: #ef4444; --danger: #dc2626;
  --idle-bg: #18181b; --idle-fg: #a1a1aa; --idle-dot: #71717a;
  --code-bg: #111113; --overlay: rgb(0 0 0 / .6); --shadow: 0 10px 30px rgb(0 0 0 / .5);
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff; --side: #fafafa; --panel: #ffffff; --muted-bg: #f4f4f5; --hover: #f4f4f5;
  --border: #e4e4e7; --row: #f4f4f5; --fg: #09090b; --muted: #71717a; --soft: #3f3f46; --faint: #a1a1aa;
  --primary: #18181b; --primary-fg: #fafafa; --track: #f4f4f5; --bar: #18181b; --ring: #a1a1aa;
  --ok-bg: #ecfdf5; --ok-fg: #047857; --ok-dot: #10b981;
  --warn-bg: #fffbeb; --warn-fg: #b45309; --warn-dot: #f59e0b;
  --bad-bg: #fef2f2; --bad-fg: #b91c1c; --bad-dot: #ef4444; --danger: #dc2626;
  --idle-bg: #f4f4f5; --idle-fg: #52525b; --idle-dot: #a1a1aa;
  --code-bg: #fafafa; --overlay: rgb(9 9 11 / .4); --shadow: 0 10px 30px rgb(0 0 0 / .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif; font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; }
a { color: var(--fg); }
a:hover { color: var(--soft); }
h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 16px; font-weight: 600; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, "JetBrains Mono", "Cascadia Mono", Consolas, monospace; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr { position: absolute; left: -9999px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.grow { flex: 1 1 auto; }
.right { margin-left: auto; }
.stack { display: flex; flex-direction: column; gap: 6px; }

/* buttons */
.btn { height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--panel); color: var(--fg); font-weight: 500;
  cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--hover); color: var(--fg); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn.primary { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.btn.primary:hover { opacity: .9; color: var(--primary-fg); }
.btn.danger { color: var(--bad-fg); }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.icon { width: 36px; padding: 0; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }

/* inputs */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.input, select.input, textarea.input { height: 40px; border: 1px solid var(--border); border-radius: 8px;
  padding: 0 12px; background: var(--panel); color: var(--fg); font-weight: 400; width: 100%; }
textarea.input { height: auto; padding: 8px 12px; }
.input:disabled { opacity: .6; }
.input.code { letter-spacing: .3em; font-variant-numeric: tabular-nums; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }

/* shell */
.shell { display: flex; min-height: 100vh; }
.side { width: 248px; flex: none; background: var(--side); border-right: 1px solid var(--border); padding: 16px 12px;
  display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.brand img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; object-position: 50% 25%; }
.brand b { font-weight: 600; display: block; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .group { font-size: 12px; font-weight: 500; color: var(--muted); padding: 12px 8px 4px; }
.nav .group:first-child { padding-top: 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 6px; text-decoration: none;
  color: var(--soft); }
.nav a:hover { background: var(--hover); color: var(--fg); }
.nav a.on { background: var(--muted-bg); color: var(--fg); font-weight: 500; }
.nav svg { width: 16px; height: 16px; flex: none; }
.side-foot { margin-top: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--panel);
  padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 24px;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); z-index: 5; }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; }
.crumbs .sep { color: var(--faint); }
.crumbs b { font-weight: 500; }
.crumbs a { text-decoration: none; color: var(--muted); }
.top-tools { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.menu-btn { display: none; }
.content { padding: 24px; display: flex; flex-direction: column; gap: 24px; width: 100%; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.page-head .stack { gap: 4px; }

.account { position: relative; }
.account > button { height: 36px; display: inline-flex; align-items: center; gap: 8px; padding: 0 10px 0 4px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--panel); cursor: pointer; }
.avatar { width: 28px; height: 28px; border-radius: 999px; background: var(--muted-bg); display: inline-flex;
  align-items: center; justify-content: center; font-weight: 600; font-size: 12px; text-transform: uppercase; }
.role { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 8px; background: var(--muted-bg);
  color: var(--fg); }
.role.superadmin { background: var(--primary); color: var(--primary-fg); }
.dropdown { position: absolute; right: 0; top: 42px; min-width: 220px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; z-index: 20; }
.dropdown .who { padding: 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.dropdown button { width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px;
  cursor: pointer; }
.dropdown button:hover { background: var(--hover); }

/* cards, stats */
.card { border: 1px solid var(--border); border-radius: 12px; background: var(--panel); min-width: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 16px 20px;
  border-bottom: 1px solid var(--border); }
.card-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.stat { border: 1px solid var(--border); border-radius: 12px; padding: 20px; display: flex; flex-direction: column;
  gap: 6px; }
.stat .k { font-size: 13px; font-weight: 500; color: var(--muted); }
.stat .v { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.25; }
.stat .v small { font-size: 16px; color: var(--faint); font-weight: 600; }
.stat .v.mono { font-size: 20px; padding-top: 6px; }
.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.split > .wide { flex: 999 1 560px; min-width: 0; }
.split > .narrow { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.kv { display: flex; justify-content: space-between; gap: 12px; }
.kv > :first-child { color: var(--muted); }
.kv > :last-child { font-weight: 500; text-align: right; }

/* tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 10px 12px;
  border-bottom: 1px solid var(--border); white-space: nowrap; }
.t td { padding: 14px 12px; border-bottom: 1px solid var(--row); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t th:first-child, .t td:first-child { padding-left: 20px; }
.t th:last-child, .t td:last-child { padding-right: 20px; }
.t .r { text-align: right; }
.t a.name { font-weight: 500; text-decoration: none; }
.t a.name:hover { text-decoration: underline; }
.sub { font-size: 12px; color: var(--muted); }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column;
  gap: 6px; align-items: center; }
.empty b { color: var(--fg); font-weight: 500; }

/* pills, bars */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px; font-size: 12px;
  font-weight: 500; white-space: nowrap; background: var(--idle-bg); color: var(--idle-fg); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--idle-dot); }
.pill.ok { background: var(--ok-bg); color: var(--ok-fg); } .pill.ok::before { background: var(--ok-dot); }
.pill.warn { background: var(--warn-bg); color: var(--warn-fg); } .pill.warn::before { background: var(--warn-dot); }
.pill.bad { background: var(--bad-bg); color: var(--bad-fg); } .pill.bad::before { background: var(--bad-dot); }
.pill.plain::before { display: none; }
.tag { display: inline-block; border: 1px solid var(--border); border-radius: 999px; padding: 0 8px; font-size: 12px;
  font-weight: 500; }
.bar { height: 6px; background: var(--track); border-radius: 999px; margin-top: 4px; overflow: hidden; }
.bar > i { display: block; height: 6px; background: var(--bar); border-radius: 999px; }
.live { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 12px; font-size: 12px; color: var(--soft); }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--ok-dot); }
.live.off::before { background: var(--bad-dot); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; padding: 2px; background: var(--muted-bg); }
.seg button { border: 0; border-radius: 6px; padding: 4px 10px; background: transparent; color: var(--muted);
  font-size: 13px; cursor: pointer; }
.seg button.on { background: var(--panel); color: var(--fg); font-weight: 500; }

/* activity, commands */
.act { display: flex; gap: 10px; }
.act .dot { width: 8px; height: 8px; margin-top: 7px; border-radius: 999px; background: var(--idle-dot); flex: none; }
.act .dot.ok { background: var(--ok-dot); } .act .dot.warn { background: var(--warn-dot); }
.act .dot.bad { background: var(--bad-dot); }
.cmd { border-bottom: 1px solid var(--row); padding: 12px 20px; display: flex; flex-direction: column; gap: 8px; }
.cmd:last-child { border-bottom: 0; }
.cmd summary { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; cursor: pointer; list-style: none; }
.cmd summary::-webkit-details-marker { display: none; }
pre.log { margin: 0; background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px;
  font-size: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; color: var(--soft);
  max-height: 260px; overflow: auto; }
.codebox { display: flex; gap: 8px; align-items: stretch; }
.codebox code { flex: 1; min-width: 0; background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 13px; overflow-x: auto; white-space: nowrap; }
.callout { border: 1px dashed var(--border); border-radius: 10px; padding: 14px 16px; color: var(--muted); }
.callout b { color: var(--fg); font-weight: 500; }
.notice { border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; background: var(--muted-bg); }
.notice.bad { background: var(--bad-bg); color: var(--bad-fg); border-color: transparent; }
.notice.warn { background: var(--warn-bg); color: var(--warn-fg); border-color: transparent; }
.notice b:empty { display: none; }
.plain-list { margin: 6px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }

/* server settings: the servers.xml editor and its diff */
textarea.input.xml { min-height: 62vh; font-size: 12.5px; line-height: 1.55; white-space: pre; overflow: auto; tab-size: 2;
  background: var(--code-bg); resize: vertical; }
pre.diff { max-height: 360px; white-space: pre; }
pre.diff .add { color: var(--ok-fg); } pre.diff .del { color: var(--bad-fg); } pre.diff .hunk { color: var(--faint); }

/* game tables: the table list, the grid and its changed cells */
.cfg-layout { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .cfg-layout { grid-template-columns: 1fr; } }
.cfg-items { max-height: 62vh; overflow: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -6px; }
.cfg-item { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; border: 0; background: transparent;
  border-radius: 6px; padding: 6px; font-size: 12.5px; cursor: pointer; color: var(--soft); }
.cfg-item .mono { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cfg-item:hover { background: var(--muted-bg); } .cfg-item.on { background: var(--muted-bg); color: var(--fg); font-weight: 500; }
.cfg-grid { max-height: 64vh; overflow: auto; }
.cfg-grid table.t { font-size: 12px; }
.cfg-grid th, .cfg-grid td { white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; padding: 6px 10px; }
.cfg-grid thead th { position: sticky; top: 0; background: var(--panel); z-index: 2; }
.cfg-grid .sticky { position: sticky; left: 0; background: var(--panel); z-index: 1; font-weight: 500; }
.cfg-grid thead th.sticky { z-index: 3; }
.cfg-grid td.edit { cursor: text; } .cfg-grid td.edit:hover { outline: 1px solid var(--border); outline-offset: -1px; }
.o-all { background: var(--ok-bg); color: var(--ok-fg); } .o-server { background: var(--warn-bg); color: var(--warn-fg); }
.cfg-grid td.pend, .legend.pend { background: var(--bad-bg); color: var(--bad-fg); }
.legend { display: inline-block; border-radius: 4px; padding: 0 6px; margin-left: 4px; }
.cell-input { width: 100%; min-width: 120px; height: 26px; border: 1px solid var(--primary, var(--border)); border-radius: 4px;
  background: var(--code-bg); padding: 0 6px; font-size: 12px; }
.cfg-record th, .cfg-record td { white-space: normal; max-width: none; word-break: break-word; vertical-align: top; }
.cfg-record tbody th { font-weight: 500; font-size: 12px; color: var(--soft); width: 38%; text-align: left; }
.cfg-record td.edit { min-width: 160px; }
.cfg-record thead th { white-space: nowrap; }
.cfg-grid td.waiting, .legend.waiting { box-shadow: inset 0 -3px 0 var(--ring); }
.legend.waiting { background: var(--muted-bg); }
.req-item { padding: 14px 20px; border-bottom: 1px solid var(--row); display: flex; flex-direction: column; gap: 8px; }
.req-done { padding: 12px 20px; } .req-done summary { cursor: pointer; }
.nav-badge { margin-left: auto; border-radius: 999px; padding: 0 7px; font-size: 11px; line-height: 18px;
  background: var(--warn-bg); color: var(--warn-fg); }
.cfg-pending { position: sticky; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px;
  background: var(--muted-bg); border: 1px solid var(--border); }

/* provisioning rules: two equal columns, one on narrow screens */
.rules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 24px; align-items: start; }

/* rollout stages */
.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; list-style: none; padding: 0; margin: 0; }
.stages li { display: flex; flex-direction: column; gap: 6px; }
.stages .seg-bar { height: 6px; border-radius: 999px; background: var(--track); }
.stages li.done .seg-bar { background: var(--bar); }
.stages li.now .seg-bar { background: linear-gradient(90deg, var(--bar) 50%, var(--track) 50%); }

/* provider cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.pcard { border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column;
  gap: 8px; }
.pcard.dashed { border-style: dashed; }
.pcard .row b { font-weight: 600; }

/* dialogs, toasts */
.overlay { position: fixed; inset: 0; background: var(--overlay); display: flex; align-items: center;
  justify-content: center; padding: 16px; z-index: 50; }
.dialog { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 24px;
  display: flex; flex-direction: column; gap: 18px; }
.dialog.wide { max-width: 640px; }
.dialog-head { display: flex; gap: 12px; align-items: flex-start; }
.dialog-head .stack { gap: 4px; flex: 1; }
.dialog-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.tabs { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; padding: 3px; background: var(--muted-bg);
  align-self: flex-start; }
.tabs button { border: 0; border-radius: 6px; padding: 6px 12px; background: transparent; color: var(--muted);
  cursor: pointer; font-weight: 500; }
.tabs button[aria-selected="true"] { background: var(--panel); color: var(--fg); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.err { color: var(--bad-fg); font-size: 13px; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60;
  max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow);
  padding: 12px 16px; }
.toast.bad { border-color: var(--bad-dot); }
.spin { width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--fg); border-radius: 999px;
  animation: spin .8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* sign-in */
.signin { display: flex; flex-wrap: wrap; min-height: 100vh; }
.signin-art { flex: 1 1 480px; position: relative; min-height: 360px; background: #000; overflow: hidden;
  border-right: 1px solid var(--border); }
.signin-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.signin-art .shade { position: absolute; inset: 0;
  background: linear-gradient(180deg, rgb(9 9 11 / .3) 0%, rgb(9 9 11 / .15) 45%, rgb(9 9 11 / .92) 100%); }
.signin-art .words { position: absolute; left: 40px; right: 40px; bottom: 40px; display: flex; flex-direction: column;
  gap: 8px; color: #fafafa; }
.signin-art .words b { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.signin-art .words span { color: #d4d4d8; max-width: 440px; }
.signin-form { flex: 1 1 420px; display: flex; align-items: center; justify-content: center; padding: 48px 24px;
  position: relative; }
.signin-form form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 18px; }
.signin-form .theme { position: absolute; top: 20px; right: 20px; }
.signin-form .head { display: flex; flex-direction: column; gap: 6px; text-align: center; }
.qr { align-self: center; border-radius: 10px; border: 1px solid var(--border); background: #fff; padding: 6px;
  width: 200px; height: 200px; }
.qr img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }

/* narrow screens */
@media (max-width: 900px) {
  .side { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .15s;
    box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .top { padding: 12px 16px; }
  .content { padding: 16px; }
  .top-tools .search { display: none; }
  .signin-art { min-height: 240px; flex-basis: 100%; border-right: 0; border-bottom: 1px solid var(--border); }
}

/* Billing: two cards a row (one on a phone) and one-series bar charts in the panel's own ink. */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 16px; }
.chart svg.bars { display: block; width: 100%; height: auto; overflow: visible; }
.chart .bar { fill: var(--bar); }
.chart .hit { fill: transparent; }
.chart g:hover .bar { opacity: .75; }
.chart .grid { stroke: var(--row); stroke-width: 1; }
.chart .base { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
details.cmd.flat { padding: 0; gap: 0; border-bottom: 0; }
details.cmd.flat > summary.card-head { padding: 16px 20px; }

/* Analytics: the online line, retention cells shaded by their share, and spread bars (levels, VIP). */
.chart .line { stroke: var(--bar); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.t td.heat { background: color-mix(in srgb, var(--bar) calc(var(--p) * 38%), transparent); }
.spread { display: flex; flex-direction: column; gap: 8px; }
.spread-row { display: grid; grid-template-columns: 70px 1fr 110px; gap: 10px; align-items: center; }
.spread-track { height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.spread-bar { display: block; height: 100%; border-radius: 999px; background: var(--bar); }

/* Calendar: a timeline, a label column and a track per row; bars, weekly segments, notices and mail dots. */
.tl { position: relative; --tl-label: 200px; display: flex; flex-direction: column; gap: 6px; }
.tl-row { display: grid; grid-template-columns: var(--tl-label) 1fr; align-items: center; min-height: 28px; }
.tl-label { display: flex; flex-direction: column; padding-right: 12px; font-size: 13px; overflow: hidden; }
.tl-label span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-track { position: relative; height: 24px; border-radius: 6px;
  background: repeating-linear-gradient(90deg, transparent 0, transparent calc(100% / 6 - 1px), var(--row) calc(100% / 6 - 1px), var(--row) calc(100% / 6)); }
.tl-head .tl-track { background: none; height: 18px; }
.tl-tick { position: absolute; top: 0; font-size: 11px; color: var(--faint); transform: translateX(2px); }
.tl-bar { position: absolute; top: 3px; height: 18px; border-radius: 5px; background: var(--bar); color: var(--primary-fg);
  font-size: 11px; line-height: 18px; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-bar.weekly { background: color-mix(in srgb, var(--bar) 70%, transparent); border-right: 2px solid var(--panel); }
.tl-bar.over { opacity: .45; }
.tl-bar.notice { background: var(--warn-bg); color: var(--warn-fg); border: 1px solid var(--warn-dot); }
.tl-dot { position: absolute; top: 6px; width: 12px; height: 12px; margin-left: -6px; border-radius: 999px; background: var(--warn-dot); border: 2px solid var(--panel); }
.tl-dot.sent { background: var(--ok-dot); } .tl-dot.failed { background: var(--bad-dot); }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad-dot); opacity: .8; pointer-events: none; }
@media (max-width: 700px) { .tl { --tl-label: 110px; } }

/* News (the website's articles): the form beside its preview; the preview's text styled like an article */
.news-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .news-edit { grid-template-columns: minmax(0, 1fr); } }
.news-edit textarea.mono { font-size: 13px; line-height: 1.5; resize: vertical; }
.news-pic { border: 1px dashed var(--border); border-radius: 10px; padding: 8px; margin: 6px 0; max-width: 420px; }
.news-pic img { display: block; max-width: 100%; border-radius: 6px; }
.news-preview { position: sticky; top: 16px; gap: 8px; }
.news-meta { display: flex; gap: 8px; align-items: center; }
.md { line-height: 1.6; overflow-wrap: anywhere; }
.md h2, .md h3, .md h4 { margin: 18px 0 6px; }
.md p, .md ul, .md ol, .md blockquote { margin: 0 0 12px; }
.md ul, .md ol { padding-left: 22px; }
.md blockquote { border-left: 3px solid var(--border); padding-left: 12px; color: var(--muted); }
.md code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; padding: 1px 5px; border-radius: 4px; background: var(--muted-bg); }
.md img { max-width: 100%; border-radius: 8px; }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.md a { text-decoration: underline; }
