/* Zip Codex - Amazon Seller Central-inspired styling. Hand-written, no framework. */

:root {
  --text: #0f1111;
  --text-muted: #565959;
  --teal: #007185;
  --link-hover: #c7511f;
  --border: #d5d9d9;
  --border-strong: #888c8c;
  --header-bg: #f0f2f2;
  --page-bg: #eaeded;
  --shade-1: #f7f8f8;
  --shade-2: #eef1f1;
  --shade-3: #e4e8e8;
  --danger: #cc0c39;
  --success: #007600;
  --primary: #ffd814;
  --primary-border: #fcd200;
  --primary-hover: #f7ca00;
}

* {
  box-sizing: border-box;
}

/* Keep the hidden attribute authoritative over display: flex/grid rules. */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--page-bg);
}

/* -------------------------------------------------------------- auth chrome */

.auth-chrome {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  min-width: 0;
}

.auth-email {
  color: #d5d9d9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signout-link {
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.signout-link:hover {
  text-decoration: underline;
}

/* -------------------------------------------------------- signed-out card */

.signed-out-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.signed-out-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(15, 17, 17, 0.08);
  padding: 40px 48px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.signed-out-card h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.signed-out-card p {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.signed-out-card .btn {
  padding: 8px 28px;
  font-size: 14px;
}

/* ------------------------------------------------------------------ layout */

.topbar {
  background: #232f3e;
  color: #fff;
  padding: 11px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.topbar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Page-level actions (Create New Shipping Template) above the rail/content. */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Left rail + right pane. minmax(0, 1fr) keeps wide tables and ZIP grids from
   pushing the page into a sideways scroll. */
.layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.content,
.template-view,
.tool-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* ------------------------------------------------------------------- rail */

.rail {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 0 10px;
  min-width: 0;
}

.rail-heading {
  margin: 0;
  padding: 10px 14px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

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

/* Seller Central's rail row: full-width target, grey fill + pointer when it is
   the row being shown. */
.rail-item {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  border-radius: 0;
  padding: 8px 14px 8px 11px;
  font: inherit;
  font-size: 13px;
  line-height: 1.3;
  color: var(--text);
  cursor: pointer;
}

/* The label ellipsizes, not the button - the button must not clip its pointer. */
.rail-item-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-item:hover {
  background: var(--shade-1);
}

.rail-item:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: -2px;
}

.rail-item--current {
  background: var(--shade-2);
  border-left-color: var(--teal);
  font-weight: 700;
}

/* The small pointer into the right pane. */
.rail-item--current::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 50%;
  width: 0;
  height: 0;
  transform: translateY(-50%);
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 7px solid var(--teal);
}

.rail-empty {
  padding: 6px 14px 8px;
  color: var(--text-muted);
  font-size: 12px;
}

/* ---------------------------------------------------- template pane header */

.template-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.template-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
}

.template-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rename-slot:empty {
  display: none;
}

.empty-state h2 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
}

.empty-state p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  padding: 10px 16px;
}

.panel-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.panel-body {
  padding: 14px 16px;
}

/* ------------------------------------------------------------ links, buttons */

.teal-link {
  color: var(--teal);
  text-decoration: none;
  font-size: 13px;
}

.teal-link:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
  padding: 7px 14px;
  cursor: pointer;
}

.btn:hover {
  background: #f7fafa;
}

.btn:active {
  background: #edfdff;
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-small {
  padding: 4px 10px;
  font-size: 12px;
}

/* -------------------------------------------------------------- zip lookup */

.lookup-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#lookup-zip-input {
  width: 120px;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 14px;
  letter-spacing: 0.06em;
}

#lookup-product-input {
  min-width: 220px;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 13px;
}

.lookup-result {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}

.lookup-result:empty {
  display: none;
}

.lookup-message {
  margin: 0;
}

.lookup-error {
  margin: 0;
}

.lookup-table-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
}

.lookup-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}

.lookup-table th,
.lookup-table td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.lookup-table td:last-child,
.lookup-table th:last-child {
  white-space: normal;
  overflow-wrap: anywhere;
}

.lookup-table th {
  background: var(--header-bg);
  font-weight: 700;
}

.lookup-table tbody tr:last-child td {
  border-bottom: none;
}

/* Badge + code chip on one line (lookup panel and Test a ZIP). */
.badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.code-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  background: var(--header-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

.inline-error {
  color: var(--danger);
  font-size: 13px;
}

/* ---------------------------------------------------- products chip editor */

.products-editor {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
}

.products-label {
  font-weight: 700;
  font-size: 13px;
}

.product-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.products-empty {
  color: var(--text-muted);
  font-size: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--header-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 6px 3px 12px;
  font-size: 12px;
  max-width: 260px;
}

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

.chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  padding: 0 4px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.chip-remove:hover {
  color: var(--danger);
}

.product-add-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-add-form input {
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 13px;
  min-width: 180px;
}

.name-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.name-form input {
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 13px;
  min-width: 220px;
}

/* ----------------------------------------------------------------- banners */

.banner-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.banner-area:empty {
  display: none;
}

.banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--danger);
  border-left-width: 5px;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
}

.banner--info {
  border-color: var(--teal);
}

.banner-dismiss {
  background: none;
  border: none;
  font-size: 16px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 2px;
}

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

/* ------------------------------------------------------------ controls row */

/* The editor's two bulk actions, side by side and identical in weight: one
   selects every region for the group being edited, the other clears them. */
.controls-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 2px 0 14px;
}

/* ------------------------------------------------------------- region tree */

.region-block {
  display: flex;
  gap: 20px;
  padding: 16px 0;
  border-top: 1px dotted var(--border);
}

.region-head {
  flex: 0 0 170px;
  min-width: 0;
}

.region-content {
  flex: 1 1 auto;
  min-width: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 18px;
  align-items: start;
}

.entry {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.entry-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  cursor: pointer;
  font-size: 13px;
}

.entry-label input {
  margin: 0;
}

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

.entry-name {
  font-weight: 700;
}

/* Group-edit mode: node/ZIP fully claimed by another group (grey, like
   Amazon's locked states). */
.claimed {
  color: var(--text-muted);
  cursor: default;
}

.claimed input[type="checkbox"] {
  accent-color: var(--border-strong);
  opacity: 0.55;
}

input[type="checkbox"] {
  accent-color: var(--teal);
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.chevron {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 3px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 4px;
}

.chevron:hover {
  background: var(--header-bg);
  color: var(--text);
}

.chevron svg {
  width: 11px;
  height: 11px;
  transition: transform 0.15s ease;
}

.chevron[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* Expansion sub-panels: state -> subregions -> zones -> ZIPs, darker each level. */

.expansion {
  grid-column: 1 / -1;
  border-radius: 6px;
  padding: 12px 14px;
}

.level-1 {
  background: var(--shade-1);
}

.level-2 {
  background: var(--shade-2);
}

.level-3 {
  background: var(--shade-3);
}

.zip-grid .entry-label {
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------- inline per-group ZIP editor */

/* The editor expands INSIDE the groups list, directly under the row it belongs
   to, and reads as one piece with it: the row loses its bottom corners and the
   editor picks up the same teal edge. -12px cancels the list's row gap so there
   is no seam between the two. */
.zip-editor {
  margin-top: -12px;
  border: 1px solid var(--teal);
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: #f9fdfe;
  padding: 12px 14px 14px;
  min-width: 0;
}

.zip-editor:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: -4px;
}

.zip-editor-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  max-width: 68ch;
}

/* The ZIPs save on every tick, the fields only on Save - stated plainly, so
   Cancel is never read as having reverted ZIP work. */
.zip-editor-note {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  max-width: 68ch;
}

.zip-editor-note strong {
  color: var(--text);
}

/* The tree is long, so the row's Save is repeated at its foot - the row itself
   is far above by then. */
.zip-editor-foot {
  display: flex;
  justify-content: flex-end;
  border-top: 1px dotted var(--border);
  padding-top: 12px;
}

/* ---------------------------------------------------------- pricing groups */

.money-field {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-muted);
}

.money-field .currency {
  color: var(--text);
}

.money-input {
  width: 84px;
  padding: 6px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 13px;
}

.window-field {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-muted);
}

.window-sep {
  color: var(--text);
}

.day-input {
  width: 54px;
  padding: 6px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
}

.groups-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.group-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.group-form input[type="text"] {
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 13px;
  min-width: 220px;
}

.groups-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.group-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* The row whose ZIP editor is expanded below it: the two read as one block. */
.group-row--editing {
  border-color: var(--teal);
  border-bottom-color: #d3ecf0;
  border-radius: 8px 8px 0 0;
  background: #f4fbfc;
}

.group-name {
  flex: 1 1 200px;
  max-width: 300px;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 13px;
}

/* Read-only row: the same three values the inputs hold, as text. The name
   keeps the input's track so a row barely moves when it opens for editing. */
.group-name-text {
  flex: 1 1 200px;
  max-width: 300px;
  padding: 6px 0;
  font-size: 13px;
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
}

.group-fact {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.group-fact-value {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.zip-count {
  background: var(--header-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: auto;
}

.group-delete {
  color: var(--danger);
  border-color: var(--border);
}

.empty-note {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
}

/* -------------------------------------------------------------- test a zip */

.test-zip-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

#test-zip-input {
  width: 120px;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 14px;
  letter-spacing: 0.06em;
}

.test-zip-result {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.test-zip-result:empty {
  display: none;
}

.badge {
  align-self: flex-start;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-yes {
  background: #ecf7ec;
  color: var(--success);
  border: 1px solid #b8dfb8;
}

.badge-no {
  background: #fdeff1;
  color: var(--danger);
  border: 1px solid #f2c5cd;
}

.result-row {
  display: flex;
  gap: 8px;
}

.result-label {
  color: var(--text-muted);
  min-width: 90px;
}

.result-value {
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------- cart quote (checkout API) */

.subhead {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
}

.hint {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.hint strong {
  color: var(--text);
}

.cart-builder {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dotted var(--border);
}

.cart-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cart-line-id {
  color: var(--text-muted);
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  min-width: 56px;
}

.cart-product {
  flex: 1 1 220px;
  max-width: 320px;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 13px;
}

.cart-qty {
  width: 72px;
  padding: 6px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
}

.cart-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.quote-result {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}

.quote-result:empty {
  display: none;
}

.quote-heading {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

/* Two independent subtotals: shipping is authoritative for shipping alone and
   deposits are their own money - they are never displayed as one number. */
.quote-totals {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--shade-1);
}

.quote-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.quote-total-label {
  color: var(--text-muted);
}

.quote-total-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.quote-total-note {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.quote-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quote-meta .result-label {
  min-width: 120px;
}

.revalidation {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px dotted var(--border);
  padding-top: 12px;
}

.revalidation-message {
  color: var(--text-muted);
}

/* Operational failure (429/5xx): "could not be verified", never a rejection. */
.inline-warning {
  margin: 0;
  color: #8a6116;
  background: #fdf6e3;
  border: 1px solid #f0dca4;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
}

/* ------------------------------------------------------------ template tabs */

.template-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  border-bottom: 1px solid var(--border);
}

.tab {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  padding: 10px 18px;
  margin-bottom: -1px;
  cursor: pointer;
}

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

.tab:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: -2px;
}

/* The selected tab reads as the front sheet: white, joined to its panel. */
.tab--active,
.tab--active:hover {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
  box-shadow: inset 0 3px 0 var(--teal);
}

.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* -------------------------------------------------------- container deposits */

.deposits-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 18px;
  align-items: center;
}

.deposit-field {
  gap: 6px;
}

/* Fixed name column: wide enough for "Massachusetts", so every $ input lines
   up without drifting away from the state it belongs to. */
.deposit-field > span:first-child {
  flex: 0 0 auto;
  min-width: 124px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deposits-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 900px) {
  /* One column: the rail becomes a horizontal strip above the content. It
     scrolls inside itself, so the page body never scrolls sideways. */
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    overflow-x: auto;
  }

  .rail-section {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
  }

  .rail-heading {
    padding: 0;
    white-space: nowrap;
  }

  .rail-list {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .rail-item {
    width: auto;
    max-width: 180px;
    border-left: none;
    border-bottom: 3px solid transparent;
    border-radius: 6px 6px 0 0;
    padding: 6px 10px;
  }

  .rail-item--current {
    border-left-color: transparent;
    border-bottom-color: var(--teal);
  }

  .rail-item--current::after {
    display: none;
  }

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

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

  .region-block {
    flex-direction: column;
    gap: 10px;
  }

  .region-head {
    flex-basis: auto;
  }

  .page {
    padding: 12px 12px 40px;
  }
}
