/* Tablet and phone navigation uses the bottom safe area, as in webmail. */
html {scroll-padding-block: 96px 20px;}
select, fieldset, .panel, .actions, .metric span {min-width:0;}
button:disabled {cursor:wait; opacity:.7;}
header nav a {white-space:nowrap;}
.row, .grid article, .check {overflow-wrap:anywhere;}
.max-columns {grid-template-columns:repeat(2,minmax(0,1fr));}
.max-table:focus-visible,summary:focus-visible,select:focus-visible {outline:3px solid #247daa;outline-offset:2px;}
summary {padding-block:10px;}
@media(max-width:1023px) {
  html {scroll-padding-block:84px calc(90px + env(safe-area-inset-bottom));}
  header {backdrop-filter:none;margin:0;padding:8px max(16px,env(safe-area-inset-right)) 8px max(16px,env(safe-area-inset-left));padding-top:max(8px,env(safe-area-inset-top));top:0;border-radius:0;border:0;border-bottom:1px solid #dce1e8;gap:10px;}
  header nav {position:fixed;inset:auto 0 0;z-index:8;display:flex;justify-content:center;margin:0;padding:5px max(8px,env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));border-top:1px solid #dce1e8;border-radius:0;background:#fffffff7;box-shadow:0 -4px 22px #2731460d;}
  header nav a {display:flex;flex:1 1 0;max-width:200px;min-width:0;min-height:50px;flex-direction:column;gap:2px;padding:4px;font-size:.79rem;}
  header nav svg {width:21px;height:21px;}
  .logout {margin-left:auto;}
  .page {padding-bottom:calc(88px + env(safe-area-inset-bottom));}
  button,.max-tools a, select {min-height:44px;}
  .history-controls label:first-child {flex-basis:100%;}
}
@media(max-width:700px) {
  .max-columns {grid-template-columns:minmax(0,1fr);}
  .page {padding-inline:max(12px,env(safe-area-inset-left)) max(12px,env(safe-area-inset-right));}
  .panel {padding:18px;}
  .max-tools, .max-tools .actions {display:grid;grid-template-columns:minmax(0,1fr);align-items:stretch;width:100%;}
  .max-tools .quiet,.max-tools .primary {justify-content:center;width:100%;}
  .history-controls {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}
  .history-controls label:first-child,.history-controls label:nth-last-child(3){grid-column:1/-1;}
  .history-controls select {padding-inline:6px;}
  .history-row {grid-template-columns:minmax(6.8em,auto) minmax(20px,1fr) minmax(5em,auto);}
  .max-table, .max-table table,.max-table tbody,.max-table tr {display:block;width:100%;min-width:0;}
  .max-table thead {position:absolute;clip-path:inset(50%);width:1px;height:1px;overflow:hidden;}
  .max-table tr {padding-block:10px;border-top:1px solid #dce1e8;}
  .max-table td {display:grid;grid-template-columns:minmax(6em,35%) 1fr;gap:4px 10px;padding:5px 0;border:0;overflow-wrap:anywhere;}
  .max-table td small {grid-column:2;}
  .max-table td[data-label]::before {content:attr(data-label);color:#596575;}
  .max-table td:first-child {display:block;min-width:0;font-weight:bold;font-size:15px;padding-bottom:8px;}
  .heading {align-items:stretch;flex-direction:column;}
  .row {display:grid;grid-template-columns:minmax(0,1fr);gap:6px;}
  .row button {justify-self:start;}
  .entry {min-height:100svh;align-content:center;}
  .brand {min-height:clamp(150px,26svh,230px);}
}
@media(max-height:520px) and (max-width:1023px) and (orientation:landscape) {
  header {position:static;}
  header nav a {flex-direction:row;min-height:44px;gap:8px;}
  .entry {grid-template-columns:minmax(0,.8fr) minmax(0,1fr);}
}

.hero {background:none;color:var(--ui-ink);box-shadow:none;padding:0 0 6px;border-radius:0}
.report-heading,.index-caption,.report-files {display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.report-heading h1 {color:var(--ui-ink);font-size:clamp(2rem,4vw,3.2rem);line-height:1.08}
.report-heading .month-select {margin:0}
.index-caption {font-weight:700;color:var(--ui-light)}
.index-caption span {font-size:.9rem;font-weight:400}
.max-index {background:radial-gradient(ellipse at 110% 0%,#389598,transparent 55%),linear-gradient(118deg,var(--ui-deep),var(--ui-sea) 80%)}
.max-index h2 {margin-top:18px;font-variant-numeric:tabular-nums}
.max-index h2 span {font-size:clamp(18px,2vw,27px);font-weight:400}
.max-plans {border-top:1px solid #ffffff40;padding-top:14px;margin-top:20px;gap:12px 24px}
.max-plans small {margin-bottom:3px}
.report-link {display:inline-flex;align-items:center;min-height:44px;background:white;color:var(--ui-accent);padding:9px 18px;border-radius:12px;font-weight:700}
.overview {max-width:740px}
.report-files {justify-content:flex-end;align-items:start}
.report-files a,.report-files button {display:inline-flex;align-items:center;gap:8px;min-height:44px;border-radius:12px;padding:9px 15px;font-weight:700;color:var(--ui-accent);background:var(--ui-tint)}
.component b {font-size:.85rem;color:var(--ui-muted)}
.component .max-bar {height:12px}
.metric-title {font-size:1.05rem;max-width:80ch;margin:20px 0 8px}
.single-month {display:flex;align-items:baseline;flex-wrap:wrap;gap:6px 12px}
.single-month strong {font-size:1.65rem;color:var(--ui-accent)}
.single-month small {flex-basis:100%}
@media(max-width:700px){
 .entry .brand {background:#f7efe8;min-height:176px;padding:18px;isolation:isolate}
 .entry .brand::before {content:"";position:absolute;inset:0 0 0 56%;background:url(prism.webp) 60% center/auto 100% no-repeat;mask-image:linear-gradient(90deg,transparent,#000 16%);z-index:-1}
 .entry .brand-title {background:none;padding:14px 18px}
 .entry .brand h1 {font-size:clamp(29px,7.9vw,42px)}
 .entry .brand .identity {flex-direction:column;align-items:flex-start;gap:3px}
 .entry .brand .identity i {display:none}
 .report-heading .month-select {display:flex;align-items:center;gap:10px}
 .report-heading .month-select select {width:auto;margin:0}
 .component>div {align-items:baseline;flex-wrap:wrap;gap:2px 8px}
 .report-files {justify-content:start}
 .max-plans {gap:10px 18px}
}

.max-index h2 span {letter-spacing:0}
.report-controls {display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap}
.excel-menu {position:relative;z-index:2}
.excel-menu summary {display:flex;align-items:center;gap:7px;min-height:44px;border:1px solid var(--ui-line);background:#fff;color:var(--ui-accent);padding:9px 12px;border-radius:12px;list-style:none}
.excel-menu summary::-webkit-details-marker {display:none}
.excel-menu summary::after {content:"▾";font-size:12px}
.excel-menu[open] summary::after {content:"▴"}
.excel-menu .report-files {position:absolute;right:0;top:calc(100% + 6px);width:min(260px,80vw);display:grid;justify-content:stretch;padding:10px;gap:7px;background:white;border:1px solid var(--ui-line);border-radius:15px;box-shadow:0 8px 28px #15485128}
.excel-menu .report-files button {width:100%}
@media(max-width:700px){
 .report-controls {width:100%;justify-content:space-between}
 .report-heading .month-select {display:block}
 .report-heading .month-select select {display:block;margin-top:3px}
}
.report-controls .excel-menu:only-child {margin-left:auto}
.brand-icon {display:block;flex:none;border-radius:24%;box-shadow:0 1px 3px #15485124}
.section-icon {display:grid;place-items:center;width:26px;height:26px;flex:none;border-radius:8px;background:linear-gradient(150deg,#258b8e,var(--ui-deep));box-shadow:inset 0 1px 1px #ffffff47}
.section-icon.max {background:linear-gradient(150deg,#219a9c,#08596e)}
.section-icon.users {background:linear-gradient(150deg,#427488,#254d65)}
nav .section-icon svg {display:block;width:21px;height:21px}
@media(max-width:700px){.entry .brand-icon{display:none}}

@media(max-width:700px){.entry .brand-title{max-width:56%}.entry .brand h1{font-size:clamp(23px,5.9vw,33px);line-height:1.04}}
