/* GovState reference: white masthead, Noto Sans, charcoal/slate and magenta.
   Orange is drawn from the supplied logo. Supplied images remain unchanged. */
:root {
  --ink: #231f20;
  --slate: #405866;
  --muted: #59636a;
  --orange: #eb7824;
  --orange-dark: #a44408;
  --magenta: #9d2064;
  --line: #dededb;
  --paper: #fff;
  --wash: #f3f3f0;
  --portal-background: url('./brand/bk_bg.png');
  font-family: 'Noto Sans', 'Segoe UI', Arial, sans-serif;
  font-size: 16px;
  color: var(--ink);
  font-synthesis: none;
  background: var(--wash);
}
* { box-sizing: border-box; }
/* Keep the portal at its vertical scroll boundaries without locking scrolling. */
html, body { overscroll-behavior-y: none; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: linear-gradient(#ffffff26, #ffffff12), var(--portal-background);
  background-size: cover;
  background-position: center bottom;
  background-attachment: fixed;
}
#main { flex: 1; width: 100%; }
.portal-shell { display: flex; flex-direction: column; flex: 1; width: 100%; min-width: 0; }
button, a, input { font: inherit; }
button, .button {
  border: 2px solid transparent;
  border-radius: 999px;
  padding: .65rem 1.1rem;
  background: var(--slate);
  color: white;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 44px;
}
button:hover:not(:disabled), .button:hover { background: var(--ink); color: white; }
button:disabled { opacity: .48; cursor: not-allowed; }
.secondary, .quiet { background: white; color: var(--slate); border-color: #aebbc1; }
.secondary:hover:not(:disabled), .quiet:hover:not(:disabled) { border-color: var(--orange); background: #fff6ed; color: var(--ink); }
a { color: var(--slate); text-underline-offset: .22rem; }
a:hover { color: var(--orange-dark); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--magenta); outline-offset: 4px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: 1rem; background: white; }
.skip-link:focus { top: 1rem; }
.masthead {
  background: white;
  color: var(--ink);
  border-top: 10px solid var(--ink);
  border-bottom: 1px solid #d4d7d8;
  padding: 1.25rem clamp(1.25rem, 3vw, 3rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  box-shadow: 0 2px 16px #231f200c;
}
.brand { display: flex; align-items: center; gap: 2rem; min-width: 0; }
.brand img { width: clamp(220px, 23vw, 300px); height: auto; display: block; flex-shrink: 0; }
.brand-mark { font-weight: 750; font-size: 1.8rem; }
.brand-description { border-left: 1px solid var(--line); padding-left: 2rem; max-width: 320px; }
.eyebrow { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .13em; line-height: 1.7; color: var(--slate); }
.account { display: none; gap: .7rem; align-items: center; font-size: .78rem; flex-wrap: wrap; justify-content: flex-end; max-width: 330px; }
.account:has(> :not([hidden])) { display: flex; }
.connection-card {
  max-width: 580px;
  margin: clamp(2rem, 8vh, 6rem) auto;
  padding: clamp(1.75rem, 4vw, 3rem);
  background: #fffffff5;
  border: 1px solid white;
  border-top: 4px solid var(--orange);
  border-radius: 3px;
  box-shadow: 0 18px 60px #231f2021;
}
.connection-card h1 { font-size: clamp(1.8rem, 3vw, 2.35rem); line-height: 1.2; letter-spacing: -.035em; margin: .8rem 0 1rem; font-weight: 650; }
.connection-card p { line-height: 1.7; color: var(--muted); }
.connection-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1rem; }
#setup-guide { border-top: 1px solid var(--line); margin-top: 1.7rem; padding-top: .5rem; }
code { font-family: ui-monospace, monospace; font-size: .9em; background: var(--wash); padding: .15rem .3rem; border-radius: 3px; overflow-wrap: anywhere; }
.landing { max-width: 1280px; margin: auto; padding: 2.5rem 2rem 4rem; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.5rem; background: #fffffff2; padding: 2rem; border-top: 4px solid var(--orange); }
.page-heading h1 { font-size: clamp(2rem, 3vw, 2.7rem); font-weight: 650; letter-spacing: -.04em; margin: .4rem 0 .6rem; }
.page-heading p { margin: 0; color: var(--muted); }
.mode-switch { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 4px; background: white; gap: 3px; }
.mode-switch button { font-size: .85rem; white-space: nowrap; }
.mode-switch button:disabled { background: transparent; color: var(--muted); opacity: .7; }
.category { background: #fffffff7; border: 1px solid white; border-left: 4px solid var(--orange); padding: 1.6rem 1.8rem; margin-bottom: 1rem; box-shadow: 0 4px 16px #231f2008; }
.category h2 { margin: 0 0 1.3rem; font-size: 1.35rem; font-weight: 650; padding-bottom: .9rem; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.subcategories { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 195px), 1fr)); gap: 1.5rem 2rem; }
.subcategory h3 { font-size: .95rem; margin: 0 0 .6rem; color: var(--slate); }
.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.menu-link { line-height: 1.5; text-decoration: none; display: inline-block; font-size: .92rem; padding: .3rem 0; overflow-wrap: anywhere; }
.menu-link::after { content: ' →'; color: var(--orange-dark); margin-left: .25rem; }
.menu-link:hover { text-decoration: underline; }
/* Default landing: a single continuous panel, following the supplied SLIP
   reference. The original card treatment remains available via ?layout=cards. */
body[data-layout="reference"]:not([data-page="detail"]) .portal-shell { flex: 0 0 auto; max-width: 1140px; width: calc(100% - 3rem); margin: 1rem auto 2rem; background: #fffffff0; border: 1px solid #ffffffa6; border-radius: 14px; box-shadow: 0 12px 40px #231f2012; }
body[data-layout="reference"]:not([data-page="detail"]) .masthead { border: 0; box-shadow: none; background: transparent; padding: 1.5rem 3.5rem .5rem; display: block; }
body[data-layout="reference"]:not([data-page="detail"]) .brand { gap: 1.7rem; align-items: center; }
body[data-layout="reference"]:not([data-page="detail"]) .brand img { width: 230px; max-width: 30%; }
body[data-layout="reference"]:not([data-page="detail"]) .brand-description { border: 0; padding: 0; max-width: none; flex: 1; }
body[data-layout="reference"]:not([data-page="detail"]) #portal-subtitle { display: block; font-size: clamp(1.3rem, 2.2vw, 1.85rem); font-weight: 650; line-height: 1.3; text-transform: none; letter-spacing: -.025em; color: var(--orange-dark); }
body[data-layout="reference"]:not([data-page="detail"]) .account { max-width: none; margin-top: .8rem; justify-content: flex-end; color: var(--muted); }
body[data-layout="reference"] .landing { max-width: none; width: 100%; margin: 0; padding: .5rem 3.5rem 2.5rem; }
body[data-layout="reference"] .page-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; padding: 0; margin: 0; }
body[data-layout="reference"] .page-heading .eyebrow { display: none; }
body[data-layout="reference"] .page-heading h1 { font-size: 1.45rem; letter-spacing: -.02em; margin: 0; color: var(--slate); }
body[data-layout="reference"] .category { background: transparent; border: 0; box-shadow: none; padding: 0; margin: 0 0 2rem; }
body[data-layout="reference"] .category:last-child { margin-bottom: 0; }
body[data-layout="reference"] .category h2 { display: block; text-align: right; color: var(--orange-dark); border-bottom: 1px solid var(--orange); font-size: 1.2rem; font-weight: 450; padding: 0 0 .3rem; margin: 0 0 .65rem; overflow-wrap: anywhere; }
body[data-layout="reference"] #landing-menu .subcategories { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.5rem 1.4rem; }
body[data-layout="reference"] #landing-menu .subcategory h3 { color: var(--ink); font-size: .9rem; font-weight: 650; margin-bottom: .35rem; overflow-wrap: anywhere; }
body[data-layout="reference"] #landing-menu .link-list { gap: .15rem; }
body[data-layout="reference"] #landing-menu .menu-link { color: var(--orange-dark); font-size: .83rem; line-height: 1.55; padding: .2rem 0; }
body[data-layout="reference"] #landing-menu .menu-link::after { content: none; }
@media (max-width: 1050px) {
  body[data-layout="reference"] .landing { padding: .5rem 2rem 2rem; }
  body[data-layout="reference"]:not([data-page="detail"]) .masthead { padding: 1.5rem 2rem .5rem; }
  body[data-layout="reference"] #landing-menu .subcategories { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  body[data-layout="reference"]:not([data-page="detail"]) .portal-shell { width: calc(100% - 2rem); margin: 1rem auto; }
  body[data-layout="reference"]:not([data-page="detail"]) .masthead { padding: 1.4rem 1.4rem .5rem; }
  body[data-layout="reference"]:not([data-page="detail"]) .brand { flex-direction: column; align-items: flex-start; gap: 1rem; }
  body[data-layout="reference"]:not([data-page="detail"]) .brand img { width: 220px; max-width: 100%; }
  body[data-layout="reference"] .landing { padding: .5rem 1.4rem 1.4rem; }
  body[data-layout="reference"] .page-heading { align-items: flex-end; }
  body[data-layout="reference"] #landing-menu .subcategories { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 400px) {
  body[data-layout="reference"] #landing-menu .subcategories { grid-template-columns: minmax(0, 1fr); }
}
.empty, .notice { background: white; border: 1px solid var(--line); padding: 1.5rem; }
.notice { margin-bottom: 1.2rem; background: #fff6ed; font-size: .9rem; border-left: 4px solid var(--orange); }
.empty h2 { font-size: 1.3rem; }
.empty p { color: var(--muted); line-height: 1.6; }
.detail { padding: 0 1.5rem; background: #f7f7f5f7; }
/* Anchor the floating menu below the full masthead, with categories beside the logo. */
body[data-page="detail"] .masthead { position: relative; z-index: 5; padding: 0 1.5rem; gap: 1.5rem; }
body[data-page="detail"] .brand { flex: 0 0 auto; width: auto; padding: 1rem 0; }
body[data-page="detail"] .brand img { width: 200px; max-width: none; }
body[data-page="detail"] .brand-description { display: none; }
#mega-menu { display: flex; align-self: stretch; align-items: stretch; flex-wrap: wrap; gap: .1rem; position: static; flex: 1; min-width: 0; }
.mega-category { position: static; }
.mega-category summary { list-style: none; cursor: pointer; display: flex; align-items: center; height: 100%; padding: .75rem .8rem; font-weight: 600; color: var(--ink); font-size: .9rem; border-bottom: 3px solid transparent; }
.mega-category summary::-webkit-details-marker { display: none; }
.mega-category summary::after { content: ' ▾'; color: var(--orange-dark); }
.mega-category[open] summary, .mega-category summary:hover { background: var(--wash); border-bottom-color: var(--orange); }
.mega-panel { position: absolute; left: 0; right: 0; top: 100%; background: white; box-shadow: 0 15px 25px #231f2022; border-bottom: 3px solid var(--orange); padding: 1.5rem 2rem; max-height: 65vh; overflow: auto; }
.view-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 0; }
.view-location { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
#home { flex-shrink: 0; font-size: .8rem; }
.breadcrumb { font-size: .85rem; color: var(--muted); line-height: 1.5; margin: 0; }
.view-actions, .export-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.view-actions button { font-size: .8rem; padding: .5rem .85rem; }
.export-actions { gap: 2px; }
.export-actions button { border-radius: 0; }
.export-actions button:first-child { border-radius: 999px 0 0 999px; }
.export-actions button:last-child { border-radius: 0 999px 999px 0; }
.view-title { font-size: 1.25rem; font-weight: 650; margin: .2rem 0 .6rem; }
.view-feedback { display: flex; align-items: center; gap: .8rem; }
.view-status { color: var(--muted); font-size: .9rem; margin: .4rem 0 .8rem; }
.view-status:empty { display: none; }
.view-status.error { color: #912d24; }
.view-container { height: var(--view-height, 60vh); min-height: 0; background: white; border: 1px solid var(--line); overflow: hidden; }
.view-container tableau-viz { display: block; width: 100%; height: 100%; }
footer { margin-top: auto; width: 100%; padding: 1.1rem clamp(1.25rem, 3vw, 3rem); color: var(--slate); background: #fffffff2; border-top: 1px solid white; display: flex; justify-content: space-between; gap: 1rem; font-size: .72rem; }
body:not([data-page="detail"]) > footer { display: none; }
.auth-overlay { position: fixed; inset: 0; background: #231f20b8; z-index: 20; }
.bootstrap-shell { position: fixed; inset: 3vh 5vw; background: white; z-index: 21; border-top: 4px solid var(--orange); border-radius: 4px; display: flex; flex-direction: column; padding: 1.2rem; box-shadow: 0 20px 80px #0006; }
/* Keep the transparent frame in the viewport: offscreen cross-origin frames
   can have their timers throttled to one second. JS also sets inert/aria-hidden. */
.bootstrap-shell.background { left: 0; top: 0; right: auto; bottom: auto; width: 1100px; height: 800px; pointer-events: none; opacity: 0; }
.auth-heading h2 { margin: .4rem 0; font-size: 1.4rem; }
.bootstrap-shell > p { color: var(--muted); line-height: 1.5; font-size: .9rem; margin: .5rem 0; }
.bootstrap-container { flex: 1; min-height: 230px; border: 1px solid var(--line); margin: .6rem 0; overflow: auto; }
.bootstrap-container tableau-viz { display: block; width: 100%; height: 100%; }
.auth-footer { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.bootstrap-shell .fine-print { font-size: .8rem; }
.modal-open { overflow: hidden; }
.diagnostic-link { background: transparent; border: 0; color: var(--slate); border-radius: 0; padding: .2rem 0; min-height: 28px; font-size: .75rem; text-decoration: underline; font-weight: 400; align-self: center; }
.diagnostic-link:hover:not(:disabled) { background: transparent; color: var(--orange-dark); }
noscript { display: block; padding: 2rem; background: white; color: #912d24; }

/* Indeterminate loading: an orbit around three gently rising analytics bars.
   Decorative only; adjacent status text supplies the accessible description. */
.loading-mark { --loader-size: 82px; position: relative; width: var(--loader-size); height: var(--loader-size); display: flex; align-items: center; justify-content: center; gap: 5px; flex-shrink: 0; margin: 0 0 1.7rem; border-radius: 50%; background: #fff6ed; }
.loading-mark::before { content: ''; position: absolute; inset: 0; border: 2px solid #d8dfdf; border-top-color: var(--orange); border-right-color: var(--orange); border-radius: 50%; animation: orbit 1.7s linear infinite; }
.loading-mark::after { content: ''; position: absolute; inset: 7px; border: 1px solid #eb782420; border-radius: 50%; }
.loading-mark span { width: 6px; height: 20px; border-radius: 2px; background: var(--slate); transform-origin: center bottom; animation: rise 1.25s ease-in-out infinite; }
.loading-mark span:nth-child(2) { height: 30px; background: var(--orange); animation-delay: .15s; }
.loading-mark span:nth-child(3) { height: 24px; animation-delay: .3s; }
.loading-mark--small { --loader-size: 36px; margin: 0 0 .5rem; gap: 3px; }
.loading-mark--small span { width: 3px; height: 10px; }
.loading-mark--small span:nth-child(2) { height: 15px; }
.loading-mark--small span:nth-child(3) { height: 12px; }
.loading-mark--small::after { inset: 4px; }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes rise { 0%, 100% { transform: scaleY(.65); opacity: .65; } 50% { transform: scaleY(1); opacity: 1; } }
@media (max-width: 1050px) {
  .brand { gap: 1.2rem; }
  .brand-description { padding-left: 1.2rem; }
  .masthead { gap: 1.2rem; }
  .account { max-width: 240px; }
}
@media (max-width: 800px) {
  .masthead { padding: 1.2rem; align-items: flex-start; flex-direction: column; gap: 1rem; }
  .brand { width: 100%; justify-content: space-between; }
  .brand img { width: 235px; max-width: 48%; }
  .brand-description { max-width: 48%; }
  .brand .eyebrow { font-size: .6rem; }
  .account { justify-content: flex-start; max-width: 100%; }
  .page-heading { align-items: flex-start; flex-direction: column; padding: 1.4rem; }
  .landing { padding: 1.5rem 1rem 3rem; }
  .category { padding: 1.2rem; }
  body[data-page="detail"] .masthead { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: 0 1rem; }
  body[data-page="detail"] .brand { padding: .75rem 0; }
  body[data-page="detail"] .brand img { width: 135px; }
  body[data-page="detail"] #mega-menu { min-width: 0; }
  body[data-page="detail"] .mega-category summary { font-size: .8rem; padding: .65rem .5rem; overflow-wrap: anywhere; }
  body[data-page="detail"] .account { flex-basis: 100%; }
  .view-heading { align-items: flex-start; flex-direction: column; }
  .bootstrap-shell { inset: 1vh 2vw; }
  .auth-footer { justify-content: flex-start; }
  .auth-footer .button, .auth-footer button { font-size: .8rem; }
  footer { flex-direction: column; gap: .35rem; }
  .connection-card { margin: 2rem 1rem; max-width: none; }
  .mega-panel { padding: 1rem; }
  body { background-attachment: scroll; }
}
@media (max-width: 440px) {
  .brand { align-items: flex-start; flex-direction: column; gap: 1rem; }
  .brand img { width: 250px; max-width: 100%; }
  .brand-description { max-width: none; border-left: 0; padding: 0; }
  .category h2 { font-size: 1.15rem; }
}
@media (prefers-reduced-motion: no-preference) {
  button, a, summary { transition: background-color .15s, color .15s, border-color .15s; }
}
@media (prefers-reduced-motion: reduce) {
  .loading-mark::before, .loading-mark span { animation: none; }
  button, a, summary { transition: none; }
}
