/*
  one id. tokens are one's (one/apps/web/src/styles.css) so the app sits inside one without a seam.
  layers: chrome (--chrome) top bar; content (--surface) inset sheet; overlays (--pop) menus, inspector, dialogs.
  one accent: cobalt marks primary actions, focus and selection. google's button keeps google's own colors.
*/
:root {
  --ink: oklch(0.22 0.006 255);
  --ink-2: oklch(0.45 0.008 255);
  --ink-3: oklch(0.51 0.008 255);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.975 0.002 255);
  --chrome: oklch(0.962 0.003 255);
  --hover: oklch(0.945 0.003 255);
  --hover-quiet: oklch(0.982 0.002 255);
  --chrome-hover: oklch(0.925 0.004 255);
  --chrome-current: oklch(0.905 0.005 255);
  --pressed: oklch(0.92 0.004 255);
  --select: oklch(0.93 0.035 255);
  --line: oklch(0.905 0.003 255);
  --line-2: oklch(0.84 0.004 255);
  --line-3: oklch(0.74 0.006 255);
  --accent: oklch(0.50 0.13 255);
  --accent-strong: oklch(0.43 0.13 255);
  --on-accent: oklch(1 0 0);
  --warn: oklch(0.47 0.11 65);
  --warn-bg: oklch(0.965 0.035 85);
  --danger: oklch(0.50 0.17 27);
  --danger-strong: oklch(0.44 0.17 27);
  --danger-bg: oklch(0.97 0.02 27);
  --ok: oklch(0.46 0.10 155);
  --ok-bg: oklch(0.96 0.03 155);
  --app-identity: oklch(0.42 0.03 255);
  --control-h: 2rem;
  --control-h-sm: 1.75rem;
  --touch: 2.75rem;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-md: 0.875rem;
  --text-lg: 0.9375rem;
  --text-xl: 1.25rem;
  --radius-s: 4px;
  --radius-m: 6px;
  --radius-l: 10px;
  --radius-xl: 16px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --shadow: 0 0 0 1px oklch(0.22 0.006 255 / 0.07), 0 1px 2px oklch(0.22 0.006 255 / 0.06);
  --pop: 0 0 0 1px oklch(0.22 0.006 255 / 0.08), 0 8px 24px oklch(0.22 0.006 255 / 0.14);
  --focus-ring: 0 0 0 1px var(--surface), 0 0 0 3px oklch(0.50 0.13 255 / 0.45);
  --focus-ring-danger: 0 0 0 1px var(--surface), 0 0 0 3px oklch(0.50 0.17 27 / 0.4);
  --scrim: oklch(0.22 0.006 255 / 0.32);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --top: max(48px, 3rem);
  --inset: 8px;
  --z-sticky: 1;
  --z-inspector: 30;
  --z-popover: 40;
  color-scheme: light;
  accent-color: var(--accent);
  font-family: var(--font);
  color: var(--ink);
  background: var(--chrome);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: var(--text-md); line-height: 1.45; }
h1, h2, h3, p, ul, ol, dl, dd, fieldset { margin: 0; padding: 0; }
h1, h2, h3 { text-wrap: balance; }
fieldset { border: 0; min-width: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: var(--text-sm); overflow-wrap: anywhere; }
.muted { color: var(--ink-2); }
.link { color: var(--accent-strong); font-weight: 600; border-radius: var(--radius-s); }
.link:hover { text-decoration: underline; text-underline-offset: 2px; }

/* boot: nothing for the first 250ms, then a quiet line; avoids a flash on fast sessions */
.boot { display: grid; place-items: center; min-height: 100dvh; color: var(--ink-2); animation: fade-in 200ms 250ms both; }

/* controls */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem; flex: none;
  height: var(--control-h); padding: 0 0.75rem; border: 1px solid var(--line-2); border-radius: var(--radius-m);
  background: var(--surface); color: var(--ink); font-size: var(--text-md); font-weight: 600; line-height: 1; white-space: nowrap;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.button:hover:not(:disabled) { background: var(--hover); }
.button:active:not(:disabled) { background: var(--pressed); }
.button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.button.small { height: var(--control-h-sm); padding: 0 0.625rem; font-size: var(--text-sm); }
.button.primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.button.primary:hover:not(:disabled) { border-color: var(--accent-strong); background: var(--accent-strong); }
.button.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.button.ghost:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.button.danger { color: var(--danger); }
.button.danger:hover:not(:disabled) { border-color: var(--danger); background: var(--danger-bg); }
.button.danger:focus-visible { box-shadow: var(--focus-ring-danger); }
.button.primary.danger { border-color: var(--danger); background: var(--danger); color: var(--on-accent); }
.button.primary.danger:hover:not(:disabled) { background: var(--danger-strong); }
.button:disabled { opacity: 0.5; cursor: not-allowed; }
.button[aria-busy='true'], .button[aria-busy='true']:disabled { opacity: 1; cursor: progress; }
.button[aria-busy='true']::before {
  content: ''; width: 0.75rem; height: 0.75rem; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 700ms linear infinite;
}
.icon-button { width: var(--control-h); padding: 0; }
@media (pointer: coarse) { .button { min-height: var(--touch); } .icon-button { width: var(--touch); } }

.field { display: grid; gap: 0.25rem; min-width: 0; }
.field-label { font-size: var(--text-sm); font-weight: 600; }
.field-hint { font-size: var(--text-sm); color: var(--ink-2); }
.field-error { font-size: var(--text-sm); color: var(--danger); }
.input {
  width: 100%; min-width: 0; height: var(--control-h); padding: 0 0.625rem; border: 1px solid var(--line-2); border-radius: var(--radius-m);
  background: var(--surface); transition: border-color 150ms var(--ease);
}
textarea.input { height: auto; min-height: 4.5rem; padding: 0.4375rem 0.625rem; resize: vertical; line-height: 1.45; }
.input.mono { font-size: var(--text-sm); }
.input::placeholder { color: var(--ink-3); }
.input:hover:not(:focus) { border-color: var(--line-3); }
.input:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.input[aria-invalid='true'] { border-color: var(--danger); }
.input[aria-invalid='true']:focus-visible { box-shadow: var(--focus-ring-danger); }
@media (pointer: coarse) { .input:not(textarea) { height: var(--touch); } }
.search { max-width: 18rem; }

.segmented { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--radius-m); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.segment {
  height: calc(var(--control-h) - 4px); padding: 0 0.75rem; border: 0; border-radius: var(--radius-s); background: transparent;
  color: var(--ink-2); font-size: var(--text-sm); font-weight: 600; transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.segment:hover { color: var(--ink); }
.segment[aria-pressed='true'] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.segment:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.badge {
  display: inline-flex; align-items: center; gap: 0.3125rem; height: 1.25rem; padding: 0 0.5rem; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); font-size: var(--text-xs); font-weight: 600; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.badge[data-tone='ok'] { background: var(--ok-bg); color: var(--ok); }
.badge[data-tone='warn'] { background: var(--warn-bg); color: var(--warn); }
.badge[data-tone='danger'] { background: var(--danger-bg); color: var(--danger); }
.badge[data-tone='accent'] { background: var(--select); color: var(--accent-strong); }
.badge.plain::before { display: none; }

.notice {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; padding: 0.5rem 0.75rem; border-radius: var(--radius-m);
  background: var(--surface-2); color: var(--ink-2); font-size: var(--text-sm); line-height: 1.45;
}
.notice p { flex: 1 1 14rem; min-width: 0; }
.notice strong { color: var(--ink); font-weight: 600; }
.notice[data-tone='error'] { background: var(--danger-bg); color: var(--danger); }
.notice[data-tone='error'] strong { color: inherit; }
.notice[data-tone='ok'] { background: var(--ok-bg); color: var(--ok); }
.notice > .button { margin-left: auto; }

/* google sign-in button: light theme, colors, font and logo per google's branding guidelines */
.google {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 40px; min-width: 15rem; padding: 0 12px;
  border: 1px solid #747775; border-radius: 20px; background: #FFFFFF; color: #1F1F1F;
  font: 500 14px/20px 'Google Sans', Roboto, var(--font); letter-spacing: 0.25px; white-space: nowrap;
  transition: box-shadow 150ms var(--ease), background-color 150ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.google:hover { box-shadow: 0 1px 2px 0 oklch(0.3 0 0 / 0.3), 0 1px 3px 1px oklch(0.3 0 0 / 0.15); }
.google:active { background: #F2F2F2; }
.google:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.google[aria-disabled='true'] { border-color: #1F1F1F1F; color: #1F1F1F61; cursor: not-allowed; box-shadow: none; }
.google[aria-disabled='true'] .g-logo { opacity: 0.38; }
.google[aria-busy='true'] { cursor: progress; }
.google[aria-busy='true']:hover:not(:focus-visible) { box-shadow: none; }
.google[aria-busy='true'] span { animation: fade-in 160ms var(--ease) both; }
.google[aria-busy='true']::after {
  content: ''; flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: fade-in 160ms var(--ease) both, spin 700ms linear infinite;
}
.g-logo { width: 20px; height: 20px; flex: none; }

/* sign in: one small centered card; brand, title, help, then the single google action and any message */
.signin { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem; min-height: 100dvh; padding: 2rem 1rem 4rem; }
.signin-sheet {
  position: relative; display: grid; gap: 2rem; width: min(440px, 100%); min-width: 0; padding: 2.75rem; border-radius: var(--radius-xl);
  background: var(--surface); text-align: left; overflow-wrap: anywhere; overflow: clip;
}
/* handoff in flight: indeterminate line along the card's top edge; no percent, google owns the next step */
.signin-sheet:has(.google[aria-busy='true'])::before {
  content: ''; position: absolute; top: 0; left: 0; width: 40%; height: 2px; background: var(--accent);
  animation: fade-in 200ms var(--ease) both, handoff 1.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
.wordmark { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.01em; }
.wordmark span { color: var(--app-identity); font-weight: 400; }
.signin-copy { display: grid; gap: 0.5rem; }
.signin-copy h1 { margin-top: 1rem; font-size: 1.5rem; font-weight: 600; line-height: 1.25; }
.signin-copy p { color: var(--ink-2); font-size: var(--text-lg); line-height: 1.5; }
.signin-action { display: grid; gap: 0.75rem; min-width: 0; }
.signin-action .google { width: 100%; min-width: 0; min-height: var(--touch); height: auto; padding: 0.75rem; font-size: 0.875rem; line-height: 1.4; white-space: normal; text-align: center; }
.signin-action .button { min-height: var(--touch); height: auto; padding-block: 0.625rem; white-space: normal; }
.signin-action .notice { text-align: left; overflow-wrap: anywhere; }
.signin-foot { display: flex; justify-content: center; }
@media (max-width: 30rem) {
  .signin { padding: 2rem 1rem; }
  .signin-sheet { padding: 2rem 1.5rem; }
}

/* shell */
.shell { display: grid; grid-template-rows: var(--top) minmax(0, 1fr); min-height: 100dvh; }
.topbar { display: flex; align-items: center; gap: 1.25rem; min-width: 0; padding: 0 0.75rem 0 1rem; }
.lockup { display: inline-flex; align-items: baseline; gap: 0.3125rem; flex: none; padding: 0.25rem; border-radius: var(--radius-s); font-size: var(--text-lg); font-weight: 600; }
.lockup span { color: var(--app-identity); font-weight: 400; }
.nav { display: flex; gap: 0.125rem; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav a {
  display: inline-flex; align-items: center; height: var(--control-h); padding: 0 0.625rem; border-radius: var(--radius-m);
  color: var(--ink-2); font-weight: 600; white-space: nowrap; transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.nav a:hover { background: var(--chrome-hover); color: var(--ink); }
.nav a[aria-current='page'] { background: var(--chrome-current); color: var(--ink); }
.who { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; flex: none; }
.avatar {
  display: inline-grid; place-items: center; flex: none; width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--app-identity); color: var(--on-accent); font-size: var(--text-sm); font-weight: 600; text-transform: uppercase;
}
.avatar.large { width: 2.75rem; height: 2.75rem; font-size: 1rem; }
.avatar-button { padding: 0; border: 0; border-radius: 50%; background: none; }
.avatar-button:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.menu {
  inset: auto; position-area: bottom span-left; margin: 0.375rem 0 0; min-width: 15rem; max-width: min(20rem, calc(100vw - 1rem));
  padding: 0.375rem; border: 0; border-radius: var(--radius-l); background: var(--surface); box-shadow: var(--pop); color: var(--ink);
}
.menu:popover-open { animation: rise 160ms var(--ease) both; }
/* browsers without anchor positioning: pin the menu under the top bar's right edge */
@supports not (position-area: bottom) { .menu { position: fixed; top: calc(var(--top) - 0.25rem); right: 0.75rem; left: auto; } }
.menu-head { display: grid; gap: 0.125rem; padding: 0.5rem 0.625rem 0.625rem; border-bottom: 1px solid var(--line); margin-bottom: 0.25rem; min-width: 0; }
.menu-head strong { font-weight: 600; overflow-wrap: anywhere; }
.menu-head span { color: var(--ink-2); font-size: var(--text-sm); overflow-wrap: anywhere; }
.menu-item {
  display: flex; align-items: center; width: 100%; min-height: var(--control-h); padding: 0 0.625rem; border: 0; border-radius: var(--radius-m);
  background: none; text-align: left; font-weight: 400;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--hover); outline: none; }
@media (pointer: coarse) { .menu-item { min-height: var(--touch); } }

.sheet {
  position: relative; min-width: 0; margin: 0 var(--inset) var(--inset); border-radius: var(--radius-l);
  background: var(--surface); box-shadow: var(--shadow);
}
.sheet:focus { outline: none; }
html[data-embed] .shell { grid-template-rows: auto minmax(0, 1fr); background: var(--surface); }
html[data-embed] .topbar { display: grid; gap: 0.5rem; min-height: 0; padding: 1.25rem 1.25rem 0; }
html[data-embed] .console-title { font-size: var(--text-xl); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
html[data-embed] .nav { gap: 1.25rem; padding: 0; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
html[data-embed] .nav a {
  flex: none; height: auto; min-height: var(--touch); padding: 0.25rem 0; border-radius: 0; border-bottom: 2px solid transparent;
  background: none; font-size: var(--text-md);
}
html[data-embed] .nav a:hover { background: none; color: var(--ink); }
html[data-embed] .nav a[aria-current='page'] { border-bottom-color: var(--ink); background: none; color: var(--ink); }
html[data-embed] .nav a:focus-visible { outline-offset: -2px; }
html[data-embed] .sheet { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
html[data-embed] .wide, html[data-embed] .page { margin: 0; padding: 1.25rem 1.25rem 2rem; }
@media (max-width: 40rem) {
  html[data-embed] .topbar { padding: 0.75rem 0.75rem 0; }
  html[data-embed] .wide, html[data-embed] .page { padding: 1rem 0.75rem 2rem; }
}
html[data-embed] .shell.bare { grid-template-rows: minmax(0, 1fr); }
@media (max-width: 40rem) {
  .shell { grid-template-rows: auto minmax(0, 1fr); }
  .topbar { flex-wrap: wrap; row-gap: 0; padding: 0.25rem 0.5rem 0.25rem 0.75rem; }
  .lockup { min-height: 2.5rem; align-items: center; }
  .nav { order: 3; flex: 1 0 100%; padding-bottom: 0.375rem; }
  .sheet { margin: 0; border-radius: 0; box-shadow: none; border-top: 1px solid var(--line); }
}

/* pages */
.page { width: min(45rem, 100%); margin: 0 auto; padding: 2rem 1.25rem 3rem; display: grid; gap: 2rem; align-content: start; }
.wide { padding: 1.25rem 1.5rem 2rem; display: grid; gap: 1rem; align-content: start; min-width: 0; }
.page-header { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; min-width: 0; }
.page-header h1 { font-size: var(--text-xl); font-weight: 600; line-height: 1.3; }
.page-header h1:focus { outline: none; }
.count { color: var(--ink-2); font-size: var(--text-md); font-weight: 400; margin-left: 0.375rem; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; min-width: 0; }
.toolbar .search { flex: 0 1 18rem; }
.page-header .toolbar { margin-left: auto; flex-wrap: nowrap; }
@media (max-width: 40rem) {
  .wide { padding: 1rem 0.75rem 2rem; } .page { padding: 1.5rem 1rem 2.5rem; }
  .page-header .toolbar { margin-left: 0; width: 100%; flex-wrap: wrap; } .toolbar .search { flex: 1 1 100%; max-width: none; }
}

/* settings groups: label/value rows with hairlines */
.group { display: grid; gap: 0.5rem; }
.group > h2 { font-size: var(--text-lg); font-weight: 600; }
.group > .field-hint { margin-top: -0.25rem; max-width: 65ch; }
.rows { border-radius: var(--radius-l); box-shadow: inset 0 0 0 1px var(--line); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; min-height: 3.25rem; padding: 0.625rem 1rem; }
.row + .row, .row + .row-form, .row-form + .row { border-top: 1px solid var(--line); }
.row-main { display: grid; gap: 0.0625rem; flex: 1 1 14rem; min-width: 0; }
.row-main strong { font-weight: 600; }
.row-main span { color: var(--ink-2); font-size: var(--text-sm); overflow-wrap: anywhere; }
.row-end { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.row-form { display: grid; gap: 0.875rem; padding: 0.25rem 1rem 1rem; animation: fade-in 160ms var(--ease) both; }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.form-actions.start { justify-content: flex-start; }
label.button[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; }
.profile { display: flex; align-items: center; gap: 0.875rem; min-width: 0; }
.profile div { display: grid; min-width: 0; }
.profile strong { font-size: var(--text-lg); font-weight: 600; overflow-wrap: anywhere; }
.profile div span { color: var(--ink-2); overflow-wrap: anywhere; }

/* tables */
.table-wrap { min-width: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-md); }
.table th {
  height: 2rem; padding: 0 0.75rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap;
  color: var(--ink-2); font-size: var(--text-sm); font-weight: 600;
}
.table td { height: 3.25rem; padding: 0.375rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { cursor: pointer; transition: background-color 120ms var(--ease); }
.table tbody tr:hover { background: var(--hover-quiet); }
.table tbody tr[aria-selected='true'] { background: var(--select); }
.person { display: flex; align-items: center; gap: 0.625rem; min-width: 0; }
.person .avatar { width: 1.75rem; height: 1.75rem; font-size: var(--text-xs); }
.person-text { display: grid; min-width: 0; }
.row-open { padding: 0; border: 0; background: none; font-weight: 600; text-align: left; overflow-wrap: anywhere; border-radius: var(--radius-s); }
.row-open:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.person-text span { color: var(--ink-2); font-size: var(--text-sm); overflow-wrap: anywhere; }
.service-cell { color: var(--ink-2); font-size: var(--text-sm); white-space: nowrap; }
.service-cell.linked { color: var(--ink); }
@media (max-width: 52rem) { .optional { display: none; } }

/* inspector: overlays the list so the list keeps its width */
.inspector {
  position: fixed; z-index: var(--z-inspector); top: calc(var(--top) + 0.25rem); right: calc(var(--inset) + 0.25rem); bottom: calc(var(--inset) + 0.25rem);
  display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(26rem, calc(100vw - 2rem));
  border-radius: var(--radius-l); background: var(--surface); box-shadow: var(--pop); animation: slide-in 200ms var(--ease) both;
}
html[data-embed] .inspector { top: 0.5rem; }
.inspector-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.625rem 0.625rem 0.625rem 1rem; border-bottom: 1px solid var(--line); min-width: 0; }
.inspector-head h2 { flex: 1; min-width: 0; font-size: var(--text-lg); font-weight: 600; overflow-wrap: anywhere; }
.inspector-head h2:focus { outline: none; }
.inspector-body { display: grid; gap: 1.25rem; align-content: start; padding: 1rem; overflow-y: auto; overscroll-behavior: contain; }
.inspector-section { display: grid; gap: 0.5rem; min-width: 0; }
.inspector-section h3 { font-size: var(--text-sm); font-weight: 600; color: var(--ink-2); }
.inspector .row-main { flex-basis: 8rem; }
.inspector .row { padding: 0.5rem 0.75rem; min-height: 2.75rem; }
@media (max-width: 40rem) { .inspector { inset: 0; width: 100%; border-radius: 0; } }

.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.375rem 1rem; align-items: baseline; }
.facts dt { color: var(--ink-2); font-size: var(--text-sm); }
.facts dd { min-width: 0; overflow-wrap: anywhere; }
.copyable { display: flex; align-items: center; gap: 0.375rem; min-width: 0; }
.copyable .mono { flex: 1; min-width: 0; }
.copyable .button { align-self: center; }
.binding { display: grid; gap: 0.5rem; padding: 0.75rem; border-radius: var(--radius-m); box-shadow: inset 0 0 0 1px var(--line); }
.binding-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.binding-head strong { font-weight: 600; }
.quote { padding: 0.5rem 0.75rem; border-radius: var(--radius-m); background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; }

/* view states */
.state { display: grid; justify-items: center; align-content: center; gap: 0.25rem; max-width: 46ch; margin: 0 auto; padding: 3rem 1.5rem; text-align: center; }
.state.fill { min-height: calc(100dvh - var(--top) - 2rem); }
.state-title { color: var(--ink); font-size: var(--text-lg); font-weight: 600; }
.state-detail { color: var(--ink-2); text-wrap: pretty; }
.state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 0.75rem; }
.state-loading { animation: fade-in 200ms 150ms both; }
.sk { display: block; border-radius: var(--radius-s); background: oklch(0.935 0.003 255); animation: sk-pulse 1.6s ease-in-out infinite; }
.sk-line { height: 0.625rem; }
.sk-row { display: flex; align-items: center; gap: 0.75rem; min-height: 3.25rem; padding: 0 0.75rem; border-bottom: 1px solid var(--line); }
.sk-stack { display: grid; gap: 0.5rem; flex: 1; min-width: 0; }
.sk-dot { flex: none; width: 1.75rem; height: 1.75rem; border-radius: 50%; }

/* embedded review surface */
.frame { width: 100%; min-height: calc(100dvh - var(--top) - 9rem); border: 0; border-radius: var(--radius-m); box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); }

/* dialog */
.dialog { width: min(26rem, calc(100vw - 2rem)); padding: 0; border: 0; border-radius: var(--radius-l); background: var(--surface); box-shadow: var(--pop); color: var(--ink); }
.dialog::backdrop { background: var(--scrim); }
.dialog[open] { animation: rise 180ms var(--ease) both; }
.dialog form { display: grid; gap: 0.5rem; padding: 1.25rem; }
.dialog h2 { font-size: var(--text-lg); font-weight: 600; }
.dialog p { color: var(--ink-2); }
.dialog .form-actions { margin-top: 0.75rem; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(12px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sk-pulse { 50% { opacity: 0.55; } }
@keyframes handoff { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .sk { animation: none; }
  .button[aria-busy='true']::before { animation: spin 1.4s linear infinite !important; }
  /* static handoff: full-width line, no spinner */
  .signin-sheet:has(.google[aria-busy='true'])::before { width: 100%; animation: none !important; }
  .google[aria-busy='true']::after { display: none; }
}

/* choices: radio and checkbox rows */
legend.field-label { padding: 0; margin-bottom: 0.25rem; }
.choices { display: grid; gap: 0.375rem; max-height: 14rem; overflow-y: auto; }
.choice {
  display: flex; align-items: flex-start; gap: 0.625rem; padding: 0.625rem 0.75rem; border-radius: var(--radius-m);
  box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer; transition: background-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.choice:hover { background: var(--hover-quiet); }
.choice:has(:checked) { background: var(--select); box-shadow: inset 0 0 0 1px var(--accent); }
.choice:has(:focus-visible) { box-shadow: inset 0 0 0 1px var(--accent), var(--focus-ring); }
.choice-input, .check-input { flex: none; width: 1rem; height: 1rem; margin: 0.1875rem 0 0; accent-color: var(--accent); }
.choice-input:focus-visible, .check-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice-text { display: grid; gap: 0.0625rem; min-width: 0; }
.choice-text strong { font-weight: 600; }
.choice-text > span { color: var(--ink-2); font-size: var(--text-sm); overflow-wrap: anywhere; }
.check { display: flex; align-items: flex-start; gap: 0.625rem; cursor: pointer; line-height: 1.45; }
.check:has(:disabled) { cursor: not-allowed; color: var(--ink-2); }
.check strong { font-weight: 600; }

.sk-line[data-w='a'] { width: 60%; }
.sk-line[data-w='b'] { width: 45%; }
.sk-line.short { width: 30%; }
.table.static tbody tr { cursor: default; }
.table.static tbody tr:hover { background: none; }
.outcome { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; }
.outcome .muted { font-size: var(--text-sm); }

/* plan rows: native disclosures laid out as a table */
.plan-list { display: grid; min-width: 0; }
.plan-head, .plan-row > summary { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 0.75rem; align-items: center; padding: 0 0.75rem 0 1.75rem; }
.plan-head { height: 2rem; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: var(--text-sm); font-weight: 600; }
.plan-row { border-bottom: 1px solid var(--line); }
.plan-row > summary { position: relative; min-height: 3.25rem; padding-block: 0.375rem; cursor: pointer; list-style: none; border-radius: var(--radius-s); transition: background-color 120ms var(--ease); }
.plan-row > summary::-webkit-details-marker { display: none; }
.plan-row > summary::before {
  content: ''; position: absolute; left: 0.625rem; top: 50%; width: 0.4rem; height: 0.4rem; margin-top: -0.25rem;
  border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2); transform: rotate(-45deg); transition: transform 150ms var(--ease);
}
.plan-row[open] > summary::before { transform: rotate(45deg); }
.plan-row > summary:hover { background: var(--hover-quiet); }
.plan-row > summary:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.plan-row[data-blocking] > summary { background: var(--danger-bg); }
.plan-detail { padding: 0.25rem 0.75rem 1rem 1.75rem; }
.plan-detail .facts dd > span:has(.copyable) { display: grid; gap: 0.125rem; }
@media (max-width: 52rem) { .plan-head, .plan-row > summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* services: rows that disclose their sign-in detail */
.service-row + .service-row { border-top: 1px solid var(--line); }
.service-row > summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; min-height: 3.5rem; padding: 0.625rem 1rem 0.625rem 2.25rem;
  position: relative; cursor: pointer; list-style: none; border-radius: var(--radius-l); transition: background-color 120ms var(--ease);
}
.service-row > summary::-webkit-details-marker { display: none; }
.service-row > summary::before {
  content: ''; position: absolute; left: 1rem; top: 50%; width: 0.4rem; height: 0.4rem; margin-top: -0.25rem;
  border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2); transform: rotate(-45deg); transition: transform 150ms var(--ease);
}
.service-row[open] > summary::before { transform: rotate(45deg); }
.service-row > summary:hover { background: var(--hover-quiet); }
.service-row > summary:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.service-detail { display: grid; gap: 0.875rem; padding: 0 1rem 1rem 2.25rem; }
