@font-face {
  font-family: "Rubik";
  src: url("../fonts/Rubik-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* v4.0 branch workspace */
.app-branch-switcher { position: relative; flex: 0 1 auto; min-width: 0; }
.app-branch-switcher summary,
.app-branch-switcher.is-static {
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  column-gap: 9px;
  padding: 6px 12px;
  color: var(--ink);
  background: #fffaf6;
  border: 1px solid #eadfd9;
  border-radius: 12px;
  cursor: pointer;
  list-style: none;
}
.app-branch-switcher summary::-webkit-details-marker { display: none; }
.app-branch-switcher summary > span,
.app-branch-switcher.is-static > span { grid-column: 1; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; line-height: 1; text-transform: uppercase; }
.app-branch-switcher summary > strong,
.app-branch-switcher.is-static > strong { grid-column: 1; max-width: 150px; overflow: hidden; font-size: 11px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.app-branch-switcher summary > b { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--red); transition: transform 160ms ease; }
.app-branch-switcher[open] summary > b { transform: rotate(180deg); }
.app-branch-switcher[open] summary { border-color: #e9b8b9; box-shadow: 0 0 0 3px rgba(225, 29, 46, .08); }
.app-branch-popover {
  position: absolute;
  z-index: 90;
  top: calc(100% + 10px);
  right: 0;
  width: min(330px, calc(100vw - 28px));
  max-height: min(520px, calc(100vh - 100px));
  padding: 10px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #eadfd9;
  border-radius: 16px;
  box-shadow: 0 22px 60px rgba(53, 28, 22, .2);
}
.app-branch-popover header { padding: 7px 8px 10px; }
.app-branch-popover header span { display: block; color: var(--red); font-size: 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.app-branch-popover header strong { display: block; margin-top: 2px; font-size: 14px; }
.app-branch-popover button,
.app-mobile-branch-list button {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 11px;
  text-align: left;
  cursor: pointer;
}
.app-branch-popover button:hover,
.app-branch-popover button:focus-visible,
.app-branch-popover button.active,
.app-mobile-branch-list button.active { background: var(--red-soft); }
.app-branch-popover button span,
.app-mobile-branch-list button span { min-width: 0; display: grid; gap: 2px; }
.app-branch-popover button strong,
.app-branch-popover button small,
.app-mobile-branch-list button strong,
.app-mobile-branch-list button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-branch-popover button strong,
.app-mobile-branch-list button strong { font-size: 11px; }
.app-branch-popover button small,
.app-mobile-branch-list button small { color: var(--muted); font-size: 9px; }
.app-branch-popover button > b,
.app-mobile-branch-list button > b { color: var(--red); font-size: 8px; text-transform: uppercase; }
.app-mobile-branch-group { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.app-mobile-branch-list { display: grid !important; grid-template-columns: 1fr 1fr; gap: 7px; }
.app-mobile-branch-list button { min-width: 0; border: 1px solid var(--line); }
.branch-switching { cursor: wait; }
.branch-switching * { pointer-events: none !important; }

@media (max-width: 1000px) {
  .app-branch-switcher summary,
  .app-branch-switcher.is-static { min-height: 42px; max-width: min(180px, 44vw); }
  .app-branch-switcher summary > strong,
  .app-branch-switcher.is-static > strong { max-width: 118px; }
}

@media (max-width: 480px) {
  .app-branch-switcher summary,
  .app-branch-switcher.is-static { max-width: 142px; padding-inline: 9px; }
  .app-branch-switcher summary > strong,
  .app-branch-switcher.is-static > strong { max-width: 92px; }
  .app-mobile-branch-list { grid-template-columns: 1fr; }
}

@font-face {
  font-family: "Rubik";
  src: url("../fonts/Rubik-SemiBold.ttf") format("truetype");
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --red: #e11d2e;
  --red-dark: #b80f20;
  --red-soft: #fff0f1;
  --honey: #f7b916;
  --honey-soft: #fff7d9;
  --cream: #fbf8f2;
  --paper: #ffffff;
  --ink: #291b19;
  --muted: #746866;
  --line: #eadfda;
  --green: #24855a;
  --green-soft: #e9f7ef;
  --blue: #3574a8;
  --blue-soft: #edf6fd;
  --shadow: 0 14px 38px rgba(74, 38, 29, 0.08);
  --field-height: 48px;
  --field-radius: 11px;
  --field-border: #d9ccc7;
  --field-border-hover: #bdaaa3;
  --field-focus: rgba(225, 29, 46, 0.16);
  --field-placeholder: #9b8e8a;
  --tap-target: 48px;
  --card-padding: 20px;
  --card-padding-compact: 16px;
  --card-grid-gap: 16px;
  --kpi-card-padding: 18px;
  --kpi-grid-gap: 12px;
  --card-radius: 18px;
}

@media (max-width: 760px) {
  :root {
    --card-padding: 16px;
    --card-padding-compact: 14px;
    --card-grid-gap: 14px;
    --kpi-card-padding: 14px;
    --kpi-grid-gap: 8px;
  }
}

@media (max-width: 390px) {
  :root {
    --card-padding: 15px;
    --card-padding-compact: 13px;
    --card-grid-gap: 12px;
    --kpi-card-padding: 13px;
  }
}

@media (orientation: landscape) and (max-height: 600px) and (max-width: 1000px) {
  :root {
    --card-padding: 16px;
    --card-padding-compact: 14px;
    --card-grid-gap: 14px;
    --kpi-card-padding: 14px;
    --kpi-grid-gap: 10px;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  width: 100%;
  min-width: 0;
  overflow-x: clip;
  background: var(--cream);
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  background: var(--cream);
  color: var(--ink);
  font-family: "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

button,
input,
select,
textarea {
  max-width: 100%;
  font: inherit;
}

button {
  color: inherit;
}

button,
a,
summary,
label,
select {
  -webkit-tap-highlight-color: transparent;
}

button,
a,
summary {
  touch-action: manipulation;
}

button,
nav a,
nav summary {
  user-select: none;
  -webkit-user-select: none;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  color: var(--ink);
  background-color: #fff;
  border: 1px solid var(--field-border);
  border-radius: var(--field-radius);
  box-shadow: 0 1px 0 rgba(41, 27, 25, 0.025);
  line-height: 1.35;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select {
  height: var(--field-height);
  min-height: var(--field-height);
  padding: 11px var(--field-padding-end, 13px) 11px var(--field-padding-start, 13px);
}

textarea {
  min-height: 92px;
  padding: 12px 13px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--field-placeholder);
  opacity: 1;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):hover,
select:hover,
textarea:hover {
  border-color: var(--field-border-hover);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: var(--red);
  box-shadow: 0 0 0 4px var(--field-focus);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):disabled,
select:disabled,
textarea:disabled,
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"])[readonly],
textarea[readonly] {
  color: #857976;
  background-color: #f3efed;
  border-color: #ded4d0;
  cursor: not-allowed;
  opacity: 1;
}

input[type="checkbox"],
input[type="radio"] {
  width: 22px;
  height: 22px;
  min-height: 22px;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  accent-color: var(--red);
  cursor: pointer;
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 3px solid var(--field-focus);
  outline-offset: 2px;
}

input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input[type="number"] {
  font-variant-numeric: tabular-nums;
}

input[type="date"]::-webkit-date-and-time-value {
  min-width: 0;
  text-align: left;
}

select {
  appearance: none;
  padding-right: 38px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 50%,
    calc(100% - 12px) 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px;
}

button:focus-visible {
  outline: 3px solid rgba(225, 29, 46, 0.2);
  outline-offset: 2px;
}

body.sheet-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(234, 223, 218, 0.9);
  backdrop-filter: blur(14px);
}

.topbar-inner,
.content-wrap {
  max-width: 100%;
  width: min(1380px, calc(100% - 48px));
  margin: 0 auto;
}

.topbar-inner > *,
.topbar-actions,
.brand-lockup,
.content-wrap > *,
.page-intro > *,
.summary-card,
.records-panel,
.records-heading > *,
.filter-bar > *,
.mobile-record-topline > *,
.sheet-header > *,
.bulk-format-card > * {
  min-width: 0;
}

.topbar-inner {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-logo {
  width: 156px;
  height: 62px;
  object-fit: contain;
  object-position: center;
}

.brand-copy {
  display: grid;
  gap: 2px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.brand-copy span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-copy strong {
  font-size: 18px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  max-width: 190px;
  overflow: hidden;
  color: var(--muted);
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip:hover { color: var(--red-dark); text-decoration: underline; text-underline-offset: 4px; }

.content-wrap {
  padding: 50px 0 80px;
}

.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 740px;
  margin-bottom: 10px;
  font-size: clamp(27px, 3.2vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  letter-spacing: -0.025em;
}

.intro-copy {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
}

.sync-note {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--kpi-grid-gap);
  margin-bottom: 24px;
}

.summary-card {
  min-height: 178px;
  padding: var(--kpi-card-padding);
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.summary-card:hover {
  transform: translateY(-2px);
  border-color: #ddcbc4;
  box-shadow: var(--shadow);
}

.summary-card strong {
  display: block;
  margin: 9px 0 8px;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.035em;
}

.summary-card small,
.records-table small {
  color: var(--muted);
}

.summary-icon {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 11px;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 700;
  font-size: 18px;
}

.summary-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.balance-card {
  color: #fff;
  border-color: var(--red);
  background:
    radial-gradient(circle at 90% 5%, rgba(255, 202, 49, 0.5), transparent 28%),
    linear-gradient(145deg, #ec2336, #c51022);
}

.balance-card .summary-icon {
  color: #7e190d;
  background: var(--honey);
}

.balance-card .summary-label,
.balance-card small {
  color: rgba(255, 255, 255, 0.75);
}

.alert-card .summary-icon {
  color: #b36a00;
  background: var(--honey-soft);
}

.records-panel {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.records-heading {
  padding: var(--card-padding) var(--card-padding) var(--card-padding-compact);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.result-count {
  color: var(--muted);
  font-size: 12px;
}

.records-heading-actions {
  display: flex;
  align-items: center;
  gap: 13px;
}

.bulk-print-open {
  min-height: 40px;
  padding: 8px 13px;
  color: var(--red-dark);
  border-color: #efc4c8;
}

.filter-bar {
  padding: 0 var(--card-padding) var(--card-padding);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 150px) minmax(150px, 190px) minmax(150px, 190px) auto;
  gap: 10px;
}

.search-field {
  position: relative;
  --field-padding-start: 48px;
}

.search-mark {
  position: absolute;
  z-index: 1;
  left: 15px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0;
  pointer-events: none;
}

.search-mark::before {
  position: absolute;
  left: 1px;
  top: 1px;
  width: 10px;
  height: 10px;
  content: "";
  border: 2px solid currentColor;
  border-radius: 50%;
}

.search-mark::after {
  position: absolute;
  left: 11px;
  top: 12px;
  width: 7px;
  height: 2px;
  content: "";
  background: currentColor;
  border-radius: 2px;
  transform: rotate(45deg);
  transform-origin: left center;
}

.filter-bar input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.filter-bar select,
.record-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.record-form select,
.record-form textarea,
.compact-field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.compact-field select {
  width: 100%;
  min-height: var(--field-height);
  padding: 11px var(--field-padding-end, 13px) 11px var(--field-padding-start, 13px);
  color: var(--ink);
  background-color: #fff;
  border-color: var(--field-border);
  border-radius: var(--field-radius);
}

.filter-bar select,
.record-form select,
.compact-field select {
  padding-right: 38px;
}

.desktop-tool {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 10px;
  text-decoration: none;
}

.mobile-tools {
  display: none;
}

.mobile-account-menu,
.mobile-quick-filters,
.mobile-filter-toggle {
  display: none;
}

.active-filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 26px 18px;
}

.active-filter-strip button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  color: var(--red-dark);
  background: var(--red-soft);
  border: 1px solid #efb6bb;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(214, 40, 40, 0.22);
  outline-offset: 2px;
}

select {
  cursor: pointer;
}

.desktop-table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

.records-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1120px;
}

.records-table th {
  padding: 13px 16px;
  color: #8a7b77;
  background: #fbf9f7;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.records-table th:first-child,
.records-table td:first-child {
  padding-left: 26px;
}

.records-table th:last-child,
.records-table td:last-child {
  padding-right: 26px;
}

.records-table td {
  padding: 15px 16px;
  border-bottom: 1px solid #f0e9e5;
  vertical-align: middle;
}

.records-table tbody tr {
  cursor: pointer;
  transition: background-color 120ms ease;
}

.records-table tbody tr:hover {
  background: #fffcf8;
}

.records-table td:first-child {
  max-width: 260px;
}

.records-table td:nth-child(2) {
  max-width: 360px;
}

.records-table td strong,
.records-table td span,
.records-table td small {
  display: block;
}

.records-table td small {
  margin-top: 4px;
  line-height: 1.35;
}

.balance-due {
  color: var(--red-dark);
  font-weight: 700;
}

.balance-clear {
  color: var(--green);
  font-weight: 700;
}

.status-badge,
.route-badge {
  width: max-content;
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.status-active {
  color: var(--green);
  background: var(--green-soft);
}

.status-follow_up {
  color: #b03e13;
  background: #fff0e6;
}

.status-verification {
  color: #986400;
  background: var(--honey-soft);
}

.status-inactive {
  color: #716764;
  background: #efedec;
}

.status-for_delivery {
  color: #765313;
  background: var(--honey-soft);
  border: 1px solid #efd783;
}

.route-badge {
  color: var(--blue);
  background: var(--blue-soft);
}

.route-badge span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
}

.muted-value {
  color: #aca29f;
}

.row-action {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
}

.mobile-record-list,
.mobile-tabs {
  display: none;
}

.empty-state {
  min-height: 290px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 40px 24px;
  text-align: center;
  border-top: 1px solid var(--line);
}

.empty-state strong {
  font-size: 18px;
}

.empty-state p {
  margin: 8px 0 18px;
  color: var(--muted);
}

.error-state strong {
  color: var(--red-dark);
}

.loading-list {
  border-top: 1px solid var(--line);
}

.loading-row {
  height: 72px;
  margin: 0 26px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, transparent, rgba(246, 240, 236, 0.9), transparent);
  background-size: 300% 100%;
  animation: shimmer 1.6s infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.primary-button,
.secondary-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 17px;
  border-radius: 11px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  text-decoration-line: none;
  user-select: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 100ms ease;
}

.primary-button {
  color: #fff;
  background: var(--red);
  border: 1px solid var(--red);
  box-shadow: 0 8px 18px rgba(225, 29, 46, 0.18);
}

.primary-button:hover,
.primary-button:focus-visible {
  color: #fff;
  background: var(--red-dark);
  border-color: var(--red-dark);
  text-decoration: none;
}

.secondary-button {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.secondary-button:hover,
.secondary-button:focus-visible,
a.secondary-button:visited:hover,
a.secondary-button:visited:focus-visible {
  color: var(--red-dark);
  background: #fff8f5;
  border-color: #e9b9b5;
  text-decoration: none;
}

a.primary-button:visited {
  color: #fff;
  text-decoration: none;
}

a.secondary-button:visited {
  color: var(--ink);
  text-decoration: none;
}

.primary-button:not(:disabled):active,
.secondary-button:not(:disabled):active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.58;
  cursor: wait;
  transform: none;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: flex-end;
  background: rgba(35, 20, 17, 0.44);
  animation: fade-in 150ms ease;
}

@keyframes fade-in {
  from { opacity: 0; }
}

.record-sheet {
  width: min(100%, 540px);
  height: 100%;
  overflow-y: auto;
  background: var(--paper);
  box-shadow: -24px 0 60px rgba(38, 19, 14, 0.16);
  animation: slide-in 220ms ease;
}

@keyframes slide-in {
  from { transform: translateX(30px); opacity: 0.6; }
}

.sheet-handle {
  display: none;
}

.sheet-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 25px 26px 20px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.sheet-header h2 {
  max-width: 390px;
}

.close-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  font-size: 24px;
}

.quick-actions {
  padding: 22px 26px;
  background: #fff9f2;
  border-bottom: 1px solid var(--line);
}

.receipt-ready {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 10px;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid #bee4cf;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.delivery-ready {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding: 10px 13px;
  color: #765313;
  background: var(--honey-soft);
  border: 1px solid #efd783;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.delivery-schedule {
  min-height: 58px;
  display: flex !important;
  align-items: center;
  gap: 12px !important;
  padding: 11px 13px;
  background: var(--honey-soft);
  border: 1px solid #efd783;
  border-radius: var(--field-radius);
  cursor: pointer;
}

.delivery-schedule input {
  width: 24px;
  height: 24px;
  min-height: 24px;
  flex: 0 0 auto;
  margin: 0;
}

.delivery-schedule span,
.delivery-schedule strong,
.delivery-schedule small { display: block; }
.delivery-schedule strong { color: #765313; font-size: 11px; }
.delivery-schedule small { margin-top: 3px; color: #806d48; font-size: 9px; line-height: 1.45; }

.bulk-print-backdrop {
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.bulk-print-dialog {
  width: min(100%, 600px);
  max-height: min(760px, calc(100dvh - 40px));
  overflow-y: auto;
  background: var(--paper);
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(38, 19, 14, 0.24);
  animation: bulk-dialog-in 180ms ease;
}

@keyframes bulk-dialog-in {
  from { transform: translateY(12px) scale(0.98); opacity: 0.65; }
}

.bulk-print-dialog .sheet-header {
  border-radius: 20px 20px 0 0;
}

.bulk-print-content {
  padding: 24px 26px 28px;
}

.bulk-print-intro {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.6;
}

.bulk-filter-grid,
.bulk-print-summary,
.bulk-format-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.bulk-filter-grid label {
  display: grid;
  gap: 7px;
}

.bulk-filter-grid label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.bulk-filter-grid select {
  width: 100%;
  min-height: var(--field-height);
  padding: 11px 38px 11px 13px;
  color: var(--ink);
  background-color: #fff;
  border-color: var(--field-border);
  border-radius: var(--field-radius);
}

.bulk-print-summary {
  margin-top: 18px;
}

.bulk-print-summary > div {
  padding: 15px;
  background: #fff9f2;
  border: 1px solid #f0dfd5;
  border-radius: 12px;
}

.bulk-print-summary span,
.bulk-print-summary strong {
  display: block;
}

.bulk-print-summary span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
}

.bulk-print-summary strong {
  color: var(--red-dark);
  font-size: 22px;
  letter-spacing: -0.03em;
}

.bulk-print-note {
  min-height: 19px;
  margin: 15px 0 11px;
  color: var(--muted);
  font-size: 11px;
}

.bulk-format-card {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.bulk-format-card:hover {
  background: var(--red-soft);
  border-color: #e99ba4;
  transform: translateY(-1px);
}

.bulk-format-card.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.bulk-format-card > span:last-child,
.bulk-format-card strong,
.bulk-format-card small {
  display: block;
}

.bulk-format-card strong {
  font-size: 12px;
}

.bulk-format-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.bulk-format-icon {
  width: 42px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: var(--red);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
}

.receipt-icon {
  width: 34px;
  background: var(--ink);
}

.balance-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.balance-summary span {
  color: var(--muted);
}

.balance-summary strong {
  color: var(--red-dark);
  font-size: 28px;
  letter-spacing: -0.035em;
}

.payment-row {
  display: grid;
  grid-template-columns: 1fr 112px;
  align-items: end;
  gap: 10px;
}

.payment-row label,
.compact-field,
.record-form label {
  display: grid;
  gap: 7px;
}

.payment-row label > span,
.compact-field > span,
.record-form label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.field-help {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.compact-field {
  margin-top: 10px;
}

.money-input {
  position: relative;
  --field-padding-start: 38px;
}

.money-input b {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.soa-actions {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.soa-actions summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #f0d7cf;
  border-radius: 11px;
  cursor: pointer;
  list-style: none;
}

.soa-actions summary::-webkit-details-marker {
  display: none;
}

.soa-actions summary > b {
  color: var(--red);
  font-size: 22px;
  transition: transform 150ms ease;
}

.soa-actions[open] summary > b {
  transform: rotate(90deg);
}

.soa-actions-body {
  display: grid;
  gap: 11px;
  padding: 12px 0 0;
}

.soa-actions-copy strong,
.soa-actions-copy small {
  display: block;
}

.soa-actions-copy strong {
  color: var(--ink);
  font-size: 13px;
}

.soa-actions-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.soa-button-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

@media (max-width: 520px) {
  .soa-button-grid { grid-template-columns: 1fr; }
}

.soa-period-field,
.soa-custom-dates label {
  display: grid;
  gap: 6px;
}

.soa-period-field > span,
.soa-custom-dates label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.soa-period-field select,
.soa-custom-dates input {
  width: 100%;
  min-height: var(--field-height);
  padding: 11px 13px;
  background-color: #fff;
  border-color: var(--field-border);
  border-radius: var(--field-radius);
}

.soa-period-field select {
  padding-right: 38px;
}

.soa-custom-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.bulk-custom-dates {
  margin-top: 11px;
}

.bulk-support-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 16px;
}

.bulk-support-links a {
  color: var(--red-dark);
  font-size: 11px;
  font-weight: 700;
}

.group-badge {
  display: inline-flex;
  margin: 2px 5px 2px 0;
  padding: 4px 7px;
  color: #5b477d;
  background: #eee8ff;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 700;
}

.pending-badge {
  display: inline-flex;
  margin: 2px 0 2px 5px;
  padding: 4px 7px;
  color: #7b5210;
  background: var(--honey-soft);
  border: 1px solid #efd271;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.role-collector .record-form {
  display: none;
}

.soa-button {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  color: var(--red-dark);
  background: #fff;
  border: 1px solid #f0c9c4;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.soa-button:hover {
  background: var(--red-soft);
  border-color: var(--red);
  transform: translateY(-1px);
}

.soa-button:focus-visible {
  outline: 3px solid rgba(214, 40, 40, 0.2);
  outline-offset: 2px;
}

.record-form {
  display: grid;
  gap: 16px;
  padding: 24px 26px 34px;
}

.record-form textarea {
  resize: vertical;
  line-height: 1.5;
}

.form-section-title {
  padding-bottom: 2px;
  font-size: 13px;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.route-switch {
  grid-template-columns: 1fr auto !important;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.route-switch span strong,
.route-switch span small {
  display: block;
}

.route-switch span strong {
  color: var(--ink);
  font-size: 13px;
}

.route-switch span small {
  margin-top: 3px;
  font-weight: 400;
}

.route-switch input {
  position: relative;
  width: 44px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  appearance: none;
  background: #d9cfca;
  border: 0;
  border-radius: 999px;
  transition: background-color 150ms ease;
}

.route-switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(41, 27, 25, 0.18);
  transition: transform 150ms ease;
}

.route-switch input:checked {
  background: var(--red);
}

.route-switch input:checked::after {
  transform: translateX(20px);
}

.sheet-footer {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 6px -26px -34px;
  padding: 15px 26px calc(15px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.toast {
  position: fixed;
  z-index: 120;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  max-width: min(90vw, 520px);
  padding: 12px 17px;
  color: #fff;
  background: #2f2826;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 8%, rgba(247, 185, 22, 0.22), transparent 30%),
    radial-gradient(circle at 92% 88%, rgba(225, 29, 46, 0.12), transparent 32%),
    var(--cream);
}

.landing-skip { position: fixed; z-index: 200; left: 16px; top: 12px; transform: translateY(-150%); padding: 10px 14px; color: #fff; background: var(--red-dark); border-radius: 9px; font-weight: 700; text-decoration: none; }
.landing-skip:focus { transform: translateY(0); }
.landing-site { min-height: 100vh; overflow: hidden; background: linear-gradient(180deg, #fffdf8 0, var(--cream) 46%, #fff 100%); }
.landing-header { position: sticky; z-index: 40; top: 0; background: rgba(255,255,255,.94); border-bottom: 1px solid rgba(234,223,218,.9); backdrop-filter: blur(16px); }
.landing-header-inner { width: min(1180px, calc(100% - 40px)); min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: auto; }
.landing-brand { min-width: 0; display: inline-flex; align-items: center; gap: 14px; color: var(--ink); font-weight: 700; text-decoration: none; }
.landing-brand img { width: 132px; height: 54px; object-fit: contain; }
.landing-brand span { padding-left: 14px; border-left: 1px solid var(--line); font-size: 12px; }
.landing-nav { display: flex; align-items: center; gap: 4px; }
.landing-nav a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 13px; color: var(--muted); border-radius: 10px; font-size: 11px; font-weight: 700; text-decoration: none; }
.landing-nav a:hover { color: var(--red-dark); background: #fff5f2; }
.landing-nav .landing-signin-link { margin-left: 4px; padding: 0 17px; color: #fff; background: var(--red); }
.landing-nav .landing-signin-link:hover { color: #fff; background: var(--red-dark); }

.landing-hero { position: relative; width: min(1180px, calc(100% - 40px)); min-height: 650px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); gap: clamp(42px, 7vw, 90px); align-items: center; margin: auto; padding: 72px 0 82px; }
.landing-hero::before { position: absolute; z-index: 0; left: -18%; top: 4%; width: 520px; height: 520px; content: ""; background: radial-gradient(circle, rgba(247,185,22,.18), rgba(247,185,22,0) 68%); pointer-events: none; }
.landing-hero::after { position: absolute; z-index: 0; right: -20%; bottom: -10%; width: 500px; height: 500px; content: ""; background: radial-gradient(circle, rgba(225,29,46,.11), rgba(225,29,46,0) 68%); pointer-events: none; }
.landing-hero > * { position: relative; z-index: 1; min-width: 0; }
.landing-kicker { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 18px; color: var(--red-dark); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.landing-kicker span { width: 10px; height: 10px; background: var(--honey); border: 3px solid #fff2b9; border-radius: 50%; box-shadow: 0 0 0 1px #efd46b; }
.landing-hero h1 { max-width: 760px; margin: 0; font-size: clamp(42px, 5.3vw, 72px); line-height: 1.02; letter-spacing: -.055em; }
.landing-lead { max-width: 700px; margin: 24px 0 0; color: var(--muted); font-size: clamp(16px, 1.6vw, 19px); line-height: 1.7; }
.landing-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.landing-actions a { min-height: 50px; text-decoration: none; }
.landing-trust { display: flex; flex-wrap: wrap; gap: 9px 18px; margin: 24px 0 0; padding: 0; color: var(--muted); font-size: 11px; list-style: none; }
.landing-trust li { display: inline-flex; align-items: center; gap: 6px; }
.landing-trust span { color: var(--green); font-weight: 800; }
.landing-login { scroll-margin-top: 96px; box-shadow: 0 30px 90px rgba(74,38,29,.16); }
.landing-login .login-brand { margin-bottom: 22px; }
.landing-login .login-brand img { height: 82px; }
.landing-login h2 { margin: 0 0 9px; font-size: 30px; letter-spacing: -.035em; }
.landing-access-note { display: flex; align-items: flex-start; gap: 7px; margin: 16px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.landing-access-note span { color: var(--green); font-size: 8px; }

.landing-metrics { width: min(1180px, calc(100% - 40px)); display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); margin: 0 auto; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.landing-metrics article { min-width: 0; padding: 22px; border-left: 1px solid var(--line); }
.landing-metrics article:first-child { border-left: 0; }
.landing-metrics strong, .landing-metrics span { display: block; }
.landing-metrics strong { margin-bottom: 6px; color: var(--red-dark); font-size: 13px; }
.landing-metrics span { color: var(--muted); font-size: 10px; line-height: 1.5; }

.landing-section, .landing-workflow, .landing-cta, .landing-footer { width: min(1180px, calc(100% - 40px)); margin-right: auto; margin-left: auto; }
.landing-section { padding: 110px 0 95px; }
.landing-section-heading { max-width: 720px; }
.landing-section-heading h2 { margin: 8px 0 13px; font-size: clamp(31px, 4vw, 48px); line-height: 1.12; letter-spacing: -.045em; }
.landing-section-heading > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.landing-feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-top: 38px; }
.landing-feature-grid article { min-height: 210px; padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 8px 28px rgba(74,38,29,.045); }
.landing-feature-grid article > span { width: 38px; height: 38px; display: grid; place-items: center; color: var(--red-dark); background: var(--red-soft); border-radius: 11px; font-size: 10px; font-weight: 800; }
.landing-feature-grid article:nth-child(2n) > span { color: #8a5b00; background: var(--honey-soft); }
.landing-feature-grid h3 { margin: 20px 0 9px; font-size: 17px; }
.landing-feature-grid p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }

.landing-workflow { display: grid; grid-template-columns: minmax(260px,.75fr) minmax(0,1.25fr); gap: 70px; align-items: start; padding: 90px 70px; background: linear-gradient(145deg,#ef2739,#b51021); border-radius: 28px; box-shadow: 0 26px 70px rgba(145,20,30,.2); }
.landing-workflow .eyebrow { color: #ffe17a; }
.landing-workflow h2 { color: #fff; }
.landing-workflow ol { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.landing-workflow li { display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 15px; padding: 18px; color: #fff; background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.16); border-radius: 15px; }
.landing-workflow li > span { width: 38px; height: 38px; display: grid; place-items: center; color: #8a3300; background: var(--honey); border-radius: 12px; font-weight: 800; }
.landing-workflow strong { display: block; margin: 1px 0 5px; font-size: 14px; }
.landing-workflow li p { margin: 0; color: rgba(255,255,255,.76); font-size: 10px; line-height: 1.55; }

.landing-cta { display: flex; align-items: center; justify-content: space-between; gap: 32px; margin-top: 95px; padding: 34px 38px; background: #fff8e7; border: 1px solid #eedc9c; border-radius: 20px; }
.landing-cta h2 { margin: 5px 0 6px; font-size: 28px; }
.landing-cta p:not(.eyebrow) { margin: 0; color: var(--muted); }
.landing-cta a { flex: 0 0 auto; min-height: 50px; text-decoration: none; }
.landing-footer { min-height: 150px; display: grid; grid-template-columns: 1fr auto auto; gap: 28px; align-items: center; margin-top: 42px; border-top: 1px solid var(--line); }
.landing-footer .landing-brand img { width: 112px; }
.landing-footer p { margin: 0; color: var(--muted); font-size: 10px; }
.landing-footer > a:last-child { min-height: 44px; display: inline-flex; align-items: center; color: var(--red-dark); font-size: 10px; font-weight: 700; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 440px);
  padding: 34px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(74, 38, 29, 0.13);
}

.login-brand {
  margin: -8px 0 30px;
  text-align: center;
}

.login-brand img {
  width: 220px;
  height: 100px;
  object-fit: contain;
}

.login-brand p {
  margin: -5px 0 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-card h1,
.login-card h2 {
  margin-bottom: 10px;
  font-size: 34px;
}

.login-copy {
  margin-bottom: 24px;
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 15px;
}

.login-form label {
  display: grid;
  gap: 7px;
}

.login-form label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.login-form input {
  width: 100%;
  min-height: var(--field-height);
  padding: 11px 13px;
  border-color: var(--field-border);
  border-radius: var(--field-radius);
}

.login-form .primary-button {
  width: 100%;
  margin-top: 4px;
}

.form-error,
.success-message {
  padding: 12px 14px;
  border-radius: 11px;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .landing-hero { min-height: 0; grid-template-columns: 1fr; gap: 48px; padding-top: 58px; }
  .landing-hero-copy { max-width: 780px; }
  .landing-login { width: min(100%, 620px); }
  .landing-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .landing-metrics article:nth-child(3) { border-top: 1px solid var(--line); border-left: 0; }
  .landing-metrics article:nth-child(4) { border-top: 1px solid var(--line); }
  .landing-feature-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .landing-workflow { grid-template-columns: 1fr; gap: 28px; padding: 54px; }
}

@media (max-width: 700px) {
  .landing-header-inner, .landing-hero, .landing-metrics, .landing-section, .landing-workflow, .landing-cta, .landing-footer { width: calc(100% - 28px); }
  .landing-header-inner { min-height: 66px; }
  .landing-brand { gap: 9px; }
  .landing-brand img { width: 110px; height: 46px; }
  .landing-brand span { padding-left: 9px; font-size: 9px; }
  .landing-nav a:not(.landing-signin-link) { display: none; }
  .landing-nav .landing-signin-link { min-height: 46px; margin-left: 0; padding: 0 13px; font-size: 9px; }
  .landing-hero { gap: 34px; padding: 44px 0 55px; }
  .landing-hero h1 { font-size: clamp(35px, 11vw, 50px); }
  .landing-lead { margin-top: 18px; font-size: 15px; line-height: 1.65; }
  .landing-actions { display: grid; grid-template-columns: 1fr; }
  .landing-actions a { width: 100%; }
  .landing-trust { gap: 8px 13px; font-size: 10px; }
  .landing-login { padding: 27px 21px; border-radius: 20px; }
  .landing-login .login-brand img { width: 180px; height: 74px; }
  .landing-metrics { grid-template-columns: 1fr 1fr; }
  .landing-metrics article { padding: 17px; }
  .landing-metrics strong { font-size: 11px; }
  .landing-metrics span { font-size: 9px; }
  .landing-section { padding: 74px 0 64px; }
  .landing-section-heading h2 { font-size: 33px; }
  .landing-section-heading > p:not(.eyebrow) { font-size: 13px; }
  .landing-feature-grid { grid-template-columns: 1fr; margin-top: 27px; }
  .landing-feature-grid article { min-height: 0; }
  .landing-workflow { gap: 22px; padding: 34px 20px; border-radius: 20px; }
  .landing-workflow li { grid-template-columns: 38px minmax(0,1fr); padding: 15px; }
  .landing-cta { align-items: flex-start; flex-direction: column; margin-top: 66px; padding: 26px 22px; }
  .landing-cta h2 { font-size: 24px; }
  .landing-cta a { width: 100%; }
  .landing-footer { grid-template-columns: 1fr auto; gap: 12px; padding: 28px 0; }
  .landing-footer p { grid-column: 1 / -1; grid-row: 2; }
  .landing-footer .landing-brand span { display: none; }
}

@media (max-width: 410px) {
  .landing-brand span { display: none; }
  .landing-metrics { grid-template-columns: 1fr; }
  .landing-metrics article, .landing-metrics article:nth-child(2), .landing-metrics article:nth-child(4) { border-top: 1px solid var(--line); border-left: 0; }
  .landing-metrics article:first-child { border-top: 0; }
}

.offline-status-button {
  position: fixed;
  z-index: 72;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  color: #315c47;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #b9dfca;
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(41, 27, 25, 0.16);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.offline-status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--green-soft);
}

.offline-status-button b {
  min-width: 20px;
  min-height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  color: #fff;
  background: var(--red);
  border-radius: 999px;
  font-size: 9px;
}

.offline-status-button.is-offline {
  color: #7b5210;
  border-color: #efcf73;
}

.offline-status-button.is-offline .offline-status-dot {
  background: var(--honey);
  box-shadow: 0 0 0 4px var(--honey-soft);
}

.offline-status-button.is-syncing .offline-status-dot {
  animation: offline-pulse 900ms ease-in-out infinite alternate;
}

.offline-status-button.needs-attention {
  color: var(--red-dark);
  border-color: #efb6bb;
}

.offline-status-button.needs-attention .offline-status-dot {
  background: var(--red);
  box-shadow: 0 0 0 4px var(--red-soft);
}

@keyframes offline-pulse {
  to { transform: scale(1.35); opacity: 0.55; }
}

.offline-status-panel {
  position: fixed;
  z-index: 74;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(70px + env(safe-area-inset-bottom));
  width: min(410px, calc(100vw - 36px));
  max-height: min(680px, calc(100dvh - 110px));
  overflow-y: auto;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(41, 27, 25, 0.24);
}

.offline-status-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.offline-status-panel h2 {
  margin: 0;
  font-size: 20px;
}

.offline-panel-close {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  background: #f6f0ed;
  border: 0;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
}

.offline-status-panel > p {
  margin: 14px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.offline-status-panel dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.offline-status-panel dl > div {
  min-width: 0;
  padding: 10px;
  background: #fff9f2;
  border-radius: 10px;
}

.offline-status-panel dt,
.offline-status-panel dd {
  margin: 0;
}

.offline-status-panel dt {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.offline-status-panel dd {
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 10px;
  font-weight: 800;
}

.offline-operation-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.offline-operation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  background: #f8f4f1;
  border: 1px solid transparent;
  border-radius: 10px;
}

.offline-operation.is-failed {
  background: var(--red-soft);
  border-color: #efb6bb;
}

.offline-operation strong,
.offline-operation small {
  display: block;
}

.offline-operation strong {
  font-size: 10px;
}

.offline-operation small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
}

.offline-operation button {
  min-height: 44px;
  padding: 0 9px;
  color: var(--red-dark);
  background: #fff;
  border: 1px solid #efc9c6;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.offline-panel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.offline-panel-actions button {
  min-height: 44px;
  padding: 8px 10px;
  font-size: 10px;
}

body.dialog-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.app-dialog-backdrop {
  position: fixed;
  z-index: 220;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background: rgba(35, 20, 17, 0.56);
  backdrop-filter: blur(8px);
  animation: dialog-backdrop-in 160ms ease-out;
}

.app-dialog {
  position: relative;
  width: min(100%, 470px);
  max-height: calc(100dvh - 40px);
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 18px;
  overflow-y: auto;
  padding: 26px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  box-shadow: 0 32px 90px rgba(35, 20, 17, 0.34);
  animation: dialog-card-in 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.app-dialog-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: var(--red-dark);
  background: var(--red-soft);
  border: 1px solid #efb6bb;
  border-radius: 17px;
  font-size: 24px;
  font-weight: 800;
}

.app-dialog-icon::before {
  content: "i";
}

.tone-success .app-dialog-icon {
  color: var(--green);
  background: var(--green-soft);
  border-color: #bee4cf;
}

.tone-success .app-dialog-icon::before {
  content: "✓";
}

.tone-warning .app-dialog-icon {
  color: #7b5210;
  background: var(--honey-soft);
  border-color: #efd271;
}

.tone-warning .app-dialog-icon::before {
  content: "?";
}

.tone-danger .app-dialog-icon::before {
  content: "!";
}

.app-dialog-copy {
  min-width: 0;
  padding-right: 24px;
}

.app-dialog-eyebrow {
  margin: 1px 0 7px;
  color: var(--red);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.app-dialog h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.app-dialog-copy > p:not(.app-dialog-eyebrow) {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.app-dialog-detail {
  margin-top: 14px;
  padding: 12px 13px;
  color: #5a4b47;
  background: #faf6f3;
  border: 1px solid #eee1d9;
  border-radius: 11px;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.5;
  white-space: pre-line;
}

.app-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--muted);
  background: #f7f2ef;
  border: 0;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.app-dialog-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 4px;
}

.app-dialog-actions button {
  min-height: 48px;
  padding: 9px 14px;
}

.app-dialog-actions button:only-child,
.app-dialog-actions button[hidden] + button {
  grid-column: 1 / -1;
}

.tone-danger #app-dialog-confirm {
  background: var(--red-dark);
}

@keyframes dialog-backdrop-in {
  from { opacity: 0; }
}

@keyframes dialog-card-in {
  from { transform: translateY(12px) scale(0.98); opacity: 0; }
}

.form-error {
  color: var(--red-dark);
  background: var(--red-soft);
  border: 1px solid #f1b3ba;
}

.success-message {
  margin-bottom: 18px;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid #bee4cf;
}

@media (max-width: 1240px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .desktop-tool {
    display: none;
  }

  .mobile-tools {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
  }

  .mobile-tools a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 0 13px;
    color: var(--red-dark);
    background: #fff;
    border: 1px solid #edc8ca;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
    scroll-snap-align: start;
  }
}

@media (max-width: 1000px) {
  .offline-status-button {
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(78px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
  }

  .offline-status-button #offline-status-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .offline-status-panel {
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(128px + env(safe-area-inset-bottom));
    width: min(410px, calc(100vw - 24px));
    max-height: calc(100dvh - 150px - env(safe-area-inset-bottom));
  }

  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  .topbar-inner,
  .content-wrap {
    width: 100%;
  }

  .topbar-inner {
    min-height: 64px;
    padding: calc(5px + env(safe-area-inset-top)) max(15px, env(safe-area-inset-right)) 5px max(15px, env(safe-area-inset-left));
  }

  .brand-logo {
    width: 122px;
    height: 50px;
  }

  .brand-copy,
  .desktop-add,
  .desktop-logout,
  .user-chip {
    display: none;
  }

  .mobile-account-menu {
    position: relative;
    display: block;
  }

  .mobile-account-menu summary {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--red);
    border: 3px solid #ffe9e9;
    border-radius: 50%;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
  }

  .mobile-account-menu summary::-webkit-details-marker {
    display: none;
  }

  .mobile-account-menu > div {
    position: absolute;
    top: 56px;
    right: 0;
    width: 220px;
    display: grid;
    gap: 5px;
    padding: 15px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(35, 20, 17, 0.18);
  }

  .mobile-account-menu > div > span {
    color: var(--muted);
    font-size: 10px;
  }

  .mobile-account-menu a,
  .mobile-account-menu button {
    min-height: 48px;
    display: flex;
    align-items: center;
    margin-top: 7px;
    padding: 0 11px;
    color: var(--red-dark);
    background: #fff8f5;
    border: 1px solid #f0d5cb;
    border-radius: 9px;
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
  }

  .content-wrap {
    padding: 14px max(15px, env(safe-area-inset-right)) calc(108px + env(safe-area-inset-bottom)) max(15px, env(safe-area-inset-left));
  }

  .page-intro {
    display: block;
    margin-bottom: 15px;
    padding: 20px;
    color: #fff;
    background: var(--red);
    border-radius: 19px;
    box-shadow: 0 16px 38px rgba(160, 20, 30, 0.2);
  }

  .page-intro h1 {
    color: #fff;
    font-size: 27px;
  }

  .page-intro .eyebrow {
    color: #ffe17a;
  }

  .intro-copy {
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
  }

  .sync-note {
    width: max-content;
    max-width: 100%;
    margin-top: 18px;
    padding: 7px 10px;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
    font-size: 10px;
  }

  .sync-note .live-dot {
    background: #ffe17a;
    box-shadow: 0 0 0 4px rgba(255, 225, 122, 0.2);
  }

  .summary-grid {
    display: flex;
    gap: var(--kpi-grid-gap);
    margin: 0 -15px 18px;
    padding: 0 15px 4px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .summary-card {
    min-width: 168px;
    min-height: 138px;
    padding: var(--kpi-card-padding);
    scroll-snap-align: start;
  }

  .summary-card strong {
    font-size: 28px;
  }

  .summary-icon {
    width: 38px;
    height: 38px;
    margin-bottom: 10px;
  }

  .mobile-tools {
    display: none;
  }

  .records-panel {
    margin: 0 -15px;
    border-width: 1px 0;
    border-radius: 0;
    box-shadow: none;
  }

  .records-heading {
    padding: 21px 15px 15px;
    align-items: center;
  }

  .records-heading h2 {
    font-size: 21px;
  }

  .records-heading-actions {
    display: grid;
    justify-items: end;
    gap: 7px;
  }

  .bulk-print-open {
    display: none;
  }

  .mobile-filter-toggle {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    color: var(--ink);
    font-size: 10px;
  }

  .mobile-filter-toggle b {
    min-width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--red);
    border-radius: 50%;
    font-size: 8px;
  }

  .mobile-quick-filters {
    display: flex;
    gap: 7px;
    padding: 0 15px 12px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
  }

  .mobile-quick-filters button {
    min-height: 44px;
    flex: 0 0 auto;
    padding: 0 13px;
    color: var(--muted);
    background: #f7f2ef;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    scroll-snap-align: start;
  }

  .mobile-quick-filters button.active {
    color: var(--red-dark);
    background: var(--red-soft);
    border-color: #efb6bb;
  }

  .bulk-print-open {
    min-height: 42px;
    padding: 8px 11px;
    font-size: 11px;
  }

  .filter-bar {
    display: grid;
    grid-template-columns: 1fr;
    padding: 0 15px 12px;
  }

  .filter-bar:not(.is-open) > label:not(.search-field) {
    display: none;
  }

  .filter-bar.is-open {
    padding: 12px 15px 15px;
    background: #fff9f5;
    border-top: 1px solid #f0dfd5;
  }

  .filter-bar.is-open > label {
    grid-column: 1 / -1;
  }

  .filter-bar label:nth-child(3) {
    grid-column: 1 / -1;
  }

  .filter-bar label:nth-child(4) {
    grid-column: 1 / -1;
  }

  .filter-bar label:nth-child(5) {
    grid-column: 1 / -1;
  }

  .active-filter-strip {
    padding: 0 15px 12px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
  }

  .active-filter-strip button {
    flex: 0 0 auto;
    min-height: 44px;
  }

  .desktop-table-wrap {
    display: none;
  }

  .mobile-record-list {
    display: block;
    padding: 10px 10px 20px;
    background: #f7f3f0;
    border-top: 1px solid var(--line);
  }

  .mobile-record {
    width: 100%;
    min-height: 148px;
    display: block;
    margin-bottom: 10px;
    padding: 15px;
    text-align: left;
    background: #fff;
    border: 1px solid #eadfda;
    border-radius: 15px;
    box-shadow: 0 7px 20px rgba(53, 28, 22, 0.05);
    cursor: pointer;
    touch-action: manipulation;
  }

  .mobile-record:active {
    background: #fff8f4;
    transform: scale(0.992);
  }

  .mobile-record-kicker {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 11px;
    color: var(--muted);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .mobile-record-kicker span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-record-topline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
  }

  .mobile-record-topline > div {
    min-width: 0;
  }

  .mobile-record-topline strong,
  .mobile-record-topline span {
    display: block;
  }

  .mobile-record-topline strong {
    font-size: 16px;
  }

  .mobile-record-topline span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
  }

  .mobile-record p {
    display: -webkit-box;
    margin: 11px 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .mobile-record-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
  }

  .mobile-date {
    margin-left: auto;
    color: var(--muted);
    font-size: 10px;
  }

  .mobile-record-topline > b {
    min-width: max-content;
    padding: 7px 9px;
    background: #fff3f0;
    border-radius: 9px;
    font-size: 14px;
  }

  .mobile-open-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    color: var(--red-dark);
    font-size: 9px;
    font-weight: 800;
  }

  .mobile-open-label b {
    font-size: 18px;
    line-height: 1;
  }

  .mobile-tabs {
    position: fixed;
    z-index: 45;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 26px rgba(53, 28, 22, 0.08);
    backdrop-filter: blur(14px);
    transition: transform 160ms ease;
  }

  .mobile-tabs button,
  .mobile-tabs a {
    min-height: 52px;
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 6px 2px 4px;
    color: #8d817e;
    background: transparent;
    border: 0;
    font-size: 9px;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
    text-decoration: none;
  }

  .mobile-tabs button span,
  .mobile-tabs a span {
    height: 24px;
    color: inherit;
    font-size: 20px;
    line-height: 24px;
  }

  .mobile-tabs button.active,
  .mobile-tabs button[aria-pressed="true"],
  .mobile-tabs a.active,
  .mobile-tabs a[aria-current="page"] {
    color: var(--red);
  }

  .mobile-tabs button.active,
  .mobile-tabs button[aria-pressed="true"],
  .mobile-tabs a.active,
  .mobile-tabs a[aria-current="page"] {
    background: var(--red-soft);
    border-radius: 10px;
  }

  .sheet-backdrop {
    align-items: flex-end;
  }

  .bulk-print-backdrop {
    justify-content: center;
    padding: 0;
  }

  .bulk-print-dialog {
    width: 100%;
    max-height: calc(94dvh - env(safe-area-inset-top));
    padding-bottom: env(safe-area-inset-bottom);
    border-radius: 22px 22px 0 0;
    overscroll-behavior: contain;
    animation: sheet-up 220ms ease;
  }

  .bulk-print-dialog .sheet-header {
    border-radius: 22px 22px 0 0;
  }

  .bulk-print-content {
    padding: 20px 15px 24px;
  }

  .record-sheet {
    width: 100%;
    height: min(94dvh, 860px);
    max-height: calc(100dvh - env(safe-area-inset-top));
    padding-bottom: env(safe-area-inset-bottom);
    border-radius: 22px 22px 0 0;
    overscroll-behavior: contain;
    animation: sheet-up 220ms ease;
  }

  @keyframes sheet-up {
    from { transform: translateY(40px); opacity: 0.6; }
  }

  .sheet-handle {
    position: sticky;
    top: 0;
    z-index: 4;
    width: 42px;
    height: 4px;
    display: block;
    margin: 8px auto -2px;
    border-radius: 999px;
    background: #d9cfca;
  }

  .sheet-header {
    padding: 17px 15px 15px;
  }

  .quick-actions {
    padding: 18px 15px;
  }

  .payment-row {
    grid-template-columns: minmax(0, 1fr) 104px;
  }

  .payment-row .primary-button {
    min-height: 50px;
  }

  #payment-amount {
    min-height: 50px;
    font-size: 20px;
    font-weight: 700;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .soa-button {
    min-height: 50px;
    font-size: 13px;
  }

  .record-form {
    padding: 20px 15px 28px;
  }

  .sheet-footer {
    margin: 6px -15px -28px;
    padding-left: 15px;
    padding-right: 15px;
  }

  .toast {
    bottom: 132px;
  }

  .login-card {
    padding: 28px 22px;
    border-radius: 20px;
  }

  body.keyboard-open .mobile-tabs,
  body.keyboard-open .offline-status-button {
    transform: translateY(calc(100% + 24px));
    pointer-events: none;
  }

  body.keyboard-open .content-wrap {
    padding-bottom: 24px;
  }
}

@media (min-width: 700px) and (max-width: 1000px) {
  .mobile-record-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .mobile-record {
    height: 100%;
    margin-bottom: 0;
  }

  .sheet-backdrop {
    align-items: stretch;
    justify-content: flex-end;
  }

  .record-sheet {
    width: min(620px, 100%);
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .bulk-print-backdrop {
    align-items: center;
    padding: 24px;
  }

  .bulk-print-dialog {
    width: min(700px, 100%);
    max-height: calc(100dvh - 48px);
    border-radius: 20px;
  }

  .bulk-print-dialog .sheet-header {
    border-radius: 20px 20px 0 0;
  }
}

@media (orientation: landscape) and (max-height: 600px) and (max-width: 1000px) {
  .topbar-inner {
    min-height: 54px;
    padding-top: max(2px, env(safe-area-inset-top));
    padding-bottom: 2px;
  }

  .brand-logo {
    width: 104px;
    height: 44px;
  }

  .mobile-account-menu summary {
    width: 44px;
    height: 44px;
  }

  .content-wrap {
    padding-top: 10px;
  }

  .page-intro {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 10px;
    padding: 12px 16px;
    border-radius: 15px;
  }

  .page-intro h1 {
    margin-bottom: 0;
    font-size: 22px;
  }

  .page-intro .eyebrow,
  .intro-copy {
    display: none;
  }

  .sync-note {
    flex: 0 0 auto;
    margin: 0 0 0 auto;
  }

  .summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(145px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }

  .summary-card {
    min-width: 145px;
    min-height: 94px;
    padding: 11px 13px;
  }

  .summary-card strong {
    font-size: 23px;
  }

  .summary-card small {
    display: none;
  }

  .summary-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 5px;
  }

  .records-heading {
    padding-top: 14px;
  }

  .mobile-record-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .mobile-record {
    min-height: 132px;
    height: 100%;
    margin-bottom: 0;
  }

  .mobile-tabs button,
  .mobile-tabs a {
    min-height: 48px;
    padding-top: 4px;
  }

  .mobile-tabs button span,
  .mobile-tabs a span {
    height: 20px;
    font-size: 18px;
    line-height: 20px;
  }

  .record-sheet,
  .bulk-print-dialog {
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .bulk-print-dialog .sheet-header {
    border-radius: 0;
  }

  .sheet-header {
    padding-top: 12px;
    padding-bottom: 12px;
  }
}

@media (max-width: 600px) {
  .app-dialog-backdrop {
    align-items: flex-end;
    padding: max(12px, env(safe-area-inset-top)) 0 0;
  }

  .app-dialog {
    width: 100%;
    max-height: calc(100dvh - max(12px, env(safe-area-inset-top)));
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 14px;
    padding: 22px max(18px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
    border-radius: 22px 22px 0 0;
    animation-name: dialog-sheet-in;
  }

  .app-dialog-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 21px;
  }

  .app-dialog h2 {
    font-size: 20px;
  }

  .app-dialog-copy {
    padding-right: 22px;
  }

  .app-dialog-actions {
    position: sticky;
    bottom: 0;
    padding-top: 4px;
    background: #fff;
  }

  @keyframes dialog-sheet-in {
    from { transform: translateY(24px); opacity: 0; }
  }
}

@media (max-width: 410px) {
  .offline-status-panel dl,
  .offline-panel-actions {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .filter-bar label,
  .filter-bar label:nth-child(3),
  .filter-bar label:nth-child(4),
  .filter-bar label:nth-child(5),
  .search-field {
    grid-column: 1;
  }

  .payment-row,
  .form-grid,
  .bulk-filter-grid,
  .bulk-print-summary,
  .bulk-format-grid {
    grid-template-columns: 1fr;
  }
}

@media (hover: none) and (pointer: coarse) {
  .primary-button,
  .secondary-button,
  .desktop-tool,
  .bulk-print-open,
  .receipt-ready,
  .delivery-ready,
  .soa-button,
  .mobile-tools a,
  .mobile-filter-toggle,
  .mobile-quick-filters button,
  .active-filter-strip button,
  .offline-status-button,
  .offline-operation button,
  .offline-panel-actions button,
  .app-dialog-actions button,
  .mobile-account-menu a,
  .mobile-account-menu button,
  .maps-link,
  .receipt-banner a {
    min-height: var(--tap-target);
  }

  .close-button,
  .offline-panel-close,
  .mobile-account-menu summary {
    width: var(--tap-target);
    height: var(--tap-target);
  }

  button:not(:disabled):active,
  a:active,
  summary:active {
    filter: brightness(0.96);
  }
}

.summary-grid::-webkit-scrollbar,
.mobile-tools::-webkit-scrollbar,
.mobile-quick-filters::-webkit-scrollbar,
.active-filter-strip::-webkit-scrollbar {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* v4.1.1 navigation, action, and KPI stability */
body.shortcuts-ready .topbar-actions > .desktop-tool,
body.shortcuts-ready .tool-actions > .desktop-only,
body.shortcuts-ready .tool-actions > a[href="./"],
body.shortcuts-ready .report-header-actions > .report-back {
  display: none;
}

body.shortcuts-ready .mobile-tools {
  display: none;
}

.primary-button,
.secondary-button,
.app-shortcut-menu summary,
.app-shortcut-action {
  min-height: 44px;
  text-decoration: none !important;
}

.primary-button,
.secondary-button {
  white-space: nowrap;
}

button:disabled {
  cursor: not-allowed;
}

button[aria-busy="true"] {
  cursor: wait;
}

.app-shortcut-menu {
  position: relative;
  flex: 0 0 auto;
}

.app-shortcut-menu summary {
  min-width: 126px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff8f5;
  border: 1px solid #e9d5cf;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.app-shortcut-menu summary::-webkit-details-marker {
  display: none;
}

.app-shortcut-menu summary:hover,
.app-shortcut-menu summary:focus-visible,
.app-shortcut-menu[open] summary {
  color: var(--red-dark);
  background: var(--red-soft);
  border-color: #eeb8bc;
}

.app-shortcut-menu summary b {
  margin-left: 2px;
  font-size: 13px;
  transition: transform 150ms ease;
}

.app-shortcut-menu[open] summary b {
  transform: rotate(180deg);
}

.app-shortcut-menu-icon {
  color: var(--red);
  font-size: 16px;
  line-height: 1;
}

.app-shortcut-popover {
  position: absolute;
  z-index: 70;
  top: calc(100% + 10px);
  right: 0;
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100dvh - 100px);
  overflow: auto;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(53, 28, 22, 0.18);
}

.app-shortcut-popover > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 0 3px 12px;
  border-bottom: 1px solid var(--line);
}

.app-shortcut-popover > header span {
  color: var(--red);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.app-shortcut-popover > header strong {
  color: var(--muted);
  font-size: 10px;
}

.app-shortcut-popover .app-shortcut-group + .app-shortcut-group {
  margin-top: 12px;
}

.app-shortcut-group h2 {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.app-shortcut-popover .app-shortcut-group > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.app-shortcut-link {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 11px;
  color: var(--ink);
  background: #fffaf6;
  border: 1px solid #eee1d9;
  border-radius: 12px;
  text-decoration: none !important;
}

.app-shortcut-link:hover,
.app-shortcut-link:focus-visible,
.app-shortcut-link.active {
  color: var(--red-dark);
  background: var(--red-soft);
  border-color: #edb9bd;
}

.app-shortcut-link > span:last-child,
.app-shortcut-link strong,
.app-shortcut-link small {
  min-width: 0;
  display: block;
}

.app-shortcut-link strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shortcut-link small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.35;
}

.app-shortcut-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--red-dark);
  background: #fff;
  border: 1px solid #efdcd5;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
}

.app-shortcut-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(35, 20, 17, .48);
  backdrop-filter: blur(3px);
}

.app-shortcut-sheet {
  width: min(680px, 100%);
  max-height: calc(94dvh - env(safe-area-inset-top));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: #fff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -20px 60px rgba(35, 20, 17, .22);
}

.app-shortcut-handle {
  width: 46px;
  height: 5px;
  margin: 9px auto 0;
  background: #ddd1cc;
  border-radius: 999px;
}

.app-shortcut-sheet > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px max(18px, env(safe-area-inset-right)) 13px max(18px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
}

.app-shortcut-sheet > header p,
.app-shortcut-sheet > header h1 {
  margin: 0;
}

.app-shortcut-sheet > header p {
  margin-bottom: 3px;
  color: var(--red);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.app-shortcut-sheet > header h1 {
  font-size: 21px;
}

.app-shortcut-close {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #f6f0ed;
  border: 0;
  border-radius: 50%;
  font-size: 25px;
  cursor: pointer;
}

.app-shortcut-sheet-body {
  display: grid;
  gap: 17px;
  overflow: auto;
  padding: 16px max(18px, env(safe-area-inset-right)) 18px max(18px, env(safe-area-inset-left));
  overscroll-behavior: contain;
}

.app-shortcut-sheet-body .app-shortcut-group > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.app-shortcut-sheet > footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 9px;
  padding: 11px max(18px, env(safe-area-inset-right)) calc(11px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: #fffaf6;
  border-top: 1px solid var(--line);
}

.app-shortcut-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--red-dark);
  background: #fff;
  border: 1px solid #e8d8d1;
  border-radius: 11px;
  font-size: 10px;
  cursor: pointer;
}

.app-shortcut-action span {
  font-size: 17px;
}

.app-shortcut-action.is-primary {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

body.shortcut-sheet-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.summary-card strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.summary-card small {
  margin-top: auto;
  line-height: 1.4;
}

@media (max-width: 1000px) {
  body.shortcuts-ready .mobile-account-menu {
    display: none;
  }

  .app-shortcut-menu {
    display: none;
  }

  body.shortcuts-ready .mobile-tabs,
  body.shortcuts-ready .tool-mobile-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-columns: auto;
    overflow: visible;
  }

  body.shortcuts-ready .mobile-tabs a,
  body.shortcuts-ready .mobile-tabs button,
  body.shortcuts-ready .tool-mobile-nav a,
  body.shortcuts-ready .tool-mobile-nav button {
    min-width: 0;
    min-height: 52px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 2px;
    padding: 5px 2px 4px;
    color: #8d817e;
    background: transparent;
    border: 0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.15;
    text-decoration: none !important;
    cursor: pointer;
  }

  body.shortcuts-ready .mobile-tabs a > span:first-child,
  body.shortcuts-ready .mobile-tabs button > span:first-child,
  body.shortcuts-ready .tool-mobile-nav a > span:first-child,
  body.shortcuts-ready .tool-mobile-nav button > span:first-child {
    width: auto;
    height: 23px;
    display: block;
    color: inherit;
    font-size: 20px;
    line-height: 23px;
  }

  body.shortcuts-ready .mobile-tabs a.active,
  body.shortcuts-ready .mobile-tabs a[aria-current="page"],
  body.shortcuts-ready .mobile-tabs button.active,
  body.shortcuts-ready .tool-mobile-nav a.active,
  body.shortcuts-ready .tool-mobile-nav a[aria-current="page"],
  body.shortcuts-ready .tool-mobile-nav button.active {
    color: var(--red);
    background: var(--red-soft);
  }

  .summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 18px;
    padding: 0;
    overflow: visible;
  }

  .summary-card {
    min-width: 0;
    min-height: 132px;
    padding: var(--kpi-card-padding);
  }

  .summary-card.balance-card {
    grid-column: 1 / -1;
  }

  .summary-card strong {
    font-size: clamp(22px, 6vw, 29px);
  }
}

@media (max-width: 480px) {
  .app-shortcut-sheet-body .app-shortcut-group > div {
    grid-template-columns: 1fr 1fr;
  }

  .app-shortcut-link {
    min-height: 66px;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
  }

  .app-shortcut-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 12px;
  }

  .app-shortcut-link strong {
    font-size: 9px;
  }

  .app-shortcut-link small {
    display: none;
  }

  .summary-card {
    min-height: 122px;
    padding: var(--kpi-card-padding);
  }

  .summary-card strong {
    margin: 7px 0 5px;
    font-size: clamp(20px, 6.5vw, 26px);
  }

  .summary-card small {
    font-size: 9px;
  }

  .summary-icon {
    width: 34px;
    height: 34px;
    margin-bottom: 8px;
  }
}

@media (orientation: landscape) and (max-height: 600px) and (max-width: 1000px) {
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-card.balance-card {
    grid-column: auto;
  }

  .app-shortcut-sheet {
    width: min(760px, 92vw);
    max-height: 96dvh;
    border-radius: 20px 20px 0 0;
  }

  .app-shortcut-sheet-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
}

@media print {
  .app-shortcut-menu,
  .app-shortcut-backdrop {
    display: none !important;
  }
}

/* v4.1.4 readable typography upgrade
   Screen typography has a deliberate minimum size. Print layouts retain their
   calibrated A4 and 58 mm sizing in the dedicated print stylesheets. */
@media screen {
  :root {
    --ui-type-caption: 12px;
    --ui-type-small: 13px;
    --ui-type-body: 15px;
    --ui-type-control: 14px;
  }

  body {
    color: #291b19;
    font-size: var(--ui-type-body);
    line-height: 1.55;
  }

  small {
    font-size: var(--ui-type-small) !important;
    line-height: 1.45;
  }

  input,
  select,
  textarea {
    font-size: 16px !important;
    line-height: 1.45;
  }

  .primary-button,
  .secondary-button,
  .danger-button,
  .download-action,
  .qr-action,
  .report-apply,
  .analytics-apply {
    font-size: var(--ui-type-control) !important;
    line-height: 1.25;
  }

  .eyebrow,
  .brand-copy span,
  .tool-brand span,
  .app-dialog-eyebrow,
  .landing-kicker,
  .login-brand p,
  .profile-role span,
  .reconciliation-access span,
  .report-as-of span,
  .analytics-as-of span,
  .reminder-user span,
  .bulk-qr-user span {
    font-size: var(--ui-type-caption) !important;
    line-height: 1.35;
    letter-spacing: .06em;
  }

  .tool-card-header p,
  .tool-intro p,
  .tool-list-empty span,
  .manage-row p,
  .field-help,
  .profile-security-note span,
  .collector-closeout-callout span,
  .batch-person span,
  .tool-message,
  .app-dialog-detail,
  .sync-note,
  .mobile-record p,
  .landing-access-note,
  .landing-metrics span,
  .landing-feature-grid p,
  .landing-workflow li p,
  .landing-footer p {
    font-size: var(--ui-type-small) !important;
    line-height: 1.5;
  }

  .tool-form label > span,
  .record-form label > span,
  .bulk-filter-grid label > span,
  .soa-custom-dates label > span,
  .login-form label span,
  .report-filters label > span,
  .analytics-filters label > span,
  .reconciliation-filters label > span,
  .remittance-form label > span,
  .reminder-filters label > span,
  .reminder-modal-fields label > span,
  .bulk-qr-filters label > span,
  .maintenance-message span {
    font-size: var(--ui-type-small) !important;
    line-height: 1.35;
  }

  .mini-badge,
  .group-badge,
  .pending-badge,
  .route-badge,
  .closeout-status,
  .status-pill,
  .event-pill,
  .analytics-status,
  .analytics-badge,
  .report-badge,
  .reminder-task b,
  .reminder-audit-action,
  .bulk-qr-state b,
  .qr-audit-action,
  .assurance-pill,
  .backup-state {
    min-height: 26px;
    align-items: center;
    font-size: var(--ui-type-caption) !important;
    line-height: 1.25;
  }

  .tool-mobile-nav a,
  .tool-mobile-nav button,
  .mobile-tabs a,
  .mobile-tabs button,
  .mobile-tools a,
  .mobile-account-menu button,
  .mobile-quick-filters button,
  .mobile-filter-toggle,
  .app-shortcut-action {
    font-size: 11.5px !important;
    line-height: 1.2;
  }

  .app-branch-switcher summary > span,
  .app-branch-switcher.is-static > span,
  .app-branch-popover header span,
  .app-branch-popover button > b,
  .app-mobile-branch-list button > b,
  .app-shortcut-popover > header span,
  .app-shortcut-group h2,
  .app-shortcut-sheet > header p {
    font-size: var(--ui-type-caption) !important;
    line-height: 1.3;
  }

  .app-branch-switcher summary > strong,
  .app-branch-switcher.is-static > strong,
  .app-branch-popover button strong,
  .app-mobile-branch-list button strong,
  .app-shortcut-link strong,
  .mobile-account-menu > div > span,
  .mobile-record-topline span,
  .mobile-date,
  .mobile-open-label {
    font-size: var(--ui-type-small) !important;
    line-height: 1.35;
  }

  .desktop-tool,
  .active-filter-strip button,
  .bulk-print-note,
  .bulk-support-links a,
  .collector-closeout-callout b,
  .batch-amount-wrap button,
  .manage-jump a,
  .download-grid a,
  .download-grid .download-action,
  .bulk-print-open,
  .offline-status-button,
  .offline-status-button b,
  .offline-operation button,
  .offline-panel-actions button {
    font-size: var(--ui-type-caption) !important;
    line-height: 1.35;
  }

  .records-table th,
  .report-table-wrap th,
  .analytics-table-wrap th,
  .closeout-table th,
  .portal-table th,
  .assurance-table th,
  .assurance-table td::before,
  .report-table-wrap td::before {
    font-size: var(--ui-type-caption) !important;
    line-height: 1.35;
  }

  .records-table td,
  .report-table-wrap td,
  .analytics-table-wrap td,
  .closeout-table td,
  .portal-table td,
  .assurance-table td {
    font-size: var(--ui-type-small) !important;
    line-height: 1.5;
  }

  .summary-card span,
  .summary-card small,
  .report-kpi span,
  .report-kpi small,
  .report-insights span,
  .report-insights small,
  .methods-grid span,
  .methods-grid small,
  .analytics-kpi span,
  .analytics-kpi small,
  .analytics-signals span,
  .analytics-signals small,
  .reconciliation-kpis span,
  .reconciliation-kpis small,
  .closeout-methods span,
  .closeout-methods small,
  .closeout-total-row span,
  .reminder-summary span,
  .reminder-summary small,
  .bulk-qr-summary span,
  .bulk-qr-summary small,
  .daily-grid span,
  .daily-grid small {
    font-size: var(--ui-type-caption) !important;
    line-height: 1.4;
  }

  .report-presets button,
  .report-tabs button,
  .analytics-presets button,
  .report-search input,
  .report-loading p,
  .analytics-loading p,
  .report-error p,
  .analytics-error p,
  .reconciliation-alert span,
  .reconciliation-filter-heading p,
  .reconciliation-list-item span,
  .reconciliation-list-item small,
  .closeout-notice,
  .closeout-section-heading p,
  .closeout-audit strong,
  .closeout-audit span,
  .closeout-audit small {
    font-size: var(--ui-type-small) !important;
    line-height: 1.45;
  }

  .report-section-heading p:not(.eyebrow),
  .analytics-section-heading p:not(.eyebrow),
  .assurance-card-heading p:not(.eyebrow),
  .backup-guidance span,
  .maintenance-actions small,
  .assurance-check small,
  .assurance-event span,
  .assurance-event small,
  .assurance-empty {
    font-size: var(--ui-type-small) !important;
    line-height: 1.5;
  }

  .analytics-alert strong,
  .analytics-alert small,
  .analytics-trend-point small,
  .analytics-empty,
  .analytics-age-label strong,
  .analytics-age-label small,
  .analytics-age-amount,
  .analytics-account strong,
  .analytics-account span,
  .analytics-account small,
  .analytics-remittance-item strong,
  .analytics-remittance-item span,
  .analytics-remittance-item small {
    font-size: var(--ui-type-caption) !important;
    line-height: 1.4;
  }

  .reminder-selection-bar strong,
  .reminder-person small,
  .reminder-person em,
  .reminder-balance span,
  .reminder-balance small,
  .reminder-plan span,
  .reminder-plan strong,
  .reminder-plan small,
  .reminder-task > strong,
  .reminder-task > small,
  .reminder-actions button,
  .reminder-actions a,
  .reminder-audit-list strong,
  .reminder-audit-list small,
  .reminder-audit-list time,
  .reminder-audit-list code,
  .reminder-modal-fields small {
    font-size: var(--ui-type-caption) !important;
    line-height: 1.4;
  }

  .bulk-qr-person small,
  .bulk-qr-person em,
  .bulk-qr-account small,
  .bulk-qr-account strong,
  .bulk-qr-state small,
  .bulk-qr-open,
  .bulk-qr-audit-list strong,
  .bulk-qr-audit-list small,
  .bulk-qr-audit-list time,
  .bulk-qr-audit-list code,
  .qr-reference span,
  .portal-header span,
  .portal-balance span,
  .portal-summary span,
  .portal-statement p,
  .portal-footer {
    font-size: var(--ui-type-small) !important;
    line-height: 1.45;
  }

  .tool-mobile-nav {
    grid-auto-columns: minmax(68px, 1fr) !important;
  }

  .tool-mobile-nav a,
  .tool-mobile-nav button {
    white-space: nowrap;
  }

  .landing-nav a,
  .landing-trust,
  .landing-footer > a:last-child,
  .app-shortcut-menu summary,
  .offline-status-panel > p,
  .offline-status-panel dd,
  .offline-operation strong,
  .bulk-print-summary span,
  .soa-period-field > span,
  .check-copy span,
  .system-stats span {
    font-size: var(--ui-type-small) !important;
    line-height: 1.45;
  }

  .landing-brand span,
  .offline-status-panel dt,
  .landing-feature-grid article > span {
    font-size: var(--ui-type-caption) !important;
    line-height: 1.35;
  }
}

/* v4.2.0 inline route-sequence editing */
@media screen {
  .records-table.has-route-sequence {
    min-width: 1240px;
  }

  .route-sequence-cell {
    width: 154px;
  }

  .route-sequence-editor,
  .route-sequence-readonly {
    min-width: 118px;
    display: grid;
    gap: 5px;
    cursor: default;
  }

  .route-sequence-input {
    width: 84px;
    min-height: 44px;
    padding: 8px 10px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--field-border);
    border-radius: 10px;
    font-size: 16px !important;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    font-variant-numeric: tabular-nums;
  }

  .route-sequence-input:hover {
    border-color: var(--field-border-hover);
  }

  .route-sequence-input:focus {
    outline: 0;
    border-color: var(--red);
    box-shadow: 0 0 0 4px rgba(225, 29, 46, .14);
  }

  .route-sequence-input[aria-invalid="true"] {
    border-color: var(--red);
    background: #fff4f4;
  }

  .route-sequence-editor small,
  .route-sequence-readonly small {
    min-height: 17px;
    margin: 0;
    color: var(--muted);
    font-size: 12px !important;
    line-height: 1.35;
  }

  .route-sequence-editor[data-state="saving"] small {
    color: #8a6412;
  }

  .route-sequence-editor[data-state="error"] small {
    color: var(--red-dark);
  }

  .route-sequence-readonly strong {
    font-size: 16px;
    font-variant-numeric: tabular-nums;
  }
}

@media screen and (max-width: 1000px) {
  .mobile-record-item {
    min-width: 0;
    margin-bottom: 10px;
  }

  .mobile-record-item .mobile-record {
    height: auto;
    margin-bottom: 0;
    border-radius: 15px 15px 0 0;
    box-shadow: none;
  }

  .mobile-route-sequence {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px 12px;
    padding: 11px 14px 12px;
    background: #fffaf6;
    border: 1px solid #eadfda;
    border-top: 0;
    border-radius: 0 0 15px 15px;
  }

  .mobile-route-sequence::before {
    grid-column: 1;
    content: "Route sequence";
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  .mobile-route-sequence .route-sequence-input,
  .mobile-route-sequence > strong {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .mobile-route-sequence small {
    grid-column: 1;
  }

  .mobile-route-sequence .route-sequence-input {
    width: 88px;
    min-height: 48px;
  }
}

@media screen and (min-width: 700px) and (max-width: 1000px) {
  .mobile-record-item {
    height: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
  }

  .mobile-record-item .mobile-record {
    flex: 1 1 auto;
  }
}

/* v4.6.1 accessible password visibility controls */
@media screen {
  .password-field {
    min-width: 0;
    display: grid;
    gap: 7px;
  }

  .password-field > label {
    color: var(--muted);
    font-size: var(--ui-type-small, 13px);
    font-weight: 600;
    line-height: 1.35;
  }

  .password-control {
    position: relative;
    min-width: 0;
  }

  .password-control > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
    padding-right: 78px !important;
  }

  .password-toggle {
    position: absolute;
    z-index: 2;
    top: 2px;
    right: 2px;
    width: auto;
    min-width: 62px;
    min-height: 44px;
    margin: 0;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--red-dark);
    background: transparent;
    border: 0;
    border-radius: 8px;
    box-shadow: none;
    font-size: 13px !important;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
  }

  .password-toggle:hover {
    color: var(--red-dark);
    background: var(--red-soft);
  }

  .password-toggle:focus-visible {
    outline: 3px solid rgba(225, 29, 46, .2);
    outline-offset: -1px;
  }

  .password-toggle:active {
    background: #ffe1e4;
    transform: translateY(1px);
  }

  .password-toggle:disabled {
    opacity: .5;
    cursor: not-allowed;
  }
}

@media screen and (pointer: coarse) {
  .password-toggle {
    top: 2px;
    right: 2px;
    min-width: 66px;
    min-height: 44px;
  }

  .password-control > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
    padding-right: 82px !important;
  }
}
