/* Five9 round-2 frame. Adapted from the Webex lab kit (banner, drawer, dock).
   One banner row. Menu sits at the top left. The drawer slides. No utility strip. */

:root {
  --dock-h: 72px;
  --head-h: 64px;
  --banner-h: 52px;
  --ink: #142033;
  --muted: #334155;
  --bg: #f4f7ff;
  --card: #ffffff;
  --line: rgba(15, 23, 42, 0.14);
  --accent: #0f766e;
  --focus: #7c3aed;
  --sans: "Segoe UI", system-ui, -apple-system, sans-serif;
}

html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 18px/1.5 var(--sans);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(34, 211, 238, 0.35), transparent 60%),
    radial-gradient(800px 380px at 100% 0%, rgba(244, 114, 182, 0.32), transparent 55%),
    radial-gradient(700px 360px at 50% 120%, rgba(250, 204, 21, 0.28), transparent 50%),
    var(--bg);
  padding-bottom: var(--dock-h);
  min-height: 100%;
}
html[data-font="sm"] body { font-size: 16px; }
html[data-font="md"] body { font-size: 18px; }
html[data-font="lg"] body { font-size: 21px; }
html[data-font="xl"] body { font-size: 24px; }

a { color: #0b3a8f; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.skip {
  position: absolute; left: 8px; top: -40px; background: #fff; color: #111; padding: 8px 12px; z-index: 100;
}
.skip:focus { top: 8px; }

.chrome-stack {
  position: sticky;
  top: 12px;
  z-index: 40;
  margin: 12px 12px 0;
  border-radius: 26px;
  overflow: hidden;
  background: transparent;
  border: 2px solid transparent;
  background:
    linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,.04)) padding-box,
    linear-gradient(120deg, #22d3ee, #a78bfa, #f472b6, #facc15) border-box;
  box-shadow:
    0 18px 40px rgba(49, 46, 129, 0.35),
    0 0 28px rgba(34, 211, 238, 0.35),
    inset 0 1px 0 rgba(255,255,255,.45);
}
html { scroll-padding-top: calc(var(--head-h) + var(--banner-h) + 36px); }
.site-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--head-h);
  max-height: var(--head-h);
  padding: 0 12px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.menu-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 2px solid #7c3aed;
  background: linear-gradient(135deg, #5b21b6, #9d174d);
  color: #fff;
  font: 700 16px/1 var(--sans);
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.55);
  cursor: pointer;
}
.brand {
  display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; min-width: 0;
}
.brand strong { display: block; font-size: 1.05rem; white-space: nowrap; }
.brand small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.head-tools::-webkit-scrollbar { display: none; }
.head-tools label { display: inline-flex; align-items: center; gap: 4px; font-size: 0.85rem; white-space: nowrap; color: var(--ink); }
.head-tools select {
  appearance: none;
  min-height: 36px;
  border-radius: 10px;
  border: 2px solid #5b21b6;
  background: #ffffff;
  color: #1e1b4b;
  font: 700 0.85rem/1 var(--sans);
  padding: 0 8px;
}
.head-tools input[type="color"] {
  width: 44px;
  height: 36px;
  padding: 2px;
  border: 2px solid #5b21b6;
  border-radius: 10px;
  background: #ffffff;
}
.ghost-btn, .text-btn {
  appearance: none;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 2px solid #5b21b6;
  background: #ede9fe;
  color: #1e1b4b;
  font: 700 0.85rem/1 var(--sans);
  cursor: pointer;
  white-space: nowrap;
}

.canon-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  height: var(--banner-h);
  max-height: var(--banner-h);
  overflow: hidden;
  padding: 0 8px;
  background:
    linear-gradient(115deg, #042f2e 0%, #1e1b4b 42%, #4c1d95 72%, #9d174d 100%);
  color: #f8fafc;
}
.rail-arrow {
  flex: none; width: 36px; height: 36px; border-radius: 999px; border: 1px solid rgba(255,255,255,.45);
  background: rgba(255,255,255,.12); color: #fff; font-size: 1.3rem; cursor: pointer;
}
.section-rail {
  display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; overflow-y: hidden;
  overscroll-behavior-x: contain;
  flex: 1 1 0; width: 0; min-width: 0; max-width: 100%;
  height: 40px; max-height: 40px; scrollbar-width: none;
}
.section-rail::-webkit-scrollbar { display: none; }
.section-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  height: 36px; padding: 0 12px;
  border-radius: 14px; text-decoration: none; color: #082f49; font-weight: 800; font-size: 0.92rem;
  background: linear-gradient(160deg, #fff, #e0f2fe 40%, #fbcfe8);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 6px 0 rgba(15, 23, 42, 0.28), 0 0 14px rgba(34, 211, 238, 0.55);
  transform: perspective(240px) rotateX(8deg);
  transition: transform .18s ease, box-shadow .18s ease;
}
html[data-motion="full"] .section-chip:hover {
  transform: perspective(240px) rotateX(0deg) translateY(-3px);
  box-shadow: 0 10px 0 rgba(15, 23, 42, 0.28), 0 0 18px rgba(244, 114, 182, 0.7);
}
.section-chip[aria-current="page"], .section-chip.is-reading {
  background: linear-gradient(135deg, #fef08a, #67e8f9);
  box-shadow: 0 0 18px #f472b6;
}
.chip-ico { width: 18px; height: 18px; display: grid; place-items: center; }

.drawer-back {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 70;
  opacity: 0; pointer-events: none; transition: opacity .35s ease;
}
.drawer-back.is-open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: min(440px, 92vw); z-index: 80;
  background: var(--card); color: var(--ink);
  transform: translateX(-105%);
  transition: transform .35s ease;
  display: flex; flex-direction: column;
  box-shadow: 12px 0 40px rgba(0,0,0,.25);
}
.drawer.is-open { transform: translateX(0); }
.drawer-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.drawer-bar p { margin: 0; font-weight: 800; }
.drawer-list { list-style: none; margin: 0; padding: 8px; overflow: auto; }
.drawer-list a {
  display: grid; grid-template-columns: 42px 1fr; gap: 10px; align-items: center;
  padding: 10px; border-radius: 14px; text-decoration: none; color: inherit; min-height: 64px;
}
.drawer-list a:hover, .drawer-list a:focus-visible { background: color-mix(in srgb, #22d3ee 18%, var(--card)); }
.drawer-list .row-ico {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
  background: linear-gradient(145deg, #67e8f9, #f472b6); color: #082f49; font-size: 1.2rem;
  box-shadow: 0 0 12px rgba(244, 114, 182, 0.45);
}
.drawer-list strong { display: block; }
.drawer-list small { display: block; color: var(--muted); font-size: 0.88rem; line-height: 1.3; }
.drawer-search { padding: 8px 12px 12px; }
.drawer-search input {
  appearance: none;
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 2px solid #5b21b6;
  padding: 0 12px;
  font: 700 16px/1.2 var(--sans);
  background: #ffffff;
  color: #142033;
}

main { padding: 20px clamp(16px, 3vw, 36px) 40px; max-width: none; margin: 0; }
main h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; margin: 0 0 8px; }
main h2 { font-size: 1.35rem; margin: 0 0 8px; }
.lede { font-size: 1.1rem; max-width: 68ch; }
.card, .room-card, section.panel {
  background:
    linear-gradient(180deg, #ffffff, #f5f3ff) padding-box,
    linear-gradient(135deg, #22d3ee, #a78bfa 45%, #f472b6) border-box;
  border: 2px solid transparent;
  border-radius: 18px;
  padding: 16px;
  margin: 14px 0;
  box-shadow: 0 12px 28px rgba(76, 29, 149, 0.12), 0 0 18px rgba(34, 211, 238, 0.16);
}
.track-grid, .card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.room-card { display: block; text-decoration: none; color: inherit; min-height: 120px; transition: transform .2s ease, box-shadow .2s ease; }
.room-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(124, 58, 237, 0.22), 0 0 22px rgba(244, 114, 182, 0.45);
}
.kicker { font-size: 0.82rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #7c3aed; margin: 0 0 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.actions a, .choice-card {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 12px;
  text-decoration: none; font-weight: 700; color: #082f49;
  background: linear-gradient(135deg, #a7f3d0, #67e8f9 40%, #f9a8d4);
  border: 2px solid #0f766e;
}

.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.dl-row { display: flex; flex-wrap: wrap; gap: 6px; }
.dl-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 10px;
  border-radius: 999px; text-decoration: none; font-weight: 800; font-size: 0.82rem; color: #082f49;
  background: linear-gradient(135deg, #fef08a, #86efac, #67e8f9);
  border: 2px solid #0f766e; box-shadow: 0 0 0 0 transparent;
}
.dl-btn:hover { box-shadow: 0 0 12px rgba(34, 211, 238, 0.7); }
.figure { overflow: auto; background: #041018; border-radius: 14px; padding: 8px; }
.figure svg { width: 100%; height: auto; display: block; }
.quiz label { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; }
.quiz-why { margin: 6px 0 0; }
.is-spoken { background: #fef08a; color: #1c1917; border-radius: 6px; box-shadow: 0 0 0 3px #facc15; }
section.is-reading {
  outline: 3px solid #22d3ee;
  box-shadow: 0 0 0 6px rgba(34, 211, 238, 0.35), 0 0 32px rgba(250, 204, 21, 0.85);
}
.callout { border-left: 4px solid #d97706; padding: 8px 12px; background: #fff7ed; color: #431407; border-radius: 8px; }
.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); text-align: left; padding: 8px; vertical-align: top; }
.note { color: var(--muted); }

.phone-dock {
  display: grid;
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 320px));
  height: 56px;
  z-index: 66;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-radius: 24px;
  border: 2px solid transparent;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(49, 46, 129, 0.9)) padding-box,
    linear-gradient(120deg, #22d3ee, #a78bfa, #f472b6, #facc15) border-box;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.4), 0 0 24px rgba(167, 139, 250, 0.55);
  padding-bottom: 0;
}
.phone-dock a, .phone-dock button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: #f8fafc; background: transparent; border: 0; font: 700 11px/1.1 var(--sans); min-width: 0;
  border-radius: 16px;
}
.phone-dock .dock-ico { font-size: 1.15rem; filter: drop-shadow(0 0 6px #22d3ee); }
.phone-dock [data-open-menu] { background: linear-gradient(135deg, #5b21b6, #9d174d); color: #fff; }
.phone-dock a[aria-current="page"] { color: #7c3aed; }

.lane-copy { max-width: 58ch; }
@media (min-width: 1100px) {
  .card-grid, .figure, .stat-row, .section-head { margin-right: 280px; }
  #main > h1 { max-width: calc(100% - 280px); }
  .lane-copy { max-width: min(58ch, calc(100% - 300px)); }
}
@media (max-width: 720px) {
  :root { --dock-h: 72px; }
  .phone-dock { width: calc(100vw - 16px); left: 8px; transform: none; }
  main { padding-bottom: 16px; }
  .brand small { display: none; }
  .head-tools .ghost-btn { display: none; }
  .chrome-stack { margin: 8px 8px 0; top: 8px; max-width: calc(100vw - 16px); }
  .canon-banner {
    height: auto;
    max-height: 156px;
    align-items: stretch;
    padding: 8px;
    min-width: 0;
  }
  .rail-arrow { display: none; }
  .section-rail {
    flex-wrap: wrap;
    align-content: flex-start;
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    height: auto;
    max-height: 140px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .section-chip,
  html[data-motion="full"] .section-chip,
  html[data-motion="full"] .section-chip:hover { transform: none; }
}
@media (max-width: 720px) and (max-height: 520px) {
  :root { --head-h: 48px; --dock-h: 64px; }
  body:has(#cg-panel:not([hidden])) .chrome-stack,
  body:has(#cg-panel:not([hidden])) .phone-dock { display: none; }
  .head-tools { display: none; }
  .canon-banner {
    height: 40px;
    max-height: 40px;
    padding: 4px 6px;
  }
  .section-rail {
    flex-wrap: nowrap;
    align-content: center;
    max-height: 32px;
    height: 32px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .section-chip { padding: 4px 8px; font-size: 0.78rem; }
  .phone-dock { height: 52px; bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .section-chip { transform: none; transition: none; }
  .drawer, .drawer-back { transition: none; }
}
.sources-deeper {
  margin: 16px 0 8px;
  padding: 14px 16px 10px;
  border: 2px solid #5b21b6;
  border-radius: 16px;
  background: #f5f3ff;
  color: #1e1b4b;
}
.sources-deeper h2 { margin: 0 0 8px; color: #1e1b4b; }
.sources-deeper li { margin: 8px 0; }
.sources-deeper a { color: #1d4ed8; font-weight: 700; }
.sources-deeper .source-kind { font-size: 0.78rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #5b21b6; }
html[data-theme="dark"] .sources-deeper { background: #1e1b4b; border-color: #c4b5fd; color: #f8fafc; }
html[data-theme="dark"] .sources-deeper h2,
html[data-theme="dark"] .sources-deeper .source-kind { color: #e9d5ff; }
html[data-theme="dark"] .sources-deeper a { color: #93c5fd; }
.cite-block { margin: 0 0 16px; }
.cite-block h3 { margin: 0 0 6px; }
.cite-line { margin: 6px 0 0; font-size: 0.95rem; }
@media print {
  .site-head, .canon-banner, .phone-dock, .drawer, .drawer-back, .dl-row { display: none !important; }
  body { background: #fff; padding: 0; }
}
