/* 3DISM ERP stylesheet. Phone first; one file for every page.
   The look follows 3dism.org and its admin (decision 0024): ink-dark surfaces, the Qalam
   green, Inter, square corners, pills with a dot for a status.
   Only logical properties (inline / block, start / end), so the same rules lay out
   English left-to-right and Urdu right-to-left. */

@font-face {
  font-family: "Noto Nastaliq Urdu";
  src: url("../fonts/noto-nastaliq-urdu/noto-nastaliq-urdu-arabic-400-normal.1d9ba7ff26a9.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200F, U+FB50-FDFF, U+FE70-FEFF;
}

@font-face {
  font-family: "Noto Nastaliq Urdu";
  src: url("../fonts/noto-nastaliq-urdu/noto-nastaliq-urdu-arabic-700-normal.05bf8c16d8dd.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200F, U+FB50-FDFF, U+FE70-FEFF;
}

@font-face {
  font-family: "Inter Variable";
  src: url("../fonts/inter/inter-latin-wght-normal.260c81a4759b.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter Variable";
  src: url("../fonts/inter/inter-latin-ext-wght-normal.1ad231aac0a8.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens (the same names and values as 3dism.org/admin) ---------- */

:root {
  --ink-deep: #1c1c1c;
  --ink: #2a2a2a;
  --ink-soft: #323232;
  --card: #333333;
  --card-hover: #3b3b3b;
  --field: #292929;
  --bg: var(--ink);
  --surface: var(--card);
  --surface-2: var(--ink-soft);
  --text: #f2f4f6;
  --muted: #bcc1c7;
  --subtle: #9ca3ab;
  --grey: #a3a3a3;
  --line: #454545;
  --line-strong: #6a6a6a;
  --accent: #22c55e;
  --accent-bright: #4ade80;
  --accent-dim: #16a34a;
  --accent-strong: var(--accent-bright);
  --accent-soft: rgb(34 197 94 / 0.14);
  --on-accent: #10241a;
  --ok: #4ade80;
  --ok-bg: rgb(74 222 128 / 0.12);
  --warn: #fbbf24;
  --warn-bg: rgb(251 191 36 / 0.12);
  --bad: #f87171;
  --bad-bg: rgb(248 113 113 / 0.14);
  --info: #60a5fa;
  --info-bg: rgb(96 165 250 / 0.14);
  --shadow: none;
  --radius: 0;
  --radius-sm: 0;
  --tap: 3rem;
  --gap: 1rem;
  --nav-h: 3.75rem;
  --side-w: 236px;
  --font: "Noto Nastaliq Urdu", "Inter Variable", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;

  font-family: var(--font);
  color-scheme: dark;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-block-start: 4rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

:lang(ur) body,
body:lang(ur) {
  line-height: 2.05;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin-block: 0 0.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

:lang(ur) h1,
:lang(ur) h2,
:lang(ur) h3 {
  line-height: 1.9;
  letter-spacing: 0;
}

h1 {
  font-size: 1.45rem;
}

h2 {
  font-size: 1rem;
}

h3 {
  font-size: 0.95rem;
}

p {
  margin-block: 0 0.75rem;
}

a {
  color: var(--accent-bright);
}

img {
  max-inline-size: 100%;
}

bdi[dir="ltr"],
.code,
.num {
  font-variant-numeric: tabular-nums;
}

.code {
  font-family: var(--mono);
  font-size: 0.95em;
  letter-spacing: 0.01em;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.875rem;
}

.ok {
  color: var(--ok);
}

.warn {
  color: var(--warn);
}

.bad {
  color: var(--bad);
}

.icon {
  inline-size: 1.25rem;
  block-size: 1.25rem;
  vertical-align: -0.3em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ---------- App shell ---------- */

/* The brand mark as on the website: "3D" plain, "ISM" green, what this is in small caps. */
.brand {
  display: inline-flex;
  align-items: baseline;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.brand > span:nth-child(2) {
  color: var(--accent);
}

.brand small {
  margin-inline-start: 0.5rem;
  color: var(--subtle);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topbar {
  position: sticky;
  inset-block-start: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--gap);
  min-block-size: 3.25rem;
  padding-block: 0.4rem;
  padding-inline: 1rem;
  background: var(--ink-deep);
  border-block-end: 1px solid var(--line);
}

.topbar .brand {
  margin-inline-end: auto;
}

.language-switch {
  margin: 0;
}

/* The sidebar (computers): the same shape as the admin's, at the start edge. */
.sidebar {
  display: none;
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 40;
  inline-size: var(--side-w);
  flex-direction: column;
  gap: 1rem;
  padding-block: 1.1rem;
  padding-inline: 0.75rem;
  background: var(--ink-deep);
  border-inline-end: 1px solid var(--line);
  overflow-y: auto;
}

.sidebar .brand {
  padding-block: 0.25rem 0.5rem;
  padding-inline: 0.6rem;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-block-size: 2.35rem;
  padding-block: 0.4rem;
  padding-inline: 0.75rem;
  border-inline-start: 3px solid transparent;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.side-nav a:hover {
  background: var(--ink-soft);
  color: var(--text);
}

.side-nav a.is-active {
  background: var(--card);
  border-inline-start-color: var(--accent);
  color: var(--text);
}

.side-nav .icon {
  color: var(--subtle);
}

.side-nav a.is-active .icon {
  color: var(--accent-bright);
}

.side-heading {
  margin-block: 0.7rem 0.15rem;
  padding-inline: 0.9rem;
  color: var(--subtle);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

:lang(ur) .side-heading {
  letter-spacing: 0;
  text-transform: none;
}

.side-foot {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-block-start: auto;
  padding-block-start: 0.9rem;
  border-block-start: 1px solid var(--line);
}

.side-user {
  display: flex;
  flex-direction: column;
  padding-inline: 0.6rem;
  line-height: 1.3;
}

.side-user strong {
  font-weight: 700;
}

.side-foot .row {
  padding-inline: 0.35rem;
}

.side-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding-inline: 0.6rem;
  color: var(--subtle);
  font-size: 0.8rem;
  text-decoration: none;
}

.side-link:hover {
  color: var(--accent-bright);
}

button.side-link {
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  min-block-size: 2rem;
}

.bottomnav {
  position: fixed;
  inset-block-end: 0;
  inset-inline: 0;
  z-index: 20;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  block-size: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-block-end: env(safe-area-inset-bottom);
  background: var(--ink-deep);
  border-block-start: 1px solid var(--line);
}

.bottomnav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-decoration: none;
}

:lang(ur) .bottomnav a {
  line-height: 1.4;
}

.bottomnav a .icon {
  inline-size: 1.5rem;
  block-size: 1.5rem;
}

.bottomnav a.is-active {
  color: var(--accent-bright);
}

/* With the keyboard up on a phone, little is left; the bar comes back when it closes. */
@media (max-height: 520px) {
  .bottomnav {
    display: none;
  }

  .page {
    padding-block-end: 1.5rem;
  }
}

.page {
  max-inline-size: 64rem;
  margin-inline: auto;
  padding-block: 1.25rem calc(var(--nav-h) + env(safe-area-inset-bottom) + 1.5rem);
  padding-inline: 1rem;
}

/* A computer: the sidebar takes the start edge; no top or bottom bar. */
@media (min-width: 900px) {
  body {
    font-size: 0.9375rem;
  }

  body.has-side .topbar,
  body.has-side .bottomnav {
    display: none;
  }

  body.has-side .sidebar {
    display: flex;
  }

  body.has-side {
    padding-inline-start: var(--side-w);
  }

  .page {
    padding-block: 1.75rem 3rem;
    padding-inline: 1.75rem;
  }
}

/* ---------- Page header ---------- */

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-block-end: 1rem;
}

.page-header h1 {
  margin: 0;
}

.page-header .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.eyebrow {
  color: var(--subtle);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

:lang(ur) .eyebrow {
  text-transform: none;
  letter-spacing: 0;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-block-size: 2.75rem;
  margin-block-end: 0.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.back:hover {
  color: var(--accent-bright);
}

/* ---------- Cards, sections ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  margin-block-end: var(--gap);
}

.card > :last-child {
  margin-block-end: 0;
}

.card-narrow {
  max-inline-size: 26rem;
  margin-inline: auto;
}

.card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin-block-end: 0.75rem;
}

.card-title h2 {
  margin: 0;
}

.grid-2 {
  display: grid;
  /* minmax(0, …): a long line inside a card wraps instead of widening the page. */
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap);
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.spread {
  justify-content: space-between;
}

/* ---------- Stats (the admin's KPI tiles) ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.75rem;
  list-style: none;
  margin: 0 0 var(--gap);
  padding: 0;
}

.stats li,
.stat {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
}

a.stat:hover {
  border-color: var(--accent);
}

.stats > li:has(> .stat) {
  display: contents;
}

.stat-value {
  /* Shrinks to the tile (decision 0032): a rupee figure never breaks in the middle. */
  font-size: clamp(1rem, 16cqi, 1.5rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  color: var(--subtle);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

:lang(ur) .stat-label {
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.85rem;
}

.stat-label a {
  text-transform: none;
  letter-spacing: 0;
}

.stat-warn .stat-value {
  color: var(--warn);
}

.stat-bad .stat-value {
  color: var(--bad);
}

.stat-ok .stat-value {
  color: var(--ok);
}

/* ---------- Badges: pills, with a dot when they mean a state ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding-block: 0.1rem;
  padding-inline: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink-deep);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.5;
}

:lang(ur) .badge,
:lang(ur) .stat-value small,
:lang(ur) .left-qty small {
  line-height: 1.9;
}

.badge-ok::before,
.badge-warn::before,
.badge-bad::before,
.badge-info::before {
  content: "";
  inline-size: 0.45rem;
  block-size: 0.45rem;
  border-radius: 50%;
  background: currentcolor;
}

.badge-ok {
  color: var(--ok);
}

.badge-warn {
  color: var(--warn);
}

.badge-bad {
  color: var(--bad);
}

.badge-info {
  color: var(--info);
}

.badge-muted {
  color: var(--grey);
}

/* ---------- Lists ---------- */

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  padding-block: 0.65rem;
  border-block-end: 1px solid var(--line);
}

.list > li:last-child {
  border-block-end: 0;
}

.list .main {
  flex: 1 1 14rem;
  min-inline-size: 0;
}

.list .side {
  text-align: end;
  flex: none;
}

.list a.main {
  color: inherit;
  text-decoration: none;
}

.list a.main:hover .title {
  color: var(--accent-bright);
}

.title {
  font-weight: 600;
}

.sub {
  color: var(--muted);
  font-size: 0.875rem;
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.item-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-block: 0.6rem;
  border-block-end: 1px solid var(--line);
}

.item-list li:last-child {
  border-block-end: 0;
}

.thumb {
  inline-size: 3rem;
  block-size: 3rem;
  flex: none;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--ink-soft);
  border: 1px solid var(--line);
}

.thumb-lg {
  inline-size: 100%;
  max-inline-size: 18rem;
  aspect-ratio: 1;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--ink-soft);
  border: 1px solid var(--line);
}

.with-thumb {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.empty {
  padding-block: 1.5rem;
  text-align: center;
  color: var(--muted);
}

/* ---------- Tables ---------- */

.table-wrap {
  overflow-x: auto;
}

.table {
  inline-size: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table th,
.table td {
  padding-block: 0.6rem;
  padding-inline: 0.65rem;
  text-align: start;
  border-block-end: 1px solid var(--line);
  vertical-align: top;
}

.table th {
  background: var(--ink-soft);
  color: var(--subtle);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

:lang(ur) .table th {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.85rem;
}

.table td.num,
.table th.num {
  text-align: end;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table tr:last-child td {
  border-block-end: 0;
}

.table tbody tr:hover {
  background: var(--card-hover);
}

@media (max-width: 640px) {
  .table.stackable thead {
    display: none;
  }

  .table.stackable tr {
    display: block;
    padding-block: 0.5rem;
    border-block-end: 1px solid var(--line);
  }

  .table.stackable td {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.2rem 0.4rem;
    padding-block: 0.2rem;
    border: 0;
  }

  /* The label pushes the cell's contents to the end, where they sit together ("12 pcs"). */
  .table.stackable td::before {
    content: attr(data-label);
    color: var(--subtle);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-inline-end: auto;
  }

  :lang(ur) .table.stackable td::before {
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.8rem;
  }

  .table.stackable td br {
    display: none;
  }

  .table.stackable td.num {
    text-align: end;
  }
}

/* ---------- Forms ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-label,
form div > label {
  font-weight: 600;
}

form .stack > div,
form .stack-sm > div {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

form .helptext {
  color: var(--muted);
  font-size: 0.85rem;
}

form ul.errorlist {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--bad);
  font-size: 0.9rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="date"],
input[type="url"],
input[type="tel"],
input[type="email"],
input[type="file"],
select,
textarea {
  inline-size: 100%;
  min-block-size: var(--tap);
  padding-block: 0.5rem;
  padding-inline: 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 1.05rem; /* keeps iOS from zooming into fields */
}

input::placeholder,
textarea::placeholder {
  color: #8b9098;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #8b9098;
}

textarea {
  min-block-size: 5rem;
  resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
  inline-size: 1.3rem;
  block-size: 1.3rem;
  accent-color: var(--accent);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.btn:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin-block-end: 0.75rem;
}

/* A row inside a form's .stack stays a row (the stack makes its other divs columns). */
form .stack > .form-row,
form .stack-sm > .form-row {
  flex-direction: row;
  margin-block-end: 0;
}

.form-row .field {
  flex: 1 1 8rem;
}

.form-row .field-narrow {
  flex: 0 1 8rem;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-block-size: var(--tap);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  position: relative;
}

.chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
}

.chip span {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.75rem;
  padding-inline: 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--ink-deep);
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}

.chip input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.chip input:focus-visible + span {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

.qty-input {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  min-block-size: 3.5rem;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-block-size: var(--tap);
  padding-block: 0.5rem;
  padding-inline: 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

:lang(ur) .btn {
  line-height: 1.9;
  letter-spacing: 0;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-bright);
}

.btn-quiet,
.btn-secondary {
  background: var(--card);
  color: var(--text);
  border-color: var(--line-strong);
}

.btn-quiet:hover,
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
}

.btn-danger {
  background: transparent;
  color: var(--bad);
  border-color: rgb(248 113 113 / 0.6);
}

.btn-danger:hover {
  background: var(--bad-bg);
}

.btn-ok {
  background: var(--accent-dim);
  color: #fff;
}

.btn-block {
  inline-size: 100%;
}

.btn-big {
  min-block-size: 4rem;
  font-size: 1.15rem;
}

.btn-small {
  min-block-size: 2.75rem;
  padding-inline: 0.75rem;
  font-size: 0.85rem;
}

.btn .icon {
  inline-size: 1.15rem;
  block-size: 1.15rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.button-row .btn-block {
  flex: 1;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.6rem;
}

.action-grid .btn {
  min-block-size: 3.5rem;
  flex-direction: column;
  gap: 0.2rem;
}

.action-grid .btn .icon {
  inline-size: 1.4rem;
  block-size: 1.4rem;
}

/* Tabs: which part of a list is shown, with how many rows it holds. */
.tabs {
  display: flex;
  gap: 2px;
  margin-block-start: 0.25rem;
  border-block-end: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: thin;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-block-size: 2.75rem;
  padding-block: 0.5rem;
  padding-inline: 0.75rem;
  border-block-end: 2px solid transparent;
  margin-block-end: -1px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  color: var(--text);
  border-block-end-color: var(--accent);
}

.tab-count {
  padding-inline: 0.45rem;
  border-radius: 999px;
  background: var(--ink-deep);
  color: var(--subtle);
  font-size: 0.72rem;
}

/* ---------- Messages ---------- */

.messages {
  position: fixed;
  inset-block-start: 3.75rem;
  inset-inline-end: 1rem;
  inset-inline-start: 1rem;
  z-index: 50;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

@media (min-width: 900px) {
  .messages {
    inset-block-start: auto;
    inset-block-end: 1rem;
    inset-inline-start: auto;
    inline-size: 26rem;
  }
}

.alert {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-block: 0.7rem;
  padding-inline: 0.85rem;
  border: 1px solid var(--line-strong);
  border-inline-start: 4px solid var(--accent);
  background: var(--ink-deep);
  color: var(--text);
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.5);
  pointer-events: auto;
  transition: opacity 0.4s ease;
}

.alert span {
  flex: 1 1 auto;
}

.alert-close {
  flex: none;
  min-inline-size: 2.25rem;
  min-block-size: 2.25rem;
  margin-inline-end: -0.5rem;
  border: 0;
  background: transparent;
  color: var(--subtle);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.alert-error {
  border-inline-start-color: var(--bad);
}

.alert-success {
  border-inline-start-color: var(--accent);
}

.alert-warning {
  border-inline-start-color: var(--warn);
}

.alert-info {
  border-inline-start-color: var(--info);
}

.alert.is-hiding {
  opacity: 0;
}

.notice {
  padding-block: 0.7rem;
  padding-inline: 1rem;
  border: 1px solid transparent;
  border-inline-start: 4px solid currentcolor;
  margin-block-end: var(--gap);
}

.notice-warn {
  background: var(--warn-bg);
  border-color: rgb(251 191 36 / 0.5);
  border-inline-start-color: var(--warn);
  color: var(--warn);
}

.notice-bad {
  background: var(--bad-bg);
  border-color: rgb(248 113 113 / 0.5);
  border-inline-start-color: var(--bad);
  color: var(--bad);
}

.notice-ok {
  background: var(--ok-bg);
  border-color: rgb(74 222 128 / 0.5);
  border-inline-start-color: var(--ok);
  color: var(--ok);
}

.notice-info {
  background: var(--info-bg);
  border-color: rgb(96 165 250 / 0.5);
  border-inline-start-color: var(--info);
  color: var(--info);
}

.notice a {
  color: inherit;
}

/* ---------- Details / progress ---------- */

.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
  font-weight: 600;
}

/* Long labels (buyer records, decision 0040): on a phone each label sits above its value. */
@media (max-width: 640px) {
  .kv-stack {
    grid-template-columns: 1fr;
    row-gap: 0;
  }

  .kv-stack dd {
    margin-block-end: 0.5rem;
  }
}

.progress {
  block-size: 0.5rem;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.progress > span {
  display: block;
  block-size: 100%;
  background: var(--accent);
}

.progress.is-done > span {
  background: var(--ok);
}

/* ---------- Scanner ---------- */

.scanner-view {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  max-inline-size: 100%;
  margin-block-end: var(--gap);
  background: #000;
}

.scanner-video {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.scanner-frame {
  position: absolute;
  inset: 20%;
  border: 3px solid rgb(255 255 255 / 0.9);
  border-radius: 0.75rem;
  box-shadow: 0 0 0 100vmax rgb(0 0 0 / 0.3);
}

/* ---------- Recipes ---------- */

fieldset.card {
  border: 1px solid var(--line);
  min-inline-size: 0;
}

fieldset.card legend {
  padding-inline: 0.4rem;
  font-weight: 800;
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding-block: 0.5rem;
  border-block-end: 1px solid var(--line);
}

.option-pick {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 12rem;
  min-block-size: var(--tap);
}

.option-qty {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.option-qty input {
  inline-size: 6rem;
}

/* ---------- Menu page ---------- */

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.75rem;
}

.menu-grid a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

.menu-grid a:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
}

.menu-grid .icon {
  inline-size: 1.6rem;
  block-size: 1.6rem;
  color: var(--accent-bright);
}

/* ---------- Print: paper is white ---------- */

@media print {
  :root {
    --bg: #fff;
    --surface: #fff;
    --surface-2: #f3f3f3;
    --ink-deep: #fff;
    --ink-soft: #f3f3f3;
    --field: #fff;
    --text: #111;
    --muted: #555;
    --subtle: #666;
    --line: #ccc;
    --line-strong: #999;
    --on-accent: #000;
    color-scheme: light;
  }

  .topbar,
  .bottomnav,
  .sidebar,
  .messages,
  .no-print {
    display: none !important;
  }

  body.has-side {
    padding-inline-start: 0;
  }

  .page {
    padding: 0;
    max-inline-size: none;
  }

  .card {
    break-inside: avoid;
  }
}

/* ---------- Worker bin page: what is left, in big numbers ---------- */

.left-now {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.left-qty {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.left-qty small {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--muted);
}

.left-label {
  color: var(--muted);
}

.left-now.is-low .left-qty {
  color: var(--warn);
}

.left-now.is-out .left-qty {
  color: var(--bad);
}

/* Home: type a bin number and go */

.open-bin {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
}

.open-bin .field {
  flex: 1 1 auto;
  margin: 0;
}

/* ---------- Android app page ---------- */

.steps {
  margin-block: 1rem;
  padding-inline-start: 1.25rem;
  display: grid;
  gap: 0.5rem;
}

.plain-list {
  margin-block: 0 0.75rem;
  padding-inline-start: 1.25rem;
  display: grid;
  gap: 0.35rem;
}

/* "Why the warnings?": folded away until tapped. */
.help {
  margin-block-start: 1rem;
  border-block-start: 1px solid var(--line);
  padding-block-start: 0.75rem;
}

.help summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent-bright);
}

.help ul {
  margin-block: 0.5rem 0;
  padding-inline-start: 1.25rem;
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.connect-code .qr {
  display: flex;
  justify-content: center;
  margin-block: 0.5rem 1rem;
}

.connect-code .qr svg {
  inline-size: min(16rem, 100%);
  block-size: auto;
  padding: 0.5rem;
  background: #fff;
}

/* Right-to-left: arrows that mean "back" or "out" point the other way. */
[dir="rtl"] .back .icon,
[dir="rtl"] .icon-flip {
  transform: scaleX(-1);
}

/* A payment removed by mistake stays visible, crossed out. */
.list li.is-void .title {
  text-decoration: line-through;
  color: var(--muted);
}

/* Toasts: errors and warnings stay until tapped, so show that they can be closed. */
.alert-error,
.alert-warning {
  cursor: pointer;
}

/* ---------- Quotations ---------- */

.quote-line {
  padding-block: 0.75rem;
  border-block-end: 1px dashed var(--line-strong);
}

.quote-line:first-child {
  padding-block-start: 0;
}

/* A line ticked "leave out" is greyed until the form is saved. */
.quote-line:has(input[name$="-DELETE"]:checked) > :not(.check) {
  opacity: 0.4;
}

.quote-line .form-row {
  margin-block: 0.6rem 0;
}

/* Quantity, price and tax side by side, even on a phone. */
.quote-line .form-row .field {
  flex: 1 1 6rem;
}

.quote-line .form-row .field-narrow {
  flex: 0 1 5rem;
}

.quote-preview {
  padding: 0.5rem;
  background: var(--ink-deep);
}

.quote-preview img {
  display: block;
  inline-size: 100%;
  max-inline-size: 44rem;
  block-size: auto;
  margin-inline: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.logo-preview {
  max-block-size: 4.5rem;
  max-inline-size: 16rem;
  object-fit: contain;
  padding: 0.35rem;
  border: 1px solid var(--line);
  background: #fff;
}

/* Long labels wrap inside grid buttons instead of running into the next one. */
.action-grid .btn {
  white-space: normal;
  text-align: center;
}

.company-form {
  max-inline-size: 40rem;
  margin-inline: auto;
}

/* ---------- Shipping labels page ---------- */

.label-ready {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  border-color: var(--accent);
  background: var(--ok-bg);
}

.label-ready h2 {
  margin-block-end: 0.25rem;
  color: var(--ok);
}

.label-form {
  margin-block-end: var(--gap);
}

/* Full width under a thumb on a phone; its own size beside the two halves on a computer. */
.label-form .btn-big {
  inline-size: 100%;
}

@media (min-width: 768px) {
  .label-form .btn-big {
    inline-size: auto;
  }
}

.label-slot {
  display: grid;
  gap: 0.6rem;
  align-content: start;
}

.label-slot .form-row {
  margin-block-end: 0;
}

/* What is typed stays regular weight; "form div > label" would make it bold in a row. */
.label-slot .field {
  font-weight: 400;
}

.label-from .notice {
  margin-block: 0.75rem 0;
}

/* Worker log: a take that was undone stays in the list, crossed out. */
.table tr.is-void td {
  color: var(--muted);
  text-decoration: line-through;
}

.table tr.is-void td .badge {
  text-decoration: none;
}

/* ---------- Statistics (decision 0027) ---------- */

/* Chart colours, checked with the palette validator against the card surface (#333).
   1 is the Qalam green, for a chart with one series only (never stacked with the others).
   2 to 5 are the machine models, in this order: blue, orange, aqua, yellow. The first three
   pass every pair (a month can stack any two of them); the fourth passes as a neighbour
   only. 0 is the grey for "other" and for earlier years. */
:root {
  --viz-0: #8b9098;
  --viz-1: #16a34a;
  --viz-2: #3987e5;
  --viz-3: #d95926;
  --viz-4: #199e70;
  --viz-5: #c98500;
}

.viz {
  position: relative;
  max-inline-size: 38rem;
}

.viz-svg {
  display: block;
  inline-size: 100%;
  block-size: auto;
  overflow: visible;
  font-family: var(--font);
}

.viz-grid {
  stroke: var(--line);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.viz-base {
  stroke: var(--line-strong);
}

.viz-tick,
.viz-axis {
  fill: var(--subtle);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.viz-now {
  fill: var(--text);
  font-weight: 700;
}

.viz-cap {
  fill: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.viz-s0 { fill: var(--viz-0); }
.viz-s1 { fill: var(--viz-1); }
.viz-s2 { fill: var(--viz-2); }
.viz-s3 { fill: var(--viz-3); }
.viz-s4 { fill: var(--viz-4); }
.viz-s5 { fill: var(--viz-5); }

.viz-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.viz-line.viz-s0 { stroke: var(--viz-0); fill: none; }
.viz-line.viz-s1 { stroke: var(--viz-1); fill: none; }
.viz-line.viz-s2 { stroke: var(--viz-2); fill: none; }

.viz-dot {
  stroke: var(--card);
  stroke-width: 2;
}

.viz-hit {
  fill: transparent;
  cursor: pointer;
  outline: none;
}

.viz-hit:hover,
.viz-hit:focus-visible,
.viz-hit.is-on {
  fill: rgb(255 255 255 / 0.06);
}

.viz-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.viz-legend li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.viz-key {
  inline-size: 0.75rem;
  block-size: 0.75rem;
  border-radius: 2px;
}

.viz-key.viz-s0 { background: var(--viz-0); }
.viz-key.viz-s1 { background: var(--viz-1); }
.viz-key.viz-s2 { background: var(--viz-2); }
.viz-key.viz-s3 { background: var(--viz-3); }
.viz-key.viz-s4 { background: var(--viz-4); }
.viz-key.viz-s5 { background: var(--viz-5); }

.viz-key.is-line {
  block-size: 2px;
  border-radius: 1px;
}

/* The readout a tap or hover opens over a column (app.js); the table has the same numbers. */
.viz-tip {
  position: absolute;
  z-index: 5;
  /* Its own width, not what is left of the chart after its last position. */
  inline-size: max-content;
  min-inline-size: 9rem;
  max-inline-size: min(16rem, 100%);
  padding-block: 0.45rem;
  padding-inline: 0.65rem;
  border: 1px solid var(--line-strong);
  background: var(--ink-deep);
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.5);
  font-size: 0.85rem;
  pointer-events: none;
}

.viz-tip-title {
  margin-block-end: 0.25rem;
  color: var(--muted);
  font-weight: 600;
}

.viz-tip-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.viz-tip-row strong {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.viz-tip-row .viz-key {
  flex: none;
  inline-size: 0.8rem;
  block-size: 2px;
}

.viz-tip-row span:last-child {
  color: var(--muted);
}

/* "Show the numbers": every chart's values as a table. */
.viz-table {
  margin-block-start: 0.5rem;
}

.viz-table summary {
  cursor: pointer;
  color: var(--accent-bright);
  font-weight: 600;
  min-block-size: 2.75rem;
  display: flex;
  align-items: center;
}

/* Ranked lists drawn with plain bars: they follow the reading direction by themselves. */
.bar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.bar-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.2rem 0.75rem;
  align-items: baseline;
}

.bar-list .bar-name {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.bar-list .bar-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: end;
}

.bar-list .bar-track {
  grid-column: 1 / -1;
  block-size: 0.5rem;
  border-radius: 2px;
  background: var(--ink-soft);
  overflow: hidden;
}

.bar-list .bar-fill {
  display: block;
  block-size: 100%;
  min-inline-size: 2px;
  border-start-end-radius: 2px;
  border-end-end-radius: 2px;
  background: var(--viz-1);
}

.bar-list .bar-fill.viz-s2 { background: var(--viz-2); }
.bar-list .bar-fill.viz-s3 { background: var(--viz-3); }
.bar-list .bar-fill.viz-s4 { background: var(--viz-4); }
.bar-list .bar-fill.viz-s5 { background: var(--viz-5); }
.bar-list .bar-fill.viz-s0 { background: var(--viz-0); }

/* Up or down against the period before: an arrow and a word, never colour alone. */
.delta {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.delta-up { color: var(--ok); }
.delta-down { color: var(--bad); }
.delta-flat { color: var(--subtle); }

.stats-section > h2 {
  margin-block-end: 0.75rem;
}

.bar-list .bar-note {
  grid-column: 1 / -1;
}

/* Month and year tables: four or five figures side by side on a phone. */
.table-compact {
  font-size: 0.8125rem;
}

.table-compact th {
  letter-spacing: 0.02em;
}

.table-compact th,
.table-compact td {
  padding-block: 0.45rem;
  padding-inline: 0.35rem;
}

.table-compact th:first-child,
.table-compact td:first-child {
  padding-inline-start: 0;
}

.table-compact th:last-child,
.table-compact td:last-child {
  padding-inline-end: 0;
}

/* ---------- Owner's home (decision 0032) ---------- */

.section-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.6rem;
  margin-block: 1.25rem 0.6rem;
  color: var(--subtle);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-label .sub {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

:lang(ur) .section-label {
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
}

.needs-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.need {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-inline-start-width: 4px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

a.need:hover {
  background: var(--card-hover);
}

.need .icon {
  flex: none;
}

.need-bad { border-inline-start-color: var(--bad); background: var(--bad-bg); }
.need-bad .icon { color: var(--bad); }
.need-warn { border-inline-start-color: var(--warn); }
.need-warn .icon { color: var(--warn); }
.need-info { border-inline-start-color: var(--info); }
.need-info .icon { color: var(--info); }
.need-ok { border-inline-start-color: var(--ok); color: var(--muted); }
.need-ok .icon { color: var(--ok); }

.stats-wide {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}

.stat-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.stat-trend .stat-value {
  font-size: clamp(1.1rem, 14cqi, 1.75rem);
}

.spark {
  display: block;
  inline-size: 100%;
  block-size: 2.1rem;
  margin-block-start: auto;
  padding-block-start: 0.35rem;
  overflow: visible;
}

.spark-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.75;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.spark-area {
  fill: var(--accent-soft);
  stroke: none;
}

.text-bad { color: var(--bad); }
.text-warn { color: var(--warn); }

.build-list .short-parts {
  display: block;
  margin-block-start: 0.15rem;
}

.build-count {
  white-space: nowrap;
}

/* The Sales page's links to pages the menu does not have. */
.page-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin-block: 0.25rem var(--gap);
}

.page-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.page-links a:hover {
  color: var(--accent-bright);
}

/* Row buttons show when the pointer is on the row; touch screens always show them. */
@media (hover: hover) {
  .list > li .row-action,
  .table tr .row-action {
    opacity: 0;
  }

  .list > li:hover .row-action,
  .list > li .row-action:focus-visible,
  .table tr:hover .row-action,
  .table tr .row-action:focus-visible {
    opacity: 1;
  }
}

/* ---------- Cameras (decision 0033): the shop's cameras through the 3DISM app on the shop PC ---------- */

.cctv .tabs .tab {
  background: none;
  border: 0;
  border-block-end: 2px solid transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.cctv .tabs .tab.is-active {
  border-block-end-color: var(--accent);
}

.cctv-summary {
  margin-block: 0.5rem;
}

.cctv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-block-start: 0.5rem;
}

@media (min-width: 900px) {
  .cctv-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 6px;
  }
}

.cctv-tile {
  position: relative;
  display: block;
  inline-size: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  background: #0b0b0b;
  overflow: hidden;
  cursor: pointer;
  font: inherit;
  color: var(--text);
}

.cctv-tile video,
.cctv-zoom video {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: contain;
}

.cctv-tile video {
  position: absolute;
  inset: 0;
}

.cctv-tile[data-motion="motion"] {
  box-shadow: inset 0 0 0 2px var(--warn);
}

.cctv-tile[data-motion="person"] {
  box-shadow: inset 0 0 0 2px var(--info);
}

.cctv-cap {
  position: absolute;
  inset-block-start: 0.35rem;
  inset-inline-start: 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-inline-size: calc(100% - 0.7rem);
  padding-block: 0.1rem;
  padding-inline: 0.5rem;
  background: rgb(0 0 0 / 0.6);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.cctv-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.cctv-no {
  color: var(--accent-bright);
}

.cctv-badge {
  position: absolute;
  inset-block-end: 0.35rem;
  inset-inline-end: 0.35rem;
  padding-block: 0.05rem;
  padding-inline: 0.45rem;
  background: var(--warn);
  color: #1c1c1c;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.cctv-tile[data-motion="person"] .cctv-badge {
  background: var(--info);
}

.cctv-msg {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0.75rem;
  color: var(--subtle);
  font-size: 0.85rem;
  text-align: center;
  pointer-events: none;
}

/* one camera over the whole screen */
.cctv-single {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: #000;
  padding-block: env(safe-area-inset-top) env(safe-area-inset-bottom);
}

.cctv-open .bottomnav {
  display: none;
}

.cctv-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-block: 0.35rem;
  padding-inline: 0.5rem;
  background: var(--ink-deep);
}

.cctv-head {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-inline-size: 0;
  line-height: 1.25;
}

.cctv-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cctv-tools {
  justify-content: space-around;
}

.cctv-stage {
  position: relative;
  flex: 1;
  min-block-size: 0;
  overflow: hidden;
  background: #000;
  touch-action: none;
}

.cctv-stage:fullscreen {
  inline-size: 100%;
  block-size: 100%;
}

.cctv-zoom {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
}

.btn.is-on {
  border-color: var(--accent);
  color: var(--accent-bright);
}

.cctv-tap {
  position: fixed;
  inset-block-end: calc(var(--nav-h) + 1rem + env(safe-area-inset-bottom));
  inset-inline: 1rem;
  z-index: 70;
  justify-content: center;
}

/* playback */
.cctv-play {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-block-start: 0.5rem;
}

.cctv-cams,
.cctv-filters {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-block-end: 0.15rem;
}

.cctv-cam {
  flex: none;
  min-block-size: 2.5rem;
  padding-inline: 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--ink-deep);
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.cctv-cam.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.cctv-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.cctv-row > .btn {
  flex: none;
}

.cctv-row input.cctv-date {
  flex: 1 1 8rem;
  inline-size: auto;
  min-inline-size: 0;
}

.cctv-stage-play {
  flex: none;
  aspect-ratio: 4 / 3;
  max-block-size: 62vh;
}

.cctv-clock {
  margin-inline: 0.4rem;
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.cctv-play-btn {
  min-inline-size: 3rem;
  justify-content: center;
}

.cctv-row select.cctv-speed {
  flex: none;
  inline-size: auto;
}

.cctv-timeline {
  display: block;
  inline-size: 100%;
  block-size: 4.25rem;
  touch-action: none;
  cursor: pointer;
}

.cctv-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  color: var(--subtle);
  font-size: 0.8rem;
}

.cctv-legend span::before {
  content: "";
  display: inline-block;
  inline-size: 0.65rem;
  block-size: 0.65rem;
  margin-inline-end: 0.35rem;
}

.cctv-legend [data-k="regular"]::before {
  background: #16a34a;
}

.cctv-legend [data-k="motion"]::before {
  background: var(--warn);
}

.cctv-legend [data-k="person"]::before {
  background: var(--info);
}

/* events */
.cctv-events {
  margin-block-start: 0.75rem;
}

.cctv-ev-list {
  list-style: none;
  margin: 0;
  margin-block-start: 0.5rem;
  padding: 0;
}

.cctv-ev-day {
  padding-block: 0.75rem 0.25rem;
  color: var(--subtle);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.cctv-ev button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "time what" "time where";
  align-items: center;
  column-gap: 0.75rem;
  inline-size: 100%;
  padding-block: 0.5rem;
  padding-inline: 0.5rem;
  border: 0;
  border-block-end: 1px solid var(--line);
  border-inline-start: 3px solid var(--warn);
  background: none;
  color: var(--text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.cctv-ev[data-kind="person"] button {
  border-inline-start-color: var(--info);
}

.cctv-ev[data-kind="bad"] button {
  border-inline-start-color: var(--bad);
}

.cctv-ev[data-kind="ok"] button {
  border-inline-start-color: var(--ok);
}

.cctv-ev-time {
  grid-area: time;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.cctv-ev-what {
  grid-area: what;
}

.cctv-ev button > .sub {
  grid-area: where;
}

/* ---------- Phase 2: stock table, levels, batch plan, prices (decision 0034) ---------- */

.table th a.sort {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.table th a.sort:hover,
.table th a.sort.is-on {
  color: var(--accent-bright);
}

.stock-table .with-thumb {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
}

.stock-table .code {
  white-space: nowrap;
}

.stock-table .with-thumb:hover .title {
  color: var(--accent-bright);
}

.level-input {
  inline-size: 6.5rem;
  min-block-size: 2.25rem;
}

.levels-table tr.is-error td {
  background: var(--bad-bg);
}

.plan-form {
  align-items: flex-end;
}

.plan-form .field {
  margin: 0;
}

.plan-form input {
  inline-size: 6rem;
}

.plan-sum {
  margin-block: 0 0.75rem;
}

.price-spark .spark {
  max-inline-size: 16rem;
  margin-block: 0 0.5rem;
}

/* ---------- Phase 3: profit, collections, service (decision 0035) ---------- */

.year-tabs {
  margin-block: var(--gap);
}

.collect .card-title {
  align-items: flex-start;
}

.collect-total {
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.collect-msg {
  margin-block-start: 0.75rem;
}

.collect-msg summary {
  cursor: pointer;
  color: var(--accent-bright);
  font-weight: 600;
}

.collect-msg textarea {
  inline-size: 100%;
  font-family: var(--font);
}

.collect-msg form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-block-start: 0.6rem;
}

/* "Open in WhatsApp (phone number)" is wider than a phone's screen. */
.collect-msg .btn {
  flex-wrap: wrap;
  white-space: normal;
}

/* The review card's one-tap buttons, one per language (decision 0046). On a phone the label
   wraps beside its icon. */
.review-ask {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-block-start: 0.75rem;
}

.review-ask .btn {
  white-space: normal;
  text-align: start;
}

.review-ask bdi {
  white-space: nowrap;
}


/* ---------- The buyer's signing page (decision 0041) ---------- */

/* No menu and no bottom bar: a narrow column like a form on paper. */
.sign-page .page {
  max-inline-size: 44rem;
  padding-block-end: 2.5rem;
}

.agreement-text {
  max-block-size: 26rem;
  overflow-y: auto;
  padding-block: 0.25rem;
  padding-inline: 1rem;
  background: var(--ink-deep);
  border: 1px solid var(--line);
  line-height: 1.55;
}

.agreement-text h3 {
  margin-block: 1rem 0.35rem;
  font-size: 1rem;
}

.agreement-text ul {
  margin-block: 0.35rem;
  padding-inline-start: 1.25rem;
}

/* White like paper, whatever the page's theme, so the ink shows as it will on the PDF. */
.signature-pad {
  position: relative;
}

.signature-pad canvas {
  display: block;
  inline-size: 100%;
  block-size: 12rem;
  background: #fff;
  border: 2px dashed var(--line-strong);
  touch-action: none;
  cursor: crosshair;
}

.signature-pad [data-signature-clear] {
  position: absolute;
  inset-block-start: 0.4rem;
  inset-inline-end: 0.4rem;
}

/* A long sentence beside a box: the box keeps its size and sits by the first line. */
.sign-page .check {
  align-items: flex-start;
}

.sign-page .check input {
  flex: none;
  inline-size: 1.25rem;
  block-size: 1.25rem;
  margin-block-start: 0.2rem;
}

/* A buyer record's paper way, folded away below online signing (decision 0041). */
.other-way > summary {
  cursor: pointer;
  margin-block-end: var(--gap);
  padding-block: 0.9rem;
  padding-inline: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
}

/* ---------- The Machines page (decision 0042), like the desktop app's tab ---------- */

.mx-head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mx-bell {
  position: relative;
}

.mx-bell .tab-count {
  position: absolute;
  inset-block-start: -0.4rem;
  inset-inline-end: -0.4rem;
  background: var(--warn);
  color: var(--ink-deep);
}

.mx .tabs .tab {
  border-block-start: 0;
  border-inline: 0;
  background: none;
  font: inherit;
  font-weight: 700;
}

.mx-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-block: 0.75rem;
}

.mx-tools[hidden] {
  display: none;
}

.mx-chips {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.mx-tool-buttons {
  display: flex;
  gap: 0.35rem;
}

.mx-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-block-size: 2.25rem;
  padding-inline: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink-deep);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.mx-chip.is-on {
  border-color: var(--accent);
  color: var(--text);
}

.mx-dot {
  display: inline-block;
  inline-size: 0.5rem;
  block-size: 0.5rem;
  border-radius: 50%;
  background: var(--grey);
}

[data-status="printing"] .mx-dot,
[data-group="printing"] .mx-dot {
  background: var(--accent);
}

[data-status="paused"] .mx-dot,
[data-group="paused"] .mx-dot {
  background: var(--warn);
}

[data-status="complete"] .mx-dot,
[data-group="done"] .mx-dot {
  background: var(--info);
}

[data-status="error"] .mx-dot,
[data-status="fault"] .mx-dot,
[data-group="help"] .mx-dot {
  background: var(--bad);
}

.mx-grid,
.mx-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 0.75rem;
}

.mx-grid[hidden],
.mx-wall[hidden] {
  display: none;
}

.mx-wall {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr));
  gap: 0.5rem;
  margin-block-start: 0.75rem;
}

.mx-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--card);
}

.mx-card[hidden] {
  display: none;
}

.mx-cam {
  position: relative;
  display: block;
  inline-size: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: var(--ink-deep);
  color: var(--subtle);
}

.mx-cam-img,
.mx-tile img {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  opacity: 0;
}

.has-frame .mx-cam-img,
.has-frame.mx-tile img {
  opacity: 1;
}

.mx-cam-msg {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
}

.mx-thumb {
  position: absolute;
  inset-block-end: 0.4rem;
  inset-inline-end: 0.4rem;
  inline-size: 28%;
  max-block-size: 60%;
  object-fit: contain;
  background: rgb(0 0 0 / 0.45);
}

.thumb-main .mx-thumb {
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  max-block-size: none;
  background: none;
}

.mx-pill {
  position: absolute;
  inset-block-start: 0.4rem;
  inset-inline-start: 0.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding-block: 0.15rem;
  padding-inline: 0.5rem;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.65);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
}

.mx-band {
  block-size: 3px;
  background: var(--ink-deep);
}

.mx-band i {
  display: block;
  block-size: 100%;
  background: var(--accent);
}

[data-status="paused"] .mx-band i {
  background: var(--warn);
}

[data-status="complete"] .mx-band i {
  background: var(--info);
}

[data-status="error"] .mx-band i,
[data-status="fault"] .mx-band i {
  background: var(--bad);
}

.mx-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.7rem;
}

.mx-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.mx-title-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-inline-size: 0;
  font-size: 0.78rem;
  line-height: 1.25;
}

.mx-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mx-model {
  color: var(--subtle);
}

.mx-serial {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
}

.mx-pct {
  color: var(--accent-bright);
  font-size: 1.3rem;
  font-weight: 700;
}

.mx-file {
  overflow-wrap: anywhere;
  font-weight: 600;
}

.mx-file:empty,
.mx-time:empty,
.mx-temps:empty,
.mx-erp:empty {
  display: none;
}

.mx-time,
.mx-temps,
.mx-erp {
  color: var(--muted);
  font-size: 0.82rem;
}

.mx-temps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.75rem;
  color: var(--subtle);
}

.mx-erp {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.mx-erp .icon {
  inline-size: 0.9rem;
  block-size: 0.9rem;
}

.mx-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.7rem;
  border-block-start: 1px solid var(--line);
}

.mx-actions .btn {
  gap: 0.3rem;
  padding-inline: 0.5rem;
  font-size: 0.85rem;
}

.mx-actions .icon {
  inline-size: 1rem;
  block-size: 1rem;
}

.mx-more {
  margin-inline-start: auto;
}

.mx-tile {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--card);
}

.mx-tile figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.mx-tile .mx-serial {
  color: var(--text);
  font-size: 1rem;
}

.mx-sheet {
  inline-size: min(100% - 2rem, 32rem);
  max-block-size: 85dvh;
  padding: 0;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--text);
}

.mx-sheet::backdrop {
  background: rgb(0 0 0 / 0.6);
}

.mx-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-block-end: 1px solid var(--line);
}

.mx-sheet-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.mx-sheet-body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem;
}

.mx-sheet-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mx-menu-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-block-size: 2.75rem;
  padding-inline: 0.5rem;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: start;
  text-decoration: none;
}

.mx-menu-row:disabled {
  opacity: 0.45;
}

.mx-menu-row.is-danger {
  color: var(--bad);
}

.mx-ticks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.25rem 0.75rem;
}

.mx-tick {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-block-size: 2.25rem;
}

.mx-tick .muted {
  font-size: 0.75rem;
}

.mx-script {
  inline-size: 100%;
  font-family: ui-monospace, Consolas, monospace;
}

.mx-progress {
  block-size: 6px;
  background: var(--ink-deep);
}

.mx-progress[hidden] {
  display: none;
}

.mx-progress i {
  display: block;
  inline-size: 0;
  block-size: 100%;
  background: var(--accent);
}

.mx-result {
  margin: 0;
  font-size: 0.88rem;
}

.mx-result.is-ok {
  color: var(--ok);
}

.mx-result.is-bad {
  color: var(--bad);
}

.mx-job {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding-block: 0.5rem;
  border-block-end: 1px solid var(--line);
  font-size: 0.88rem;
}

.mx-job-file {
  overflow-wrap: anywhere;
  font-weight: 600;
}

.mx-live {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: #000;
}

.mx-live[hidden] {
  display: none;
}

.mx-live-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem;
  font-weight: 700;
}

.mx-live-head .btn:first-of-type {
  margin-inline-start: auto;
}

.mx-live img {
  flex: 1;
  min-block-size: 0;
  inline-size: 100%;
  object-fit: contain;
}

.mx-flash {
  position: fixed;
  inset-block-end: calc(var(--bottomnav-space, 4.5rem) + 0.5rem);
  inset-inline: 1rem;
  z-index: 70;
  margin: 0;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line-strong);
  background: var(--ink-deep);
  color: var(--text);
}

.mx-flash[hidden] {
  display: none;
}

.mx-flash[data-kind="bad"] {
  border-color: var(--bad);
  color: var(--bad);
}

/* ---------- The Social page (decision 0043) ---------- */

.sx .tabs .tab {
  border-block-start: 0;
  border-inline: 0;
  background: none;
  font: inherit;
  font-weight: 700;
}

.sx section[hidden] {
  display: none;
}

.sx-small {
  font-size: 0.8rem;
}

.sx-end {
  margin-inline-start: auto;
}

.sx-h3 {
  margin: 0;
  font-size: 0.92rem;
}

.sx-clip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sx-item {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-block-end: 0.6rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
  background: var(--card);
}

.sx-item.is-lead {
  border-inline-start: 3px solid var(--warn);
}

.sx-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.sx-tag {
  padding-inline: 0.4rem;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.sx-tag.is-done {
  border-color: var(--accent);
  color: var(--accent-bright);
}

.sx-text,
.sx-caption {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.sx-caption {
  max-block-size: 14rem;
  overflow-y: auto;
  padding: 0.5rem;
  background: var(--field);
  font-size: 0.88rem;
}

.sx-draft,
.sx-url {
  inline-size: 100%;
}

.sx-actions {
  padding: 0;
  border: 0;
}

.sx-post,
.sx-cal {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  inline-size: 100%;
  margin-block-end: 0.5rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font: inherit;
  text-align: start;
}

.sx-cover {
  flex: none;
  inline-size: 4.5rem;
  block-size: 4.5rem;
  object-fit: cover;
  background: var(--ink-deep);
}

.sx-post-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.2rem;
  min-inline-size: 0;
}

.sx-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.sx-time {
  font-weight: 700;
}

.sx-day {
  margin-block-start: 0.75rem;
}

.sx-day .sx-h3 {
  margin-block-end: 0.35rem;
  color: var(--muted);
}

.sx-day.is-today .sx-h3 {
  color: var(--accent-bright);
}

.sx-approve {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--field);
}

.sx-platform {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-block-end: 0.7rem;
  border-block-end: 1px solid var(--line);
}

.sx-mark {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.sx-mark .sx-url {
  flex: 1 1 100%;
  min-inline-size: 0;
}

.sx-file {
  margin: 0;
}

.sx-file img,
.sx-file video {
  display: block;
  inline-size: 100%;
  max-block-size: 22rem;
  object-fit: contain;
  background: var(--ink-deep);
}

.sx-file figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-block-start: 0.3rem;
  overflow-wrap: anywhere;
}

.sx-file figcaption .btn {
  margin-inline-start: auto;
}

.sx-charts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: 0.6rem;
}

.sx-chart {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-block: 0.6rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
  background: var(--card);
}

.sx-line {
  display: block;
  inline-size: 100%;
  block-size: 6rem;
  touch-action: pan-y;
}

.sx-stroke {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2px;
}

.sx-axis,
.sx-cross {
  stroke: var(--line);
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
}

.sx-cross {
  stroke: var(--line-strong);
}

.sx-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  block-size: 6rem;
  border-block-end: 1px solid var(--line);
}

.sx-bar {
  display: flex;
  flex: 1;
  align-items: flex-end;
  block-size: 100%;
  padding: 0;
  border: 0;
  background: none;
}

.sx-bar i {
  display: block;
  inline-size: 100%;
  border-start-start-radius: 4px;
  border-start-end-radius: 4px;
  background: var(--accent);
}

.sx-best {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-block-start: 0.75rem;
}

.sx-best-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding-block: 0.45rem;
  border-block-end: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

.sx-best-row .muted {
  flex: none;
}

.sx-report {
  margin: 0;
  overflow-x: auto;
  font-size: 0.78rem;
  white-space: pre-wrap;
}
