@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/rotvi/instrument-sans.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

.portal-document {
  background: #f4f6f8;
  color-scheme: light;
  scroll-padding-top: 4.5rem;
}

body.portal {
  --blue: #18624e;
  --blue-deep: #114c3c;
  --ink: #172435;
  --text: #344457;
  --muted: #526174;
  --field: #f4f6f8;
  --line: #dde4ea;
  --tint: #e9f3ee;
  --badge-ring: #fff;
  --portal-rail: 13.75rem;
  --portal-navy: #142232;
  --portal-surface: #fff;
  --portal-gutter: clamp(1rem, 2.45vw, 2.5rem);
  --portal-gap: 1rem;
  --portal-radius: .625rem;
  --portal-chart-done: #288167;
  --portal-chart-open: #acc3d6;
  margin: 0;
  min-height: 100vh;
  background: var(--field);
  color: var(--ink);
  font: 400 .875rem/1.5 "Instrument Sans", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.portal *, .portal *::before, .portal *::after { box-sizing: border-box; }
.portal button, .portal input, .portal select { font-family: inherit; }
.portal a { color: inherit; }
.portal :focus-visible { outline: 2px solid #26826a; outline-offset: 3px; }
.portal [hidden] { display: none !important; }

.portal-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--portal-rail) minmax(0, 1fr);
}

.portal-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: auto;
  padding: 0 .875rem 1rem;
  background: var(--portal-navy);
  color: #dce5ee;
}

.portal-brand {
  display: inline-flex;
  width: fit-content;
  min-height: 3.75rem;
  align-items: center;
  padding-inline: .6rem;
  text-decoration: none;
}

.portal-brand img { display: block; width: 7.55rem; height: auto; }
.portal-sidebar .portal-brand { margin-bottom: .75rem; }
.portal-navigation { display: grid; gap: 1.3rem; }
.portal-nav-group { display: grid; gap: .2rem; }
.portal-nav-group p {
  margin: 0 0 .3rem;
  padding-inline: .7rem;
  color: #9db0c3;
  font-size: .6875rem;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.portal-link {
  display: flex;
  min-height: 2.5rem;
  align-items: center;
  gap: .65rem;
  padding: .45rem .7rem;
  border-radius: .375rem;
  font-weight: 530;
  text-decoration: none;
}

.portal-link:hover { background: #203246; }
.portal-link[aria-current="page"] { background: #263c50; color: #fff; font-weight: 650; }
.portal-link .portal-icon { color: #b2c2d2; }
.portal-link[aria-current="page"] .portal-icon { color: #80dab7; }
.portal-icon { width: 1.0625rem; height: 1.0625rem; flex: none; }
.portal-sidebar :focus-visible, .portal-menu .portal-navigation :focus-visible { outline-color: #80dab7; }

.portal-workspace, .portal-content { min-width: 0; }
.portal-content {
  width: min(100%, 99rem);
  margin-inline: auto;
  padding: 1.5rem var(--portal-gutter) 2.5rem;
}
.portal-content:focus { outline: none; }

.portal-visually-hidden, .portal-skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.portal-skip:focus {
  position: fixed;
  z-index: 3000;
  top: .65rem;
  left: .65rem;
  padding: .65rem .95rem;
  border-radius: .375rem;
  background: var(--portal-surface);
  color: var(--blue);
  font-weight: 650;
}

.portal-top {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 3.75rem;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-inline: var(--portal-gutter);
  border-bottom: 1px solid var(--line);
  background: var(--portal-surface);
}

.portal-breadcrumb, .portal-account {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: .55rem;
}

.portal-breadcrumb { color: var(--muted); font-size: .8125rem; }
.portal-breadcrumb a { text-decoration: none; }
.portal-breadcrumb a:hover { text-decoration: underline; }
.portal-breadcrumb [aria-current] { color: var(--ink); font-weight: 640; }
.portal-breadcrumb .portal-icon, .portal-account > .portal-icon { width: .875rem; height: .875rem; color: var(--muted); }

.portal-account {
  max-width: 45%;
  padding: .25rem .45rem .25rem .25rem;
  border-radius: .375rem;
  color: var(--ink);
  font-size: .8125rem;
  font-weight: 620;
  text-decoration: none;
}

.portal-account:hover, .portal-account[aria-current] { background: var(--field); }
.portal-account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.portal-account-avatar, .portal-profile-avatar, .portal-initial {
  display: grid;
  flex: none;
  place-items: center;
  border-radius: .375rem;
  background: var(--tint);
  color: var(--blue);
  font-weight: 680;
}
.portal-account-avatar, .portal-initial { width: 1.9375rem; height: 1.9375rem; }
.portal-mobile, .portal-dock { display: none; }

.portal-heading {
  display: flex;
  min-height: 2.5rem;
  align-items: center;
  justify-content: space-between;
  gap: .65rem 1rem;
  margin-bottom: 1.25rem;
}

.portal-heading h1, .portal .hero-title {
  color: var(--ink);
  font-size: clamp(1.5rem, 2.35vw, 1.875rem);
  font-weight: 670;
  line-height: 1.15;
  letter-spacing: -.035em;
}
.portal-heading h1 { margin: 0; }
.portal-heading-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.portal-heading-actions:empty { display: none; }
.portal-count { color: var(--muted); font-size: .8125rem; white-space: nowrap; }

.portal-button,
.portal .btn-add, .portal .btn-export, .portal .btn-primary {
  display: inline-flex;
  min-height: 2.25rem;
  height: auto;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .4rem .7rem;
  border: 1px solid #d6dfe6;
  border-radius: .375rem;
  background: var(--portal-surface);
  box-shadow: none;
  color: var(--ink);
  cursor: pointer;
  font-size: .8125rem;
  font-weight: 640;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
}
.portal-button:hover, .portal .btn-export:hover { background: var(--field); }
.portal-button.primary, .portal .btn-add, .portal .btn-primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
.portal-button.primary:hover, .portal .btn-add:hover, .portal .btn-primary:hover { background: var(--blue-deep); }
.portal-button.danger { border-color: transparent; background: transparent; color: #9f3345; }
.portal-button.danger:hover { background: #fceff1; }
.portal-button .portal-icon, .portal .btn-add svg, .portal .btn-export svg { width: 1rem; height: 1rem; }
.portal-dropdown { position: relative; }
.portal-dropdown summary, .portal-menu summary { list-style: none; }
.portal-dropdown summary::-webkit-details-marker, .portal-menu summary::-webkit-details-marker { display: none; }
.portal-dropdown-list {
  position: absolute;
  z-index: 10;
  top: calc(100% + .4rem);
  right: 0;
  display: grid;
  min-width: 9.5rem;
  padding: .25rem;
  border: 1px solid var(--line);
  border-radius: .45rem;
  background: var(--portal-surface);
  box-shadow: 0 4px 14px #17243516;
}
.portal-dropdown:not([open]) .portal-dropdown-list { display: none; }
.portal-dropdown-list button {
  padding: .5rem .6rem;
  border: 0;
  border-radius: .25rem;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: .8125rem;
  text-align: left;
}
.portal-dropdown-list button:hover { background: var(--field); }

.portal-dashboard, .portal-stack, .portal .app {
  display: grid;
  min-width: 0;
  gap: var(--portal-gap);
}
.portal .app { max-width: none; min-height: 0; padding: 0; }
.portal .app > .hero, .portal .app > .sheet {
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
}
.portal .app > .hero::before { display: none; }
.portal .app > .hero {
  grid-template: "back title pill" / auto minmax(0, 1fr) auto;
  gap: .7rem;
  overflow: visible;
  padding-bottom: .25rem;
}
.portal .hero-title { flex-flow: row wrap; gap: .1rem .4rem; }
.portal .hero-title .hero-lbl, .portal .hero-title .hero-num { color: inherit; font: inherit; letter-spacing: inherit; }
.portal .app > .hero .status-pill { border-radius: .375rem; }
.portal .app > .hero .status-pill.pending { background: #e9f1fa; color: #2c597e; }
.portal .back-btn {
  width: 2.25rem;
  height: 2.25rem;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: .375rem;
  background: var(--portal-surface);
  color: var(--blue);
}
.portal .back-btn:focus-visible { outline-color: var(--blue); }

.portal .card, .portal .block, .portal .chart-card, .portal-panel, .portal .summary .sum-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--portal-radius);
  background: var(--portal-surface);
  box-shadow: none;
}
.portal-panel-head {
  display: flex;
  min-height: 3.5rem;
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
  padding: .75rem 1rem;
}
.portal-panel-head > * { min-width: 0; }
.portal-panel-head h2, .portal .block-head h2, .portal .chart-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: .9375rem;
  font-weight: 680;
  letter-spacing: -.01em;
}
.portal-panel-head p, .portal-panel-head small, .portal .chart-sub {
  display: block;
  margin: .15rem 0 0;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 500;
}
.portal-panel-body { min-width: 0; padding: 0 1rem 1rem; }
.portal-panel-head .see-all {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .3rem 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font: 640 .8125rem/1.25 "Instrument Sans", "Segoe UI", sans-serif;
  text-align: right;
  text-decoration: none;
}
.portal-panel-head .see-all:hover { text-decoration: underline; }

.portal-kpis, .portal .summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--portal-gap);
  margin: 0;
}
.portal-kpis.dual { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.portal-kpi, .portal .summary .sum-item { padding: .85rem 1rem; }
.portal-kpi-label, .portal .summary .lbl { color: var(--text); font-size: .8125rem; font-weight: 600; text-transform: none; letter-spacing: 0; }
.portal-kpi-icon {
  display: grid;
  width: 1.9rem;
  height: 1.9rem;
  float: right;
  place-items: center;
  margin-left: .3rem;
  border-radius: .375rem;
  background: var(--tint);
  color: var(--blue);
}
.portal-kpi-value, .portal .summary .num {
  display: block;
  margin: .18rem 0 .12rem;
  font-size: 1.875rem;
  font-weight: 680;
  line-height: 1.12;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}
.portal-kpi-note { color: var(--muted); font-size: .75rem; }
.portal-kpi-note a { color: var(--blue); font-weight: 650; text-underline-offset: .13em; }
.portal-kpi .trend { margin-right: .2rem; border-radius: .25rem; padding: .18rem .3rem; font-weight: 650; }
.portal-kpi .trend.up { background: #e7f4ed; color: #1a654e; }
.portal-kpi .trend.down { background: #fbecef; color: #932e40; }

.portal-chart-grid, .portal-dashboard-pair, .portal-dashboard-trio {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--portal-gap);
}
.portal-chart-grid { grid-template-columns: minmax(0, 2.1fr) minmax(15.5rem, 1fr); }
.portal-dashboard-trio { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.portal-volume { height: 11.375rem; }
.portal-volume svg { display: block; width: 100%; height: 100%; }
.portal-volume .plot-axis { fill: var(--muted); font-size: 11px; }
.portal-volume .plot-grid { stroke: var(--line); stroke-dasharray: 3 4; }
.portal-volume .plot-completed { fill: var(--portal-chart-done); }
.portal-volume .plot-pending { fill: var(--portal-chart-open); }
.portal .chart-legend .sw.completed { background: var(--portal-chart-done); }
.portal .chart-legend .sw.pending { background: var(--portal-chart-open); }
.portal .chart-legend { margin-top: .55rem; }
.portal-distribution .donut-wrap {
  display: flex;
  min-height: 12.25rem;
  flex-wrap: nowrap;
  justify-content: center;
  gap: .85rem;
}
.portal-distribution .donut-svg { width: clamp(5.5rem, 8.4vw, 8rem); height: auto; }
.portal-distribution .donut-legend { min-width: 0; }
.portal-distribution .donut-legend .lg-v { font-variant-numeric: tabular-nums; }

.portal-table-scroll { max-width: 100%; overflow-x: auto; }
.portal-table-scroll:focus-visible { outline-offset: -2px; }
.portal-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
  font-size: .8125rem;
  text-align: left;
}
.portal-table th, .portal-table td { padding: .7rem .85rem; border-top: 1px solid var(--line); }
.portal-table th {
  background: #f8fafb;
  color: var(--muted);
  font-weight: 620;
  white-space: nowrap;
}
.portal-table td { vertical-align: middle; }
.portal-table tbody tr:hover { background: #fafcfd; }
.portal-table .portal-num { text-align: right; font-variant-numeric: tabular-nums; }
.portal-table .portal-nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; }
.portal-table .portal-record { color: var(--blue); font-weight: 680; text-decoration: none; }
.portal-table .portal-record:hover { text-decoration: underline; }
.portal-table .portal-cell-primary { display: block; color: var(--ink); font-weight: 620; }
.portal-mobile-unit { display: none; }
.portal-cell-note { display: block; margin-top: .08rem; color: var(--muted); font-size: .75rem; }
.portal-cell-identity { display: flex; align-items: center; gap: .55rem; }
.portal-state {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .18rem .45rem;
  border-radius: .3rem;
  background: #eef2f6;
  color: #45556a;
  font-size: .75rem;
  font-weight: 620;
  white-space: nowrap;
}
.portal-state::before { width: .375rem; height: .375rem; border-radius: 50%; background: currentColor; content: ""; }
.portal-state.completed { background: #e8f4ee; color: #17624c; }
.portal-state.pending { background: #e9f1fa; color: #2c597e; }
.portal-state.queued { background: #f9f1df; color: #75551d; }
.portal-state.cancelled { background: #faeef0; color: #8e3e4e; }
.portal-status-controls { display: grid; justify-items: start; gap: .1rem; }
.portal-status-trigger {
  min-height: 2rem;
  border: 0;
  border-radius: .25rem;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: .75rem;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}
.portal-status-trigger:hover { text-decoration: underline; }
.portal-proof-status-action { grid-column: 1 / -1; justify-self: start; }
.portal-status-feedback { margin: 0; }
.portal-status-feedback:not(:empty) {
  margin-bottom: .75rem;
  padding: .55rem .75rem;
  border-radius: .375rem;
  background: #e8f4ee;
  color: #17624c;
  font-size: .8125rem;
}
.portal-panel > .portal-status-feedback:not(:empty) { margin-inline: .85rem; }
.portal-status-editor {
  width: min(26rem, calc(100% - 2rem));
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--portal-radius);
  background: var(--portal-surface);
  color: var(--ink);
  box-shadow: 0 18px 48px #14223242;
}
.portal-status-editor::backdrop { background: #1422328c; }
.portal-status-editor fieldset { min-width: 0; margin: 0; padding: 1rem; border: 0; }
.portal-status-editor h2 { margin: 0; font-size: 1.1rem; font-weight: 680; }
.portal-status-editor header p { margin: .3rem 0 .85rem; color: var(--muted); overflow-wrap: anywhere; }
.portal-status-editor label { display: block; margin-bottom: .3rem; font-weight: 650; }
.portal-status-editor select {
  width: 100%;
  min-height: 2.75rem;
  padding: .4rem .6rem;
  border: 1px solid var(--line);
  border-radius: .375rem;
  background: var(--portal-surface);
  color: var(--ink);
  font: inherit;
}
.portal-status-error { margin: 0; color: #923044; }
.portal-status-error:not(:empty) { margin-top: .5rem; }
.portal-status-footer { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .9rem; }
.portal-status-footer .portal-button { min-height: 2.5rem; }

.portal .empty-mini, .portal-table-empty { display: block; margin: 0; padding: 1.4rem 1rem; color: var(--muted); font-size: .8125rem; text-align: center; }
.portal-table-empty { justify-content: center; }
.portal .rank-item { padding-block: .6rem; }
.portal .rank-pos { background: var(--field); color: var(--muted); }
.portal .rank-avatar, .portal .row-ic { border-radius: .375rem; }
.portal .feed-item::before { background-color: var(--portal-surface); }

.portal .toolbar, .portal .filter-bar { gap: .625rem; }
.portal .search-box, .portal .search-wrap, .portal .select-wrap { min-width: 0; }
.portal .search-box input, .portal .search-wrap input, .portal .driver-select, .portal .driver-pill {
  min-width: 0;
  height: 2.375rem;
  border: 1px solid #d6dfe6;
  border-radius: .375rem;
  background-color: var(--portal-surface);
  color: var(--ink);
  font-size: .8125rem;
  font-weight: 500;
}
.portal .search-box input:focus, .portal .search-wrap input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px #18624e20;
}
.portal .search-box input::placeholder, .portal .search-wrap input::placeholder { font-weight: 450; }
.portal .filter-pill, .portal .chip {
  min-height: 2rem;
  border-radius: .375rem;
  font-size: .8125rem;
  font-weight: 610;
}
.portal .filter-pill.active, .portal .chip.active {
  border-color: #c6ded1;
  background: var(--tint);
  color: var(--blue);
}
.portal .filter-pill.active .cnt, .portal .chip.active > span { background: #d6eae0; color: var(--blue); }
.portal .portal-table-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
  padding: .75rem .85rem;
}
.portal .portal-table-filters .filter-bar {
  flex: 1 1 100%;
  flex-flow: row wrap;
  align-items: center;
  margin: 0;
}
.portal .portal-table-filters .search-wrap { flex: 1 1 17rem; }
.portal .portal-table-filters .search-wrap input { width: 100%; }
.portal .portal-table-filters .filter-row { flex-wrap: wrap; gap: .4rem; }
.portal .portal-table-filters .driver-pill { max-width: 100%; }
.portal .portal-table-filters .search-box { flex: 1 1 16rem; max-width: 26rem; }
.portal .portal-table-filters > .toolbar,
.portal .portal-table-filters > .filters,
.portal .portal-table-filters > .driver-select { margin: 0; }
.portal .portal-table-filters > .toolbar { flex: 1 1 22rem; min-width: 0; }
.portal .portal-table-filters > .filters { flex-wrap: wrap; padding: 0; }
.portal-proofs .portal-table-filters > .driver-select { flex: 0 1 13rem; }
.portal-proofs .portal-table-filters > .filters { flex-basis: 100%; }
.portal-proofs .charts-grid, .portal-proofs .proof-ranking { gap: var(--portal-gap); margin: 0; }

.portal .drivers-grid, .portal .proofs-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.portal .portal-results { overflow: hidden; }
.portal .portal-results .driver-card, .portal .portal-results .proof-card {
  min-width: 0;
  align-items: center;
  gap: .85rem;
  padding: .75rem 1rem;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: var(--portal-surface);
  box-shadow: none;
}
.portal .portal-results .driver-card {
  display: grid;
  grid-template-columns: minmax(9rem, 1.1fr) minmax(12rem, .85fr) auto;
}
.portal .driver-stats { min-width: 0; padding: .32rem; border-radius: .375rem; background: var(--field); }
.portal .driver-avatar { width: 2.25rem; height: 2.25rem; border: 0; border-radius: .375rem; box-shadow: none; }
.portal .driver-actions { justify-content: flex-end; }
.portal .portal-results .proof-card { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); }
.portal .portal-results .proof-thumb { width: 100%; height: 4.375rem; border-radius: .375rem; }
.portal .portal-results .proof-thumb img { object-fit: cover; }
.portal .portal-results .proof-thumb .ph-status {
  top: .25rem;
  left: .25rem;
  padding: .15rem .3rem;
  border-radius: .25rem;
  font-size: .625rem;
}
.portal .portal-results .proof-thumb .ph-empty { padding-top: 1rem; }
.portal .portal-results .proof-thumb .ph-empty svg { width: 1.25rem; height: 1.25rem; }
.portal .portal-results .proof-thumb .ph-zoom { display: none; }
.portal .portal-results .proof-body { min-width: 0; padding: 0; }
.portal .portal-results .proof-meta { padding-top: 0; border-top: 0; }
.portal .portal-results .empty-drivers, .portal .portal-results .empty-proofs { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.portal .btn-mini {
  flex: none;
  padding: .38rem .6rem;
  border-color: var(--line);
  border-radius: .375rem;
  font-weight: 640;
}
.portal .btn-mini.danger { border-color: transparent; background: transparent; color: #9f3345; }
.portal .btn-mini.danger:hover { background: #fceff1; }
.portal .modal, .portal .chat-panel { border-radius: var(--portal-radius); }
.portal .chat-head { background: var(--portal-navy); }
.portal-notification-dot { width: .4rem; height: .4rem; border-radius: 50%; background: #b14557; }

.overview-modal {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: #1422328c;
  backdrop-filter: blur(4px);
  animation: portal-fade-in .2s ease;
}
.overview-modal.show { display: flex; }
.overview-modal .modal {
  display: flex;
  width: min(100%, 38.75rem);
  max-height: calc(100dvh - 2rem);
  flex-direction: column;
  overflow: hidden;
  background: var(--portal-surface);
  box-shadow: 0 24px 60px #14223245;
  animation: portal-slide-in .25s ease;
}
.overview-modal .modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--line);
}
.overview-modal .modal-head h2 { margin: 0; font-size: 1.125rem; font-weight: 680; }
.overview-modal .modal-close {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: .375rem;
  background: var(--field);
  color: var(--ink);
  cursor: pointer;
}
.overview-modal .modal-close svg { width: 1.125rem; height: 1.125rem; }
.overview-modal .modal-body { overflow-y: auto; padding: .875rem 1rem 1rem; }

@keyframes portal-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes portal-slide-in { from { opacity: 0; transform: translateY(.875rem); } to { opacity: 1; transform: none; } }

.portal .route-dot.dest { background: var(--blue); }
.portal .block { margin-bottom: 1rem; padding: 1rem; }
.portal .block .status-pill { border-radius: .375rem; }

.portal-empty, .portal-profile-grid .portal-panel { padding: 1rem; }
.portal-empty-icon {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  margin-bottom: .7rem;
  border-radius: .375rem;
  background: var(--tint);
  color: var(--blue);
}
.portal-empty h2, .portal-profile-grid h2 { margin: 0; font-size: 1rem; font-weight: 670; }
.portal-empty p, .portal-profile-summary p { margin: .2rem 0 0; color: var(--muted); }
.portal-profile-grid { display: grid; grid-template-columns: minmax(0, .65fr) minmax(0, 1fr); align-items: start; gap: var(--portal-gap); }
.portal-profile-avatar { width: 2.75rem; height: 2.75rem; margin-bottom: .65rem; font-size: 1.1rem; }
.portal-profile-summary h2 { overflow-wrap: anywhere; }
.portal-profile-details dl { margin: .6rem 0 1rem; }
.portal-profile-details dl > div {
  display: grid;
  grid-template-columns: minmax(6.5rem, .45fr) minmax(0, 1fr);
  gap: .25rem .65rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--line);
}
.portal-profile-details dt { color: var(--muted); }
.portal-profile-details dd { margin: 0; overflow-wrap: anywhere; }
.portal-profile-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.portal-signout { color: #9f3345; }
.portal-profile-install { grid-column: 1 / -1; }
.portal-profile-install:empty { display: none; }
.portal .portal-profile-install .sti-box { margin: 0; border-color: var(--line); border-radius: var(--portal-radius); }
.portal .sti-btn.primary, .portal .sti-btn.primary:hover { background: var(--blue); }
.portal .sti-btn { height: 2.375rem; border-radius: .375rem; font-size: .8125rem; }

.portal-integration { max-width: 46rem; }
.portal-integration-head {
  justify-content: flex-start;
  gap: .85rem;
  margin-bottom: 1rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--line);
}
.portal-integration-head img { width: 4rem; height: 2rem; flex: none; object-fit: contain; }
.portal-integration-fields {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem;
  margin: 0;
  padding: 0;
  border: 0;
}
.portal-integration-address, .portal-integration-actions { grid-column: 1 / -1; }
.portal-integration-form label { display: block; margin-bottom: .3rem; font-weight: 650; }
.portal-integration-form input {
  width: 100%;
  min-height: 2.75rem;
  padding: .55rem .65rem;
  border: 1px solid #d6dfe6;
  border-radius: .375rem;
  background: var(--portal-surface);
  color: var(--ink);
  font-size: .875rem;
}
.portal-integration-form input:disabled { background: var(--field); }
.portal-integration-form small { display: block; margin-top: .25rem; color: var(--muted); }
.portal-integration-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.portal-integration-actions .portal-button { min-width: 6rem; min-height: 2.75rem; }
.portal-integration-actions .portal-button:disabled { cursor: progress; opacity: .75; }
.portal-integration-actions .portal-loading-indicator { border-color: #ffffff50; border-top-color: #fff; }
.portal-integration-status:empty { margin: 0; }
.portal-integration-status[data-state] {
  margin: .85rem 0 0;
  padding: .65rem .75rem;
  border-radius: .375rem;
  font-weight: 600;
}
.portal-integration-status[data-state="success"] { background: #e8f4ee; color: #17624c; }
.portal-integration-status[data-state="error"] { background: #faeef0; color: #8e3e4e; }
.portal-integration-details {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto;
  gap: .85rem;
  margin: .9rem 0 1rem;
}
.portal-integration-details dt { margin-bottom: .15rem; color: var(--muted); font-size: .8125rem; }
.portal-integration-details dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }

@media (max-width: 560px) {
  .portal-integration-fields, .portal-integration-details { grid-template-columns: minmax(0, 1fr); }
  .portal-integration-form input { font-size: 1rem; }
}


@media (max-width: 1130px) {
  .portal-kpi-icon { display: none; }
  .portal-dashboard-trio { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal .portal-results .driver-card { grid-template-columns: minmax(10rem, 1fr) minmax(10rem, 1fr); }
  .portal .driver-actions { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .portal-layout { grid-template-columns: minmax(0, 1fr); }
  .portal-sidebar, .portal-breadcrumb { display: none; }
  .portal-mobile { display: flex; align-items: center; gap: .5rem; }
  .portal-mobile .portal-brand {
    min-height: 1.875rem;
    border-radius: .25rem;
    padding: .16rem .35rem;
    background: var(--portal-navy);
  }
  .portal-mobile .portal-brand img { width: 5.7rem; }
  .portal-menu summary {
    display: grid;
    width: 2.125rem;
    height: 2.125rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: .375rem;
    color: var(--ink);
    cursor: pointer;
  }
  .portal-menu[open] summary { background: var(--field); }
  .portal-menu nav {
    position: absolute;
    top: calc(100% + .375rem);
    left: var(--portal-gutter);
    width: min(14.5rem, calc(100% - 2 * var(--portal-gutter)));
    padding: .75rem .65rem;
    border-radius: var(--portal-radius);
    background: var(--portal-navy);
    color: #dce5ee;
    box-shadow: 0 6px 18px #14223226;
  }
  .portal-menu:not([open]) nav { display: none; }
  .portal-account { max-width: 54%; }
  .portal-kpi-icon { display: grid; }

  .portal-docked {
    --portal-dock-height: calc(4.125rem + env(safe-area-inset-bottom));
    scroll-padding-bottom: calc(var(--portal-dock-height) + 1rem);
  }
  .portal-carrier .portal-content { padding-bottom: calc(var(--portal-dock-height) + var(--portal-gutter)); }
  .portal-dock {
    position: fixed;
    z-index: 50;
    inset: auto 0 0;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(max-content, 1fr);
    min-height: var(--portal-dock-height);
    padding: .25rem max(.35rem, env(safe-area-inset-right)) calc(.25rem + env(safe-area-inset-bottom))
      max(.35rem, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: #fffffff5;
    backdrop-filter: blur(14px);
  }
  .portal-dock .portal-link {
    min-height: 3.5rem;
    flex-direction: column;
    justify-content: center;
    gap: .3rem;
    padding: .25rem .15rem;
    color: var(--muted);
    font-size: clamp(.625rem, 2.8vw, .75rem);
    line-height: 1.2;
    white-space: nowrap;
  }
  .portal-dock .portal-link .portal-icon { width: 1.25rem; height: 1.25rem; color: currentColor; }
  .portal-dock .portal-link:hover { background: var(--field); }
  .portal-dock .portal-link[aria-current="page"] { background: var(--tint); color: var(--blue); }
}

@media (max-width: 670px) {
  body.portal { --portal-gap: .75rem; }
  .portal-content { padding-top: 1rem; }
  .portal-heading { flex-wrap: wrap; margin-bottom: .875rem; }
  .portal-kpis, .portal .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-chart-grid, .portal-dashboard-pair, .portal-dashboard-trio,
  .portal-profile-grid { grid-template-columns: minmax(0, 1fr); }
  .portal-distribution .donut-wrap { min-height: 0; }
  .portal-distribution .donut-legend { max-width: 13rem; }
  .portal-table th, .portal-table td { padding-inline: .65rem; }
  .portal-table .portal-route-cell { min-width: 9rem; }
  .portal .portal-results .driver-card { grid-template-columns: minmax(0, 1fr); }
  .portal .portal-results .proof-card { grid-template-columns: 4.5rem minmax(0, 1fr); }
}

@media (max-width: 390px) {
  .portal-account { gap: .25rem; font-size: .75rem; }
  .portal-account > .portal-icon, .portal-kpi-icon { display: none; }
  .portal-kpi, .portal .summary .sum-item { padding: .7rem; }
}

@media (max-width: 560px) {
  .portal .shipment-status-group { flex-direction: column; align-items: flex-end; gap: .1rem; }
  .portal-status-controls { justify-items: end; }
  .portal-status-editor select { font-size: 1rem; }
  :is(.portal-shipments, .portal-carriers),
  :is(.portal-shipments, .portal-carriers) tbody { display: block; }
  :is(.portal-shipments, .portal-carriers) thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  :is(.portal-shipments, .portal-carriers) tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: .28rem .625rem;
    padding: .7rem .85rem;
    border-top: 1px solid var(--line);
  }
  :is(.portal-shipments, .portal-carriers) td { padding: 0; border: 0; overflow-wrap: anywhere; }
  :is(.portal-shipments, .portal-carriers) .portal-nowrap { white-space: normal; }
  .portal-shipments td:nth-child(3), .portal-shipments td:nth-child(4) { grid-column: 1 / -1; }
  .portal-shipments td:nth-child(even):not(:nth-child(4)) { text-align: right; }
  .portal-shipments td:nth-child(n+5) { color: var(--muted); font-size: .75rem; }
  .portal-shipments .portal-num { text-align: left; }
  .portal-shipments .portal-record { display: inline-flex; min-height: 1.75rem; align-items: center; }
  .portal-carriers td:nth-child(2), .portal-carriers td:nth-child(3) { grid-column: 1 / -1; }
  .portal-carriers td:nth-child(3) { color: var(--muted); font-size: .75rem; }
  .portal-carriers td:nth-child(4) { grid-area: 1 / 2; }
  .portal-mobile-unit { display: inline; }
}

@media (min-width: 1140px), (min-width: 720px) and (max-width: 900px) {
  .portal .portal-results .proof-body {
    display: grid;
    grid-template-columns: minmax(5.25rem, .65fr) minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal *, .portal *::before, .portal *::after { animation-duration: 0ms !important; transition-duration: 0ms !important; }
}
