/* Visual refresh layer for the standalone employee portal. */
:root {
  --ink: #102f37;
  --muted: #62777c;
  --navy: #0b3a44;
  --navy-2: #12515c;
  --teal: #10a38c;
  --teal-dark: #087565;
  --mint: #dcf5ee;
  --sky: #eaf4f7;
  --line: #d8e5e4;
  --surface: #ffffff;
  --surface-soft: #f6faf9;
  --canvas: #f1f6f5;
  --danger: #c94949;
  --shadow: 0 12px 34px rgba(17,55,63,.07);
  --shadow-raised: 0 18px 48px rgba(10,47,55,.12);
  --radius: 17px;
}

html { background: var(--canvas); }
body.portal-body { color: var(--ink); background: var(--canvas); }

/* Shared shell */
.portal-sidebar {
  width: 248px;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 20% 102%, rgba(16,163,140,.18), transparent 30%),
    linear-gradient(165deg,#092f38 0%,#0b414b 64%,#0a3540 100%);
  box-shadow: 8px 0 28px rgba(9,42,49,.06);
}
.portal-page { margin-left: 248px; }
.portal-brand { padding: 4px 8px; }
.portal-brand strong { font-size: 16px; }
.portal-nav { gap: 5px; margin-top: 42px; }
.portal-nav a {
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #c5d9dc;
  font-size: 13px;
}
.portal-nav a:hover {
  border-color: rgba(255,255,255,.07);
  background: rgba(255,255,255,.07);
}
.portal-nav a.active {
  border-color: rgba(92,221,198,.12);
  background: linear-gradient(90deg,rgba(255,255,255,.13),rgba(255,255,255,.08));
  box-shadow: inset 3px 0 0 #28c3a8;
}
.sidebar-person { margin: auto 7px 0; padding: 15px 3px 0; }

.portal-header {
  height: 82px;
  position: sticky;
  top: 0;
  z-index: 40;
  grid-template-columns: minmax(215px,auto) minmax(0,1fr) auto;
  gap: 22px;
  padding: 14px clamp(24px,3vw,44px);
  border-bottom: 1px solid rgba(197,214,214,.85);
  background: rgba(255,255,255,.92);
  box-shadow: 0 5px 20px rgba(14,50,57,.035);
  backdrop-filter: blur(18px);
}
.portal-header h1 {
  margin-top: 3px;
  font-size: 22px;
  letter-spacing: -.03em;
}
.portal-header > .section-tabs {
  align-self: center;
  min-height: 43px;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f1f6f5;
}
.portal-header > .section-tabs a {
  min-height: 33px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  color: #5d7378;
  font-size: 11px;
}
.portal-header > .section-tabs a:hover {
  color: var(--teal-dark);
  background: rgba(255,255,255,.7);
}
.portal-header > .section-tabs a.active {
  color: var(--navy);
  border: 0;
  background: white;
  box-shadow: 0 3px 10px rgba(22,64,72,.10);
}
.notification-menu > summary {
  border-color: #d2e2e0;
  box-shadow: 0 4px 12px rgba(18,61,68,.05);
}
.notification-menu-panel {
  border-color: #d3e1e0;
  box-shadow: var(--shadow-raised);
}

.portal-main {
  width: min(1360px,100%);
  padding: 24px clamp(24px,3vw,44px) 52px;
}
.content-card,
.balance-card,
.overview-card,
.notification-card,
.payslip-row,
.employment-card {
  border-color: var(--line);
  box-shadow: var(--shadow);
}
.content-card { border-radius: var(--radius); }
.eyebrow { color: var(--teal-dark); letter-spacing: .09em; }

/* Buttons and focus */
.button {
  border-radius: 10px;
  font-weight: 800;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.button.primary {
  background: linear-gradient(135deg,#12aa92,#0b927d);
  box-shadow: 0 8px 18px rgba(16,163,140,.18);
}
.button.primary:hover {
  background: linear-gradient(135deg,#0e9a84,#087565);
  transform: translateY(-1px);
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(16,163,140,.22);
  outline-offset: 2px;
}

/* Assigned company and live balance projection */
.assigned-company {
  min-height: 64px;
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid #cce4df;
  border-radius: 12px;
  background: #f2faf7;
}
.assigned-company > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: white;
  background: var(--teal);
  font-size: 12px;
  font-weight: 900;
}
.assigned-company small,
.assigned-company strong { display: block; }
.assigned-company small {
  color: var(--teal-dark);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.assigned-company strong { margin-top: 3px; font-size: 12px; }
.assigned-company p {
  max-width: 220px;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
  text-align: right;
}
.balance-projection {
  display: grid;
  grid-template-columns: minmax(0,1fr) 24px minmax(0,1fr);
  align-items: stretch;
  gap: 6px;
}
.balance-projection .preview-balance { padding: 18px; }
.balance-projection .preview-balance strong { font-size: 34px; }
.projected-balance { background: linear-gradient(135deg,#0b7568,#10a38c); }
.balance-projection-arrow {
  display: grid;
  place-items: center;
  color: #789095;
  font-weight: 850;
}
.preview-calculation-state {
  min-height: 36px;
  margin: 10px 0 0;
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--muted);
  background: #f3f7f6;
  font-size: 9px;
  line-height: 1.45;
}
.preview-calculation-state[data-state="loading"] { color: #376b75; background: #eaf4f7; }
.preview-calculation-state[data-state="success"] { color: #087162; background: #e1f6ef; }
.preview-calculation-state[data-state="error"] { color: #9d3030; background: #feecec; }
.validation-list[data-state="pending"] li {
  color: #7d8f93;
  opacity: .68;
}
.validation-list[data-state="pending"] span {
  color: #7d8f93;
  background: #edf2f1;
}
.validation-list[data-state="success"] li { color: #315b55; }
.validation-list[data-state="success"] span {
  color: white;
  background: var(--teal);
}

.approval-route-preview { display: grid; gap: 8px; margin-top: 13px; padding: 13px; border: 1px solid #dce8e6; border-radius: 12px; background: #f7fbfa; }
.approval-route-preview[hidden] { display: none; }
.approval-route-preview > .eyebrow { margin: 0 0 2px; }
.approval-route-preview > div { display: grid; grid-template-columns: 26px minmax(0,1fr); align-items: center; gap: 9px; }
.approval-route-preview > div > span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 9px; color: var(--teal-dark); background: var(--mint); font-size: 10px; font-weight: 850; }
.approval-route-preview p { min-width: 0; margin: 0; }
.approval-route-preview small, .approval-route-preview strong { display: block; }
.approval-route-preview small { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }.approval-route-preview strong { margin-top: 2px; overflow-wrap: anywhere; font-size: 10px; }
.calendar-session-selection { display: grid; grid-template-columns: minmax(0,1fr) 22px minmax(0,1fr); align-items: end; gap: 10px; margin: -4px 25px 14px; padding: 12px 14px; border: 1px solid #dce8e6; border-radius: 13px; background: #fbfdfc; }
.calendar-session-selection[hidden], .calendar-session-selection label[hidden], .calendar-session-arrow[hidden], [data-end-session-field][hidden] { display: none; }
.calendar-session-selection[data-range="same"] { grid-template-columns: minmax(0,1fr); }
.calendar-session-selection label { display: grid; gap: 5px; color: var(--ink); }
.calendar-session-selection label > span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.calendar-session-selection select { width: 100%; min-height: 38px; padding: 0 34px 0 11px; border: 1px solid #cedddb; border-radius: 9px; color: var(--ink); background-color: white; font-weight: 750; }
.calendar-session-arrow { align-self: center; color: var(--teal-dark); text-align: center; }

/* Leave workspace */
.request-status-select { display: none; }
.request-command-bar {
  min-height: 50px;
  gap: 10px;
  margin-bottom: 12px;
  padding: 6px;
  border-color: var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 8px 22px rgba(17,55,63,.05);
}
.request-command-main { gap: 8px; }
.request-command-bar .tabs {
  gap: 3px;
  overflow-y: hidden;
}
.request-command-bar .tabs a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 11px;
}
.request-command-bar .tabs a.active {
  color: white;
  background: var(--navy);
  box-shadow: 0 4px 12px rgba(11,58,68,.16);
}
.request-command-bar .request-view-toggle {
  min-height: 36px;
  padding: 0 0 0 8px;
}
.request-view-toggle a {
  min-height: 36px;
  padding: 0 11px;
  border-radius: 9px;
}
.request-view-toggle a.active {
  color: var(--navy);
  background: var(--mint);
}
.request-new-button {
  min-height: 38px;
  padding-right: 16px;
  padding-left: 16px;
  border-radius: 10px;
}

.request-history-card {
  border-color: #d4e2e1;
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(17,55,63,.065);
}
.request-calendar-toolbar {
  min-height: 64px;
  margin-bottom: 10px;
  border-bottom-color: #e1ebea;
  background: linear-gradient(180deg,#fbfdfd,#f5f9f8);
}
.request-calendar-navigation {
  grid-template-columns: 36px minmax(150px,auto) 36px;
}
.request-calendar-navigation > a {
  width: 36px;
  height: 36px;
  border-color: #d4e2e1;
  box-shadow: 0 3px 9px rgba(17,55,63,.04);
}
.request-calendar-navigation h3 { font-size: 16px; }
.request-calendar-summary { font-size: 10px; }
.request-calendar-summary strong { font-size: 12px; }
.request-calendar-legend { gap: 7px 12px; }
.request-calendar-legend i { border-radius: 50%; }

.request-calendar {
  border-color: #d5e2e1;
  border-radius: 12px;
  background: #dce7e6;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.request-calendar-weekday {
  min-height: 34px;
  color: #536b70;
  background: #edf4f3;
}
.request-calendar-day {
  padding: 8px;
  background: #fff;
}
.request-calendar-day.other-month { background: #f7faf9; }
.request-calendar-day > time {
  width: 26px;
  height: 26px;
  font-size: 10px;
}
.request-calendar-day.today {
  z-index: 2;
  box-shadow: inset 0 0 0 2px var(--teal);
}
.request-calendar-event {
  min-height: 25px;
  border-radius: 6px;
  font-size: 9px;
}
.request-calendar-tooltip {
  border-color: #d1dfde;
  box-shadow: 0 20px 48px rgba(11,48,56,.22);
}

/* Tables */
.data-table-toolbar {
  min-height: 66px;
  display: grid;
  grid-template-columns: minmax(240px,360px) minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 0 -26px;
  padding: 11px 26px 13px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #f8fbfa;
}
.data-table-search {
  width: auto;
  position: relative;
}
.data-table-search > span {
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  position: absolute;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.data-table-search:before {
  content: "";
  width: 12px;
  height: 12px;
  position: absolute;
  left: 14px;
  top: 50%;
  z-index: 1;
  border: 1.7px solid #6d8286;
  border-radius: 50%;
  transform: translateY(-58%);
  pointer-events: none;
}
.data-table-search:after {
  content: "";
  width: 6px;
  height: 1.7px;
  position: absolute;
  left: 24px;
  top: calc(50% + 6px);
  z-index: 1;
  border-radius: 2px;
  background: #6d8286;
  transform: rotate(45deg);
  transform-origin: left center;
  pointer-events: none;
}
.data-table-search input {
  width: 100%;
  padding-left: 40px;
}
.data-table-filters {
  min-width: 0;
  align-items: center;
}
.data-table-search input,
.data-table-size select,
.data-table-facet summary {
  min-height: 40px;
  border-color: #d5e2e1;
  border-radius: 10px;
  background: white;
}
.data-table-facet summary { padding-right: 13px; padding-left: 13px; }
.data-table-size {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
  color: #607579;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
.data-table-size select { min-width: 70px; }
.responsive-table th {
  color: #52696e;
  background: #f0f6f5;
}
.responsive-table tbody tr:hover td { background: #fbfefd; }
.responsive-table td { border-bottom-color: #e7eeee; }

/* Empty and informational states */
.empty-state {
  border-color: #cddfdd;
  background: linear-gradient(180deg,#fff,#f8fbfa);
}
.information-strip { border-radius: 13px; }

/* Wide screens can use the height recovered by moving tabs into the header. */
@media (min-width: 1181px) {
  .request-calendar[data-week-count="4"] .request-calendar-day {
    min-height: clamp(76px,calc(25dvh - 70px),122px);
  }
  .request-calendar[data-week-count="5"] .request-calendar-day {
    min-height: clamp(72px,calc(20dvh - 56px),122px);
  }
  .request-calendar[data-week-count="6"] .request-calendar-day {
    min-height: clamp(66px,calc(16.667dvh - 46.667px),122px);
  }
}

@media (min-width: 781px) and (max-width: 1180px) {
  .portal-header {
    min-height: 82px;
    padding: 13px 28px 0;
  }
  .portal-header > .section-tabs {
    margin-top: 9px;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
    background: transparent;
  }
}

@media (max-width: 1040px) {
  .data-table-toolbar {
    grid-template-columns: minmax(220px,1fr) minmax(0,1.4fr) auto;
  }
}

@media (max-width: 780px) {
  .calendar-session-selection { margin-right: 16px; margin-left: 16px; }
  .portal-page { margin-left: 0; }
  .portal-header {
    min-height: 74px;
    padding: 12px 16px 0;
  }
  .portal-header > .section-tabs {
    margin-top: 8px;
    padding: 3px 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
    background: transparent;
  }
  .portal-header > .section-tabs a { min-height: 38px; }
  .portal-main { padding: 18px 14px 34px; }
  .data-table-toolbar {
    grid-template-columns: 1fr auto;
    margin-right: -18px;
    margin-left: -18px;
    padding-right: 18px;
    padding-left: 18px;
  }
  .data-table-search { grid-column: 1/-1; }
  .data-table-filters { align-items: center; }
  .data-table-size { align-self: center; }
  .request-command-bar { padding: 6px; }
  .request-command-bar .tabs { padding-bottom: 2px; }
  .request-command-bar .request-view-toggle {
    margin: 0;
    padding: 2px 0;
  }
  .request-history-card { padding-right: 18px; padding-left: 18px; }
  .request-calendar-toolbar {
    margin-right: -18px;
    margin-left: -18px;
    padding-right: 18px;
    padding-left: 18px;
  }
}

@media (max-width: 430px) {
  .portal-header h1 { font-size: 19px; }
  .assigned-company { grid-template-columns: 34px minmax(0,1fr); }
  .assigned-company p { grid-column: 2; max-width: none; text-align: left; }
  .request-command-bar .tabs a { padding-right: 11px; padding-left: 11px; }
  .data-table-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .data-table-search,
  .data-table-filters { width: 100%; }
  .data-table-size {
    width: max-content;
    margin-left: 0;
  }
  .request-calendar-navigation {
    width: 100%;
    grid-template-columns: 36px 1fr 36px;
  }
}

/* Claim Leave is a focused two-view workspace: create or track. */

.claim-workspace { margin-top: 0; }
.portal-header > .claim-header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  overflow: visible;
}
.claim-header-tabs { min-width: max-content; display: flex; align-items: center; gap: 3px; }
.claim-header-tabs button {
  min-height: 33px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  color: #5d7378;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.claim-header-tabs button:hover { color: var(--teal-dark); background: rgba(255,255,255,.7); }
.claim-header-tabs button.active { color: var(--navy); background: white; box-shadow: 0 3px 10px rgba(22,64,72,.10); }
.claim-header-tabs button em {
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 99px;
  color: #4f686d;
  background: #e1ecea;
  font-size: 9px;
  font-style: normal;
  text-align: center;
}
.claim-header-tabs button.active em { color: white; background: var(--navy); }
.claim-header-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-left: auto;
  padding-left: 12px;
  border-left: 1px solid #d9e5e3;
}
.claim-header-summary > span { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.claim-header-summary > span strong { color: var(--ink); font-size: 10px; }
.portal-header > .section-tabs .claim-header-summary > a {
  min-height: 33px;
  padding: 0 12px;
  border: 1px solid #c9ded9;
  border-radius: 8px;
  color: var(--navy);
  background: #e8f4f1;
  font-size: 10px;
  font-weight: 850;
}
.portal-header > .section-tabs .claim-header-summary > a:hover { border-color: #9bcfc5; color: var(--teal-dark); background: #ddf2ec; }
.claim-pane[hidden] { display: none; }
.claim-pane .claim-application-layout { margin-top: 0; }
.claim-credit-field input { max-width: 240px; }
.claim-application-form > .form-actions { align-items: center; justify-content: space-between; }
.claim-projection-card .preview-note { margin-bottom: 0; }

.claim-history-card { padding-top: 0; overflow: hidden; }
.claim-history-heading {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 -26px;
  padding: 18px 26px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg,#fff,#fbfdfd);
}
.claim-history-heading .eyebrow { margin: 0; }
.claim-history-heading h2 { margin: 4px 0 3px; font-size: 19px; }
.claim-history-heading p:last-child { margin: 0; color: var(--muted); font-size: 10px; }
.claim-history-card .data-table-toolbar { margin-top: 0; }
.claim-history-card .responsive-table { margin-right: -26px; margin-left: -26px; }
.claim-history-card .responsive-table table { min-width: 980px; }
.claim-history-card .responsive-table th:first-child,
.claim-history-card .responsive-table td:first-child { padding-left: 26px; }
.claim-history-card .responsive-table th:last-child,
.claim-history-card .responsive-table td:last-child { padding-right: 26px; text-align: right; }
.claim-reason-cell { max-width: 300px; color: #3e575d; white-space: normal; line-height: 1.45; }
.claim-no-action { color: #9aabad; }
.claim-history-card > .empty-state { margin: 26px 0 0; }


@media (max-width: 780px) {
  .claim-header-tabs { flex: 1; }
  .claim-header-tabs button { flex: 1; justify-content: center; padding: 0 9px; }
  .claim-header-summary { flex: 0 0 auto; padding-left: 7px; }
  .claim-header-summary > span { display: none; }
  .claim-application-form > .form-actions { align-items: stretch; flex-direction: column; }
  .claim-credit-field input { max-width: none; }
  .claim-history-card { padding-right: 18px; padding-left: 18px; }
  .claim-history-heading { align-items: flex-start; margin-right: -18px; margin-left: -18px; padding-right: 18px; padding-left: 18px; }
  .claim-history-card .responsive-table { margin-right: -18px; margin-left: -18px; }
  .claim-history-card .responsive-table th:first-child,
  .claim-history-card .responsive-table td:first-child { padding-left: 18px; }
  .claim-history-card .responsive-table th:last-child,
  .claim-history-card .responsive-table td:last-child { padding-right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
}
/* Leave balance comparison and progressive detail. */
.balance-page-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}
.balance-page-intro h2 { margin: 4px 0 5px; font-size: 21px; letter-spacing: -.03em; }
.balance-page-intro p:last-child { margin: 0; color: var(--muted); font-size: 11px; }
.balance-page-actions { display: flex; align-items: center; gap: 12px; }
.balance-as-of {
  padding-right: 13px;
  border-right: 1px solid var(--line);
  text-align: right;
}
.balance-as-of small,
.balance-as-of strong { display: block; }
.balance-as-of small { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.balance-as-of strong { margin-top: 3px; font-size: 11px; }

.balance-comparison { display: grid; gap: 9px; }
.balance-comparison-head,
.balance-comparison-row {
  display: grid;
  grid-template-columns: minmax(220px,1.4fr) repeat(3,minmax(112px,.64fr)) minmax(180px,1fr);
  gap: 15px;
}
.balance-comparison-head {
  padding: 0 20px 2px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.balance-comparison-head span:not(:first-child) { align-self: end; }
.balance-comparison-row {
  align-items: center;
  padding: 17px 20px 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
  box-shadow: 0 8px 24px rgba(17,55,63,.045);
}
.balance-comparison-row.compensation {
  border-color: #bce3da;
  background: linear-gradient(110deg,#fff 0%,#f5fbf9 100%);
}
.balance-leave-type { min-width: 0; display: flex; align-items: center; gap: 11px; }
.balance-leave-type .card-icon { width: 34px; height: 34px; flex: 0 0 auto; font-size: 17px; }
.balance-leave-type h3 { margin: 0; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.balance-leave-type small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.balance-comparison-metric { min-width: 0; }
.balance-comparison-metric small { display: none; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.balance-comparison-metric strong { font-size: 19px; letter-spacing: -.035em; }
.balance-comparison-metric span { margin-left: 4px; color: var(--muted); font-size: 9px; }
.balance-comparison-metric.primary strong { color: var(--navy); font-size: 29px; }

.balance-attention { min-width: 0; }
.balance-alert { min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; }
.balance-alert > b {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  font-size: 10px;
}
.balance-alert strong,
.balance-alert small { display: block; }
.balance-alert strong { font-size: 10px; }
.balance-alert small { margin-top: 2px; color: inherit; font-size: 8px; opacity: .82; }
.balance-alert.warning { color: #76501c; background: #fff4dc; }
.balance-alert.warning > b { color: white; background: #d39433; }
.balance-alert.neutral { color: #38636a; background: #eef6f6; }
.balance-alert.neutral > b { color: white; background: #6e9298; }
.balance-clear { display: inline-flex; align-items: center; gap: 6px; color: #678087; font-size: 9px; }
.balance-clear b { color: var(--teal-dark); }

.balance-breakdown {
  grid-column: 1/-1;
  margin: 13px -20px 0;
  border-top: 1px solid var(--line);
}
.balance-breakdown > summary,
.balance-history > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
}
.balance-breakdown > summary::-webkit-details-marker,
.balance-history > summary::-webkit-details-marker { display: none; }
.balance-breakdown > summary { min-height: 42px; padding: 0 20px; color: var(--teal-dark); font-size: 9px; font-weight: 850; }
.balance-breakdown > summary > span:last-child,
.balance-history > summary > span:last-child { transition: transform .16s ease; }
.balance-breakdown[open] > summary > span:last-child,
.balance-history[open] > summary > span:last-child { transform: rotate(180deg); }
.balance-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 9px;
  margin: 0;
  padding: 5px 20px 16px;
}
.balance-breakdown-grid > div {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #e1e9e8;
  border-radius: 10px;
  background: #f8fbfa;
}
.balance-breakdown-grid dt { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.balance-breakdown-grid dd { margin: 5px 0 0; font-size: 11px; font-weight: 800; }
.balance-breakdown-grid .breakdown-total { border-color: #a9ddd3; color: var(--teal-dark); background: #ecf9f5; }
.balance-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 0 20px 17px; }
.balance-row-actions > a:not(.button) { font-size: 10px; font-weight: 800; }
.balance-row-actions .button { min-height: 35px; padding: 0 13px; font-size: 10px; }

.off-in-lieu-heading p:last-child { max-width: 680px; }
.off-in-lieu-table { padding-top: 8px; overflow: hidden; }
.off-in-lieu-table .responsive-table { margin: 0 -26px -26px; }
.balance-history { margin-top: 12px; padding: 0; overflow: hidden; }
.balance-history > summary { min-height: 66px; padding: 0 22px; }
.balance-history > summary strong,
.balance-history > summary small { display: block; }
.balance-history > summary strong { font-size: 13px; }
.balance-history > summary small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.balance-history .responsive-table { border-top: 1px solid var(--line); }
.balance-explanation { margin-top: 22px; }

@media (max-width: 1120px) {
  .balance-comparison-head,
  .balance-comparison-row { grid-template-columns: minmax(190px,1.25fr) repeat(3,minmax(95px,.6fr)) minmax(150px,.9fr); gap: 10px; }
  .balance-comparison-head { padding-right: 16px; padding-left: 16px; }
  .balance-comparison-row { padding-right: 16px; padding-left: 16px; }
  .balance-breakdown { margin-right: -16px; margin-left: -16px; }
}

@media (max-width: 900px) {
  .balance-comparison-head { display: none; }
  .balance-comparison-row { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px 10px; }
  .balance-leave-type,
  .balance-attention,
  .balance-breakdown { grid-column: 1/-1; }
  .balance-comparison-metric small { display: block; min-height: 20px; margin-bottom: 4px; }
  .balance-attention { padding-top: 2px; }
  .balance-breakdown-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 600px) {
  .balance-page-intro { align-items: stretch; flex-direction: column; gap: 14px; }
  .balance-page-actions { justify-content: space-between; }
  .balance-as-of { text-align: left; }
  .balance-comparison-row { padding-top: 15px; }
  .balance-comparison-metric strong,
  .balance-comparison-metric.primary strong { font-size: 22px; }
  .balance-comparison-metric span { display: block; margin: 1px 0 0; }
  .balance-breakdown-grid { gap: 7px; padding-right: 16px; padding-left: 16px; }
  .balance-row-actions { align-items: stretch; flex-direction: column; }
  .balance-row-actions .button { width: 100%; }
  .off-in-lieu-table .responsive-table { margin-right: -21px; margin-left: -21px; }
}

/* Phone-safe portal navigation and notification sizing. */
.notification-bell {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 780px) {
  .portal-page {
    min-width: 0;
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
    overflow-x: clip;
  }
  .portal-header {
    width: 100%;
    height: auto;
    min-width: 0;
    padding: calc(10px + env(safe-area-inset-top)) 14px 5px;
    column-gap: 10px;
    align-content: start;
  }
  .portal-header > div:first-child {
    min-width: 0;
    overflow: hidden;
  }
  .portal-header .eyebrow {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .portal-header h1 {
    max-width: 100%;
    overflow: hidden;
    font-size: 19px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .portal-header-actions {
    align-self: start;
  }
  .notification-menu > summary {
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: 0;
  }
  .notification-bell {
    width: 17px;
    height: 17px;
  }
  .notification-menu > summary strong {
    min-width: 16px;
    height: 16px;
    right: -4px;
    top: -4px;
    padding: 0 3px;
    border-width: 2px;
    font-size: 7px;
  }
  .notification-menu-panel {
    width: auto;
    max-height: calc(100dvh - 142px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    position: fixed;
    inset: calc(61px + env(safe-area-inset-top)) 12px auto;
    border-radius: 14px;
  }
  .notification-menu-head { padding: 15px; }
  .notification-menu-head h2 { font-size: 15px; }
  .notification-menu-item button { padding: 13px 15px; }
  .notification-menu-all { padding: 12px 15px; }

  .portal-header > .section-tabs {
    max-width: calc(100vw - 28px);
    justify-content: flex-start;
    overflow-x: auto;
    margin-bottom: 0;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .portal-header > .section-tabs::-webkit-scrollbar { display: none; }
  .portal-header > .section-tabs a {
    min-height: 38px;
    padding-right: 11px;
    padding-left: 11px;
  }
  .portal-header > .claim-header-nav {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .claim-header-tabs { flex: 0 0 auto; }
  .claim-header-summary { flex: 0 0 auto; }

  .mobile-nav {
    height: calc(62px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(6,minmax(0,1fr));
    gap: 1px;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    overflow: hidden;
    border-top-color: #cfdedc;
    background: rgba(255,255,255,.98);
    box-shadow: 0 -8px 24px rgba(12,49,57,.08);
    z-index: 50;
  }
  .mobile-nav a {
    min-width: 0;
    min-height: 50px;
    align-content: center;
    gap: 2px;
    padding: 3px 1px;
    overflow: hidden;
    border-radius: 9px;
    font-size: inherit;
  }
  .mobile-nav a.active {
    color: var(--teal-dark);
    background: #eaf7f3;
  }
  .mobile-nav a > span {
    width: 19px;
    height: 19px;
    display: grid;
    place-items: center;
    font-size: 17px;
    line-height: 1;
  }
  .mobile-nav a > small {
    width: 100%;
    display: block;
    overflow: hidden;
    font-size: clamp(7.5px,2.25vw,9px);
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Phone request history: compact controls and readable request cards. */
@media screen and (max-width: 600px) {
  .portal-header > .section-tabs:not(.claim-header-nav) {
    width: 100%;
    max-width: none;
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 3px;
    overflow: visible;
  }
  .portal-header > .section-tabs:not(.claim-header-nav) a {
    min-width: 0;
    justify-content: center;
    padding-right: 6px;
    padding-left: 6px;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
  }

  .request-command-bar {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 8px;
  }
  .request-command-main { display: contents; }
  .request-command-bar .tabs { display: none; }
  .request-status-select {
    min-width: 0;
    display: grid;
    grid-column: 1/-1;
    grid-row: 1;
    gap: 4px;
    padding: 2px;
    color: var(--muted);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .055em;
    text-transform: uppercase;
  }
  .request-status-select select {
    width: 100%;
    min-height: 40px;
    padding: 0 36px 0 12px;
    border: 1px solid #cbdad8;
    border-radius: 10px;
    color: var(--ink);
    background: white;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0;
    text-transform: none;
  }
  .request-command-bar .request-view-toggle {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    align-self: center;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .request-view-toggle a {
    min-height: 38px;
    padding-right: 10px;
    padding-left: 10px;
  }
  .request-new-button {
    width: auto;
    min-height: 38px;
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    margin: 0;
    padding-right: 13px;
    padding-left: 13px;
    white-space: nowrap;
  }

  .request-history-card.list-view {
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .request-history-card.list-view .data-table-toolbar {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-items: end;
    gap: 10px 8px;
    margin: 0 0 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: white;
    box-shadow: var(--shadow);
  }
  .request-history-card.list-view .data-table-search {
    width: auto;
    min-width: 0;
    grid-column: 1;
    grid-row: 1;
  }
  .request-history-card.list-view .data-table-size {
    width: auto;
    grid-column: 2;
    grid-row: 1;
    margin: 0;
  }
  .request-history-card.list-view .data-table-filters {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    grid-column: 1/-1;
    grid-row: 2;
    gap: 8px;
  }
  .request-history-card.list-view .data-table-facet {
    min-width: 0;
    width: 100%;
  }
  .request-history-card.list-view .data-table-facet summary {
    min-width: 0;
    justify-content: space-between;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .request-history-card.list-view .responsive-table {
    overflow: visible;
    margin: 0;
  }
  .request-history-card.list-view table.data-table {
    min-width: 0;
    display: block;
  }
  .request-history-card.list-view .data-table thead { display: none; }
  .request-history-card.list-view .data-table tbody {
    display: grid;
    gap: 11px;
  }
  .request-history-card.list-view .data-table tbody tr {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    overflow: hidden;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: white;
    box-shadow: var(--shadow);
  }
  .request-history-card.list-view .data-table tbody tr[hidden] { display: none; }
  .request-history-card.list-view .data-table td {
    min-width: 0;
    display: block;
    padding: 10px 0;
    border: 0;
    overflow-wrap: anywhere;
    font-size: 11px;
  }
  .request-history-card.list-view .data-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .055em;
    text-transform: uppercase;
  }
  .request-history-card.list-view .data-table td:first-child,
  .request-history-card.list-view .data-table td:nth-child(2),
  .request-history-card.list-view .data-table td:nth-child(3),
  .request-history-card.list-view .data-table td:nth-child(6),
  .request-history-card.list-view .data-table td:last-child {
    grid-column: 1/-1;
  }
  .request-history-card.list-view .data-table td:first-child {
    padding-top: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e7eeee;
  }
  .request-history-card.list-view .data-table td:first-child::before { display: none; }
  .request-history-card.list-view .data-table td:nth-child(4) { padding-right: 8px; }
  .request-history-card.list-view .data-table td:nth-child(5) { padding-left: 8px; }
  .request-history-card.list-view .leave-period.range {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  }
  .request-history-card.list-view .leave-period.range > span {
    align-items: flex-start;
    display: grid;
    gap: 4px;
  }
  .request-history-card.list-view .data-table td:last-child {
    padding: 7px 0 0;
    border-top: 1px solid #e7eeee;
  }
  .request-history-card.list-view .row-link {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    color: var(--teal-dark);
    background: #eaf7f3;
  }
  .request-history-card.list-view .data-table-pager {
    margin-top: 10px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: white;
  }
}

@media (max-width: 360px) {
  .portal-header { padding-right: 11px; padding-left: 11px; }
  .portal-header > .section-tabs { max-width: calc(100vw - 22px); }
  .mobile-nav { padding-right: 2px; padding-left: 2px; }
  .mobile-nav a > span { font-size: 16px; }
  .mobile-nav a > small { font-size: 7.5px; letter-spacing: -.01em; }
}

/* Canonical phone shell: one title row, one compact context row, one bottom dock. */
@media screen and (max-width: 780px) {
  .portal-page {
    min-width: 0;
    padding-bottom: 0;
  }

  .portal-header,
  .portal-header.has-section-navigation {
    width: 100%;
    height: auto;
    min-height: calc(58px + env(safe-area-inset-top));
    display: grid;
    grid-template-columns: minmax(0,1fr) 36px;
    grid-template-rows: 58px;
    align-items: center;
    align-content: start;
    gap: 0 12px;
    padding: env(safe-area-inset-top) 14px 0;
  }
  .portal-header.has-section-navigation {
    grid-template-rows: 58px 42px;
  }
  .portal-header > div:first-child {
    min-width: 0;
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    overflow: hidden;
  }
  .portal-header .eyebrow {
    font-size: 8px;
    line-height: 1.1;
  }
  .portal-header h1 {
    margin: 4px 0 0;
    font-size: 19px;
    line-height: 1.08;
  }
  .portal-header-actions {
    min-width: 36px;
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: end;
    margin: 0 0 0 auto;
  }
  .notification-menu,
  .notification-menu > summary {
    margin-left: auto;
  }

  .portal-header > .section-tabs {
    width: calc(100% + 28px);
    max-width: none;
    min-height: 42px;
    grid-column: 1/-1;
    grid-row: 2;
    align-self: stretch;
    align-items: center;
    gap: 3px;
    margin: 0 -14px;
    padding: 4px 14px;
    overflow: hidden;
    border: 0;
    border-top: 1px solid #dce7e5;
    border-radius: 0;
    background: #f5f9f8;
    box-shadow: none;
  }
  .portal-header > .section-tabs:not(.claim-header-nav) {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
  .portal-header > .section-tabs:not(.claim-header-nav) a {
    min-width: 0;
    min-height: 34px;
    justify-content: center;
    padding: 0 5px;
    overflow: hidden;
    border-radius: 8px;
    font-size: clamp(9px,2.55vw,10px);
    line-height: 1;
    text-align: center;
    text-overflow: ellipsis;
  }
  .portal-header > .section-tabs:not(.claim-header-nav) a.active {
    background: white;
    box-shadow: 0 2px 8px rgba(22,64,72,.09);
  }

  .portal-header > .claim-header-nav {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    overflow: hidden;
  }
  .claim-header-tabs {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .claim-header-tabs button {
    min-width: 0;
    min-height: 34px;
    justify-content: center;
    padding: 0 8px;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
  }
  .claim-header-summary {
    min-width: auto;
    margin: 0;
    padding: 0 0 0 4px;
    border: 0;
  }
  .claim-header-summary > span { display: none; }
  .portal-header > .section-tabs .claim-header-summary > a {
    min-height: 34px;
    padding: 0 9px;
    white-space: nowrap;
  }

  .portal-main {
    width: 100%;
    padding: 12px 14px calc(88px + env(safe-area-inset-bottom));
  }
  .mode-banner,
  .flash-stack {
    margin-right: 14px;
    margin-left: 14px;
  }

  .mobile-nav {
    width: auto;
    height: 60px;
    grid-template-columns: repeat(6,minmax(0,1fr));
    gap: 2px;
    inset: auto 8px max(8px,env(safe-area-inset-bottom));
    padding: 5px;
    overflow: hidden;
    border: 1px solid #cfdddb;
    border-radius: 16px;
    background: rgba(255,255,255,.98);
    box-shadow: 0 10px 32px rgba(10,47,55,.16);
  }
  .mobile-nav a {
    min-width: 0;
    min-height: 48px;
    gap: 1px;
    padding: 3px 1px;
    border-radius: 11px;
  }
  .mobile-nav a > span {
    width: 18px;
    height: 18px;
    font-size: 16px;
  }
  .mobile-nav a > small {
    font-size: clamp(7px,2.15vw,8.5px);
    line-height: 1.1;
  }

  /* Claim Leave phone journey. */
  .portal-header > .section-tabs .claim-header-summary > a {
    font-size: 0;
  }
  .portal-header > .section-tabs .claim-header-summary > a::after {
    content: "Balance";
    font-size: 10px;
  }
  .claim-application-layout { gap: 12px; }
  .claim-application-form .form-section {
    padding: 18px 16px;
  }
  .claim-application-form .form-section-heading {
    gap: 10px;
    margin-bottom: 16px;
  }
  .claim-application-form .form-section-heading > span {
    width: 28px;
    height: 28px;
  }
  .claim-application-form .form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .claim-application-form .form-grid .span-2 { grid-column: auto; }
  .claim-application-form .assigned-company {
    grid-template-columns: 30px minmax(0,1fr);
    gap: 8px 10px;
    padding: 12px;
  }
  .claim-application-form .assigned-company p {
    max-width: none;
    grid-column: 2;
    text-align: left;
  }
  .claim-application-form > .form-actions {
    gap: 8px;
    padding: 14px 16px;
  }
  .claim-application-form > .form-actions .button { width: 100%; }
  .claim-projection-card { padding: 18px; }
  .claim-projection-card .preview-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 13px;
  }
  .claim-projection-card h2 { margin-bottom: 15px; }
  .claim-projection-card .balance-projection {
    grid-template-columns: minmax(0,1fr) 16px minmax(0,1fr);
    gap: 4px;
  }
  .claim-projection-card .balance-projection .preview-balance {
    min-width: 0;
    padding: 13px 11px;
  }
  .claim-projection-card .balance-projection .preview-balance strong {
    font-size: 28px;
  }
  .claim-projection-card .balance-projection .preview-balance span {
    overflow-wrap: anywhere;
  }

  .claim-history-card {
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .claim-history-heading {
    min-height: auto;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: white;
    box-shadow: var(--shadow);
  }
  .claim-history-heading > div { min-width: 0; }
  .claim-history-heading .read-only-pill {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .claim-history-card .data-table-toolbar {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-items: end;
    gap: 10px 8px;
    margin: 0 0 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: white;
    box-shadow: var(--shadow);
  }
  .claim-history-card .data-table-search {
    width: auto;
    min-width: 0;
    grid-column: 1;
    grid-row: 1;
  }
  .claim-history-card .data-table-size {
    width: auto;
    grid-column: 2;
    grid-row: 1;
    margin: 0;
  }
  .claim-history-card .data-table-filters {
    width: 100%;
    grid-column: 1/-1;
    grid-row: 2;
  }
  .claim-history-card .responsive-table {
    overflow: visible;
    margin: 0;
  }
  .claim-history-card .responsive-table table {
    width: 100%;
    min-width: 0;
    display: block;
  }
  .claim-history-card table thead { display: none; }
  .claim-history-card table tbody {
    display: grid;
    gap: 11px;
  }
  .claim-history-card table tbody tr {
    min-width: 0;
    display: grid;
    overflow: hidden;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: white;
    box-shadow: var(--shadow);
  }
  .claim-history-card table tbody tr[hidden] { display: none; }
  .claim-history-card .responsive-table table td[data-label] {
    min-width: 0;
    display: block;
    padding: 9px 0;
    border: 0;
    overflow-wrap: anywhere;
    text-align: left;
    white-space: normal;
  }
  .claim-history-card table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .055em;
    text-transform: uppercase;
  }
  .claim-history-card .responsive-table table td[data-label]:first-child {
    padding-top: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e7eeee;
  }
  .claim-history-card table td[data-label]:first-child::before { display: none; }
  .claim-history-card .responsive-table table td[data-label]:last-child {
    padding: 10px 0 0;
    border-top: 1px solid #e7eeee;
  }
  .claim-history-card .claim-cancel-form .button { width: 100%; }
  .claim-history-card .data-table-pager {
    margin-top: 10px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: white;
  }
}

/* Tablet shell: keep the second-row tabs and balance actions out of the content. */
@media (min-width: 781px) and (max-width: 1180px) {
  .portal-header {
    height: auto;
    min-height: 82px;
    grid-template-columns: minmax(0,1fr) auto;
    align-content: start;
    padding-bottom: 5px;
  }
  .portal-header > div:first-child {
    grid-column: 1;
    grid-row: 1;
  }
  .portal-header > .section-tabs {
    width: 100%;
    grid-column: 1/-1;
    grid-row: 2;
    min-height: 43px;
    align-self: auto;
    margin-top: 8px;
    padding-bottom: 3px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .portal-header > .section-tabs::-webkit-scrollbar { display: none; }
  .portal-header > .section-tabs a {
    min-height: 38px;
    white-space: nowrap;
  }
  .portal-header-actions {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    justify-self: end;
    margin-left: auto;
  }
}

@media (min-width: 781px) and (max-width: 1100px) {
  .home-welcome,
  .balance-page-intro {
    align-items: stretch;
    flex-direction: column;
    gap: 13px;
  }
  .balance-page-intro > div:first-child {
    min-width: 0;
  }
  .home-welcome {
    min-height: auto;
    padding: 28px 32px;
  }
  .home-welcome > div:first-child {
    max-width: 560px;
  }
  .home-welcome .welcome-actions {
    width: auto;
    align-self: flex-start;
    display: grid;
    grid-template-columns: repeat(2,minmax(132px,auto));
    gap: 9px;
  }
  .home-welcome .welcome-actions .button {
    min-width: 132px;
    padding-right: 18px;
    padding-left: 18px;
    white-space: nowrap;
  }
  .home-balances {
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 11px;
  }
  .home-balances .balance-card {
    min-width: 0;
    padding: 20px;
  }
  .home-balances .balance-card > p {
    min-height: 38px;
  }
  .home-balances .balance-card > strong small {
    display: block;
    margin-top: 3px;
  }
  .balance-page-actions {
    align-self: stretch;
    justify-content: flex-end;
  }
  .balance-page-actions .button {
    width: auto;
    min-width: max-content;
    white-space: nowrap;
  }
}

/* Tablet navigation uses a compact dock instead of a full-height desktop rail. */
@media screen and (min-width: 781px) and (max-width: 1100px) {
  .portal-sidebar {
    display: none;
  }
  .portal-page {
    min-width: 0;
    margin-left: 0;
    padding-bottom: 0;
  }
  .portal-main {
    width: 100%;
    padding: 22px clamp(24px,4vw,36px) 96px;
  }
  .mobile-nav {
    width: min(720px,calc(100vw - 32px));
    height: 64px;
    display: grid;
    grid-template-columns: repeat(6,minmax(0,1fr));
    gap: 3px;
    position: fixed;
    right: auto;
    bottom: max(10px,env(safe-area-inset-bottom));
    left: 50%;
    z-index: 50;
    padding: 6px;
    overflow: hidden;
    border: 1px solid #cedddb;
    border-radius: 17px;
    background: rgba(255,255,255,.97);
    box-shadow: 0 14px 38px rgba(10,47,55,.17);
    backdrop-filter: blur(16px);
    transform: translateX(-50%);
  }
  .mobile-nav a {
    min-width: 0;
    min-height: 50px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    padding: 3px 6px;
    overflow: hidden;
    border-radius: 11px;
    color: #657a80;
  }
  .mobile-nav a.active {
    color: var(--teal-dark);
    background: #e8f6f2;
  }
  .mobile-nav a > span {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    font-size: 18px;
    line-height: 1;
  }
  .mobile-nav a > small {
    width: 100%;
    display: block;
    overflow: hidden;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .home-welcome,
  .balance-page-intro {
    align-items: center;
    flex-direction: row;
    gap: 24px;
  }
  .home-welcome {
    min-height: 170px;
    padding: 30px 34px;
  }
  .home-welcome > div:first-child,
  .balance-page-intro > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
  }
  .home-welcome .welcome-actions {
    width: auto;
    flex: 0 0 auto;
    align-self: center;
    display: flex;
  }
  .balance-page-actions {
    flex: 0 0 auto;
    align-self: center;
  }
  .request-command-bar {
    grid-template-columns: minmax(0,1fr) auto;
    align-items: center;
    gap: 7px 10px;
    padding: 7px;
  }
  .request-command-main {
    display: contents;
  }
  .request-command-bar .tabs {
    width: 100%;
    grid-column: 1/-1;
    grid-row: 1;
    margin: 0;
    padding: 0 0 5px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .request-command-bar .tabs::-webkit-scrollbar { display: none; }
  .request-command-bar .request-view-toggle {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    margin: 0;
    padding: 0;
    border-left: 0;
  }
  .request-new-button {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    white-space: nowrap;
  }
  .request-history-card {
    min-width: 0;
  }
  .request-calendar-scroll {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .request-calendar {
    min-width: 700px;
  }
}


/* Independently loaded Home sections keep navigation usable during SQL work. */
.home-async { display: grid; gap: 24px; min-width: 0; }
.home-widget { min-width: 0; }
.home-widget h2 { font-size: 20px; }
.home-widget[aria-busy="true"] { min-height: 150px; }
.home-widget [data-home-result] { min-width: 0; }
.home-widget .overview-card { margin-bottom: 16px; }
.home-widget .home-recent-requests { margin-top: 20px; }
.home-widget .home-work-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-widget .home-work-overview > * { min-width: 0; overflow-wrap: anywhere; }
.home-widget [hidden] { display: none !important; }
.home-skeleton { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.home-skeleton span { display: block; height: 82px; border-radius: 14px; background: #e2edeb; }
.home-load-error { color: var(--muted); margin: 12px 0; }
.home-full-link { margin: 24px 0 0; font-size: 12px; }
.home-widget .request-copy { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .home-async { gap: 18px; }
  .home-widget .home-work-overview { grid-template-columns: minmax(0, 1fr); }
  .home-skeleton { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .home-skeleton span { height: 35px; }
}
