/* The app's primitives in CSS, with the measurements of mobile/src/ui/*.tsx:
   Blueprint, Button, StatusBlock, StatusTag, ProgressBar, Chip, ListRow, tabs, the Confirm table, Toast. */

/* — Blueprint (Blueprint.tsx): square hairline frame with four 11px "+" marks drawn 6px outside the
   corners, so each cross sits on the frame's corner. One pseudo-element, no extra markup. — */
.blueprint, .btn-primary { position: relative; }
.blueprint { border: 1px solid var(--bp-border, var(--color-divider)); border-radius: var(--radius); }
.blueprint::after, .btn-primary::after {
  content: ""; position: absolute; inset: -6px; pointer-events: none;
  --m: var(--color-corner-mark);
  background:
    linear-gradient(var(--m), var(--m)) left 5px top 0 / 1px 11px,
    linear-gradient(var(--m), var(--m)) left 0 top 5px / 11px 1px,
    linear-gradient(var(--m), var(--m)) right 5px top 0 / 1px 11px,
    linear-gradient(var(--m), var(--m)) right 0 top 5px / 11px 1px,
    linear-gradient(var(--m), var(--m)) left 5px bottom 0 / 1px 11px,
    linear-gradient(var(--m), var(--m)) left 0 bottom 5px / 11px 1px,
    linear-gradient(var(--m), var(--m)) right 5px bottom 0 / 1px 11px,
    linear-gradient(var(--m), var(--m)) right 0 bottom 5px / 11px 1px;
  background-repeat: no-repeat;
}

/* — Button (Button.tsx): one solid primary per screen, with corner marks; hairline secondary; ghost. — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 56px; padding: 0 22px;
  font-family: var(--font-heading); font-weight: 600; font-size: 18px; line-height: 1.1;
  text-align: center; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--radius); background: transparent;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent-600); color: var(--color-bg); }
.btn-primary:active { background: var(--color-accent-700); }
.btn-secondary { height: 48px; font-size: 16px; border-color: var(--color-divider); color: var(--color-text); }
.btn-secondary:hover { background: rgba(29, 31, 32, 0.07); color: var(--color-text); }
.btn-secondary:active { background: var(--color-pressed-neutral); }
/* The app draws ghost labels in accent; on the site they are real links, so they use accent-700 for AA contrast. */
.btn-ghost { height: 44px; padding: 0 4px; font-size: 16px; color: var(--color-accent-700); }
.btn-ghost:hover { background: rgba(89, 128, 166, 0.1); color: var(--color-accent-800); }
.btn-hero { height: 60px; font-size: 20px; }
.btn-secondary.btn-hero { height: 56px; font-size: 18px; }
.btn-compact { height: 44px; font-size: 15px; padding: 0 14px; }
.btn-block { display: flex; width: 100%; }

/* — ProgressBar (ProgressBar.tsx): 4px; track = fill color at 20% (status blocks) or neutral-300 (lists). — */
.progress { position: relative; height: 4px; width: 100%; background: var(--track, var(--color-neutral-300)); }
.progress > span { position: absolute; inset: 0 auto 0 0; background: var(--fill, currentColor); }
.fill-100 { width: 100%; }
.fill-92 { width: 92%; }
.fill-54 { width: 54%; }
.fill-30 { width: 30%; }
.fill-0 { width: 0; }

/* — StatusBlock (StatusBlock.tsx) with the status model of theme.ts — */
.is-overdue { --s-bg: var(--status-overdue-block-bg); --s-fg: var(--status-overdue-block-fg); --s-border: var(--status-overdue-block-border); }
.is-due-soon { --s-bg: var(--status-due-soon-block-bg); --s-fg: var(--status-due-soon-block-fg); --s-border: var(--status-due-soon-block-border); }
.is-good { --s-bg: var(--status-good-block-bg); --s-fg: var(--status-good-block-fg); --s-border: var(--status-good-block-border); }
.status-block {
  --bp-border: var(--s-border);
  background: var(--s-bg); color: var(--s-fg);
  padding: 16px 18px;
}
.status-block.size-hero { padding: 20px; }
.sb-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
.sb-status { font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; }
.sb-name { font-family: var(--font-heading); font-weight: 600; font-size: 22px; line-height: 1.2; margin-top: 10px; }
.sb-count { display: flex; align-items: baseline; gap: 10px; font-family: var(--font-heading); font-weight: 600; }
.sb-num { font-size: var(--num-large); line-height: 1; letter-spacing: -0.02em; }
.sb-unit { font-size: 22px; }
.size-hero .sb-num { font-size: var(--num-hero); line-height: 0.95; }
.size-hero .sb-unit { font-size: 26px; }
.status-block .progress { --fill: var(--s-fg); --track: color-mix(in srgb, var(--s-fg) 20%, transparent); margin-top: 8px; }
.size-hero .progress { margin-top: 12px; }
.sb-foot { font-size: 13px; margin-top: 8px; }
.size-hero .sb-foot { font-size: 14px; margin-top: 10px; }

/* — StatusTag (StatusTag.tsx): fixed 72px — */
.status-tag {
  display: inline-flex; justify-content: center; flex: none; width: 72px;
  padding: 3px 4px; border: 1px solid; font-size: 11px; letter-spacing: 0.02em; line-height: 1.35; white-space: nowrap;
}
.status-tag.is-overdue { background: var(--status-overdue-tag-bg); color: var(--status-overdue-tag-fg); border-color: var(--status-overdue-tag-border); }
.status-tag.is-due-soon { background: var(--status-due-soon-tag-bg); color: var(--status-due-soon-tag-fg); border-color: var(--status-due-soon-tag-border); }
.status-tag.is-good { background: var(--status-good-tag-bg); color: var(--status-good-tag-fg); border-color: var(--status-good-tag-border); }

/* — Chip (Chip.tsx): small 36px filter chips, default 48px option chips — */
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 8px; border: 1px solid var(--color-divider);
  font-size: 15px; color: var(--color-text); white-space: nowrap;
}
.chip-small { height: 36px; padding: 0 12px; font-size: 13px; }
.chip.is-selected { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-bg); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* — ListRow (ListRow.tsx): 56px row, chevron, hairline bottom divider — */
.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 0 2px; border-bottom: 1px solid var(--color-divider);
  font-size: 16px; color: var(--color-text); text-decoration: none;
}
.list-row svg { width: 18px; height: 18px; flex: none; }
a.list-row:hover { background: var(--color-neutral-200); color: var(--color-text); }

/* — System detail tabs: 4 columns, 44px, condensed 16px, active accent-700 with a 2px accent underline — */
.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--color-divider); }
.tabs > span {
  display: flex; align-items: center; justify-content: center; height: 44px;
  font-family: var(--font-heading); font-weight: 600; font-size: 16px; color: var(--color-neutral-700);
}
.tabs > .is-active { color: var(--color-accent-700); box-shadow: inset 0 -2px 0 var(--color-accent); }

/* — Confirm step table (ConfirmStep.tsx) — */
.kv { border: 1px solid var(--color-divider); }
.kv > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px; }
.kv > div + div { border-top: 1px solid var(--color-divider); }
.kv dt { color: var(--color-neutral-700); font-size: 15px; }
.kv dd { margin: 0; font-weight: 500; font-size: 15px; text-align: right; }
.kv .kv-number { font-family: var(--font-heading); font-weight: 600; font-size: 26px; line-height: 1.1; }

/* — Toast (Toast.tsx) — */
.toast {
  padding: 14px 16px; background: var(--color-neutral-900); color: var(--color-bg);
  font-size: 15px; line-height: 1.4; box-shadow: var(--shadow-lg);
}

/* — Reader card (System detail → Reader tab) — */
.reader-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--color-divider); }
.reader-card > div { padding: 12px; }
.reader-card > .wide { grid-column: 1 / -1; border-bottom: 1px solid var(--color-divider); }
.reader-card > div + div + div { border-left: 1px solid var(--color-divider); }
.reader-card .label { font-size: 12px; color: var(--color-neutral-700); }
.reader-card .value { font-family: var(--font-heading); font-weight: 600; font-size: 22px; line-height: 1.2; }
.reader-card .name { font-family: var(--font-heading); font-weight: 600; font-size: 20px; line-height: 1.2; }
.reader-card .state { font-size: 14px; }
