/* Staff PWA (spec 26.1, 26.2): light theme, high contrast, big tabular numbers, 56 px money
   buttons. Customer-facing amounts 64 px, staff amounts 48 px. Accent only on the primary button. */
:root {
  /* v1 §6 shared visual system: base #F5F7FA, ink #152238, primary #155EEF, success #067647,
     error #B42318, attention #92400E. Pairs checked at >= 4.5:1 for text, >= 7:1 for amounts. */
  --bg: #f5f7fa;
  --panel: #ffffff;
  --text: #152238;
  --muted: #4a5568;
  --border: #d5dce6;
  --accent: #155eef;
  --accent-text: #ffffff;
  --ok: #067647;
  --ok-bg: #e7f4ec;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --warn: #92400e;
  --warn-bg: #fff4e0;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}
body {
  font:
    16px/1.4 system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  font-variant-numeric: tabular-nums;
}
button,
input,
select {
  font: inherit;
}

.strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 12px;
  padding: 8px 16px;
  font-size: 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.strip-left {
  display: flex;
  flex-direction: column;
}
.strip-left strong {
  font-size: 16px;
}
.strip-left span {
  color: var(--muted);
}
.timer {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.icon-btn {
  min-width: 48px;
  min-height: 48px;
  background: none;
  border: 0;
  font-size: 20px;
}
.preview-banner {
  background: var(--warn-bg);
  color: var(--warn);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  padding: 6px 16px;
}
.strip-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bad);
  display: inline-block;
}
.dot-on {
  background: var(--ok);
}

.screen {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
h1 {
  font-size: 24px;
  margin: 0;
}
.muted {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}
.error {
  color: var(--bad);
  min-height: 1.4em;
  margin: 0;
  font-size: 16px;
}

.amount {
  font-size: 48px;
  font-weight: 700;
  text-align: center;
  line-height: 1.1;
  word-break: break-word;
}
.amount-customer {
  font-size: 64px;
}

.amount-entry {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.quick-btn {
  min-height: 48px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 10px;
  font-size: 16px;
}
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.key {
  min-height: 56px;
  font-size: 24px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 10px;
}
.key:active,
.quick-btn:active {
  background: var(--border);
}

.actions {
  display: flex;
  gap: 12px;
}
.actions > button {
  flex: 1;
}
.actions-bottom {
  margin-top: auto;
}
#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
#app > .screen {
  width: 100%;
}
.confirm {
  flex: 1;
}
.primary,
.secondary {
  min-height: 48px;
  border-radius: 10px;
  padding: 0 16px;
  font-weight: 600;
}
.primary {
  background: var(--accent);
  color: var(--accent-text);
  border: 0;
}
.primary:disabled {
  opacity: 0.4;
}
.secondary {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
}
.money {
  min-height: 56px;
  font-size: 20px;
}
.link {
  background: none;
  border: 0;
  color: var(--accent);
  padding: 4px;
  text-decoration: underline;
}

.chip {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  text-align: center;
}
.chip-ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.chip-warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.chip-info {
  background: var(--panel);
  border: 1px solid var(--border);
  font-weight: 600;
}

.breakdown {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  margin: 0;
  font-size: 18px;
}
.breakdown dt {
  color: var(--muted);
}
.breakdown dd {
  margin: 0;
  text-align: right;
}

.waiting {
  align-items: center;
  text-align: center;
  padding-top: 32px;
}
.waiting .actions {
  width: 100%;
}
.arm {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
}
.pulse {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 6px solid var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    transform: scale(0.85);
    opacity: 0.5;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}
.spinner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 6px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.charging {
  align-items: center;
  text-align: center;
  padding-top: 64px;
}
@media (prefers-reduced-motion: reduce) {
  .pulse,
  .spinner {
    animation: none;
  }
}

.full {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 16px;
  text-align: center;
}
.full-ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.full-bad {
  background: var(--bad-bg);
  color: var(--bad);
}
.full-warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.full-mark {
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
}
.full h1 {
  font-size: 32px;
}
.full .reason {
  font-size: 22px;
  color: var(--text);
}
.full .actions {
  width: 100%;
  max-width: 480px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  color: var(--muted);
}
.field input,
.field select {
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font-size: 18px;
}

.scan {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}
.scan video {
  width: 100%;
  border-radius: 12px;
  background: #000;
}

/* v1 §6 screen catalogue: label-over-value blocks, one bottom action, bottom navigation. */
.page h1 {
  font-size: 28px;
}
.page h2 {
  font-size: 18px;
  margin: 8px 0 4px;
}
.page.has-nav,
.screen.has-nav {
  padding-bottom: 88px;
}
.page .actions-bottom {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  padding: 8px 0;
}
.has-nav .actions-bottom {
  bottom: 64px;
}
.context {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.back {
  align-self: flex-start;
  text-decoration: none;
  min-height: 44px;
}
.page-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.unwired {
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 14px;
}
.toast {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--text);
  color: #fff;
  font-size: 14px;
}
.kv {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kv-label {
  color: var(--muted);
  font-size: 16px;
}
.kv-value {
  font-size: 24px;
  font-weight: 700;
}
.kv-big .kv-value {
  font-size: 32px;
}
.kv-ok .kv-value {
  color: var(--ok);
}
.kv-bad .kv-value {
  color: var(--bad);
}
.kv-warn .kv-value {
  color: var(--warn);
}
.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.kv-grid .kv-value {
  font-size: 20px;
}
.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  min-height: 56px;
}
.row + .row {
  border-top: 1px solid var(--border);
}
.row-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.row-title {
  font-weight: 600;
}
.row-sub {
  color: var(--muted);
  font-size: 14px;
}
.row-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.row-right {
  font-weight: 700;
}
.small {
  min-height: 40px;
  padding: 0 12px;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
a.secondary {
  border-radius: 10px;
}
.chip-inline {
  display: inline-block;
  padding: 4px 8px;
  font-size: 13px;
}
.chip-bad {
  background: var(--bad-bg);
  color: var(--bad);
}
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.tile {
  min-height: 56px;
  font-size: 16px;
}
.denoms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.denom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 8px;
  font-size: 15px;
}
.denom input {
  width: 64px;
  min-height: 40px;
  text-align: right;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 18px;
}
.toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 56px;
  padding: 0 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.toggle input {
  width: 28px;
  height: 28px;
}
.field textarea {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
}
.section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
details {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
}
.pulse-small {
  width: 64px;
  height: 64px;
  align-self: center;
}
.navbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 5;
}
.nav-item {
  flex: 1;
  min-height: 56px;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 14px;
}
.nav-on {
  color: var(--accent);
  font-weight: 700;
  box-shadow: inset 0 3px 0 var(--accent);
}
.code-display {
  letter-spacing: 0.08em;
  font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  font-size: 40px;
}
/* v1.2 counter app pages (`#/alur/counter`). Sizes follow the design's phone screen
   (ui/shell.html): 15 px text, 25 px title, 20 px side padding. */
.cp {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--panel);
  font:
    15px/1.5 system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
}
.cp-header {
  display: flex;
  flex-direction: column;
  padding: 17px 20px;
  border-bottom: 1px solid var(--border);
}
.cp-header small {
  font-size: 12px;
  color: #526277;
}
.cp-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
}
.cp-body h1 {
  font-size: 25px;
  line-height: 1.2;
  margin: 0 0 20px;
}
.cp-intro {
  margin: 0;
  color: #526277;
}
.cp-hint {
  margin: 15px 0 0;
  padding: 12px;
  border-radius: 9px;
  background: #f0f4fa;
  color: #526277;
  font-size: 13px;
}
.cp-field {
  margin-top: 16px;
  font-size: 13px;
  color: #526277;
}
.cp-field input,
.cp-field select {
  min-height: 48px;
  padding: 12px;
  border: 1px solid #c3cddd;
  border-radius: 8px;
  font-size: 15px;
  background: var(--panel);
  color: var(--text);
}
.cp-field select {
  width: 100%;
  box-sizing: border-box;
}
.cp-body .error {
  margin-top: 8px;
  font-size: 13px;
}
.cp-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 17px;
}
.cp-actions button {
  min-height: 48px;
  border-radius: 9px;
}
.cp-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.cp-metric {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  overflow-wrap: anywhere;
}
.cp-metric small {
  display: block;
  color: #526277;
}
.cp-metric strong {
  display: block;
  font-size: 19px;
  margin-top: 6px;
}
.cp-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 12px;
  table-layout: fixed;
}
.cp-table th,
.cp-table td {
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding: 9px 5px;
  overflow-wrap: anywhere;
  vertical-align: top;
}
.cp-table th {
  background: #f0f4fa;
}
.cp-table th:first-child,
.cp-table td:first-child {
  width: 32%;
}
.cp-note {
  margin: 0;
  padding: 15px;
  background: #fff1db;
  color: #854e00;
  border-radius: 10px;
}
.cp-blocked {
  display: block;
  font-size: 12px;
  color: #92400e;
}
.cp-check {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.cp-check input {
  width: 22px;
  min-height: 22px;
  margin: 0 0 0 4px;
}
.cp-nav {
  display: flex;
  border-top: 1px solid var(--border);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
}
.cp-nav button {
  flex: 1;
  border: 0;
  background: none;
  padding: 8px 4px;
  font-size: 12px;
  color: #526277;
}
.cp-nav button[aria-current='page'] {
  color: #155eef;
  font-weight: 700;
}
.cp-amount {
  margin: 4px 0 20px;
  font-size: 46px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  overflow-wrap: anywhere;
}
.cp-quick,
.cp-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.cp-quick button,
.cp-keypad button {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
}
.cp-quick {
  margin-bottom: 10px;
}
.cp-quick button {
  min-height: 44px;
  border-radius: 9px;
  font-size: 13px;
}
.cp-keypad button {
  min-height: 58px;
  border-radius: 9px;
  font-size: 22px;
}
.cp-wait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  text-align: center;
}
.cp-wait .pulse {
  margin: 8px 0;
}
.cp-wait .cp-intro {
  max-width: 28ch;
}
/* Temporary phone log. Sits above the page so a tap can be copied after the error. */
.phone-log {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 40;
  width: min(92vw, 420px);
  font:
    12px/1.4 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
.phone-log-toggle {
  min-height: 36px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font: inherit;
}
.phone-log-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  padding: 8px;
  max-height: 46vh;
  border-radius: 10px;
  background: #111827;
  color: #e5e7eb;
}
.phone-log-panel[hidden] {
  display: none;
}
.phone-log-hint {
  margin: 0;
  color: #cbd5e1;
}
.phone-log-panel pre {
  margin: 0;
  max-height: 28vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.phone-log-actions {
  display: flex;
  gap: 8px;
}
.phone-log-actions button {
  flex: 1;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: #e5e7eb;
  color: #111827;
  font: inherit;
}
.cp-ok {
  background: #e5f4ea;
  color: #067647;
}
.cp-inline {
  align-self: flex-start;
  margin-top: 16px;
  min-height: 48px;
}
.cp-balance {
  margin-top: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.cp-balance small {
  display: block;
  font-size: 13px;
  color: #526277;
}
.cp-balance strong {
  display: block;
  margin-top: 4px;
  font-size: 25px;
}

/* v1.2 shared enrollment controls: keyboard-visible focus, narrow phones and bottom actions. */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #b57600;
  outline-offset: 3px;
}
.cp-field {
  min-width: 0;
  width: 100%;
}
.cp-field input,
.cp-field select {
  width: 100%;
  min-width: 0;
}
.cp-actions {
  margin-top: auto;
  padding-top: 24px;
}
.cp-nav button {
  min-height: 48px;
}
.cp-body {
  min-width: 0;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Compact staff typography; retain large money displays and 48px touch targets. */
.cp {
  font-size: 16px;
}
.cp-body h1 {
  font-size: 20px;
}
.cp-header small,
.cp-hint,
.cp-field {
  font-size: 13px;
}
.cp-field input,
.cp-field select {
  font-size: 16px;
}

/* Reserve the actual variable header/nav height through the flex frame.
   Short screens may scroll naturally; never clip the action controls. */
.cp[data-ui-screen^='T'] .cp-body {
  min-height: 0;
}
.assignment {
  margin: 16px 0;
}
.assignment dt {
  color: var(--muted);
  font-size: 14px;
  margin-top: 12px;
}
.assignment dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.cp-table,
.cp-body .error {
  font-size: 14px;
}

.cp-loading-fields {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.cp-session-header small {
  font-size: 14px;
  overflow-wrap: anywhere;
}
.cp-session-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  font-size: 14px;
}
.cp-session-status button {
  min-height: 48px;
  padding: 8px 12px;
}
.cp[data-ui-screen='C03'] .cp-actions button[data-edge='0'] {
  min-height: 56px;
}

.cp-session-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--panel);
}

.cp .cp-financial-action {
  min-height: 56px;
}
.cp .cp-reference {
  font-size: 14px;
  overflow-wrap: anywhere;
}
.cp .cp-keypad {
  margin-top: 16px;
}
.cp [data-amount] {
  font-size: 24px;
  font-weight: 700;
  text-align: right;
}
.cp .cp-quick button {
  min-height: 48px;
  font-size: 14px;
}
.cp-nav button {
  font-size: 14px;
}
/* The session header has variable height; let the flex frame reserve its actual size. */
.cp:has(.cp-session-header) .cp-body {
  min-height: 0;
}

.cp-consent {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.cp-consent input[type='checkbox'] {
  width: 24px;
  height: 24px;
  min-height: 24px;
  flex: 0 0 24px;
}
/* Counter home keeps operational shortcuts separate from the primary screen actions. */
.cp-home-more summary {
  min-height: 48px;
  padding: 12px 16px;
  cursor: pointer;
  box-sizing: border-box;
}
.cp-extra-actions {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.cp-sale-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.cp-sale-row input[type='radio'] {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.cp-sale-row span {
  min-width: 0;
}
.cp-sale-row small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}
.cp-field textarea {
  font-size: 16px;
  line-height: 1.4;
  min-height: 96px;
  width: 100%;
  max-width: 100%;
  padding: 12px;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
}

/* C19 consent remains a 48px target; the shared full-width input rule must not stretch its checkbox. */
.cp:is(
    [data-ui-screen='C19'],
    [data-ui-screen='C20'],
    [data-ui-screen='C21'],
    [data-ui-screen='C08'],
    [data-ui-screen='C26'],
    [data-ui-screen='C25']
  )
  .cp-check {
  flex-direction: row-reverse;
  align-items: center;
  justify-content: flex-end;
  min-height: 48px;
  gap: 12px;
}
.cp:is(
    [data-ui-screen='C19'],
    [data-ui-screen='C20'],
    [data-ui-screen='C21'],
    [data-ui-screen='C08'],
    [data-ui-screen='C26'],
    [data-ui-screen='C25']
  )
  .cp-check
  input {
  width: 24px;
  min-height: 24px;
  flex: 0 0 24px;
  margin: 0;
}

/* Financial review amounts stay legible; descriptions keep the supporting text size. */
.cp:is([data-ui-screen='C19'], [data-ui-screen='C20'], [data-ui-screen='C21'])
  .cp-table
  td:nth-child(2) {
  font-size: 18px;
  font-weight: 600;
}

.owner-session .owner-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  box-sizing: border-box;
  text-decoration: none;
  text-align: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 600;
}
.owner-session .owner-button.primary {
  color: white;
  background: var(--accent, #155eef);
}
.owner-session .owner-button.secondary {
  color: var(--text);
  background: var(--panel);
}
.owner-session .cp-consent input {
  width: 24px;
  min-height: 24px;
  flex: 0 0 24px;
}
.owner-session [data-owner-workspace] {
  overflow-wrap: anywhere;
}

/* v1.2 C18: readable receipt facts, without repeating a technical status column. */
.cp-receipt {
  margin: 24px 0;
  display: grid;
  gap: 16px;
}
.cp-receipt > div {
  padding-bottom: 12px;
  border-bottom: 1px solid #d6dfed;
}
.cp-receipt dt {
  font-size: 13px;
  color: #475569;
  margin-bottom: 4px;
}
.cp-receipt dd {
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
  overflow-wrap: anywhere;
}

/* Owner contracts retain the shared mobile typography and full-width touch controls. */
.owner-session .cp-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.owner-session .cp-field input,
.owner-session .cp-field select,
.owner-session .cp-field textarea {
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
  min-width: 0;
  padding: 12px;
  border: 1px solid #c3cddd;
  border-radius: 8px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--panel);
}
.owner-session .cp-field textarea {
  min-height: 96px;
  resize: vertical;
}
.owner-session .cp-consent {
  margin-top: 16px;
}
.owner-session dl {
  margin: 20px 0;
}
.owner-session dt {
  font-size: 13px;
  color: #475569;
  margin-bottom: 4px;
}
.owner-session dd {
  font-size: 16px;
  line-height: 1.5;
  margin: 0 0 16px;
  overflow-wrap: anywhere;
}
.owner-session article {
  border: 1px solid #d6dfed;
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
  overflow-wrap: anywhere;
}
.owner-session [data-owner-settings] > .primary {
  margin-top: 16px;
}
.owner-session [data-owner-verify] {
  margin-top: 16px;
}

.owner-session .cp-body {
  overflow-wrap: anywhere;
}

.owner-session [data-statement-sources] details {
  border: 1px solid #d6dfed;
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
}
.owner-session [data-statement-sources] summary {
  min-height: 48px;
  display: grid;
  gap: 8px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.owner-session [data-statement-sources] summary small {
  font-size: 14px;
  color: #475569;
}

.owner-session [data-response-history] summary {
  min-height: 48px;
  padding: 16px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.owner-session [data-response-history] details {
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  margin-block: 12px;
  padding-inline: 12px;
}

.owner-session [data-correction-trace] summary {
  min-height: 48px;
  padding: 16px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.owner-session [data-correction-trace] details {
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  margin-block: 12px;
  padding-inline: 12px;
}

.owner-session .owner-overview-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 12px;
  margin-block: 20px;
}
.owner-session .owner-overview-metrics article {
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 16px;
  margin: 0;
}
.owner-session .owner-overview-metrics h3 {
  font-size: 14px;
  margin: 0 0 8px;
  color: #475569;
}
.owner-session .owner-overview-metrics p {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  overflow-wrap: anywhere;
}

/* Explicit station-source navigation in Counter movement history. */
.cp-source-link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 12px;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--accent);
  overflow-wrap: anywhere;
  margin: 8px 0;
  text-decoration: none;
}

/* Reserve text space and inset the arrow on single-choice dropdowns. */
select:not([multiple]):not([size]),
select:not([multiple])[size='1'] {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23344054' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px 16px;
  padding-right: 44px;
}
@media (forced-colors: active) {
  select:not([multiple]):not([size]),
  select:not([multiple])[size='1'] {
    appearance: auto;
    background-image: none;
  }
}

/* Keep multi-sentence guidance in readable, separate rows. */
.prose-lines {
  display: grid;
  gap: 4px;
}
.prose-lines > span {
  display: block;
}

/* Counter and Tenant forms use the same compact field rhythm. */
form {
  align-content: start;
  row-gap: 16px;
}
form :is(.field, .cp-field) {
  margin-block: 0;
  gap: 8px;
}
form fieldset {
  margin-block: 0;
  padding: 16px;
}
form fieldset > label:has(input:is([type='checkbox'], [type='radio'])) {
  margin-block: 8px;
}

/* Enrollment actions follow the code field instead of the screen bottom. */
.cp:is([data-ui-screen='C01'], [data-ui-screen='T01']) .cp-actions {
  margin-top: 16px;
  padding-top: 0;
}
.cp:is([data-ui-screen='C01'], [data-ui-screen='T01']) .error:empty {
  display: none;
}

/* Quiet loading state; preserve an announced status and reduced-motion preference. */
.cp-loading {
  align-items: center;
  justify-content: center;
}
.cp-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: cp-spin 0.8s linear infinite;
}
.cp-loading-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@keyframes cp-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .cp-spinner {
    animation: none;
  }
}

/* Native Counter recovery views share the current action theme, including
   controls rendered without a generated screen model. */
.cp-body button:not([class]),
.cp-body button[class=''] {
  appearance: none;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  box-shadow: none;
}
.cp-actions:not(:has(.primary)) > button:first-child:not([class]) {
  background: var(--accent);
  color: var(--accent-text);
  border: 0;
}
.cp-body button:not([class]):disabled,
.cp-body button[class='']:disabled {
  opacity: 0.4;
}

/* Compact Counter home shortcuts, with unchanged action labels and handlers. */
.cp[data-ui-screen='C04'] .cp-actions,
.cp[data-ui-screen='C04'] .cp-extra-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.cp[data-ui-screen='C04'] .cp-actions {
  margin-top: 20px;
  padding-top: 0;
}
.cp[data-ui-screen='C04'] .cp-actions button {
  min-width: 0;
  min-height: 56px;
  padding: 10px 8px;
  font-size: 13px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}
.cp[data-ui-screen='C04'] .cp-home-more,
.cp[data-ui-screen='C04'] .cp-blocked {
  grid-column: 1 / -1;
}
.cp[data-ui-screen='C04'] .cp-home-more summary {
  font-size: 14px;
}
@media (max-width: 319px) {
  .cp[data-ui-screen='C04'] .cp-actions,
  .cp[data-ui-screen='C04'] .cp-extra-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Compact staff screens: readable controls retain 48px touch targets. */
.cp {
  font-size: 14px;
  line-height: 1.45;
}
.cp-header {
  padding: 10px 16px;
  gap: 4px;
}
.cp-header strong {
  font-size: 15px;
}
.cp-header small,
.cp-session-header small {
  font-size: 12px;
  line-height: 1.4;
}
.cp-session-status {
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
}
.cp-session-status button {
  font-size: 13px;
  padding: 6px 10px;
}
.cp-body {
  padding: 18px 16px;
}
.cp-body h1 {
  font-size: 19px;
  margin-bottom: 14px;
}
.cp-body h2 {
  font-size: 17px;
  margin: 18px 0 10px;
}
.cp-actions {
  gap: 8px;
  padding-top: 16px;
}
.cp-actions button,
.cp-body button:not([class]),
.cp-header button,
.cp-source-link {
  font-size: 14px;
  line-height: 1.35;
}
.cp-header [data-workspace-link] {
  align-self: flex-start;
  width: auto;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.cp-custody .cp-body > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
  color: #526277;
  font-size: 13px;
  min-width: 0;
}
.cp-custody .cp-body > label:has(input[type='checkbox']) {
  flex-direction: row;
  align-items: center;
  min-height: 48px;
}
.cp-custody input:not([type='checkbox']),
.cp-custody select,
.cp-custody textarea {
  display: block;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #c3cddd;
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.cp-custody .cp-actions {
  margin-top: 12px;
  padding-top: 0;
}
.cp-custody .error:empty {
  display: none;
}

/* One staff control scale across Counter/Tenant, including native custody and owner forms. */
.cp input:not([type='checkbox']):not([type='radio']),
.cp select,
.cp textarea,
.cp .cp-field input,
.cp .cp-field select,
.cp .cp-field textarea {
  font-size: 14px;
  line-height: 1.45;
}
.cp input::placeholder,
.cp textarea::placeholder {
  font-size: inherit;
}

/* Keep session actions together on phone widths; connection facts may wrap separately. */
.cp-session-status {
  gap: 6px;
}
.cp-session-status button,
.cp-session-status [data-workspace-link] {
  min-height: 48px;
  padding: 8px;
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}
.cp .cp-table {
  font-size: 12px;
  line-height: 1.4;
}
.cp .cp-table th,
.cp .cp-table td {
  padding: 8px 4px;
}
@media (max-width: 359px) {
  .cp-session-status {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cp-session-status button {
    width: 100%;
  }
}

/* Staff action groups use two-column tiles; a lone action retains full width. */
.cp .cp-actions,
.cp .cp-extra-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.cp .cp-actions:not(:has(> :is(button, a) ~ :is(button, a))),
.cp .cp-extra-actions:not(:has(> :is(button, a) ~ :is(button, a))) {
  grid-template-columns: minmax(0, 1fr);
}
.cp .cp-actions > :is(button, a),
.cp .cp-extra-actions > :is(button, a) {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  min-height: 56px;
  height: auto;
  padding: 10px 8px;
  font-size: 13px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}
.cp .cp-actions > :not(button, a),
.cp .cp-extra-actions > :not(button, a) {
  grid-column: 1 / -1;
}
.cp .cp-actions > :is(button, a),
.cp .cp-extra-actions > :is(button, a) {
  margin: 0;
  align-self: stretch;
}

/* Keep all staff navigation labels on one line on narrow phones. */
.cp .cp-nav {
  gap: 2px;
  padding-inline: 4px;
}
.cp .cp-nav button {
  min-width: 0;
  min-height: 48px;
  padding: 8px 2px;
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
}

/* Source records separate readable evidence from the navigation action. */
.cp .cp-record-list {
  list-style: none;
  padding: 0;
  margin: 16px 0;
  display: grid;
  gap: 12px;
}
.cp .cp-record-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}
.cp .cp-record-card p {
  margin: 8px 0;
}
.cp .cp-record-reference {
  font-size: 12px;
  overflow-wrap: anywhere;
  color: var(--muted, #526277);
}
.cp .cp-record-card .cp-actions {
  margin-top: 12px;
}
.cp .cp-count-group {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.cp .cp-count-group legend {
  padding: 0 6px;
  font-weight: 600;
}

.cp .cp-home-action-groups {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}
.cp .cp-home-action-group h2 {
  margin: 0 0 6px;
}
.cp .cp-home-action-group > p {
  margin: 0 0 10px;
}
.cp[data-ui-screen='C04'] .cp-home-action-group .cp-actions {
  margin-top: 0;
  gap: 8px;
}

/* Keep native choice controls compact on every Counter/Tenant screen,
   including dynamically mounted custody and evidence forms. */
.cp.cp input:is([type='checkbox'], [type='radio']) {
  box-sizing: border-box;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  max-width: 20px;
  max-height: 20px;
  padding: 0;
  flex: 0 0 20px;
  margin: 0 8px 0 0;
}
.cp label:has(> input:is([type='checkbox'], [type='radio'])) {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

/* Mobile app navigation: retain context in the header, actions in a left drawer. */
.cp .cp-header.cp-has-menu { position: relative; padding-left: 64px; min-height: 72px; }
.cp .cp-menu-trigger { position: absolute; left: 12px; top: 12px; width: 40px; min-height: 44px; padding: 8px; border: 0; background: transparent; color: #1c2c43; }
.cp .cp-menu-icon { width: 21px; height: 21px; flex: 0 0 21px; vertical-align: middle; pointer-events: none; }
.cp .cp-drawer { position: fixed; inset: 0 auto 0 0; margin: 0; width: min(300px, 86vw); height: 100dvh; max-height: 100dvh; max-width: 86vw; padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom)); border: 0; border-radius: 0 16px 16px 0; background: white; color: #1c2c43; box-sizing: border-box; overflow-y: auto; box-shadow: 8px 0 30px #12213a30; }
.cp .cp-drawer::backdrop { background: #14223a70; }
.cp .cp-drawer-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cp .cp-drawer-heading h2 { margin: 0; font-size: 18px; }
.cp .cp-menu-close { width: 44px; min-height: 44px; padding: 10px; border: 0; background: transparent; }
.cp .cp-drawer-session .cp-session-status { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; font-size: 13px; }
.cp .cp-drawer .cp-nav, .cp .cp-drawer-controls { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 12px 0; margin: 0; border: 0; }
.cp .cp-drawer-controls { border-top: 1px solid #d8dfe9; }
.cp .cp-drawer :is(.cp-nav button, .cp-drawer-controls button) { display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; min-height: 48px; height: auto; padding: 12px; margin: 0; font-size: 14px; line-height: 1.4; text-align: left; border: 0; border-radius: 9px; background: transparent; color: #34465f; white-space: normal; }
.cp .cp-drawer .cp-nav button[aria-current='page'] { color: #155eef; background: #edf3ff; font-weight: 600; }
.cp .cp-drawer button:focus-visible, .cp .cp-menu-trigger:focus-visible { outline: 3px solid #155eef; outline-offset: 2px; }

/* Navigation tiles share button typography, including native anchor routes. */
.cp .cp-source-link, .cp .cp-actions > a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.cp .cp-actions > a.primary { color: white; }
.cp .cp-drawer :is(.cp-nav, .cp-drawer-controls) a {
  display: flex; align-items: center; justify-content: flex-start; gap: 12px;
  width: 100%; min-height: 48px; box-sizing: border-box; padding: 12px;
  margin: 0; font-size: 14px; line-height: 1.4; font-weight: 600;
  border: 0; border-radius: 9px; background: transparent; color: #34465f;
  text-decoration: none; text-align: left; white-space: normal;
}
.cp .cp-drawer :is(.cp-nav, .cp-drawer-controls) a[aria-current='page'] { color: #155eef; background: #edf3ff; }
.cp .cp-drawer :is(.cp-nav, .cp-drawer-controls) a:focus-visible { outline: 3px solid #155eef; outline-offset: 2px; }
.cp .cp-drawer :is(.cp-nav button, .cp-drawer-controls button) { font-weight: 600; }

/* Keep mobile context and the menu reachable while long forms/history scroll. */
.cp > .cp-header,
.cp > .cp-header.cp-has-menu {
  position: sticky;
  top: 0;
  z-index: 30;
  flex-shrink: 0;
  background: var(--panel, white);
}

/* Read-only facts: small muted labels, distinct values and a separator per pair. */
.cp .cp-body dl:not(.breakdown) dt {
  color: #526277;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  margin: 0 0 3px;
}
.cp .cp-body dl:not(.breakdown) dd {
  color: #1c2c43;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  margin: 0;
  overflow-wrap: anywhere;
}
.cp .cp-body dl:not(.breakdown) > dd,
.cp .cp-body dl:not(.breakdown) > div {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #d8dfe9;
}
.cp .cp-body dl:not(.breakdown) > dd:last-child,
.cp .cp-body dl:not(.breakdown) > div:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

/* Merchant owner actions share one mobile control system, including anchor routes.
   Keep the header/drawer controls independent and preserve native disabled/consent behavior. */
.cp.owner-session .cp-body :is(button, .owner-button) {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 56px;
  height: auto;
  padding: 12px 16px;
  margin: 12px 0 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  background: var(--panel);
  text-align: center;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.cp.owner-session .cp-body :is(button, .owner-button).primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
}
.cp.owner-session .cp-body button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.cp.owner-session .cp-body :is(button, .owner-button):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.cp.owner-session .cp-body .cp-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  align-items: stretch;
}
.cp.owner-session .cp-body .cp-actions > :is(button, .owner-button) {
  margin: 0;
  align-self: stretch;
}
.cp.owner-session .cp-body .cp-actions:empty,
.cp.owner-session .cp-body [role='alert']:empty {
  display: none;
}
.cp.owner-session .cp-body :is(button, .owner-button)[hidden] {
  display: none;
}
/* Owner menu controls retain their compact icon shape and a 48px touch target. */
.cp.owner-session :is(.cp-menu-trigger, .cp-menu-close) {
  width: 48px;
  min-height: 48px;
}

.cp .cp-drawer-controls:empty { display: none; }

/* Owner PWA: compact larger action groups; keep primary confirmation full width. */
@media (min-width: 320px) {
  .cp.owner-session .cp-body .cp-actions:has(> :is(button, a):not([hidden]) ~ :is(button, a):not([hidden]) ~ :is(button, a):not([hidden])) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 1fr;
  }
}
.cp.owner-session .cp-body .cp-actions > .primary {
  grid-column: 1 / -1;
}
