/* AI Account Manager panel: styled after the Binary Computer hosting panel (dark sidebar, white top bar,
   count pills, gradient stat tiles). No inline styles anywhere: the Content-Security-Policy forbids them. */
:root {
  --side-bg: #0f1a2b;
  --side-text: #e4e9f1;
  --side-muted: #7d889b;
  --side-hover: #18263b;
  --bg: #f1f3f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e3e6eb;
  --green: #28a745;
  --green-dark: #218838;
  --green-soft: #e3f5e8;
  --blue: #3b6fe0;
  --purple: #7c6cf0;
  --orange: #f08c2e;
  --red: #e5484d;
  --red-soft: #fdecec;
  --amber-soft: #fdf3e1;
  --amber-text: #8a5300;
  --pink-code: #d63384;
  --gray-btn: #6c757d;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --side-w: 220px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", sans-serif;
}
a { color: var(--green); }
code { font: .85em ui-monospace, SFMono-Regular, Consolas, monospace; }
h1, h2, h3 { margin: 0; }
.icon { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* -- shell ------------------------------------------------------------------- */
/* The page background paints the sidebar column too, so it stays navy below the sticky sidebar. */
.app { display: flex; min-height: 100vh; background: linear-gradient(to right, var(--side-bg) var(--side-w), var(--bg) var(--side-w)); }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.sidebar {
  position: sticky; top: 0; height: 100vh; width: var(--side-w); flex: none;
  display: flex; flex-direction: column; overflow-y: auto;
  background: var(--side-bg); color: var(--side-text); padding: 0 8px 12px;
}
.side-brand {
  display: flex; align-items: center; gap: 10px; padding: 14px 8px 16px; margin: 0 -8px 6px;
  color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.side-brand .logo {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 7px;
  background: var(--green); color: #fff; flex: none;
}
.side-brand .logo .icon { width: 22px; height: 22px; }
.side-brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.side-brand-text strong { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-brand-text small { color: var(--side-muted); font-size: 12px; }
.side-label {
  color: var(--side-muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  margin: 18px 10px 6px;
}
.side-link {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px; margin: 2px 0;
  color: var(--side-text); text-decoration: none; border-radius: var(--radius); font-size: 16px; font-weight: 500;
}
.side-link:hover { background: var(--side-hover); }
.side-link.active { background: var(--green); color: #fff; font-weight: 600; }
.side-icon { display: grid; place-items: center; }
.side-icon .icon { width: 20px; height: 20px; }
.side-link.active .side-icon { color: #fff; }
.ic-green { color: #3ccf6e; }
.ic-blue { color: #4f8ff7; }
.ic-purple { color: #9b87f5; }
.ic-orange { color: #f5a524; }
.ic-pink { color: #f06ba8; }
.ic-teal { color: #2dd4bf; }
.side-foot { margin-top: auto; padding: 16px 10px 0; color: var(--side-muted); font-size: 12px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 10px 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.search {
  display: flex; align-items: center; gap: 8px; width: 350px; max-width: 100%;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 0 8px; color: var(--muted);
}
.search input { border: 0; outline: 0; padding: 7px 0; flex: 1; min-width: 0; min-height: 0; background: transparent; }
.search:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
kbd {
  font: 11px ui-monospace, Consolas, monospace; color: var(--muted);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; white-space: nowrap;
}
.topbar-gap { flex: 1; }
.clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.clock strong { color: var(--green); font-size: 16px; font-variant-numeric: tabular-nums; }
.clock small { color: var(--muted); font-size: 12px; }
.icon-btn {
  position: relative; display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 50%; color: var(--muted); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .icon { width: 20px; height: 20px; }
.bell .count {
  position: absolute; top: 1px; right: 0; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--surface);
}
.menu-btn { display: none; }
.usermenu { position: relative; }
.usermenu summary {
  display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px 3px 3px;
}
.usermenu summary::-webkit-details-marker { display: none; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--green); color: #fff; }
.uname { font-weight: 600; }
.caret { width: 14px; height: 14px; color: var(--muted); }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 200px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(16, 24, 40, .12); padding: 6px;
}
.menu-head { display: flex; flex-direction: column; padding: 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-head small { color: var(--muted); }
.menu form { margin: 0; }
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 4px;
  background: none; font: inherit; color: var(--text); cursor: pointer; text-align: left;
}
.menu-item:hover { background: var(--surface-2); }

.page-head { padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.page-head h1 { font-size: 20px; font-weight: 500; color: #3a4252; }
.content { padding: 14px 16px 8px; flex: 1; }
.footer { color: var(--muted); font-size: 12px; text-align: center; padding: 8px 16px 18px; }

/* -- buttons, forms, messages -------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 15px; line-height: 1.2; padding: 7px 12px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #c4c9d2; }
.btn .icon { width: 16px; height: 16px; }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-gray { background: var(--gray-btn); border-color: var(--gray-btn); color: #fff; }
.btn-gray:hover { background: #5c636a; border-color: #5c636a; }
.btn-sm { font-size: 14px; padding: 3px 9px; }
.inline-form { display: inline-flex; align-items: center; margin: 0; }
.btn-block { width: 100%; padding: 10px; }

input, select {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 4px; padding: 7px 10px; min-height: 38px;
}
input:focus, select:focus { outline: 0; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.btn:focus-visible, .side-link:focus-visible, summary:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 600; color: #3a4252; }

.flash { border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; border: 1px solid transparent; }
.flash-ok { background: var(--green-soft); color: #14532d; border-color: #bfe6ca; }
.flash-error { background: var(--red-soft); color: #9f1d22; border-color: #f6c9ca; }
.flash-warn { background: var(--amber-soft); color: var(--amber-text); border-color: #f4dcae; }

/* -- cards ----------------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 14px; min-width: 0;
}
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #374151; }
.card-head h2.plain { text-transform: none; letter-spacing: 0; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-head h2 small { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); margin-left: 6px; }
.card-head-band { background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 10px 16px; margin: 0; }
.card-head-band .icon { color: var(--muted); }
.card-link { margin-left: auto; color: var(--green); font-size: 14px; }
.empty { color: var(--muted); margin: 4px 0; }
.lead { color: var(--muted); margin: 0 0 12px; }
.pad { padding: 14px 16px; }

/* -- dashboard: pills + actions ------------------------------------------------------ */
.pillbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px;
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid; border-radius: 4px;
  color: var(--muted); text-decoration: none; font-size: 14px;
}
.pill b { color: var(--text); }
.pill .icon { width: 16px; height: 16px; }
.pill-blue { border-left-color: #3b82f6; } .pill-blue .icon { color: #3b82f6; }
.pill-purple { border-left-color: #8b5cf6; } .pill-purple .icon { color: #8b5cf6; }
.pill-orange { border-left-color: #f97316; } .pill-orange .icon { color: #f97316; }
.pill-green { border-left-color: #22c55e; } .pill-green .icon { color: #22c55e; }
.pill-teal { border-left-color: #14b8a6; } .pill-teal .icon { color: #14b8a6; }
.pill-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.pill-status-ok { border-left-color: var(--green); }
.pill-status-warn { border-left-color: var(--orange); }
.pill-status-err { border-left-color: var(--red); }
.pill-active { background: var(--green-soft); border-color: var(--green); color: var(--text); }

/* -- Excise App Report ------------------------------------------------------------- */
.qr-thumb { display: inline-block; line-height: 0; border: 1px solid var(--border); border-radius: 4px; padding: 2px; background: #fff; }
.qr-thumb img { display: block; width: 40px; height: 40px; }
.head-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.line-hint { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 8px 16px; font-size: 13px;
  color: var(--amber-text); background: var(--amber-soft); border-bottom: 1px solid var(--border); }
.line-hint .icon { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.cell-check { width: 28px; }
.cell-check input { min-height: 0; width: 16px; height: 16px; padding: 0; margin: 0; vertical-align: middle; }
.app-meta { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; white-space: normal; max-width: 220px; }
.app-meta.note { color: var(--amber-text); }
.excise-summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* -- Logins: Telegram card ------------------------------------------------------------ */
.span-2 { grid-column: span 2; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
label.check input { min-height: 0; width: 18px; height: 18px; }
.steps { margin: 10px 0 0; padding-left: 20px; color: #3a4252; }
.steps li { margin: 4px 0; }
.found-chats { border: 1px dashed var(--border); border-radius: var(--radius); padding: 4px 12px 8px; margin-bottom: 12px; }
.found-chats h3 { margin-top: 8px; }
.found-chats .feed li { align-items: center; }
@media (max-width: 640px) { .span-2 { grid-column: auto; } }

/* -- Stock Report ------------------------------------------------------------------- */
.qty-input { width: 130px; }
.stock-table .group-row td { background: var(--green-soft); font-weight: 700; color: #14532d; padding-top: 7px; padding-bottom: 7px; }
.stock-table .group-row small { font-weight: 400; color: var(--muted); margin-left: 8px; }
.stock-table td.up { color: var(--green); font-weight: 600; }
.stock-table td.down { color: var(--red); font-weight: 600; }

/* -- dashboard: stat tiles --------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat {
  position: relative; display: flex; align-items: center; gap: 14px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 14px 14px;
}
.stat-icon { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 10px; color: #fff; flex: none; }
.stat-icon .icon { width: 28px; height: 28px; }
.grad-blue { background: linear-gradient(135deg, #5b9cf8, #2f6fe4); }
.grad-pink { background: linear-gradient(135deg, #f77fb5, #e0457f); }
.grad-orange { background: linear-gradient(135deg, #fbb36b, #f37b1d); }
.grad-purple { background: linear-gradient(135deg, #b3b2fa, #8c86ef); }
.stat-body { min-width: 0; }
.stat-label { color: #4b5563; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clamp { display: block; max-width: 100%; }
.v-green { color: var(--green); }
.v-blue { color: var(--blue); }
.v-orange { color: var(--orange); }
.v-red { color: var(--red); }
.v-muted { color: #9aa1ad; }
.stat-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--surface-2); }
.stat-bar span { display: block; height: 100%; width: 0; }
.bar-green { background: var(--green); }
.bar-orange { background: var(--orange); }
.bar-red { background: var(--red); }

/* -- dashboard: chart + pipeline -------------------------------------------------- */
.split { display: grid; grid-template-columns: minmax(0, 2.6fr) minmax(300px, 1.4fr); gap: 14px; }
.legend { display: flex; gap: 16px; margin-left: auto; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.legend b { color: var(--text); }
.chart { position: relative; height: 300px; }
.chart svg { display: block; }
.chart .grid { stroke: #eceef2; }
.chart .axis { stroke: #d5d9e0; }
.chart .area { fill: #ece9ff; }
.chart .line { fill: none; stroke: var(--purple); stroke-width: 2; stroke-linejoin: round; }
.chart .pt { fill: var(--surface); stroke: #1f8fff; stroke-width: 2; }
.chart .ylabel, .chart .xlabel { fill: var(--muted); font-size: 12px; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--muted); text-align: center; padding: 0 20px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot-blue { background: #1f8fff; margin-right: 6px; }
.dot-purple { background: var(--purple); margin-right: 6px; }
.dot-ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.dot-bad { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.dot-warn { background: var(--orange); box-shadow: 0 0 0 3px var(--amber-soft); }
.dot-off { background: #c3c8d1; box-shadow: 0 0 0 3px #f0f1f4; }
.services { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
.services li { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--border); min-width: 0; }
.svc-icon { color: #6d5fd3; width: 17px; height: 17px; }
.svc-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.svc-name small { color: var(--muted); font-size: 12px; }

/* -- tables ------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th { color: #4b5563; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; background: var(--surface-2); }
.table .num { text-align: right; }
.table tfoot td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--border); }
.table tr.selected td { background: var(--green-soft); }
.table-striped tbody tr:nth-child(odd) td { background: var(--surface-2); }
.table td.wide { min-width: 240px; }
.muted-cell { color: #4b5563; }
.card .table th:first-child, .card .table td:first-child { padding-left: 16px; }
code.action { color: var(--pink-code); font-size: 14px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
.badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--green-soft); color: #166534; }
.badge-warn { background: var(--amber-soft); color: var(--amber-text); }
.badge-err { background: var(--red-soft); color: #b42318; }
.tag {
  display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.tag-warn { background: var(--amber-soft); color: var(--amber-text); border-color: transparent; margin-left: 6px; }

/* -- reports / activity toolbars ------------------------------------------------------ */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .search-input { min-width: 220px; }
.toolbar-label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.toolbar-label .qty-input { width: 70px; }
.small-note { font-size: 12px; margin: 4px 4px 14px; }
.headline { margin: 0 0 12px; }
.headline strong { color: var(--green); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0 0; font-size: 13px; }
.chip { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 9px; }
.pager { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px; }
.pager:empty { display: none; }

/* -- logins ------------------------------------------------------------------------- */
.site-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.site-head .stat-icon { width: 44px; height: 44px; border-radius: 8px; }
.site-head .stat-icon .icon { width: 22px; height: 22px; }
.site-head h2 { font-size: 17px; }
.site-head .badge { margin-left: auto; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 22px; margin: 0 0 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.actions { display: flex; gap: 8px; margin-bottom: 12px; }
.actions:empty { display: none; }
.actions form { margin: 0; }
.reveal { display: grid; gap: 10px; margin-bottom: 14px; max-width: 480px; }
.copy-row { display: flex; gap: 6px; }
.secret { flex: 1; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
details.edit { border-top: 1px solid var(--border); padding-top: 12px; }
details.edit summary { cursor: pointer; color: var(--green); font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; align-items: end; margin-top: 12px; }
.card h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .03em; color: #4b5563; margin: 16px 0 8px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); }
.feed li:last-child { border-bottom: 0; }
.feed time { color: var(--muted); font-size: 13px; white-space: nowrap; }
.feed-text { flex: 1; min-width: 0; }

/* -- sign in ------------------------------------------------------------------------ */
.auth-body { background: var(--side-bg); }
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.auth > .flash { width: 100%; max-width: 400px; }
.auth-card { width: 100%; max-width: 400px; padding: 28px; display: grid; gap: 16px; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand .logo { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; background: var(--green); color: #fff; }
.auth-brand .logo .icon { width: 26px; height: 26px; }
.auth-brand strong { display: block; font-size: 18px; }
.auth-brand small { color: var(--muted); }
.auth-card h1 { font-size: 20px; }
.auth-card .flash { margin: 0; }
.auth-foot { color: var(--side-muted); font-size: 12px; margin-top: 16px; }

/* -- smaller screens ------------------------------------------------------------------ */
@media (max-width: 1200px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .app { background: var(--bg); }
  .sidebar {
    position: fixed; left: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s ease;
  }
  .nav-toggle:checked ~ .app .sidebar { transform: none; box-shadow: 4px 0 24px rgba(0, 0, 0, .25); }
  .scrim { display: none; position: fixed; inset: 0; z-index: 30; background: rgba(15, 26, 43, .45); }
  .nav-toggle:checked ~ .app .scrim { display: block; }
  .menu-btn { display: grid; }
  .search { width: auto; flex: 1; }
  .search kbd { display: none; }
  .topbar-gap { display: none; }
}
@media (max-width: 640px) {
  .topbar { gap: 8px; padding: 8px 10px; }
  .clock, .uname, .caret { display: none; }
  .usermenu summary { padding: 2px; border: 0; }
  .content { padding: 12px 10px 4px; }
  .page-head { padding: 10px 12px; }
  .stats { grid-template-columns: 1fr; }
  .pill-actions { margin-left: 0; }
  .services { grid-template-columns: 1fr; }
  .legend { margin-left: 0; width: 100%; }
  .chart { height: 240px; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 8px; }
  .card .table th:first-child, .card .table td:first-child { padding-left: 12px; }
  .hide-sm { display: none; }
  .when span { display: block; }
  /* Excise App Report: each line becomes a card - brand + QR, then the numbers, then App Update. */
  .table-stack tr { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 12px; padding: 10px 12px; }
  .table-stack tbody tr { border-bottom: 1px solid var(--border); }
  .table-stack td, .card .table-stack td:first-child { display: block; padding: 0; border: 0; background: none !important; }
  .table-stack thead, .card .table-stack td.cell-empty { display: none; }
  .table-stack td[data-label]::before { content: attr(data-label) " "; color: var(--muted); font-size: 12px; }
  .table-stack .cell-check { order: 0; flex: none; width: auto; }
  .table-stack .cell-sl { order: 0; flex: none; color: var(--muted); }
  .table-stack .cell-brand { order: 0; flex: 1 1 0; font-weight: 600; min-width: 0; }
  .table-stack .cell-qr { order: 1; flex: none; }
  .table-stack td[data-label] { order: 2; }
  .table-stack td[data-label="Barcode"] { flex-basis: 100%; }   /* starts the second line of the card */
  .table-stack .cell-app { order: 3; flex-basis: 100%; white-space: normal; }
  .table-stack tfoot tr { border-top: 2px solid var(--border); }
  .table-stack tbody tr:nth-child(odd) { background: var(--surface-2); }
  .table td.wide { min-width: 0; }
  .table th, .table td { padding: 8px; }
}

/* -- phone screen (phone.php) ------------------------------------------------------- */
.phone-card { max-width: 560px; margin-left: auto; margin-right: auto; }
.phone {   /* small enough to show the whole phone: 720 x 1600 is 9:20, plus the bezel */
  width: min(100%, max(240px, calc((100vh - 230px) * 9 / 20 + 20px))); margin: 0 auto;
}
.phone-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.phone-bar .badge { font-size: 13px; padding: 5px 12px; }
.phone-bar form { margin: 0; }
.btn-phone {   /* red: it switches the phone off and on */
  gap: 7px; padding: 7px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: var(--red); border-color: var(--red); color: #fff; box-shadow: var(--shadow);
}
.btn-phone:hover { background: #c9353a; border-color: #c9353a; }
.phone-frame { padding: 10px; background: #111827; border-radius: 30px; box-shadow: var(--shadow); }
.phone-screen { aspect-ratio: 9 / 20; background: #000; border-radius: 20px; overflow: hidden; }
.phone-screen canvas { cursor: pointer; }
.phone-note { margin: 12px 0 0; font-size: 13px; text-align: center; }
