/* HostDesk — compact admin UI. Light by default, dark via [data-theme="dark"]. */
:root {
  --bg: #EEF2F0;
  --surface: #FFFFFF;
  --surface-2: #F5F8F6;
  --line: #DFE6E3;
  --line-2: #EBF0EE;
  --ink: #14231F;
  --ink-2: #4A5B56;
  --ink-3: #7D8C87;
  --accent: #0E7C66;
  --accent-hover: #0B6853;
  --accent-ink: #FFFFFF;
  --accent-soft: #DCF0EA;

  --domain: #5B4BDB;   --domain-soft: #ECE9FC;
  --hosting: #0E7C66;  --hosting-soft: #DCF0EA;
  --ssl: #A86B12;      --ssl-soft: #FBEFD9;
  --email: #2A72AE;    --email-soft: #E1EDF8;
  --other: #66727A;    --other-soft: #ECEFF1;
  --free: #C0407A;     --free-soft: #FBE5EF;

  --bad: #C9372C;   --bad-soft: #FCE7E5;
  --warn: #C05A00;  --warn-soft: #FFEBD8;
  --soon: #8A6D00;  --soon-soft: #FFF4C7;
  --ok: #1E8656;    --ok-soft: #E0F3E9;

  --horizon-bg: #14231F;
  --horizon-ink: #E6F0EC;
  --horizon-line: rgba(230, 240, 236, .14);

  --r-sm: 6px;
  --r: 9px;
  --r-lg: 14px;
  --shadow: 0 1px 2px rgba(20, 35, 31, .05), 0 6px 20px -12px rgba(20, 35, 31, .18);
  --f-body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-display: "Bricolage Grotesque", "Geist", system-ui, sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0C1412;
  --surface: #131D1A;
  --surface-2: #19241F;
  --line: #25322E;
  --line-2: #1E2A26;
  --ink: #E3ECE8;
  --ink-2: #A7B6B1;
  --ink-3: #6F807A;
  --accent: #35C29F;
  --accent-hover: #4BD4B1;
  --accent-ink: #05201A;
  --accent-soft: rgba(53, 194, 159, .14);

  --domain: #A59BFF;   --domain-soft: rgba(165, 155, 255, .14);
  --hosting: #35C29F;  --hosting-soft: rgba(53, 194, 159, .14);
  --ssl: #E7B35A;      --ssl-soft: rgba(231, 179, 90, .14);
  --email: #6FB2EE;    --email-soft: rgba(111, 178, 238, .14);
  --other: #9AA6AD;    --other-soft: rgba(154, 166, 173, .14);
  --free: #F084B5;     --free-soft: rgba(240, 132, 181, .14);

  --bad: #FF7A6E;   --bad-soft: rgba(255, 122, 110, .13);
  --warn: #FFA24D;  --warn-soft: rgba(255, 162, 77, .13);
  --soon: #E9CB4F;  --soon-soft: rgba(233, 203, 79, .12);
  --ok: #58D08F;    --ok-soft: rgba(88, 208, 143, .12);

  --horizon-bg: #0F2A23;
  --horizon-ink: #E3ECE8;
  --horizon-line: rgba(227, 236, 232, .12);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -14px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 400 13px/1.45 var(--f-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-display); margin: 0; letter-spacing: -.015em; }
.ic { flex: none; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.inline { display: inline; margin: 0; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hide { display: none !important; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 14px 10px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--horizon-bg); color: var(--accent-soft);
  font: 700 13px var(--f-display); letter-spacing: .02em;
}
[data-theme="dark"] .brand-mark { background: var(--accent); color: var(--accent-ink); }
.brand-logo { width: 32px; height: 32px; object-fit: contain; border-radius: 8px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font: 700 14px var(--f-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--ink-3); font-size: 11.5px; }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a {
  display: flex; align-items: center; gap: 10px; height: 33px; padding: 0 10px;
  color: var(--ink-2); border-radius: 8px; font-weight: 500; position: relative;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.nav a.on::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav a span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav em {
  font-style: normal; font-size: 11px; font-weight: 600; min-width: 20px; height: 18px; padding: 0 6px;
  border-radius: 9px; display: grid; place-items: center; background: var(--soon-soft); color: var(--soon);
}
.nav em.bad { background: var(--bad-soft); color: var(--bad); }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.cron { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-3); padding: 7px 10px; border-radius: 8px; background: var(--surface-2); }
.cron i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; }
.cron.ok i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.cron.off i { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.cron:hover { text-decoration: none; color: var(--ink-2); }
.me { display: flex; align-items: center; gap: 9px; padding: 8px 4px 0 6px; border-top: 1px solid var(--line-2); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); font-size: 11px; font-weight: 600; color: var(--ink-2); flex: none; }
.me-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.me-text strong { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px; padding: 10px 22px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-2);
}
.top h1 { font-size: 20px; font-weight: 700; white-space: nowrap; }
.search { margin-left: auto; position: relative; display: flex; align-items: center; }
.search .ic { position: absolute; left: 10px; color: var(--ink-3); pointer-events: none; }
.search input { width: 240px; height: 32px; padding: 0 10px 0 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.content { padding: 18px 22px 40px; max-width: 1360px; width: 100%; }
.only-m { display: none; }
.scrim { display: none; }

/* theme toggle */
#themeBtn .i-moon { display: none; }
[data-theme="dark"] #themeBtn .i-moon { display: block; }
[data-theme="dark"] #themeBtn .i-sun { display: none; }

/* ---------- buttons ---------- */
.btn, .btn-icon {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 500 13px var(--f-body);
  cursor: pointer; white-space: nowrap; text-decoration: none; list-style: none;
}
.btn:hover, .btn-icon:hover { background: var(--surface-2); text-decoration: none; border-color: color-mix(in srgb, var(--line) 60%, var(--ink-3)); }
.btn-icon { width: 32px; padding: 0; }
.btn-icon.ghost { border-color: transparent; background: transparent; color: var(--ink-3); }
.btn-icon.ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: var(--bad-soft); }
.btn-wa { color: #128C4A; }
[data-theme="dark"] .btn-wa { color: #4ED98A; }
.btn-sm { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn-sm.btn-icon, .btn-icon.btn-sm { width: 26px; padding: 0; }
.btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.btns.end { justify-content: flex-end; }
summary::-webkit-details-marker { display: none; }

.menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px; z-index: 30;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 5px; box-shadow: var(--shadow);
}
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 9px; border-radius: 7px; color: var(--ink); font: inherit; background: none; border: 0; cursor: pointer; text-align: left; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); text-decoration: none; }
.menu-pop .ic { color: var(--ink-3); }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; }
.ph { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.ph h2 { font-size: 14.5px; font-weight: 650; }
.ph .sub { color: var(--ink-3); font-size: 12px; }
.ph .btns { margin-left: auto; }
.pb { padding: 14px; }
.pb-0 { padding: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.g-side { grid-template-columns: 300px minmax(0, 1fr); }
.empty { padding: 28px 16px; text-align: center; color: var(--ink-3); }
.empty strong { display: block; color: var(--ink); font-size: 14px; margin-bottom: 4px; }
.empty .btn { margin-top: 10px; }

/* ---------- ledger (kpi strip) ---------- */
.ledger { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.ledger > div { padding: 12px 16px; border-left: 1px solid var(--line-2); min-width: 0; }
.ledger > div:first-child { border-left: 0; }
.ledger .k { font-size: 12px; color: var(--ink-3); }
.ledger .v { font: 700 24px/1.15 var(--f-display); letter-spacing: -.02em; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ledger .s { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ledger .v.bad { color: var(--bad); }
.ledger .v.warn { color: var(--warn); }

/* ---------- renewal horizon (the dashboard's signature element) ---------- */
.horizon { background: var(--horizon-bg); color: var(--horizon-ink); border-radius: 18px; padding: 16px 18px 14px; position: relative; overflow: hidden; }
.hz-head { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.hz-head h2 { font-size: 22px; font-weight: 750; letter-spacing: -.025em; }
.hz-head p { margin: 2px 0 0; opacity: .66; font-size: 12.5px; }
.hz-zones { margin-left: auto; display: flex; gap: 22px; }
.hz-zones div { line-height: 1.1; }
.hz-zones b { display: block; font: 700 22px var(--f-display); }
.hz-zones span { font-size: 11.5px; opacity: .64; }
.hz-zones .z-bad b { color: #FF8A7E; }
.hz-zones .z-warn b { color: #FFB561; }
.hz-zones .z-soon b { color: #F0D46A; }
.hz-track { position: relative; margin-top: 16px; height: var(--hz-h, 96px); border-top: 1px solid var(--horizon-line); border-bottom: 1px solid var(--horizon-line); }
.hz-past { position: absolute; top: 0; bottom: 0; left: 0; background: repeating-linear-gradient(135deg, rgba(255, 122, 110, .10) 0 6px, transparent 6px 12px); border-right: 1.5px solid rgba(255, 138, 126, .7); }
.hz-tick { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--horizon-line); }
.hz-tick span { position: absolute; bottom: -19px; left: 0; transform: translateX(-50%); font-size: 11px; opacity: .6; white-space: nowrap; }
.hz-now span { opacity: 1; color: #FF8A7E; font-weight: 600; }
.hz-dot {
  position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: var(--c, #9FE3CF); border: 2px solid var(--horizon-bg); box-shadow: 0 0 0 1px rgba(255, 255, 255, .25);
  transition: transform .12s ease;
}
.hz-dot:hover, .hz-dot:focus-visible { transform: scale(1.5); z-index: 3; text-decoration: none; }
.hz-dot.free { background: transparent; box-shadow: inset 0 0 0 2px var(--c); }
.hz-dot::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: #fff; color: #14231F; font-size: 11.5px; line-height: 1.35; padding: 5px 8px; border-radius: 6px;
  white-space: pre; pointer-events: none; opacity: 0; transition: opacity .12s; box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}
.hz-dot:hover::after, .hz-dot:focus-visible::after { opacity: 1; }
.hz-foot { display: flex; gap: 14px; margin-top: 28px; font-size: 11.5px; opacity: .72; flex-wrap: wrap; }
.hz-foot i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.hz-foot i.o { background: transparent; box-shadow: inset 0 0 0 2px #9FE3CF; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 500; font-size: 11.5px; color: var(--ink-3); padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
.tbl td { padding: 7px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl .act { text-align: right; white-space: nowrap; width: 1%; }
.tbl .act .btns { justify-content: flex-end; flex-wrap: nowrap; }
.tbl a.strong, .strong { font-weight: 600; color: var(--ink); }
.tbl a.strong:hover { color: var(--accent); }
.cell-2 { display: flex; flex-direction: column; line-height: 1.25; }
.cell-2 small { color: var(--ink-3); font-size: 11.5px; }
.who { display: flex; align-items: center; gap: 9px; }
.who .avatar { width: 26px; height: 26px; font-size: 10.5px; }
tr.row-dim td { opacity: .6; }

/* ---------- chips, tags, life bar ---------- */
.chip { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px; font-size: 11.5px; font-weight: 550; white-space: nowrap; }
.c-ok { background: var(--ok-soft); color: var(--ok); }
.c-soon { background: var(--soon-soft); color: var(--soon); }
.c-warn { background: var(--warn-soft); color: var(--warn); }
.c-bad { background: var(--bad-soft); color: var(--bad); }
.c-mute { background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 19px; padding: 0 6px; border-radius: 5px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.t-domain { background: var(--domain-soft); color: var(--domain); }
.t-hosting { background: var(--hosting-soft); color: var(--hosting); }
.t-ssl { background: var(--ssl-soft); color: var(--ssl); }
.t-email { background: var(--email-soft); color: var(--email); }
.t-other { background: var(--other-soft); color: var(--other); }
.t-free { background: var(--free-soft); color: var(--free); }
.t-internal { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.life { display: inline-block; width: 46px; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; vertical-align: middle; margin-right: 8px; }
.life i { display: block; height: 100%; border-radius: 2px; background: var(--ok); }
.life.soon i { background: var(--soon); }
.life.warn i { background: var(--warn); }
.life.bad i { background: var(--bad); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }

/* ---------- tabs & filters ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.tabs a { padding: 4px 10px; border-radius: 6px; color: var(--ink-2); font-weight: 500; font-size: 12.5px; white-space: nowrap; }
.tabs a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.tabs a.on { background: var(--ink); color: var(--surface); }
[data-theme="dark"] .tabs a.on { background: var(--accent); color: var(--accent-ink); }
.tabs a b { font-weight: 600; opacity: .55; margin-left: 4px; font-size: 11.5px; }
.toolbar select, .toolbar input { height: 32px; }

/* ---------- forms ---------- */
.form { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px 14px; }
.f { grid-column: span 6; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f.w-12 { grid-column: span 12; }
.f.w-4 { grid-column: span 4; }
.f.w-3 { grid-column: span 3; }
.f.w-8 { grid-column: span 8; }
.f > label, .f > .lbl { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.f .hint { font-size: 11.5px; color: var(--ink-3); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], input[type=tel], input[type=search], select, textarea {
  width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: inherit;
}
textarea { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=color] { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.sep { grid-column: span 12; border: 0; border-top: 1px solid var(--line-2); margin: 4px 0; }
.form-h { grid-column: span 12; font: 650 13.5px var(--f-display); margin-top: 4px; }
.check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 13px; color: var(--ink); }
.check input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.check small { display: block; color: var(--ink-3); font-size: 11.5px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); font-weight: 500; }
.seg input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 14px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* ---------- flash ---------- */
.flash { display: flex; align-items: flex-start; gap: 9px; padding: 9px 12px; border-radius: 10px; margin-bottom: 12px; font-weight: 500; border: 1px solid transparent; }
.flash span { flex: 1; }
.f-ok { background: var(--ok-soft); color: var(--ok); }
.f-err { background: var(--bad-soft); color: var(--bad); }
.f-info { background: var(--accent-soft); color: var(--accent); }
.flash-x { background: none; border: 0; color: inherit; cursor: pointer; opacity: .6; padding: 0; }

/* ---------- misc blocks ---------- */
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 7px 10px; font-size: 12.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.chart-box { position: relative; height: 230px; }
.chart-box.sm { height: 190px; }
.bar-list { display: flex; flex-direction: column; gap: 9px; }
.bar-list .bl-row { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; font-size: 12.5px; }
.bar-list .bl-bar { grid-column: span 2; height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; }
.bar-list .bl-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.acc-card { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: 14px; display: flex; flex-direction: column; gap: 10px; border-top: 3px solid var(--acc, var(--accent)); }
.acc-card h3 { font-size: 15px; font-weight: 650; }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.meter { height: 7px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--acc, var(--accent)); border-radius: 4px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.feed li:last-child { border-bottom: 0; }
.feed time { color: var(--ink-3); white-space: nowrap; margin-left: auto; font-size: 11.5px; }
.profile-head { display: flex; align-items: center; gap: 12px; }
.profile-head .avatar { width: 44px; height: 44px; font-size: 15px; background: var(--accent-soft); color: var(--accent); border: 0; }
.profile-head h2 { font-size: 18px; }
.item-rows td { padding: 5px 6px; }
.item-rows input { height: 32px; }
.totals { margin-left: auto; width: 280px; display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; font-size: 13px; }
.totals .grand { font: 700 18px var(--f-display); padding-top: 6px; border-top: 1px solid var(--line); }
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--surface); color: var(--ink); width: min(420px, 94vw); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(10, 20, 17, .45); }
.placeholders { display: flex; flex-wrap: wrap; gap: 5px; }
.placeholders code { font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; cursor: pointer; }
.placeholders code:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- auth screens ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px; box-shadow: var(--shadow); }
.auth-card.wide { width: min(640px, 100%); }
.auth-card h1 { font-size: 24px; font-weight: 750; margin: 14px 0 4px; }
.auth-card p.lead { color: var(--ink-3); margin: 0 0 18px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .ledger { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ledger > div:nth-child(4) { border-left: 0; }
  .ledger > div:nth-child(n+4) { border-top: 1px solid var(--line-2); }
  .g-main, .g-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; width: 250px; transform: translateX(-100%); transition: transform .2s ease; }
  .app.nav-open .side { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(10, 20, 17, .4); z-index: 40; }
  .only-m { display: inline-flex; }
  .search { display: none; }
  .top { padding: 10px 14px; }
  .top h1 { font-size: 17px; }
  .content { padding: 14px; }
  .g-2, .g-side { grid-template-columns: minmax(0, 1fr); }
  .f, .f.w-3, .f.w-4, .f.w-8 { grid-column: span 12; }
  .hz-zones { margin-left: 0; }
  .top-actions .btn span { display: none; }
}
@media (max-width: 560px) {
  .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger > div:nth-child(odd) { border-left: 0; }
  .ledger > div:nth-child(4) { border-left: 1px solid var(--line-2); }
  .ledger > div:nth-child(n+3) { border-top: 1px solid var(--line-2); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
.menu-pop form { display: block; }
.menu-pop button span { flex: 1; }
details.tpl { border-bottom: 1px solid var(--line-2); }
details.tpl:last-child { border-bottom: 0; }
details.tpl > summary { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; list-style: none; }
details.tpl > summary:hover { background: var(--surface-2); }
details.tpl > summary .strong { flex: 0 0 auto; }
details.tpl > summary .muted { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details.tpl[open] > summary { border-bottom: 1px solid var(--line-2); background: var(--surface-2); }
.run-log { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.run-log li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.run-log li:last-child { border-bottom: 0; }
.g-settings { grid-template-columns: 200px minmax(0, 1fr); align-items: start; }
.panel .nav a.on::before { display: none; }
@media (max-width: 900px) { .g-settings { grid-template-columns: minmax(0, 1fr); } .g-settings > nav { position: static !important; } }

.search input[type=search] { padding-left: 32px; }
.seg label { position: relative; }
