:root {
  --bg: #ffffff;
  --ink: #000000;
  --muted: #525252;
  --surface: #eeeeee;
  --line: #8a8a8a;
  --subtle-line: #eaeaea;
  --accent: #eb4233;
  --error: #a8241a;
  --font: 'Source Code Pro', monospace;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-height: 100dvh;
  --nav-height: 76px;
  color-scheme: light;
  font-family: var(--font);
  font-synthesis: none;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 24px); }
body { margin: 0; font-size: 15px; line-height: 1.6; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, select, summary { cursor: pointer; }
button { background: none; border: 0; }
button:disabled, input:disabled, textarea:disabled { cursor: not-allowed; }
a { color: inherit; text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }
button, a, summary { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 2px; }
::selection { background: var(--accent); color: var(--ink); }
input, textarea { caret-color: var(--ink); }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: square; stroke-linejoin: miter; flex: none; }
img { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; overflow-wrap: anywhere; }
h1:focus { outline: none; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 12px; background: var(--ink); color: var(--bg); }
.app-shell { max-width: 1168px; margin: auto; padding: 0 20px calc(var(--nav-height) + var(--safe-bottom) + 24px); }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--ink); }
.brand { display: inline-flex; gap: 9px; align-items: center; min-height: 48px; font-size: 21px; font-weight: 650; letter-spacing: -.03em; text-decoration: none; }
.brand img { width: 36px; height: 36px; }
.studio-link { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 48px; font-size: 13px; text-decoration: none; }
.studio-link svg { width: 16px; height: 16px; }
.preview-notice { font-size: 12px; line-height: 1.6; padding: 12px 0; color: var(--muted); border-bottom: 1px solid var(--subtle-line); }
.page-heading { padding: 24px 0; }
.page-heading h1 { font-weight: 600; font-size: clamp(2rem, 6vw, 3.75rem); line-height: 1.13; letter-spacing: -.04em; max-width: 900px; }
.page-heading p { margin-top: 17px; line-height: 1.65; font-size: 14px; color: var(--muted); max-width: 65ch; }
.catalog-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 12px; }
.catalog-controls label { display: block; font-size: 12px; margin-bottom: 7px; font-weight: 600; }
.search-field { grid-column: 1 / -1; }
.search-input { display: flex; align-items: center; border: 1px solid var(--line); min-height: 48px; padding: 0 12px; gap: 10px; }
.search-input:focus-within { border-color: var(--ink); }
.search-input input { min-width: 0; width: 100%; border: 0; background: transparent; padding: 11px 0; font-size: 14px; }
.search-input input:focus-visible { outline-offset: -2px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.select-field { min-width: 0; }
.select-field select { width: 100%; min-height: 48px; border: 1px solid var(--line); background: var(--bg); padding: 10px 24px 10px 10px; border-radius: 0; font-size: 12px; text-overflow: ellipsis; }
.format-filters { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 16px 0 0; }
.format-filters button { min-height: 44px; padding: 8px 0; font-size: 12px; border-bottom: 2px solid transparent; }
.format-filters button[aria-pressed=true] { font-weight: 700; border-bottom-color: var(--accent); }
.format-filters button:hover { border-bottom-color: var(--ink); }
.results-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 22px; min-height: 44px; padding-bottom: 9px; border-bottom: 1px solid var(--ink); font-size: 12px; }
.text-button { min-height: 44px; padding: 8px 0; font-size: 12px; text-decoration: underline; text-underline-offset: .2em; }
.program-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.program-card { display: flex; flex-direction: column; min-width: 0; padding: 24px 0; border-bottom: 1px solid var(--subtle-line); }
.program-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.program-card h2 { margin: 13px 0; font-size: clamp(1.25rem, 3vw, 1.65rem); line-height: 1.3; font-weight: 600; letter-spacing: -.03em; }
.program-facts { display: grid; gap: 5px; font-size: 13px; }
.program-availability { color: var(--muted); font-size: 12px; margin-top: 10px; }
.program-description { margin: 16px 0 4px; font-size: 13px; }
.program-description summary { min-height: 44px; padding: 10px 0; text-decoration: underline; text-underline-offset: .2em; }
.program-description p { color: var(--muted); margin-bottom: 14px; line-height: 1.7; white-space: pre-line; }
.program-bottom { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 14px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 11px 15px; background: var(--ink); color: var(--bg); border: 1px solid var(--ink); border-radius: 0; font-size: 12px; font-weight: 500; line-height: 1.6; text-align: center; text-decoration: none; transition: background-color 140ms ease-out, color 140ms ease-out; }
.button:hover { background: #222222; text-decoration: none; }
.button.secondary { color: var(--ink); background: var(--bg); }
.button.secondary:hover { background: var(--surface); }
.button:active { background: var(--surface); color: var(--ink); }
.button:disabled { color: var(--muted); border-color: var(--line); background: var(--surface); }
.catalog-help { padding: 30px 0; max-width: 680px; }
.catalog-help h2, .account-section h2, .family-section h2 { font-size: 19px; font-weight: 600; line-height: 1.4; letter-spacing: -.02em; }
.catalog-help p { margin: 12px 0 18px; color: var(--muted); font-size: 13px; max-width: 60ch; }
.view-state { grid-column: 1 / -1; padding: 28px 0; font-size: 14px; line-height: 1.7; color: var(--muted); max-width: 65ch; }
.view-state h2 { color: var(--ink); font-size: 20px; margin-bottom: 10px; }
.view-state p { margin-bottom: 12px; }
.view-state .button { margin: 6px 8px 6px 0; }
.family-details { margin: 20px 0 0; }
.family-details > div { display: grid; grid-template-columns: minmax(80px, 1fr) minmax(0, 2fr); gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--subtle-line); }
.family-details dt { color: var(--muted); font-size: 12px; }
.family-details dd { margin: 0; overflow-wrap: anywhere; font-size: 14px; }
.family-section, .account-section, .profile-help { max-width: 780px; }
.account-section { margin-top: 34px; }
.charges-list { margin-top: 12px; }
.charge-card { padding: 18px 0; border-bottom: 1px solid var(--subtle-line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.charge-title { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.charge-date, .charge-status { font-size: 12px; color: var(--muted); margin-top: 6px; }
.charge-amount { font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; }
.reminder-setting { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--subtle-line); }
.reminder-setting label { font-size: 14px; font-weight: 600; cursor: pointer; }
.reminder-setting p { color: var(--muted); margin-top: 5px; font-size: 12px; }
.reminder-setting input { appearance: none; width: 52px; min-width: 52px; height: 44px; position: relative; margin: 0; border: 1px solid var(--line); background: var(--bg); border-radius: 0; cursor: pointer; }
.reminder-setting input::before { content: ''; position: absolute; left: 5px; top: 10px; width: 22px; height: 22px; background: var(--muted); transition: transform 140ms ease-out; }
.reminder-setting input:checked { border-color: var(--ink); }
.reminder-setting input:checked::before { background: var(--ink); transform: translateX(18px); }
.reminder-setting input:disabled { background: var(--surface); cursor: not-allowed; }
.profile-help { padding: 30px 0; }
.profile-help p { margin-bottom: 15px; font-size: 13px; color: var(--muted); }
.chat-screen { max-width: 820px; }
.chat-screen .page-heading { padding-bottom: 20px; }
.chat-status { font-size: 12px; padding: 12px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--subtle-line); color: var(--muted); }
.chat-messages { display: flex; flex-direction: column; gap: 15px; min-height: 210px; max-height: max(230px, calc(var(--app-height) - 430px)); overflow: auto; padding: 22px 3px; scrollbar-width: thin; scrollbar-color: var(--line) var(--bg); overscroll-behavior: contain; }
.chat-message { max-width: 92%; align-self: flex-start; background: var(--surface); padding: 15px; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.chat-message.from-parent { align-self: flex-end; background: var(--ink); color: var(--bg); }
.message-body { white-space: pre-wrap; }
.message-caption { display: block; font-size: 12px; margin-top: 8px; color: var(--muted); }
.from-parent .message-caption { color: #d0d0d0; }
.chat-empty { margin: auto 0; font-size: 13px; line-height: 1.7; max-width: 60ch; color: var(--muted); }
.chat-empty strong { display: block; font-size: 18px; margin-bottom: 10px; font-weight: 600; color: var(--ink); }
.chat-prompts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chat-prompts button { border: 1px solid var(--line); min-height: 44px; padding: 10px 12px; font-size: 12px; }
.chat-prompts button:hover { border-color: var(--ink); }
.chat-prompts button:disabled { color: var(--muted); background: var(--surface); }
.chat-form { display: flex; gap: 10px; align-items: flex-end; border: 1px solid var(--line); padding: 6px; scroll-margin-bottom: 32px; }
.chat-form:focus-within { border-color: var(--ink); }
.chat-form textarea { min-width: 0; width: 100%; min-height: 46px; max-height: 130px; resize: vertical; background: var(--bg); border: 0; padding: 11px 8px; font-size: 14px; line-height: 1.6; }
.chat-form button { display: grid; place-items: center; width: 46px; height: 46px; flex: none; background: var(--ink); color: var(--bg); }
.chat-form button:disabled { background: var(--surface); color: var(--muted); }
.chat-actions { padding: 0 0 10px; }
.form-note { font-size: 12px; color: var(--muted); margin-top: 11px; }
.field-error { font-size: 12px; color: var(--error); margin-top: 10px; }
.app-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 24px 0 4px; border-top: 1px solid var(--subtle-line); color: var(--muted); font-size: 12px; }
.app-footer a { display: inline-flex; align-items: center; min-height: 44px; }
.tabbar { position: fixed; z-index: 20; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); min-height: var(--nav-height); padding: 6px 12px calc(6px + var(--safe-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.tabbar button { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; min-height: 60px; font-size: 12px; color: var(--muted); }
.tabbar button[aria-current=page] { color: var(--ink); font-weight: 650; }
.tabbar button[aria-current=page]::after { position: absolute; bottom: 0; width: 28px; height: 2px; content: ''; background: var(--accent); }
.toast { position: fixed; z-index: 30; bottom: calc(var(--nav-height) + var(--safe-bottom) + 12px); left: 50%; width: max-content; max-width: min(640px, calc(100% - 32px)); background: var(--ink); color: var(--bg); padding: 14px 18px; font-size: 13px; line-height: 1.6; pointer-events: none; opacity: 0; transform: translate(-50%, 6px); transition: opacity 140ms ease-out, transform 140ms ease-out; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.keyboard-open .tabbar { display: none; }
.keyboard-open .app-shell { padding-bottom: 24px; }
.keyboard-open .toast { bottom: 16px; }
@media (min-width: 620px) {
  .app-shell { padding-inline: 32px; }
  .page-heading { padding-top: 44px; }
  .catalog-controls { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
  .search-field { grid-column: auto; }
  .select-field select { font-size: 13px; }
  .program-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 30px; }
  .program-card { padding-block: 28px; }
  .page-heading p { font-size: 15px; }
  .format-filters { gap: 8px 24px; }
  .format-filters button { font-size: 13px; }
  .tabbar { max-width: 520px; left: 50%; right: auto; width: 100%; transform: translateX(-50%); border: 1px solid var(--line); border-bottom: 0; }
}
@media (min-width: 980px) {
  .app-shell { padding-bottom: 28px; }
  .topbar { min-height: 100px; }
  .tabbar { position: absolute; top: 14px; bottom: auto; width: 420px; border: 0; }
  .page-heading { padding-block: 48px 32px; }
  .catalog-controls { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, 1fr); }
  .program-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .program-card h2 { font-size: 23px; }
  .select-field select { font-size: 14px; }
  .chat-screen .page-heading h1, #profileTitle { font-size: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media (forced-colors: active) {
  .tabbar button[aria-current=page] { border-bottom: 3px solid Highlight; }
  .format-filters button[aria-pressed=true] { border-bottom-color: Highlight; }
  .reminder-setting input { appearance: auto; }
}
