/* Kairos design tokens and hand-rolled Material 3 components. Shared by landing and app. */

:root {
  color-scheme: light;
  --primary: #00696D;
  --on-primary: #FFFFFF;
  --primary-container: #9CF1F0;
  --on-primary-container: #002020;
  --secondary: #4A6363;
  --on-secondary: #FFFFFF;
  --secondary-container: #CCE8E7;
  --on-secondary-container: #051F1F;
  --tertiary: #7A5900;
  --on-tertiary: #FFFFFF;
  --tertiary-container: #FFDEA6;
  --on-tertiary-container: #261900;
  --error: #BA1A1A;
  --on-error: #FFFFFF;
  --error-container: #FFDAD6;
  --on-error-container: #410002;
  --surface: #F4FBFA;
  --surface-dim: #D5DBDA;
  --surface-bright: #F4FBFA;
  --surface-container-lowest: #FFFFFF;
  --surface-container-low: #EEF5F4;
  --surface-container: #E8EFEE;
  --surface-container-high: #E3E9E8;
  --surface-container-highest: #DDE4E3;
  --on-surface: #161D1D;
  --on-surface-variant: #3F4948;
  --outline: #6F7979;
  --outline-variant: #BEC9C8;
  --inverse-surface: #2B3231;
  --inverse-on-surface: #ECF2F1;
  --inverse-primary: #80D5D4;
  --shadow: 0 0 0;
  --art-bg: #ECEDEA;
  --gold: #E9C46A;

  /* shape */
  --r-xs: 8px;
  --r-s: 12px;
  --r-m: 16px;
  --r-l: 28px;
  --r-full: 999px;

  /* elevation */
  --elev-1: 0 1px 2px rgba(var(--shadow), .16), 0 1px 3px 1px rgba(var(--shadow), .07);
  --elev-2: 0 1px 2px rgba(var(--shadow), .16), 0 2px 6px 2px rgba(var(--shadow), .08);
  --elev-3: 0 4px 8px 3px rgba(var(--shadow), .08), 0 1px 3px rgba(var(--shadow), .16);
  --elev-4: 0 6px 10px 4px rgba(var(--shadow), .08), 0 2px 3px rgba(var(--shadow), .16);
  --elev-5: 0 8px 12px 6px rgba(var(--shadow), .08), 0 4px 4px rgba(var(--shadow), .16);

  /* motion */
  --ease: cubic-bezier(.2, 0, 0, 1);
  --ease-decel: cubic-bezier(.05, .7, .1, 1);
  --ease-accel: cubic-bezier(.3, 0, .8, .15);
  --d-short: 200ms;
  --d-med: 300ms;
  --d-long: 450ms;
  --d-xl: 500ms;

  /* type */
  --font: "Google Sans Flex", "Google Sans", "Roboto Flex", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --primary: #80D5D4;
  --on-primary: #003737;
  --primary-container: #004F50;
  --on-primary-container: #9CF1F0;
  --secondary: #B0CCCB;
  --on-secondary: #1B3435;
  --secondary-container: #324B4B;
  --on-secondary-container: #CCE8E7;
  --tertiary: #EBC248;
  --on-tertiary: #402D00;
  --tertiary-container: #5C4300;
  --on-tertiary-container: #FFDEA6;
  --error: #FFB4AB;
  --on-error: #690005;
  --error-container: #93000A;
  --on-error-container: #FFDAD6;
  --surface: #0E1514;
  --surface-dim: #0E1514;
  --surface-bright: #343B3A;
  --surface-container-lowest: #090F0F;
  --surface-container-low: #161D1D;
  --surface-container: #1A2121;
  --surface-container-high: #252B2B;
  --surface-container-highest: #2F3636;
  --on-surface: #DDE4E3;
  --on-surface-variant: #BEC9C8;
  --outline: #899392;
  --outline-variant: #3F4948;
  --inverse-surface: #DDE4E3;
  --inverse-on-surface: #2B3231;
  --inverse-primary: #00696D;
  --art-bg: #E4E8E6;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--on-surface);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
  transition: background-color var(--d-med) var(--ease), color var(--d-med) var(--ease);
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: var(--primary-container); color: var(--on-primary-container); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* type scale (18px base) */
.display-l { font-size: clamp(2.6rem, 4.6vw, 3.75rem); line-height: 1.06; font-weight: 500; letter-spacing: -.02em; }
.display-s { font-size: clamp(2rem, 3.4vw, 2.6rem); line-height: 1.12; font-weight: 500; letter-spacing: -.015em; }
.headline-l { font-size: clamp(1.75rem, 2.6vw, 2.1rem); line-height: 1.2; font-weight: 500; letter-spacing: -.01em; }
.headline-m { font-size: 1.6rem; line-height: 1.25; font-weight: 500; }
.headline-s { font-size: 1.35rem; line-height: 1.3; font-weight: 500; }
.title-l { font-size: 1.2rem; line-height: 1.35; font-weight: 500; }
.title-m { font-size: 1rem; line-height: 1.45; font-weight: 600; letter-spacing: .005em; }
.title-s { font-size: .875rem; line-height: 1.4; font-weight: 600; letter-spacing: .01em; }
.body-l { font-size: 1rem; line-height: 1.55; }
.body-m { font-size: .889rem; line-height: 1.5; }
.body-s { font-size: .8rem; line-height: 1.45; }
.label-l { font-size: .889rem; line-height: 1.3; font-weight: 500; letter-spacing: .01em; }
.label-m { font-size: .8rem; line-height: 1.3; font-weight: 500; letter-spacing: .02em; }
.muted { color: var(--on-surface-variant); }

/* icons */
.ms {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  font-feature-settings: "liga";
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  user-select: none;
  flex: none;
  width: 1em;
  overflow: hidden;
}
.ms.fill { font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }
.ms.sm { font-size: 18px; }
.ms.lg { font-size: 32px; }

/* ------------------------------------------------------------------ state layers (shared) */
.btn::before, .icon-btn::before, .fab::before, button.chip::before, a.chip::before,
.segmented > button::before, .tab::before, .menu-item::before, .st::before {
  content: ""; position: absolute; inset: 0; background: currentColor; opacity: 0;
  border-radius: inherit; pointer-events: none; z-index: -1;
  transition: opacity var(--d-short) var(--ease);
}
.btn:hover::before, .icon-btn:hover::before, .fab:hover::before, button.chip:hover::before, a.chip:hover::before,
.segmented > button:hover::before, .tab:hover::before, .menu-item:hover::before, .st:hover::before { opacity: .08; }
.btn:focus-visible::before, .icon-btn:focus-visible::before, .fab:focus-visible::before, button.chip:focus-visible::before,
.segmented > button:focus-visible::before, .tab:focus-visible::before, .menu-item:focus-visible::before, .st:focus-visible::before { opacity: .10; }
.btn:active::before, .icon-btn:active::before, .fab:active::before, button.chip:active::before,
.segmented > button:active::before, .tab:active::before, .menu-item:active::before, .st:active::before { opacity: .10; }
.btn:disabled::before, .icon-btn:disabled::before, .st[aria-disabled="true"]::before { opacity: 0 !important; }
.st { position: relative; isolation: isolate; }

/* ------------------------------------------------------------------ buttons */
.btn {
  --h: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--h);
  padding: 0 24px;
  border: 0;
  border-radius: var(--r-full);
  font-size: .889rem;
  font-weight: 500;
  letter-spacing: .01em;
  text-decoration: none;
  white-space: nowrap;
  background: transparent;
  color: var(--primary);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: box-shadow var(--d-short) var(--ease), background-color var(--d-short) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn .ms { font-size: 20px; }
.btn.has-icon { padding-left: 18px; }
.btn-filled { background: var(--primary); color: var(--on-primary); }
.btn-filled:hover { box-shadow: var(--elev-1); }
.btn-tonal { background: var(--secondary-container); color: var(--on-secondary-container); }
.btn-tonal:hover { box-shadow: var(--elev-1); }
.btn-outlined { border: 1px solid var(--outline); color: var(--primary); }
.btn-text { padding: 0 14px; }
.btn-text.has-icon { padding-left: 12px; }
.btn-elevated { background: var(--surface-container-low); color: var(--primary); box-shadow: var(--elev-1); }
.btn-elevated:hover { box-shadow: var(--elev-2); }
.btn-lg { --h: 56px; padding: 0 28px; font-size: 1rem; }
.btn-lg.has-icon { padding-left: 22px; }
.btn-lg .ms { font-size: 22px; }
.btn-sm { --h: 40px; padding: 0 16px; font-size: .8rem; }
.btn-sm.has-icon { padding-left: 12px; }
.btn-danger { color: var(--error); }
.btn:disabled, .btn[aria-disabled="true"] {
  cursor: default; box-shadow: none;
  background: color-mix(in srgb, var(--on-surface) 12%, transparent);
  color: color-mix(in srgb, var(--on-surface) 45%, transparent);
}
.btn-text:disabled, .btn-outlined:disabled { background: transparent; }
.btn-outlined:disabled { border-color: color-mix(in srgb, var(--on-surface) 12%, transparent); }

.icon-btn {
  width: 48px; height: 48px; flex: none; padding: 0;
  display: inline-grid; place-items: center;
  border: 0; border-radius: var(--r-full);
  background: transparent; color: var(--on-surface-variant);
  position: relative; isolation: isolate; overflow: hidden;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn.sm { width: 40px; height: 40px; }
.icon-btn.sm .ms { font-size: 22px; }
.icon-btn.tonal { background: var(--secondary-container); color: var(--on-secondary-container); }
.icon-btn.filled { background: var(--primary); color: var(--on-primary); }
.icon-btn.outlined { border: 1px solid var(--outline-variant); }
.icon-btn[aria-pressed="true"] { color: var(--primary); }
.icon-btn.star[aria-pressed="true"] { color: var(--tertiary); }
.icon-btn[aria-pressed="true"] .ms { font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }

.fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 30;
  display: inline-flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 20px 0 16px;
  border: 0; border-radius: var(--r-m);
  background: var(--primary-container); color: var(--on-primary-container);
  font-size: .889rem; font-weight: 500; letter-spacing: .01em;
  box-shadow: var(--elev-3);
  isolation: isolate; overflow: hidden;
  transition: box-shadow var(--d-short) var(--ease), transform var(--d-med) var(--ease);
}
.fab:hover { box-shadow: var(--elev-4); }

/* ------------------------------------------------------------------ chips */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 36px; padding: 0 16px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--r-xs);
  background: transparent; color: var(--on-surface-variant);
  font-size: .8rem; font-weight: 500; letter-spacing: .01em;
  white-space: nowrap; text-decoration: none;
  position: relative; isolation: isolate; overflow: hidden;
  transition: background-color var(--d-short) var(--ease), border-color var(--d-short) var(--ease), color var(--d-short) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.chip .ms { font-size: 18px; margin-left: -4px; }
.chip.has-trail { padding-right: 10px; }
.chip.has-trail .ms.trail { margin-left: 0; margin-right: -2px; }
.chip.selected, .chip[aria-pressed="true"], .chip[aria-checked="true"] {
  background: var(--secondary-container); color: var(--on-secondary-container); border-color: transparent;
}
.chip.assist { color: var(--on-surface); }
.chip.assist .ms { color: var(--primary); }
.chip.input { padding: 0 4px 0 14px; color: var(--on-surface); background: var(--surface-container-low); }
.chip.input .x {
  width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: var(--r-full);
  background: transparent; color: var(--on-surface-variant); padding: 0;
}
.chip.input .x:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.chip.input .x .ms { margin: 0; font-size: 18px; }
.chip.static { min-height: 30px; padding: 0 12px; font-size: .75rem; cursor: default; }
.chip.static .ms { font-size: 16px; margin-left: -2px; }
.chip.kw { background: var(--surface-container-high); border-color: transparent; color: var(--on-surface-variant); }
.chip.tone-primary { background: color-mix(in srgb, var(--primary-container) 72%, transparent); color: var(--on-primary-container); border-color: transparent; }
.chip.tone-gold { background: var(--tertiary-container); color: var(--on-tertiary-container); border-color: transparent; }
.chip.tone-error { background: var(--error-container); color: var(--on-error-container); border-color: transparent; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ------------------------------------------------------------------ text fields (outlined) */
.field { position: relative; display: block; --field-bg: var(--surface); }
.field > input, .field > textarea, .field > select {
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border: 1px solid var(--outline);
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--on-surface);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--d-short) var(--ease), box-shadow var(--d-short) var(--ease);
  appearance: none;
  -webkit-appearance: none;
}
.field > textarea { resize: vertical; min-height: 120px; line-height: 1.5; padding-top: 18px; display: block; }
.field > select { padding-right: 48px; cursor: pointer; }
.field > select option { background: var(--surface-container); color: var(--on-surface); }
.field.has-select::after {
  content: "arrow_drop_down"; font-family: "Material Symbols Rounded"; font-size: 24px; line-height: 1;
  position: absolute; right: 12px; top: 28px; transform: translateY(-50%); pointer-events: none; color: var(--on-surface-variant);
}
.field > input:hover, .field > textarea:hover, .field > select:hover { border-color: var(--on-surface); }
.field > input:focus, .field > textarea:focus, .field > select:focus { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.field-label {
  position: absolute; left: 12px; top: 28px; transform: translateY(-50%);
  padding: 0 4px;
  color: var(--on-surface-variant);
  font-size: 1rem; line-height: 1.2;
  pointer-events: none;
  background: var(--field-bg);
  border-radius: 4px;
  transition: top var(--d-short) var(--ease), font-size var(--d-short) var(--ease), color var(--d-short) var(--ease), left var(--d-short) var(--ease);
  max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.field.lead > input { padding-left: 52px; }
.field.lead .field-label { left: 48px; }
.field.trail > input { padding-right: 56px; }
.field .lead-icon { position: absolute; left: 14px; top: 28px; transform: translateY(-50%); color: var(--on-surface-variant); pointer-events: none; }
.field .trail-btn { position: absolute; right: 4px; top: 4px; }
.field > input:focus ~ .field-label,
.field > input:not(:placeholder-shown) ~ .field-label,
.field > textarea:focus ~ .field-label,
.field > textarea:not(:placeholder-shown) ~ .field-label,
.field > select ~ .field-label,
.field.float .field-label {
  top: 0; font-size: .75rem; left: 12px;
}
.field > input:focus ~ .field-label, .field > textarea:focus ~ .field-label, .field > select:focus ~ .field-label { color: var(--primary); }
.field > input::placeholder, .field > textarea::placeholder { color: transparent; }
.field > input:focus::placeholder, .field > textarea:focus::placeholder { color: var(--on-surface-variant); opacity: .75; }
.field-support { display: flex; justify-content: space-between; gap: 12px; padding: 4px 16px 0; font-size: .75rem; color: var(--on-surface-variant); }
.field.invalid > input, .field.invalid > textarea { border-color: var(--error); }
.field.invalid .field-label { color: var(--error); }
[data-theme="dark"] .field > input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.85); }
.field.lg > input { min-height: 76px; font-size: 1.6rem; padding: 18px 20px; border-radius: var(--r-s); }
.field.lg .field-label { top: 38px; font-size: 1.25rem; left: 16px; }
.field.lg > input:focus ~ .field-label, .field.lg > input:not(:placeholder-shown) ~ .field-label { top: 0; font-size: .8rem; }

.form-error {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 16px; border-radius: var(--r-s);
  background: var(--error-container); color: var(--on-error-container);
  font-size: .889rem;
}
.form-error .ms { font-size: 20px; margin-top: 2px; }

/* ------------------------------------------------------------------ segmented buttons */
.segmented { display: inline-flex; border: 1px solid var(--outline); border-radius: var(--r-full); overflow: hidden; max-width: 100%; }
.segmented > button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border: 0; background: transparent;
  color: var(--on-surface); font-size: .889rem; font-weight: 500;
  position: relative; isolation: isolate; overflow: hidden; flex: 1 1 0; white-space: nowrap;
  transition: background-color var(--d-short) var(--ease);
}
.segmented > button + button { border-left: 1px solid var(--outline); }
.segmented > button[aria-checked="true"] { background: var(--secondary-container); color: var(--on-secondary-container); }
.segmented > button .ms { font-size: 20px; }
.segmented > button[aria-checked="true"] .ms.ic { display: none; }
.segmented > button .ms.ck { display: none; }
.segmented > button[aria-checked="true"] .ms.ck { display: inline-block; }

/* ------------------------------------------------------------------ cards */
.card { border-radius: var(--r-s); background: var(--surface-container-low); color: var(--on-surface); position: relative; }
.card-elevated { background: var(--surface-container-low); box-shadow: var(--elev-1); }
.card-filled { background: var(--surface-container-high); }
.card-outlined { background: var(--surface); border: 1px solid var(--outline-variant); }
.card.r-l { border-radius: var(--r-l); }
.card.r-m { border-radius: var(--r-m); }

/* ------------------------------------------------------------------ switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 52px; height: 32px; margin: 0; cursor: pointer; }
.switch .track {
  width: 52px; height: 32px; border-radius: var(--r-full); flex: none;
  background: var(--surface-container-highest); border: 2px solid var(--outline);
  position: relative; transition: background-color var(--d-short) var(--ease), border-color var(--d-short) var(--ease);
}
.switch .track::after {
  content: ""; position: absolute; top: 50%; left: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--outline); transform: translateY(-50%);
  transition: all var(--d-med) var(--ease);
}
.switch input:checked + .track { background: var(--primary); border-color: var(--primary); }
.switch input:checked + .track::after { left: 22px; width: 24px; height: 24px; background: var(--on-primary); }
.switch input:focus-visible + .track { outline: 3px solid var(--primary); outline-offset: 2px; }

/* ------------------------------------------------------------------ slider */
.slider { width: 100%; appearance: none; -webkit-appearance: none; height: 44px; margin: 0; background: transparent; cursor: pointer; --p: 0%; }
.slider::-webkit-slider-runnable-track {
  height: 16px; border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--primary) var(--p), var(--secondary-container) var(--p));
}
.slider::-moz-range-track { height: 16px; border-radius: var(--r-full); background: var(--secondary-container); }
.slider::-moz-range-progress { height: 16px; border-radius: var(--r-full); background: var(--primary); }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 6px; height: 44px; margin-top: -14px; border-radius: 3px;
  background: var(--primary); box-shadow: 0 0 0 6px var(--slider-gap, var(--surface));
}
.slider::-moz-range-thumb { width: 6px; height: 44px; border-radius: 3px; border: 0; background: var(--primary); }
.slider:focus-visible { outline: none; }
.slider:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 6px var(--slider-gap, var(--surface)), 0 0 0 9px color-mix(in srgb, var(--primary) 35%, transparent); }

/* ------------------------------------------------------------------ progress */
.progress { height: 6px; border-radius: var(--r-full); background: var(--secondary-container); overflow: hidden; position: relative; }
.progress > .bar { height: 100%; width: 0; border-radius: inherit; background: var(--primary); transition: width var(--d-xl) var(--ease); }
.progress.indeterminate > .bar { width: 40%; position: absolute; left: -40%; animation: indet 1.4s var(--ease) infinite; }
@keyframes indet { 0% { left: -40%; width: 30%; } 60% { width: 50%; } 100% { left: 100%; width: 30%; } }

/* ------------------------------------------------------------------ tabs */
.tabs { display: flex; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--outline-variant); }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  min-height: 52px; padding: 0 18px; border: 0; background: transparent;
  color: var(--on-surface-variant); font-size: .889rem; font-weight: 500; letter-spacing: .01em;
  position: relative; isolation: isolate; overflow: hidden; white-space: nowrap;
}
.tab::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px;
  border-radius: 3px 3px 0 0; background: var(--primary); transform: scaleX(0);
  transition: transform var(--d-med) var(--ease);
}
.tab[aria-selected="true"] { color: var(--primary); }
.tab[aria-selected="true"]::after { transform: scaleX(1); }

/* ------------------------------------------------------------------ badge */
.badge {
  display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px;
  border-radius: var(--r-full); font-size: .7rem; font-weight: 600; line-height: 1;
  background: var(--surface-container-highest); color: var(--on-surface-variant);
  font-variant-numeric: tabular-nums;
}
.tab[aria-selected="true"] .badge, .badge.primary { background: var(--primary); color: var(--on-primary); }

/* ------------------------------------------------------------------ dialog */
dialog.dialog {
  border: 0; padding: 0; border-radius: var(--r-l);
  background: var(--surface-container-high); color: var(--on-surface);
  width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  box-shadow: var(--elev-3);
}
dialog.dialog::backdrop { background: rgba(0, 0, 0, .36); }
dialog.dialog[open] { animation: dlg-in var(--d-long) var(--ease-decel); }
dialog.dialog[open]::backdrop { animation: fade-in var(--d-med) var(--ease); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(-16px) scale(.97); } }
@keyframes fade-in { from { opacity: 0; } }
.dialog-body { padding: 24px; display: grid; gap: 16px; }
.dialog .field { --field-bg: var(--surface-container-high); }
.dialog-head { display: grid; gap: 8px; }
.dialog-head .ms { color: var(--secondary); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 24px 24px; }

/* ------------------------------------------------------------------ menu */
.menu {
  position: fixed; z-index: 90; min-width: 220px; max-width: 320px; max-height: 60vh; overflow: auto;
  padding: 8px 0; border-radius: var(--r-xs);
  background: var(--surface-container); color: var(--on-surface); box-shadow: var(--elev-2);
  animation: menu-in var(--d-med) var(--ease-decel);
  transform-origin: top center;
}
@keyframes menu-in { from { opacity: 0; transform: scaleY(.85); } }
.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 16px;
  border: 0; background: transparent; text-align: left; font-size: .889rem; color: var(--on-surface);
  position: relative; isolation: isolate; text-decoration: none;
}
.menu-item:focus-visible { outline: none; }
.menu-item .ms { color: var(--on-surface-variant); font-size: 22px; }
.menu-item[aria-checked="true"] { background: var(--secondary-container); color: var(--on-secondary-container); }
.menu-item[aria-checked="true"] .ms { color: inherit; }
.menu-sep { height: 1px; background: var(--outline-variant); margin: 8px 0; }

/* ------------------------------------------------------------------ snackbar */
.snackbar-host { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(560px, calc(100vw - 32px)); pointer-events: none; }
.snackbar {
  display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 8px 6px 18px;
  border-radius: var(--r-xs); background: var(--inverse-surface); color: var(--inverse-on-surface);
  box-shadow: var(--elev-3); font-size: .889rem; pointer-events: auto;
  animation: snack-in var(--d-med) var(--ease-decel);
}
.snackbar.out { animation: snack-out var(--d-short) var(--ease-accel) forwards; }
.snackbar .msg { flex: 1; padding: 8px 0; }
.snackbar .btn { color: var(--inverse-primary); --h: 40px; padding: 0 12px; }
.snackbar .icon-btn { color: var(--inverse-on-surface); width: 40px; height: 40px; }
.snackbar.error { background: var(--error-container); color: var(--on-error-container); }
.snackbar.error .btn, .snackbar.error .icon-btn { color: var(--on-error-container); }
@keyframes snack-in { from { opacity: 0; transform: translateY(16px); } }
@keyframes snack-out { to { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------------ illustration frames */
.art {
  position: relative; overflow: hidden; border-radius: var(--r-l);
  background: var(--art-bg);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--outline-variant) 45%, transparent);
}
.art > img { width: 100%; height: 100%; object-fit: cover; }
[data-theme="dark"] .art { box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 24px 60px -24px rgba(0, 0, 0, .8); }
[data-theme="dark"] .art > img { filter: brightness(.92); }
.art-icon { display: grid; place-items: center; background: color-mix(in srgb, var(--primary-container) 55%, var(--surface)); box-shadow: none; }
.art-icon .ms { font-size: 128px; color: var(--primary); font-variation-settings: "FILL" 0, "wght" 300, "opsz" 48; }
[data-theme="dark"] .art-icon { box-shadow: none; background: color-mix(in srgb, var(--primary-container) 40%, var(--surface)); }

/* brand */
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--on-surface); }
.brand img { width: 36px; height: 36px; }
.brand .word { font-size: 1.3rem; font-weight: 600; letter-spacing: -.01em; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity var(--d-xl) var(--ease), transform 700ms var(--ease-decel); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .progress.indeterminate > .bar { animation: none; left: 0; width: 100%; opacity: .5; }
}
