/*
 * Primer earnings calendar.
 * Studio's design language (design system v3.6: the mono grey scale, white matte surfaces with hairline borders,
 * Inter for UI and JetBrains Mono for numbers and tickers, small radii, 9-10px uppercase labels) with Primer's brand:
 * the Primer mark, Newsreader for display titles, and green only for actions and the selected or current day.
 * The dark theme keeps the same scale inverted.
 */

:root {
  --mono-50: #f9fafb;
  --mono-100: #f3f4f6;
  --mono-200: #e5e7eb;
  --mono-300: #d1d5db;
  --mono-400: #9ca3af;
  --mono-500: #6b7280;
  --mono-600: #4b5563;
  --mono-700: #374151;
  --mono-800: #1f2937;
  --mono-900: #111827;
  --mono-950: #030712;

  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-2: var(--mono-50);
  --hover: var(--mono-50);
  --line: var(--mono-200);
  --line-soft: var(--mono-100);
  --line-strong: var(--mono-300);
  --ink: var(--mono-950);
  --ink-2: var(--mono-700);
  --muted: var(--mono-500);
  --faint: var(--mono-400);
  --code-bg: var(--mono-50);
  --logo-ink: #383838;
  --logo-tile: #ffffff;
  --avatar-bg: var(--mono-100);
  --volume: var(--mono-300);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-pop: 0 12px 32px rgba(17, 24, 39, 0.12), 0 2px 6px rgba(17, 24, 39, 0.06);

  /* Primer green: actions, the selected day, today */
  --brand-green: #4aea8b;
  --green: #1cae54;
  --green-ink: #0f7c3b;
  --green-soft: rgba(28, 174, 84, 0.09);
  --green-ring: rgba(28, 174, 84, 0.22);
  --on-green: #04140a;

  /* event types and statuses (Studio) */
  --results: #6889c7;
  --update: #4a9e82;
  --meeting: #a07ec8;
  --investor: #e8913a;
  --confirmed: #4a9e82;
  --estimated: #d97706;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", Menlo, Monaco, Consolas, monospace;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --page: 1200px;
  --gutter: 24px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d10; --surface: #121418; --surface-2: #171a1f; --hover: #181b21; --line: #23272e; --line-soft: #1b1e24;
    --line-strong: #30353d; --ink: #f3f4f6; --ink-2: #d1d5db; --muted: #9ca3af; --faint: #6b7280; --code-bg: #0e1013;
    --logo-ink: #e5e7eb; --logo-tile: #eceef1; --avatar-bg: #1b1e24; --volume: #3a4049;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-pop: 0 14px 36px rgba(0, 0, 0, 0.55);
    --green-ink: #7ffaae; --green-soft: rgba(74, 234, 139, 0.08); --green-ring: rgba(74, 234, 139, 0.24);
    --results: #8ba6d9; --update: #5fb89a; --meeting: #b598d9; --investor: #f0a35a; --confirmed: #5fb89a; --estimated: #f0a35a;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b0d10; --surface: #121418; --surface-2: #171a1f; --hover: #181b21; --line: #23272e; --line-soft: #1b1e24;
  --line-strong: #30353d; --ink: #f3f4f6; --ink-2: #d1d5db; --muted: #9ca3af; --faint: #6b7280; --code-bg: #0e1013;
  --logo-ink: #e5e7eb; --logo-tile: #eceef1; --avatar-bg: #1b1e24; --volume: #3a4049;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-pop: 0 14px 36px rgba(0, 0, 0, 0.55);
  --green-ink: #7ffaae; --green-soft: rgba(74, 234, 139, 0.08); --green-ring: rgba(74, 234, 139, 0.24);
  --results: #8ba6d9; --update: #5fb89a; --meeting: #b598d9; --investor: #f0a35a; --confirmed: #5fb89a; --estimated: #f0a35a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-padding-top: 72px; }
body {
  min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink);
  font: 13px/1.5 var(--sans); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11" 1;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 6px; }
.label { font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.display { margin: 0; font-family: var(--serif); font-weight: 400; letter-spacing: -0.015em; line-height: 1.1; font-optical-sizing: auto; }
.display .soft { color: var(--faint); }
.icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- logo ------------------------------------------------------------------------------------------------------ */
.logo-mark, .logo-word { display: block; height: 18px; width: auto; fill: var(--logo-ink); flex: none; }
.logo-mark .logo-green { fill: var(--brand-green); }

/* ---- top bar --------------------------------------------------------------------------------------------------- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner {
  height: 56px; max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 1fr minmax(0, 440px) 1fr; align-items: center; gap: 20px;
}
.brand { justify-self: start; display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.brand .product {
  margin-left: 9px; padding-left: 12px; border-left: 1px solid var(--line); font-size: 12.5px; font-weight: 500;
  color: var(--muted); white-space: nowrap; line-height: 18px;
}
.brand:hover .product { color: var(--ink-2); }
.search { position: relative; width: 100%; }
.search-icon { position: absolute; left: 11px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%); fill: var(--faint); pointer-events: none; }
.search input {
  width: 100%; height: 34px; padding: 0 34px 0 32px; font-size: 12.5px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; transition: border-color .15s, box-shadow .15s, background .15s;
}
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-ring); background: var(--surface); }
.search input::-webkit-search-cancel-button { display: none; }
.search-key {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 10px/16px var(--mono); color: var(--faint);
  border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; background: var(--surface); pointer-events: none;
}
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 4px; list-style: none; z-index: 40;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop);
  max-height: 70vh; overflow: auto;
}
.search-results a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; }
.search-results a:hover, .search-results a.focus { background: var(--hover); }
.search-results .who { flex: 1; min-width: 0; }
.search-results .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-results .sub { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-results .ticker { font-family: var(--mono); font-size: 10.5px; }
.search-results .next-up { font-size: 11px; color: var(--muted); text-align: right; white-space: nowrap; }
.search-results .next-up b { display: block; color: var(--ink-2); font-weight: 500; }
.search-results .next-up.locked { display: inline-flex; align-items: center; gap: 5px; color: var(--faint); }
.search-results .next-up.locked .icon { width: 12px; height: 12px; }
.search-results .none { padding: 10px; color: var(--muted); font-size: 12px; }

.tools { justify-self: end; display: inline-flex; align-items: center; gap: 4px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap;
}
.nav-link .icon { display: none; }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--ink); }
.nav-link[aria-current="page"] { background: var(--hover); }
.icon-button { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); }
.icon-button:hover, .icon-button[aria-expanded="true"] { background: var(--hover); color: var(--ink); }
.account { display: inline-flex; align-items: center; margin-left: 4px; }
.avatar-button {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600;
  background: var(--ink); color: var(--surface); transition: box-shadow .15s;
}
.avatar-button:hover, .avatar-button[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--green-ring); }

/* ---- popovers: settings and the account menu ------------------------------------------------------------------ */
.pop-anchor { position: relative; }
.popover {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 45; min-width: 240px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop);
}
.popover.settings { width: 272px; padding: 14px; display: grid; gap: 14px; }
.pop-section { display: grid; gap: 7px; }
.pop-note { margin: 0; font-size: 11px; color: var(--muted); }
.pop-note .mono { font-size: 10.5px; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.menu-email { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; margin-top: 2px; }
.menu-item {
  width: 100%; display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 6px; text-align: left;
  font-size: 12.5px; color: var(--ink-2);
}
.menu-item:hover { background: var(--hover); color: var(--ink); }
.menu-item .icon { width: 15px; height: 15px; color: var(--muted); }

/* ---- shared controls ------------------------------------------------------------------------------------------- */
.segmented { display: inline-flex; padding: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; }
.segmented.full { display: flex; }
.segmented.full button { flex: 1; }
.segmented button { height: 26px; padding: 0 11px; border-radius: 5px; font-size: 11.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.segmented button:hover { color: var(--ink); }
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 0 0 1px var(--line); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.stepper button { height: 30px; padding: 0 11px; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.stepper button + button { border-left: 1px solid var(--line); }
.stepper button:hover { background: var(--hover); color: var(--ink); }
.stepper .arrow { width: 30px; padding: 0; display: grid; place-items: center; }
.stepper .arrow .icon { width: 14px; height: 14px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 12px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 6px; font-size: 12px; font-weight: 500;
  color: var(--ink-2); box-shadow: var(--shadow); white-space: nowrap;
}
.button:hover { color: var(--ink); border-color: var(--line-strong); }
.button.small { height: 28px; padding: 0 11px; font-size: 11.5px; }
.button.primary { background: var(--green); border-color: var(--green); color: var(--on-green); font-weight: 600; }
.button.primary:hover { filter: brightness(1.06); color: var(--on-green); }
.button.danger:hover { color: #c2410c; border-color: rgba(194, 65, 12, 0.4); }
.button:disabled { opacity: .55; cursor: default; }
.text-button { color: var(--green-ink); font-weight: 500; }
.text-button:hover { text-decoration: underline; text-underline-offset: 2px; }
.link { color: var(--green-ink); font-weight: 500; }
.link:hover { text-decoration: underline; text-underline-offset: 2px; }
.select {
  height: 30px; font-size: 12px; font-weight: 500; color: var(--ink-2); background-color: transparent; max-width: 180px;
  border: 1px solid transparent; border-radius: 6px; padding: 0 24px 0 8px; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%);
  background-position: calc(100% - 12px) 13px, calc(100% - 8px) 13px; background-size: 4px 4px; background-repeat: no-repeat;
}
.select:hover { border-color: var(--line); background-color: var(--surface); }
.select.on { color: var(--ink); }
.select option { color: var(--ink); background: var(--surface); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; background: var(--faint); }
.dot.results { background: var(--results); }
.dot.update, .dot.updates { background: var(--update); }
.dot.agm, .dot.egm, .dot.meetings { background: var(--meeting); }
.dot.investor_day, .dot.investor { background: var(--investor); }

/* underline tabs: the calendar's event types, the company page's sections */
.tabs { display: flex; gap: 22px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; font-size: 12.5px; font-weight: 500; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap; flex: none;
}
.tab .short { display: none; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); border-bottom-color: var(--green); }
.tab .count { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }

/* ---- page ------------------------------------------------------------------------------------------------------ */
.view { flex: 1; width: 100%; max-width: var(--page); margin: 0 auto; padding: 28px var(--gutter) 80px; }
.cal-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px 16px; margin-bottom: 14px; }
.cal-head .display { font-size: 34px; }
.cal-controls { display: inline-flex; align-items: center; gap: 8px; }
/* the hairline under tabs is an inset shadow, so a tab's own underline sits on it (a border would be clipped by the scroller) */
.filter-row { display: flex; align-items: center; gap: 16px; box-shadow: inset 0 -1px 0 var(--line); margin-bottom: 18px; }
.filter-row .tabs { flex: 1; }

/* ---- week ------------------------------------------------------------------------------------------------------ */
.week {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 30px;
}
.wtile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 12px 14px 14px;
  text-align: left; border-left: 1px solid var(--line-soft); min-width: 0; transition: background .12s;
}
.wtile:first-child { border-left: 0; }
.wtile:hover { background: var(--hover); }
.wtile .wday { font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.wtile .wnum { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.wtile .wcount { font-size: 11px; color: var(--muted); white-space: nowrap; }
.wtile .wcount b { font-family: var(--mono); font-weight: 500; color: var(--ink-2); font-size: 11px; }
.wtile.weekend .wnum { color: var(--faint); }
.wtile.today .wday, .wtile.today .wnum { color: var(--green-ink); }
.wtile.on { background: var(--green-soft); }
.wtile.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--green); }
.volume { display: block; width: 100%; height: 2px; margin-top: 9px; border-radius: 1px; background: var(--line-soft); overflow: hidden; }
.volume i { display: block; height: 100%; width: calc(var(--v, 0) * 100%); background: var(--volume); border-radius: 1px; }
.wtile.on .volume { visibility: hidden; }

/* ---- month ----------------------------------------------------------------------------------------------------- */
.month { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 30px; }
.month-head, .month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-head div { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.mcell {
  position: relative; display: flex; flex-direction: column; gap: 2px; min-height: 108px; padding: 8px 10px 10px; text-align: left;
  border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); min-width: 0; transition: background .12s;
}
.month-grid .mcell:nth-child(7n) { border-right: 0; }
.month-grid .mcell:nth-last-child(-n + 7) { border-bottom: 0; }
.mcell:hover { background: var(--hover); }
.mcell.on { background: var(--green-soft); box-shadow: inset 0 0 0 1.5px var(--green); }
.mcell.outside .mnum, .mcell.outside .mline, .mcell.outside .mcount { color: var(--faint); opacity: .7; }
.mcell.outside .dot { opacity: .35; }
.mcell .mtop { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.mcell .mnum { font-size: 12px; font-weight: 600; min-width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 11px; margin-left: -4px; font-variant-numeric: tabular-nums; }
.mcell.today .mnum { background: var(--green); color: var(--on-green); padding: 0 6px; }
.mcell .mcount { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.mcell .mline { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; line-height: 1.55; }
.mcell .mline span:last-child { overflow: hidden; text-overflow: ellipsis; }
.mcell .mline .dot { width: 5px; height: 5px; }
.mcell .volume { margin-top: auto; padding-top: 0; }
.mcell .mmore { font-size: 10px; color: var(--faint); }

/* ---- the selected day's events --------------------------------------------------------------------------------- */
.day-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 10px; }
.day-head h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.day-head .meta { font-size: 11.5px; color: var(--muted); }
.lock-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin: -2px 0 12px; font-size: 12px; color: var(--muted); }
.lock-line .icon { width: 13px; height: 13px; color: var(--faint); }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.erow {
  display: grid; grid-template-columns: 70px minmax(0, 0.9fr) minmax(0, 1.3fr) 96px; align-items: center; gap: 18px;
  padding: 10px 16px; border-top: 1px solid var(--line-soft); transition: background .1s;
}
.erow:first-child { border-top: 0; }
a.erow:hover { background: var(--hover); }
.time { font-family: var(--mono); font-size: 12px; color: var(--ink); white-space: nowrap; line-height: 1.3; font-variant-numeric: tabular-nums; }
.time .zone { display: block; font-family: var(--sans); font-size: 10px; color: var(--muted); }
.time.tbc { font-family: var(--sans); font-size: 11px; color: var(--faint); }
.company { display: flex; align-items: center; gap: 11px; min-width: 0; }
.company .who { min-width: 0; }
.company .name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company .ticker { font-family: var(--mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event { min-width: 0; }
.event .title { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; }
.event .title span:last-child { overflow: hidden; text-overflow: ellipsis; }
.event .sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 1px 0 0 15px; }
.derived { border-bottom: 1px dotted var(--faint); cursor: help; }
.status { justify-self: end; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 500; white-space: nowrap; color: var(--muted); cursor: help; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); flex: none; }
.status.confirmed::before { background: var(--confirmed); }
.status.estimated::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--estimated); }
.status.reported { color: var(--faint); }
.more { display: flex; justify-content: center; padding: 10px; border-top: 1px solid var(--line-soft); }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); font-size: 12px; }

/* ---- avatars and logos ----------------------------------------------------------------------------------------- */
.avatar {
  flex: none; width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; overflow: hidden;
  font-size: 10px; font-weight: 600; letter-spacing: .02em; color: var(--ink-2); background: var(--avatar-bg); border: 1px solid var(--line);
}
.avatar.logo { background: var(--logo-tile); padding: 3px; }
.avatar img { width: 100%; height: 100%; object-fit: contain; display: block; }
.avatar.large { width: 56px; height: 56px; border-radius: 12px; font-size: 17px; }
.avatar.large.logo { padding: 7px; }

/* ---- company --------------------------------------------------------------------------------------------------- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; margin-bottom: 20px; }
.back:hover { color: var(--ink); }
.back .icon { width: 13px; height: 13px; }
.hero { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.hero > div { min-width: 0; }
.hero .display { font-size: 34px; overflow-wrap: anywhere; }
.facts { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; color: var(--muted); font-size: 12px; margin-top: 5px; }
.facts > * + *::before { content: "·"; margin: 0 8px; color: var(--faint); }
.facts .ticker { font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.facts a { color: var(--green-ink); font-weight: 500; }
.facts a:hover { text-decoration: underline; text-underline-offset: 2px; }
.next {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 14px 16px;
  margin-bottom: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
}
.next .when { width: 54px; text-align: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.next .when .m { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--on-green); background: var(--green); padding: 2px 0; }
.next .when .d { font-size: 20px; font-weight: 500; padding: 2px 0 4px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.next .title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 15px; font-weight: 600; margin: 2px 0; }
.next .title .status { justify-self: auto; }
.next .meta { font-size: 12px; color: var(--muted); }
.next .countdown { font-size: 12px; font-weight: 600; color: var(--green-ink); white-space: nowrap; }
.section-tabs { box-shadow: inset 0 -1px 0 var(--line); margin-bottom: 18px; }
.subhead { display: flex; align-items: center; gap: 8px; margin: 22px 0 8px; min-height: 22px; }
.subhead:first-child { margin-top: 0; }
.subhead .meta { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.subhead .spacer { flex: 1; }
.subhead .link { font-size: 11.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px;
  border: 1px solid var(--line); background: var(--surface); font-size: 11.5px; font-weight: 500; color: var(--ink-2);
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.on { border-color: var(--green); background: var(--green-soft); color: var(--ink); }
.chip .count { font-family: var(--mono); font-size: 10px; color: var(--faint); }
.crow {
  display: grid; grid-template-columns: 136px minmax(0, 1fr) 88px 96px; align-items: center; gap: 16px;
  padding: 10px 16px; border-top: 1px solid var(--line-soft);
}
.list > .crow:first-child, .yearhead + .crow { border-top: 0; }
.crow .date { font-size: 12px; font-weight: 500; white-space: nowrap; }
.crow .date .rel { display: block; font-size: 10.5px; font-weight: 400; color: var(--muted); }
.crow .event .sub { margin-left: 15px; }
.yearhead {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 0 16px; height: 36px; text-align: left;
  border-top: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface-2);
}
.list > .yearhead:first-child { border-top: 0; }
.yearhead:hover { color: var(--ink); background: var(--hover); }
.yearhead .chev { width: 12px; height: 12px; transition: transform .15s; }
.yearhead[aria-expanded="true"] .chev { transform: rotate(90deg); }
.yearhead .count { font-family: var(--mono); font-size: 10.5px; font-weight: 400; color: var(--muted); margin-left: auto; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 0 16px; height: 32px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 16px; border-top: 1px solid var(--line-soft); white-space: nowrap; font-size: 12px; }
.table tbody tr:first-child td { border-top: 0; }
.table td.strong { font-weight: 600; }
.table td.mono { font-size: 11.5px; color: var(--ink-2); }
.table td.wrap { white-space: normal; min-width: 220px; color: var(--ink); }
.table tr.future td { color: var(--muted); }
.locked-card {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
}
.locked-card p { margin: 0; color: var(--ink-2); }
.locked-card .icon { color: var(--faint); margin-right: 8px; vertical-align: -3px; }

/* ---- developers ------------------------------------------------------------------------------------------------ */
.docs { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 56px; align-items: start; }
.docs.single { grid-template-columns: minmax(0, 1fr); }
.toc { position: sticky; top: 84px; display: grid; gap: 1px; }
.toc .label { padding: 0 10px 8px; }
.toc button { text-align: left; padding: 5px 10px; border-radius: 6px; font-size: 12.5px; color: var(--muted); border-left: 2px solid transparent; }
.toc button:hover { color: var(--ink); background: var(--hover); }
.toc button.on { color: var(--ink); font-weight: 500; border-left-color: var(--green); border-radius: 0 6px 6px 0; }
.doc { max-width: 760px; min-width: 0; }
.doc-intro { margin-bottom: 8px; }
.doc-intro .display { font-size: 40px; margin: 6px 0 12px; }
.lead { font-size: 14.5px; line-height: 1.6; color: var(--ink-2); margin: 0 0 4px; max-width: 640px; }
.doc section { padding-top: 40px; }
.doc h2 { font-family: var(--serif); font-weight: 400; font-size: 26px; letter-spacing: -0.01em; line-height: 1.2; margin: 0 0 12px; }
.doc h3 { font-size: 13px; font-weight: 600; margin: 28px 0 8px; }
.doc p { margin: 0 0 12px; color: var(--ink-2); line-height: 1.65; }
.doc ul { margin: 0 0 12px; padding-left: 18px; color: var(--ink-2); line-height: 1.65; }
.doc li { margin: 2px 0; }
.doc ol.steps { padding-left: 20px; }
.doc ol.steps li { margin: 6px 0; padding-left: 2px; }
.doc ol.steps b { font-weight: 600; color: var(--ink); }
.stack { display: grid; gap: 6px; }
.doc code { font-family: var(--mono); font-size: 11.5px; padding: 1px 5px; border-radius: 4px; background: var(--code-bg); border: 1px solid var(--line-soft); color: var(--ink); overflow-wrap: anywhere; }
.facts-grid { display: grid; grid-template-columns: max-content minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 4px 0 12px; }
.facts-grid > div { padding: 10px 16px; border-top: 1px solid var(--line-soft); min-width: 0; }
.facts-grid > div:nth-child(-n + 2) { border-top: 0; }
.facts-grid .k { font-size: 12px; color: var(--muted); white-space: nowrap; }
.facts-grid .v { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.copy-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin: -2px 0; }
.copy-line .mono { font-size: 12px; color: var(--ink); overflow-wrap: anywhere; }
.code { position: relative; margin: 8px 0 16px; background: var(--code-bg); border: 1px solid var(--line); border-radius: 8px; }
.code .code-top { display: flex; align-items: center; justify-content: space-between; height: 32px; padding: 0 6px 0 14px; border-bottom: 1px solid var(--line-soft); }
.code pre { margin: 0; padding: 12px 14px 14px; overflow: auto; max-height: 360px; font: 12px/1.65 var(--mono); color: var(--ink); tab-size: 2; }
.doc .code pre code { padding: 0; border: 0; background: none; font: inherit; overflow-wrap: normal; }
.copy { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 5px; font-size: 11px; font-weight: 500; color: var(--muted); }
.copy:hover { color: var(--ink); background: var(--surface); }
.copy .icon { width: 13px; height: 13px; }
.copy.done { color: var(--green-ink); }
.endpoint { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line); }
.endpoint:first-of-type { border-top: 0; padding-top: 4px; }
.endpoint-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 8px; }
.method { font: 600 10px/1 var(--mono); letter-spacing: .04em; padding: 4px 6px; border-radius: 4px; color: var(--green-ink); background: var(--green-soft); border: 1px solid var(--green-ring); }
.endpoint-path { font: 500 13px var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.params { width: 100%; border-collapse: collapse; margin: 6px 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: table; }
.params td { padding: 8px 14px; border-top: 1px solid var(--line-soft); vertical-align: top; font-size: 12px; color: var(--ink-2); }
.params tr:first-child td { border-top: 0; }
.params td:first-child { width: 1%; white-space: nowrap; font-family: var(--mono); font-size: 11.5px; color: var(--ink); }
.params .type { display: block; font-size: 10px; color: var(--faint); }
.tool { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; }
.tool-sig { font: 12.5px/1.6 var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.tool-sig b { font-weight: 600; color: var(--green-ink); }
.tool p { margin: 6px 0 0; font-size: 12.5px; }

/* ---- OAuth consent (/oauth/consent) ---------------------------------------------------------------------------- */
body.consent-page .topbar, body.consent-page .footer { display: none; }
body.consent-page .view { display: grid; place-items: center; min-height: 100vh; padding: 40px var(--gutter); }
.consent { width: 100%; max-width: 440px; }
.consent-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 28px 28px 24px; }
.consent-brand { display: flex; align-items: center; gap: 7px; margin-bottom: 26px; }
.consent-brand .logo-mark, .consent-brand .logo-word { display: block; height: 20px; }
.consent-title { font-size: 26px; margin: 0 0 12px; line-height: 1.2; }
.consent-title .client { font-weight: 500; }
.consent-text { margin: 0 0 10px; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.consent-text.muted { color: var(--muted); font-size: 12px; }
.consent-list { list-style: none; margin: 4px 0 14px; padding: 0; display: grid; gap: 8px; }
.consent-list li { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; line-height: 1.5; color: var(--ink); }
.consent-list .icon { width: 15px; height: 15px; margin-top: 2px; color: var(--green); stroke-width: 2; }
.consent-meta { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 14px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 11.5px; }
.consent-meta dt { color: var(--faint); }
.consent-meta dd { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.consent-meta dd.mono { font-family: var(--mono); font-size: 11px; }
.consent-card .error { margin: 14px 0 0; }
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
.consent-actions.single { grid-template-columns: 1fr; }
.consent-actions .button { height: 38px; font-size: 13px; }
.consent-foot { margin: 14px 0 0; text-align: center; font-size: 11.5px; color: var(--faint); }
.consent-foot a:hover { color: var(--ink-2); }

/* ---- footer and states ----------------------------------------------------------------------------------------- */
.footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner {
  max-width: var(--page); margin: 0 auto; padding: 18px var(--gutter); display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px 20px; font-size: 11.5px; color: var(--muted);
}
.footer-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink-2); }
.footer-brand .logo-mark { height: 14px; }
.footer-links { display: inline-flex; gap: 16px; flex-wrap: wrap; }
.footer-links a:hover { color: var(--ink); }
.skeleton { height: 44px; margin: 8px 0; border-radius: 8px; border: 1px solid var(--line-soft); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.error { padding: 12px 14px; margin-bottom: 14px; border-radius: 8px; border: 1px solid rgba(217, 119, 6, 0.35); background: var(--surface); color: var(--estimated); font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---- narrower screens ------------------------------------------------------------------------------------------ */
@media (max-width: 980px) {
  .topbar-inner { grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; }
  .search { max-width: 440px; justify-self: center; }
  .erow { grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.1fr) auto; gap: 14px; }
  .crow { grid-template-columns: 120px minmax(0, 1fr) 76px auto; }
  .docs { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { position: static; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; }
  .toc .label { display: none; }
  .toc button { border: 1px solid var(--line); border-radius: 14px; padding: 3px 10px; font-size: 11.5px; background: var(--surface); }
  .toc button.on { border-color: var(--green); border-radius: 14px; }
}

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .topbar-inner { height: 52px; gap: 10px; }
  .logo-word, .brand .product, .search-key { display: none; }
  .logo-mark { height: 20px; }
  .search { max-width: none; }
  .search input { padding-right: 10px; }
  .search-results { position: fixed; top: 56px; left: 12px; right: 12px; }
  .nav-link { width: 32px; padding: 0; justify-content: center; }
  .nav-link span { display: none; }
  .nav-link .icon { display: block; }
  .tools { gap: 0; }
  .view { padding: 20px var(--gutter) 64px; }
  .cal-head .display, .hero .display { font-size: 27px; }
  .doc-intro .display { font-size: 30px; }
  .filter-row { display: block; box-shadow: none; margin-bottom: 14px; }
  .lock-line .sep { display: none; }
  .filter-row .tabs { gap: 16px; box-shadow: inset 0 -1px 0 var(--line); }
  .filter-row .select { margin: 8px 0 0 -8px; }
  .tab { height: 36px; font-size: 12px; }
  .tab .long { display: none; }
  .tab .short { display: inline; }
  .wtile { padding: 10px 0 12px; align-items: center; text-align: center; }
  .wtile .wday { font-size: 9px; letter-spacing: 0.03em; }
  .wtile .wnum { font-size: 18px; }
  .wtile .wcount .word { display: none; }
  .wtile .wcount b { font-size: 10px; }
  .volume { width: 60%; }
  .mcell { min-height: 58px; padding: 6px 5px 7px; align-items: center; }
  .mcell .mtop { flex-direction: column; gap: 0; margin-bottom: 2px; }
  .mcell .mnum { margin-left: 0; }
  .mcell .mcount { font-size: 9.5px; }
  .mcell .mline, .mcell .mmore { display: none; }
  .mcell .volume { width: 70%; }
  .month-head div { padding: 7px 0; text-align: center; }
  .erow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "company time" "event status"; gap: 6px 12px; padding: 11px 14px; }
  .erow .company { grid-area: company; }
  .erow .time { grid-area: time; justify-self: end; text-align: right; display: flex; align-items: baseline; gap: 4px; }
  .erow .time .zone { display: inline; }
  .erow .event { grid-area: event; padding-left: 41px; }
  .erow .status { grid-area: status; }
  .crow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "date status" "event event"; gap: 4px 12px; padding: 11px 14px; }
  .crow .date { grid-area: date; }
  .crow .date .rel { display: inline; margin-left: 6px; }
  .crow .event { grid-area: event; }
  .crow .status { grid-area: status; }
  .crow .time { display: none; }
  .hero { gap: 12px; align-items: flex-start; }
  .facts { gap: 2px 12px; }
  .facts > * + *::before { display: none; }
  .avatar.large { width: 48px; height: 48px; }
  .next { grid-template-columns: auto minmax(0, 1fr); gap: 12px 14px; }
  .next .countdown { grid-column: 2; }
  .next .title { font-size: 14px; }
  .table .optional { display: none; }
  .facts-grid { grid-template-columns: minmax(0, 1fr); }
  .facts-grid > div:nth-child(-n + 2) { border-top: 1px solid var(--line-soft); }
  .facts-grid > div:first-child { border-top: 0; }
  .facts-grid .k { padding-bottom: 0; border-top: 1px solid var(--line-soft); }
  .facts-grid .v { border-top: 0 !important; padding-top: 2px; }
  .popover.settings { right: -40px; }
  .consent-card { padding: 22px 20px 20px; }
  .consent-title { font-size: 23px; }
}
