:root {
  --bg: #09111b;
  --panel: rgba(13, 22, 34, 0.9);
  --panel-strong: rgba(19, 29, 43, 0.96);
  --surface: rgba(255, 255, 255, 0.04);
  --surface-soft: rgba(255, 255, 255, 0.03);
  --line: rgba(255, 255, 255, 0.09);
  --text: #f5f7fb;
  --muted: #9caac0;
  --brand: #ff2141;
  --brand-deep: #b90d28;
  --brand-soft: rgba(255, 33, 65, 0.14);
  --success: #0f8e6d;
  --success-soft: rgba(15, 142, 109, 0.16);
  --warning: #f2b84b;
  --danger: #ff7d92;
  --shadow: 0 22px 44px rgba(0, 0, 0, 0.28);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 33, 65, 0.18), transparent 22%),
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.08), transparent 18%),
    linear-gradient(180deg, #08111a 0%, #0b1622 52%, #0d1826 100%);
}

button,
input,
textarea,
select {
  font: inherit;
}

.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;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  height: 100dvh;
  transition: grid-template-columns 180ms ease;
}

.app-shell.is-sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 18px;
  background: rgba(10, 17, 27, 0.88);
  border-right: 1px solid var(--line);
  transition: opacity 180ms ease, transform 180ms ease, padding 180ms ease;
}

.app-shell.is-sidebar-collapsed .sidebar {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-24px);
  padding-left: 0;
  padding-right: 0;
  overflow: hidden;
  border-right: 0;
}

.mobile-nav-backdrop {
  display: none;
}

.sidebar__brand {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 8px 6px;
}

.logo-chip {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, var(--brand), white);
  background-size: cover;
  background-position: center;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--brand);
}

.sidebar h1,
.topbar h2,
.section-heading h3,
.card h3,
.stat strong,
.empty-state h3 {
  margin: 0;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav__link {
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--muted);
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.nav__link:hover,
.nav__link.is-active {
  background: var(--brand-soft);
  color: var(--text);
  transform: translateX(2px);
}

.sidebar__footer {
  margin-top: auto;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
}

.version-badge {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}

.version-badge--ok {
  background: var(--success-soft);
  border-color: rgba(15, 142, 109, 0.35);
}

.version-badge--warn {
  background: rgba(242, 184, 75, 0.12);
  border-color: rgba(242, 184, 75, 0.35);
}

.version-badge--offline {
  background: rgba(255, 125, 146, 0.08);
  border-color: rgba(255, 125, 146, 0.28);
}

.main-panel {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: 24px;
  min-width: 0;
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.topbar__leading {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.auth-topbar-brand {
  display: none;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.auth-topbar-brand img {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(255, 33, 65, 0.24);
}

.app-shell.is-auth-gate {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell.is-auth-gate .sidebar,
.app-shell.is-auth-gate .sidebar-toggle {
  display: none;
}

.app-shell.is-auth-gate .auth-topbar-brand {
  display: inline-flex;
}

.topbar__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.sidebar-toggle {
  white-space: nowrap;
}

.view {
  display: grid;
  gap: 20px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.global-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.global-fab__menu {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  min-width: 220px;
  border-radius: 20px;
  background: rgba(10, 17, 27, 0.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.global-fab.is-open .global-fab__menu {
  display: flex;
}

.global-fab__menu-button {
  justify-content: flex-start;
  text-align: left;
}

.global-fab__save {
  min-width: 154px;
  box-shadow: 0 16px 34px rgba(15, 142, 109, 0.3);
}

.global-fab__trigger {
  width: 58px;
  min-width: 58px;
  height: 58px;
  padding: 0;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 2rem;
  line-height: 1;
  box-shadow: 0 18px 40px rgba(229, 15, 48, 0.28);
}

.card,
.panel,
.stat,
.table-shell,
.empty-state,
.hero-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 24px 26px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.card--embedded {
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
}

.hero-card p,
.section-copy,
.subtle,
.table-shell table td,
.table-shell table th,
.empty-state p {
  color: var(--muted);
}

.hero-card__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tournament-detail-hero {
  background: linear-gradient(135deg, rgba(15, 142, 109, 0.18), var(--panel));
}

.tournament-detail-hero__identity,
.tournament-detail-hero__company {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tournament-detail-hero__logo {
  width: 82px;
  height: 82px;
  flex: 0 0 82px;
  border-radius: 22px;
}

.tournament-detail-hero__company {
  color: var(--text);
  text-align: right;
}

.tournament-detail-hero__company .logo-chip {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 16px;
}

.tournament-detail-hero h3,
.tournament-detail-hero p {
  margin-top: 0;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  min-height: 44px;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease, background 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.button--primary {
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
}

.button--ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.button--danger {
  color: var(--danger);
  background: rgba(255, 125, 146, 0.08);
  border: 1px solid rgba(255, 125, 146, 0.24);
}

.button--success {
  color: white;
  background: linear-gradient(135deg, #0f8e6d, #0b6550);
}

.button--small {
  padding: 9px 14px;
  font-size: 0.92rem;
}

.button--compact {
  padding: 7px 12px;
  border-radius: 12px;
  font-size: 0.84rem;
  line-height: 1.15;
}

.field--inline {
  min-width: 160px;
}

.field--inline select {
  min-width: 160px;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid>* {
  min-width: 0;
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.summary-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.summary-list dt,
.summary-list dd {
  margin: 0;
}

.card-import-note {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.field-span-2 {
  grid-column: span 2;
}

.field-span-3 {
  grid-column: span 3;
}

.stats--compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.stat {
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.stat span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat--accent {
  background: linear-gradient(135deg, rgba(255, 33, 65, 0.16), rgba(255, 255, 255, 0.06));
}

.stat--success {
  background: linear-gradient(135deg, rgba(15, 142, 109, 0.18), rgba(255, 255, 255, 0.05));
}

.panel {
  padding: 10px;
}

.panel__section {
  padding: 24px 22px;
}

.panel__section+.panel__section {
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.logo-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.86rem;
}

.logo-preview img {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.logo-preview--uploaded {
  color: var(--success);
}

.field label {
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
input[type="file"],
textarea,
select {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--panel-strong);
  color: var(--text);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 20px;
  align-items: start;
}

.split-layout>* {
  min-width: 0;
}

.split-layout.has-collapsed-rail {
  grid-template-columns: minmax(0, 1fr) 92px;
}

.business-finance-layout {
  display: grid;
  gap: 20px;
}

.business-finance-summary .stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.business-revenue-card {
  border-radius: 24px;
  overflow: hidden;
}

.business-revenue-card__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.business-revenue-card__amount {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 142, 109, 0.16);
  border: 1px solid rgba(15, 142, 109, 0.28);
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.business-revenue-grid {
  align-items: end;
}

.business-linked-expense-table {
  min-width: 980px;
}

.business-linked-mileage-table {
  min-width: 1120px;
}

.business-register-table td strong {
  display: block;
}

.sticky {
  position: sticky;
  top: 24px;
}

.rail-shell {
  display: grid;
  gap: 10px;
}

.rail-shell__toggle-row {
  display: flex;
  justify-content: flex-end;
}

.rail-shell__toggle {
  width: 100%;
}

.rail-shell__collapsed-note {
  display: none;
}

.rail-shell.is-collapsed {
  align-content: start;
}

.rail-shell.is-collapsed .rail-shell__body {
  display: none;
}

.rail-shell.is-collapsed .rail-shell__toggle-row {
  justify-content: stretch;
}

.rail-shell.is-collapsed .rail-shell__toggle {
  min-height: 112px;
  border-radius: 18px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  padding: 14px 8px;
  width: 64px;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.rail-shell.is-collapsed .rail-shell__toggle:hover {
  color: var(--text);
  background: rgba(255, 33, 65, 0.08);
  border-color: rgba(255, 33, 65, 0.2);
}

.rail-shell.is-collapsed .rail-shell__collapsed-note {
  display: block;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-card {
  display: grid;
  gap: 20px;
  padding: 22px;
}

.summary-head {
  display: flex;
  gap: 16px;
  align-items: center;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-line:last-child {
  border-bottom: 0;
}

.list-editor {
  display: grid;
  gap: 12px;
}

.list-editor__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.line-items {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.line-item {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(180px, 1.2fr) minmax(120px, 0.7fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.line-item>* {
  min-width: 0;
}

.line-item:first-child {
  border-top: 0;
}

.line-item--expense {
  grid-template-columns: minmax(220px, 1.35fr) minmax(120px, 0.7fr) auto;
}

.line-item--rates {
  grid-template-columns: minmax(140px, 1fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr) auto;
}

.table-shell {
  overflow: hidden;
  min-width: 0;
}

.table-shell--scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable both-edges;
}

.card-import-table-shell {
  overflow-x: auto;
}

.card-import-table {
  min-width: 980px;
  table-layout: fixed;
}

.card-import-table td {
  vertical-align: top;
}

.card-import-col--date {
  width: 15%;
}

.card-import-col--transaction {
  width: 26%;
}

.card-import-col--amount {
  width: 12%;
}

.card-import-col--verdict {
  width: 13%;
}

.card-import-col--category {
  width: 12%;
}

.card-import-col--purpose {
  width: 14%;
}

.card-import-col--action {
  width: 8%;
}

.table-sort {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.table-sort.is-active {
  color: var(--text);
}

.table-shell table {
  width: 100%;
  border-collapse: collapse;
}

.table-shell--responsive td::before {
  content: none;
}

.table-shell th,
.table-shell td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.table-shell tr:last-child td {
  border-bottom: 0;
}

.report-row td {
  border-bottom: 0;
  padding-bottom: 10px;
}

.report-actions-row td {
  padding-top: 0;
  padding-bottom: 18px;
}

.report-actions-bar {
  justify-content: flex-start;
}

.mileage-destinations-table {
  min-width: 900px;
  table-layout: fixed;
}

.mileage-destinations-table__col--preset {
  width: 160px;
}

.mileage-destinations-table__col--name {
  width: 160px;
}

.mileage-destinations-table__col--coordinate {
  width: 92px;
}

.mileage-destinations-table__col--quick-pick {
  width: 120px;
}

.mileage-destinations-table__col--action {
  width: 96px;
}

.mileage-log-table {
  min-width: 1240px;
  table-layout: fixed;
}

.mileage-log-table th:nth-child(1),
.mileage-log-table .selection-col {
  width: 52px;
}

.mileage-log-table th:nth-child(2),
.mileage-log-table .mileage-col--date-display {
  width: 11%;
}

.mileage-log-table th:nth-child(3),
.mileage-log-table .mileage-col--route-display {
  width: 25%;
}

.mileage-log-table th:nth-child(4),
.mileage-log-table .mileage-col--purpose-display {
  width: 24%;
}

.mileage-log-table th:nth-child(5),
.mileage-log-table .mileage-col--linked-display {
  width: 14%;
}

.mileage-log-table th:nth-child(6),
.mileage-log-table .mileage-col--metric-display {
  width: 8%;
}

.mileage-log-table th:nth-child(7),
.mileage-log-table .mileage-col--money-display {
  width: 8%;
}

.mileage-log-table th:nth-child(8),
.mileage-log-table .mileage-col--receipt-display {
  width: 8%;
}

.mileage-log-table th:nth-child(9),
.mileage-log-table .mileage-col--action {
  width: 72px;
}

.mileage-log-table .table-sort {
  white-space: nowrap;
}

.mileage-routes-table {
  min-width: 1320px;
  table-layout: fixed;
}

.mileage-col input[type="text"],
.mileage-col input[type="number"],
.mileage-col input[type="date"] {
  width: 100%;
}

.mileage-col--label {
  width: 14%;
}

.mileage-col--preset {
  width: 160px;
}

.mileage-col--address {
  width: auto;
}

.mileage-col--coordinate {
  width: 92px;
}

.mileage-col--note {
  width: 18%;
}

.mileage-col--quick-pick {
  width: 120px;
}

.mileage-col--route-name {
  width: 20%;
}

.mileage-col--route-note {
  width: 16%;
}

.mileage-col--date {
  width: 15%;
}

.mileage-col--linked {
  width: 16%;
}

.mileage-routes-table .mileage-col--place {
  width: 15%;
}

.mileage-routes-table .mileage-col--trip-type {
  width: 11%;
}

.mileage-routes-table .mileage-col--metric {
  width: 12%;
}

.mileage-routes-table .mileage-col--quick-pick {
  width: 8%;
}

.mileage-col--purpose {
  width: 20%;
}

.mileage-col--metric {
  width: 12%;
}

.mileage-col--receipt {
  width: 12%;
}

.mileage-col--action {
  width: 72px;
  white-space: nowrap;
}

.mileage-col--route-display {
  width: 18%;
}

.mileage-col--money-display {
  width: 12%;
}

.mileage-col--linked-display,
.mileage-col--receipt-display,
.mileage-col--metric-display,
.mileage-col--purpose-display,
.mileage-col--date-display {
  vertical-align: middle;
}

.mileage-log-table td,
.mileage-destinations-table .mileage-log-row td {
  vertical-align: middle;
}

.mileage-log-row {
  cursor: pointer;
}

.mileage-log-row.is-duplicate-row {
  background: linear-gradient(90deg, rgba(255, 33, 65, 0.12), rgba(255, 33, 65, 0.04));
}

.mileage-log-row.is-duplicate-row td:first-child {
  box-shadow: inset 3px 0 0 rgba(255, 33, 65, 0.75);
}

.selection-col {
  width: 52px;
  min-width: 52px;
  text-align: center;
}

.row-selection {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 28px;
  cursor: pointer;
}

.row-selection input[type="checkbox"],
.selection-col input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.mileage-row-button {
  width: 100%;
  text-align: left;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.mileage-row-button strong,
.mileage-route-display strong,
.mileage-summary-text strong,
.mileage-summary-metric strong {
  display: block;
  font-size: 1rem;
  line-height: 1.3;
}

.mileage-row-button strong {
  font-size: 1.08rem;
  letter-spacing: 0.01em;
}

.mileage-row-button span,
.mileage-route-display span,
.mileage-summary-text span,
.mileage-summary-metric span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.mileage-route-display,
.mileage-summary-text,
.mileage-summary-metric {
  min-height: 0;
}

.mileage-summary-text strong,
.mileage-route-display strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mileage-log-table .actions-row {
  flex-wrap: nowrap;
  align-items: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 9, 16, 0.72);
  backdrop-filter: blur(8px);
  z-index: 50;
}

.modal-card {
  width: min(760px, 100%);
  max-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(10, 17, 27, 0.98);
  box-shadow: var(--shadow);
}

.modal-card--wide {
  width: min(980px, 100%);
}

.modal-card__header,
.modal-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.modal-card__footer {
  border-bottom: 0;
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}

.modal-card__body {
  overflow: auto;
  padding: 24px;
}

.help-modal-backdrop {
  z-index: 60;
}

.help-modal {
  max-height: min(760px, calc(100dvh - 48px));
}

.help-modal__body {
  display: grid;
  gap: 22px;
}

.help-modal__intro {
  margin: 0;
  max-width: 72ch;
}

.help-modal__sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.help-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.help-section h4 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 1rem;
}

.help-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.help-list li::marker {
  color: var(--brand);
}

.grid-span-2 {
  grid-column: span 2;
}

.mileage-editor-grid {
  align-items: start;
}

.mileage-editor-metrics,
.mileage-editor-receipt {
  min-height: 100%;
}

@media (max-width: 900px) {
  .modal-backdrop {
    padding: 12px;
    align-items: end;
  }

  .modal-card,
  .modal-card--wide {
    width: 100%;
    max-height: calc(100dvh - 24px);
    border-radius: 20px 20px 0 0;
  }

  .mileage-editor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .mileage-editor-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .grid-span-2 {
    grid-column: span 1;
  }

  .modal-card__header,
  .modal-card__footer,
  .modal-card__body {
    padding-left: 16px;
    padding-right: 16px;
  }
}

.mileage-destinations-table .mileage-col--coordinate input[type="number"] {
  max-width: 78px;
}

.mileage-destinations-table .mileage-col--address input[type="text"] {
  width: 100%;
}

.mileage-destinations-table .mileage-col--coordinate input[readonly] {
  background: rgba(255, 255, 255, 0.02);
  cursor: default;
}

.mileage-log-table .table-note {
  margin-top: 0;
  line-height: 1.35;
}

.mileage-destinations-table .autocomplete-list {
  min-width: 320px;
}

.mileage-bulk-grid {
  align-items: end;
}

.mileage-quick-picks {
  margin-bottom: 16px;
}

.mileage-quick-picks__groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.pill--button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.mileage-calendar {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
}

.mileage-calendar__header,
.mileage-calendar__footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.mileage-calendar__weekdays,
.mileage-calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.mileage-calendar__weekdays {
  margin-top: 16px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mileage-calendar__weekdays span {
  text-align: center;
}

.mileage-calendar__day {
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.mileage-calendar__day:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 45, 85, 0.5);
}

.mileage-calendar__day.is-selected {
  background: linear-gradient(135deg, rgba(255, 33, 65, 0.22), rgba(255, 255, 255, 0.07));
  border-color: rgba(255, 45, 85, 0.58);
}

.mileage-calendar__day.is-today {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.mileage-calendar__day--blank {
  border: 0;
  background: transparent;
  min-height: 42px;
}

.mileage-calendar__footer {
  margin-top: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.pill--archived {
  background: rgba(255, 184, 75, 0.14);
  color: #ffd988;
}

.pill--success {
  background: var(--success-soft);
  border: 1px solid rgba(15, 142, 109, 0.28);
  color: #9af0d2;
}

.pill--danger {
  background: rgba(255, 125, 146, 0.1);
  border: 1px solid rgba(255, 125, 146, 0.24);
  color: #ffc2cc;
}

.admin-hero-card {
  background: linear-gradient(135deg, rgba(255, 33, 65, 0.16), rgba(15, 142, 109, 0.1), var(--panel));
}

.admin-hero-card__meta {
  display: grid;
  gap: 8px;
  justify-items: end;
  text-align: right;
}

.admin-directory {
  overflow: visible;
}

.admin-directory .table-shell--scroll {
  height: auto;
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}

.admin-filter-field {
  min-width: min(300px, 100%);
}

.admin-user-table {
  min-width: 1080px;
}

.admin-user-table td {
  vertical-align: middle;
}

.admin-user-table td strong,
.table-cell-meta {
  display: block;
}

.table-cell-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 190px;
}

.admin-note-card {
  padding: 22px;
}

.empty-state--inline {
  border: 0;
  box-shadow: none;
  padding: 24px;
}

.pill.is-active {
  background: rgba(255, 33, 65, 0.16);
  border: 1px solid rgba(255, 33, 65, 0.28);
}

.stack {
  display: grid;
  gap: 12px;
}

.calculator {
  display: grid;
  gap: 12px;
}

.top-space {
  margin-top: 16px;
}

.calculator__display {
  text-align: right;
  font-size: 1.2rem;
  font-weight: 700;
}

.calculator__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.calculator__key {
  border-radius: 14px;
}

.actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-button {
  min-width: 38px;
  width: 38px;
  padding: 6px 0;
  display: inline-grid;
  place-items: center;
  font-size: 1rem;
  line-height: 1;
}

.help-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
}

.help-button__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.empty-state {
  padding: 28px;
  text-align: center;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.kv-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.kv-card dl {
  margin: 0;
  display: grid;
  gap: 10px;
}

.kv-card dt {
  color: var(--muted);
  font-size: 0.9rem;
}

.kv-card dd {
  margin: 4px 0 0;
  font-weight: 600;
}

.upload-box {
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.statement-dropzone {
  display: grid;
  gap: 6px;
  padding: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.statement-dropzone:hover,
.statement-dropzone.is-dragging {
  border-color: rgba(255, 45, 85, 0.6);
  background: linear-gradient(180deg, rgba(255, 45, 85, 0.08), rgba(255, 255, 255, 0.03));
  transform: translateY(-1px);
}

.statement-dropzone input {
  display: none;
}

.statement-dropzone__title {
  font-size: 1rem;
  font-weight: 700;
}

.statement-dropzone__copy {
  color: var(--muted);
  font-size: 0.92rem;
}

.file-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.autocomplete-list {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.autocomplete-item {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.autocomplete-item:hover {
  border-color: rgba(255, 45, 85, 0.45);
  background: rgba(255, 45, 85, 0.08);
}

.autocomplete-item__title {
  font-weight: 700;
}

.autocomplete-item__copy {
  color: var(--muted);
  font-size: 0.86rem;
}

.mono {
  font-family: Consolas, "Courier New", monospace;
}

.referee-source {
  min-height: 180px;
}

.editor-table input {
  min-width: 100px;
  padding: 10px 12px;
}

.table-note {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.receipt-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.button-link {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.empty-cell {
  text-align: center;
  color: var(--muted);
}

@media (max-width: 1200px) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .business-finance-summary .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topbar__actions {
    justify-content: flex-start;
  }

  .split-layout {
    grid-template-columns: 1fr;
  }

  .split-layout.has-collapsed-rail {
    grid-template-columns: 1fr;
  }

  .sticky {
    position: static;
  }

  .rail-shell.is-collapsed .rail-shell__body {
    display: block;
  }

  .rail-shell.is-collapsed .rail-shell__toggle {
    min-height: 0;
    writing-mode: initial;
    text-orientation: initial;
    transform: none;
    padding: 9px 14px;
  }

  .rail-shell__collapsed-note,
  .rail-shell.is-collapsed .rail-shell__collapsed-note {
    display: none;
  }
}

@media (max-width: 960px) {
  body.is-mobile-nav-open {
    overflow: hidden;
  }

  .app-shell {
    display: block;
    position: relative;
    height: 100dvh;
  }

  .app-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(4, 9, 16, 0.68);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 34;
  }

  .app-shell.is-mobile-viewport:not(.is-sidebar-collapsed)::before {
    opacity: 1;
    pointer-events: auto;
  }

  .app-shell.is-mobile-viewport:not(.is-sidebar-collapsed) .mobile-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0 0 0 min(86vw, 332px);
    z-index: 35;
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 332px);
    max-width: 332px;
    z-index: 40;
    overflow-y: auto;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    box-shadow: 0 28px 48px rgba(0, 0, 0, 0.42);
  }

  .app-shell.is-sidebar-collapsed .sidebar {
    max-height: none;
    min-height: 100vh;
    padding-top: 24px;
    padding-bottom: 24px;
    border-right: 1px solid transparent;
    opacity: 0;
    transform: translateX(-110%);
  }

  .grid--2,
  .grid--3,
  .grid--4,
  .details-grid,
  .stats,
  .stats--compact {
    grid-template-columns: 1fr;
  }

  .field-span-2,
  .field-span-3 {
    grid-column: span 1;
  }

  .business-revenue-card__header {
    flex-direction: column;
    align-items: stretch;
  }

  .line-item,
  .line-item--expense,
  .line-item--rates {
    grid-template-columns: 1fr;
  }

  .mileage-quick-picks__groups {
    grid-template-columns: 1fr;
  }

  .topbar {
    position: static;
    top: auto;
    z-index: auto;
    margin: 0 0 18px;
    padding: 0;
    background: none;
    backdrop-filter: none;
  }

  .topbar__leading,
  .topbar__actions {
    width: 100%;
  }

  .topbar__actions .button,
  .topbar__actions a.button,
  .topbar__actions .pill,
  .topbar__actions .field--inline {
    flex: 1 1 220px;
  }

  .hero-card__actions .button {
    flex: 1 1 220px;
  }

  .panel__section {
    padding: 22px 18px;
  }

  .summary-card {
    padding: 18px;
  }

  .main-panel {
    height: 100dvh;
    padding-bottom: 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .view {
    flex: none;
    min-height: auto;
    overflow: visible;
    padding-bottom: 26px;
  }

  .table-shell--responsive {
    overflow: visible;
  }

  .table-shell--responsive thead {
    display: none;
  }

  .table-shell--responsive table,
  .table-shell--responsive tbody,
  .table-shell--responsive tr,
  .table-shell--responsive td {
    display: block;
    width: 100%;
  }

  .table-shell--responsive tbody {
    display: grid;
    gap: 14px;
  }

  .table-shell--responsive tr {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.025);
  }

  .table-shell--responsive td {
    padding: 0;
    border-bottom: 0;
  }

  .table-shell--responsive td+td {
    margin-top: 12px;
  }

  .table-shell--responsive td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .table-shell--responsive .actions-row {
    gap: 8px;
  }

  .table-shell--responsive .empty-cell {
    text-align: left;
  }

  .table-shell--responsive .empty-cell::before {
    content: none;
  }

  .mileage-calendar__header,
  .mileage-calendar__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .mileage-log-table {
    min-width: 0;
  }

  .mileage-log-table thead {
    display: none;
  }

  .mileage-log-table,
  .mileage-log-table tbody,
  .mileage-log-table tr,
  .mileage-log-table td {
    display: block;
    width: 100%;
  }

  .mileage-log-table tbody {
    display: grid;
    gap: 14px;
  }

  .mileage-log-table tr {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.02);
  }

  .mileage-log-table td {
    padding: 0;
    border-bottom: 0;
  }

  .mileage-log-table td+td {
    margin-top: 12px;
  }

  .mileage-log-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .mileage-log-table .mileage-col--metric .table-note,
  .mileage-log-table .mileage-col--receipt .table-note,
  .mileage-log-table .receipt-meta {
    margin-top: 0;
  }

  .mileage-log-table .mileage-col--action {
    margin-top: 14px;
  }

  .mileage-log-table .mileage-col--action button {
    width: 100%;
  }

  .mileage-log-table .empty-cell {
    text-align: left;
    padding: 0;
  }

  .mileage-log-table .empty-cell::before {
    content: none;
  }

  .table-shell--scroll {
    margin: 0 -6px;
    padding: 0 6px 4px;
  }
}

@media (max-width: 720px) {
  .global-fab {
    right: 16px;
    bottom: 16px;
  }

  .global-fab__menu {
    min-width: 200px;
    max-width: min(240px, calc(100vw - 32px));
    padding: 12px;
  }

  .global-fab__trigger {
    width: 54px;
    min-width: 54px;
    height: 54px;
    font-size: 1.85rem;
  }

  .global-fab__save {
    min-width: 138px;
  }

  .topbar__actions [data-pwa-action],
  .topbar__actions [data-auth-action],
  .topbar__actions .pill,
  .topbar__actions [data-business-export],
  .topbar__actions [data-mileage-export],
  .topbar__actions [data-export-all],
  .topbar__actions [data-export-summary],
  .topbar__actions [data-export-business-expenses],
  .topbar__actions [data-export-mileage-log],
  .topbar__actions [data-export-tournament],
  .topbar__actions [data-export-tournament-csv],
  .topbar__actions a[href="#/card-import"],
  .topbar__actions a[href="#/import-export"],
  .topbar__actions a[href="#/annual-summary"],
  .topbar__actions a[href="#/reports"],
  .topbar__actions a[href="#/invoices"],
  .topbar__actions a[href="#/settings"],
  .topbar__actions a[href="#/archive"],
  .hero-card__actions a[href="#/card-import"],
  .hero-card__actions a[href="#/import-export"],
  .hero-card__actions a[href="#/annual-summary"],
  .hero-card__actions a[href="#/reports"],
  .hero-card__actions a[href="#/settings"],
  .view [data-export-all],
  .view [data-export-summary],
  .view [data-export-business-expenses],
  .view [data-export-mileage-log],
  .view [data-business-export],
  .view [data-export-tournament],
  .view [data-export-tournament-csv],
  .view [data-import-action],
  .view [data-card-import-action="clear"],
  .view [data-card-import-action="parse"],
  .view [data-card-import-action="import-approved"] {
    display: none !important;
  }

  .mileage-log-table tbody {
    gap: 12px;
  }

  .mileage-log-table tr {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 44px;
    gap: 10px 12px;
    align-items: start;
    padding: 14px;
  }

  .mileage-log-table td {
    width: auto;
  }

  .mileage-log-table td+td {
    margin-top: 0;
  }

  .mileage-log-table td::before {
    margin-bottom: 4px;
    font-size: 0.72rem;
    letter-spacing: 0.07em;
  }

  .mileage-log-table .selection-col {
    display: none;
  }

  .mileage-log-table .selection-col::before,
  .mileage-log-table .mileage-col--date-display::before,
  .mileage-log-table .mileage-col--route-display::before,
  .mileage-log-table .mileage-col--purpose-display::before,
  .mileage-log-table .mileage-col--action::before {
    display: none;
  }

  .mileage-log-table .row-selection {
    min-height: 24px;
    align-items: flex-start;
  }

  .mileage-log-table .mileage-col--date-display {
    grid-column: 1 / 3;
    grid-row: 1;
  }

  .mileage-log-table .mileage-col--date-display .mileage-row-button strong {
    font-size: 1.1rem;
  }

  .mileage-log-table .mileage-col--route-display {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .mileage-log-table .mileage-col--route-display strong {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-size: 1rem;
  }

  .mileage-log-table .mileage-col--purpose-display {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .mileage-log-table .mileage-col--purpose-display strong {
    font-size: 0.95rem;
    color: var(--muted);
    white-space: normal;
  }

  .mileage-log-table .mileage-col--linked-display,
  .mileage-log-table .mileage-col--receipt-display {
    display: none;
  }

  .mileage-log-table .mileage-col--metric-display,
  .mileage-log-table .mileage-col--money-display {
    grid-column: 2 / -1;
  }

  .mileage-log-table .mileage-col--linked-display,
  .mileage-log-table .mileage-col--metric-display,
  .mileage-log-table .mileage-col--money-display,
  .mileage-log-table .mileage-col--receipt-display,
  .mileage-log-table .mileage-col--action {
    padding-left: 0;
  }

  .mileage-log-table .mileage-col--linked-display strong,
  .mileage-log-table .mileage-col--metric-display strong,
  .mileage-log-table .mileage-col--money-display strong,
  .mileage-log-table .mileage-col--receipt-display strong {
    font-size: 0.95rem;
  }

  .mileage-log-table .mileage-col--linked-display::before {
    margin-bottom: 2px;
  }

  .mileage-log-table .mileage-col--metric-display,
  .mileage-log-table .mileage-col--money-display {
    display: inline-block;
    width: auto;
    min-width: 96px;
    margin-top: 2px;
  }

  .mileage-log-table .mileage-col--metric-display {
    grid-column: 1;
  }

  .mileage-log-table .mileage-col--money-display {
    grid-column: 2;
    justify-self: end;
    text-align: right;
  }

  .mileage-log-table .mileage-col--metric-display::before,
  .mileage-log-table .mileage-col--money-display::before {
    margin-bottom: 2px;
  }

  .mileage-log-table .mileage-col--action {
    grid-column: 3;
    grid-row: 1;
    margin-top: 0;
    justify-self: end;
    align-self: start;
    width: 44px;
  }

  .mileage-log-table .mileage-col--action .actions-row {
    justify-content: flex-end;
  }

  .mileage-log-table .mileage-col--action button {
    width: 38px;
    min-width: 38px;
  }

  .mileage-log-table .mileage-summary-text,
  .mileage-log-table .mileage-summary-metric,
  .mileage-log-table .mileage-route-display {
    min-height: 0;
  }

  .mileage-log-table .mileage-summary-text strong,
  .mileage-log-table .mileage-summary-metric strong {
    white-space: normal;
  }

  .business-expense-table tbody {
    display: grid;
    gap: 12px;
  }

  .business-expense-table tr.mileage-log-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 92px 44px;
    gap: 10px 12px;
    align-items: start;
    padding: 14px;
  }

  .business-expense-table tr.mileage-log-row td {
    width: auto;
    padding: 0;
    border-bottom: 0;
  }

  .business-expense-table tr.mileage-log-row td+td {
    margin-top: 0;
  }

  .business-expense-table .expense-col::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
  }

  .business-expense-table .expense-col--select {
    display: none;
  }

  .business-expense-table .expense-col--select::before,
  .business-expense-table .expense-col--date::before,
  .business-expense-table .expense-col--vendor::before,
  .business-expense-table .expense-col--amount::before,
  .business-expense-table .expense-col--action::before {
    display: none;
  }

  .business-expense-table .expense-col--date {
    grid-column: 1 / 3;
    grid-row: 1;
  }

  .business-expense-table .expense-col--date .mileage-row-button strong {
    font-size: 1.05rem;
  }

  .business-expense-table .expense-col--amount {
    grid-column: 3;
    grid-row: 1;
    text-align: right;
    justify-self: end;
    align-self: center;
    min-width: 92px;
  }

  .business-expense-table .expense-col--amount strong {
    font-size: 1rem;
  }

  .business-expense-table .expense-col--action {
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
  }

  .business-expense-table .expense-col--action .actions-row {
    justify-content: flex-end;
  }

  .business-expense-table .expense-col--action button {
    width: 38px;
    min-width: 38px;
  }

  .business-expense-table .expense-col--vendor {
    grid-column: 1 / 5;
    grid-row: 2;
  }

  .business-expense-table .expense-col--vendor strong {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-size: 1rem;
  }

  .business-expense-table .expense-col--category {
    grid-column: 1;
    grid-row: 3;
  }

  .business-expense-table .expense-col--category::before {
    margin-bottom: 2px;
  }

  .business-expense-table .expense-col--category strong {
    font-size: 0.92rem;
  }

  .business-expense-table .expense-col--summary,
  .business-expense-table .expense-col--receipt {
    display: none;
  }

  .business-expense-table .mileage-summary-text,
  .business-expense-table .mileage-summary-metric {
    min-height: 0;
  }

  .business-expense-table .mileage-summary-text strong,
  .business-expense-table .mileage-summary-metric strong {
    white-space: normal;
  }

  .main-panel {
    padding: 14px;
  }

  .topbar,
  .hero-card,
  .section-heading,
  .list-editor__header {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar__leading {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar__actions .button,
  .topbar__actions a.button,
  .topbar__actions .pill,
  .topbar__actions .field--inline,
  .hero-card__actions .button,
  .report-actions-bar .button,
  .actions-row .button {
    width: 100%;
    flex-basis: 100%;
  }

  .sidebar {
    width: min(92vw, 360px);
    max-width: 360px;
  }

  .hero-card,
  .summary-card {
    padding: 18px;
  }

  .summary-head {
    align-items: flex-start;
  }

  .line-item {
    grid-template-columns: 1fr;
  }

  .mileage-calendar__weekdays,
  .mileage-calendar__grid {
    gap: 6px;
  }

  .mileage-calendar__day {
    min-height: 38px;
    border-radius: 12px;
    padding: 0;
  }

  .table-shell--responsive {
    overflow: visible;
  }

  .table-shell--responsive thead {
    display: none;
  }

  .table-shell--responsive table,
  .table-shell--responsive tbody,
  .table-shell--responsive tr,
  .table-shell--responsive td {
    display: block;
    width: 100%;
  }

  .table-shell--responsive tbody {
    display: grid;
    gap: 14px;
  }

  .table-shell--responsive tr {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.025);
  }

  .table-shell--responsive td {
    padding: 0;
    border-bottom: 0;
  }

  .table-shell--responsive td+td {
    margin-top: 12px;
  }

  .table-shell--responsive td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .table-shell--responsive .actions-row {
    gap: 8px;
  }

  .table-shell--responsive .empty-cell {
    text-align: left;
  }

  .table-shell--responsive .empty-cell::before {
    content: none;
  }

  .card-import-table,
  .mileage-destinations-table,
  .mileage-routes-table,
  .business-register-table {
    min-width: 0;
    table-layout: auto;
  }

  .card-import-table td .table-note,
  .mileage-destinations-table td .table-note,
  .mileage-routes-table td .table-note {
    margin-top: 8px;
  }
}

.topbar__actions .help-button {
  flex: 0 0 44px;
  width: 44px;
}

@media (max-width: 640px) {
  .help-modal__sections {
    grid-template-columns: 1fr;
  }
}

.auth-layout {
  width: min(1080px, 100%);
  min-height: min(680px, calc(100vh - 150px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.85fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(13, 22, 34, 0.82);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.3);
}

.auth-visual {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 620px;
  padding: 52px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 33, 65, 0.94), rgba(120, 8, 35, 0.94) 56%, rgba(8, 17, 27, 0.96)),
    var(--brand);
}

.auth-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 25%, rgba(3, 8, 14, 0.42));
  pointer-events: none;
}

.auth-visual__content {
  position: relative;
  z-index: 1;
  max-width: 420px;
}

.auth-visual__content .eyebrow {
  color: rgba(255, 255, 255, 0.72);
  margin-top: 28px;
}

.auth-visual__content h3 {
  max-width: 380px;
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.auth-visual__content > p:not(.eyebrow) {
  max-width: 360px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.6;
}

.auth-brand-mark {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 22px;
  color: white;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.08em;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
}

.auth-brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.auth-visual__orb {
  position: absolute;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  pointer-events: none;
}

.auth-visual__orb--one {
  top: -130px;
  right: -110px;
  box-shadow: 0 0 0 46px rgba(255, 255, 255, 0.04), 0 0 0 92px rgba(255, 255, 255, 0.025);
}

.auth-visual__orb--two {
  right: 18%;
  bottom: -250px;
  width: 460px;
  height: 460px;
  border-color: rgba(255, 255, 255, 0.1);
}

.auth-feature-list {
  display: grid;
  gap: 12px;
  margin-top: 34px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.92rem;
}

.auth-feature-list span {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-feature-list i {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #6ff0c8;
  font-style: normal;
  font-weight: 900;
  background: rgba(3, 8, 14, 0.24);
}

.auth-card {
  align-self: center;
  width: min(100%, 500px);
  margin: 0 auto;
  padding: 46px 52px;
}

.auth-card__header h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.05em;
}

.auth-card__header > p:last-child {
  max-width: 410px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 30px 0 24px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.auth-tab {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.auth-tab:hover,
.auth-tab.is-active {
  color: var(--text);
  background: var(--brand-soft);
}

.auth-form {
  display: grid;
  gap: 17px;
}

.auth-field {
  gap: 7px;
}

.auth-field > span:first-child {
  color: #dce4f0;
  font-size: 0.88rem;
  font-weight: 700;
}

.auth-field input {
  min-height: 50px;
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.13);
}

.auth-field input[type="password"] {
  color: #ff4d68;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.auth-field input[type="password"]::placeholder {
  color: var(--muted);
  font-weight: 400;
  letter-spacing: normal;
}

.auth-field input:focus {
  outline: none;
  border-color: rgba(255, 33, 65, 0.7);
  box-shadow: 0 0 0 4px rgba(255, 33, 65, 0.12);
}

.auth-field__hint,
.auth-optional,
.auth-privacy {
  color: var(--muted);
  font-size: 0.78rem;
}

.auth-optional {
  margin-left: 4px;
  font-weight: 400;
}

.auth-password-field {
  position: relative;
}

.auth-password-field input {
  padding-right: 68px;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  min-height: 30px;
  padding: 4px 8px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
}

.auth-password-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.auth-form__utility {
  display: flex;
  justify-content: flex-end;
  margin-top: -5px;
}

.auth-link {
  padding: 0;
  border: 0;
  color: #ff91a4;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.auth-link:hover {
  color: white;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-link--back {
  justify-self: center;
  margin-top: 2px;
}

.auth-submit-button,
.auth-provider-button {
  width: 100%;
  min-height: 50px;
  justify-content: center;
  font-weight: 800;
}

.button--google {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #202124;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.button--google:hover {
  background: #f3f5f8;
}

.google-mark {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #4285f4;
  font-family: Arial, sans-serif;
  font-size: 1rem;
  font-weight: 900;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.auth-switch-copy {
  margin: 2px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.88rem;
}

.auth-privacy {
  margin: 28px 0 0;
  text-align: center;
  line-height: 1.45;
}

.auth-home-link {
  display: block;
  margin-top: 14px;
  color: #ff91a4;
  text-align: center;
  font-size: 0.84rem;
  font-weight: 700;
}

.auth-home-link:hover {
  color: white;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.notice-banner {
  padding: 12px 14px;
  border: 1px solid rgba(242, 184, 75, 0.3);
  border-radius: 12px;
  color: #ffe3a1;
  background: rgba(242, 184, 75, 0.1);
  line-height: 1.45;
}

.notice-banner--error {
  border-color: rgba(255, 125, 146, 0.3);
  color: #ffc2cc;
  background: rgba(255, 125, 146, 0.1);
}

.notice-banner--success {
  border-color: rgba(15, 142, 109, 0.35);
  color: #9af0d2;
  background: rgba(15, 142, 109, 0.12);
}

.auth-button__spinner {
  width: 16px;
  height: 16px;
  display: inline-block;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: auth-spin 700ms linear infinite;
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

@media (max-width: 900px) {
  .auth-layout {
    display: block;
    min-height: auto;
  }

  .auth-visual {
    display: none;
  }

  .auth-card {
    width: 100%;
    padding: 34px 26px;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 28px 18px;
  }

  .auth-card__header h2 {
    font-size: 2.2rem;
  }
}
