:root {
  color-scheme: light;
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-subtle: #f7f9f7;
  --surface-muted: #ecefeb;
  --ink: #202520;
  --muted: #626a63;
  --quiet: #7d857e;
  --line: #d7dcd6;
  --line-strong: #aab2aa;
  --accent: #167a45;
  --accent-strong: #0f6236;
  --accent-soft: #e5f2e9;
  --warning: #8b5a13;
  --warning-soft: #fff5df;
  --danger: #a33d2e;
  --dark: #202721;
  --dark-surface: #293129;
  --dark-line: #424b43;
  --sticky-offset: 84px;
  --assistant-width: 380px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button, a, label { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible { outline: 3px solid rgba(22, 122, 69, .24); outline-offset: 2px; }

.launcher-shell {
  width: min(1320px, calc(100% - 48px));
  margin-inline: auto;
  padding: 28px 0 96px;
  transition: width .22s ease, margin .22s ease;
}
.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding: 4px 0 28px;
  border-bottom: 1px solid var(--line);
}
.page-kicker { margin: 0 0 8px; color: var(--accent); font-size: 10px; font-weight: 800; }
.page-heading h1 { margin: 0; font-size: 32px; line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; }
.page-heading > div > p:last-child { max-width: 680px; margin: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

.style-direction { padding: 32px 0 36px; border-bottom: 1px solid var(--line); }
.section-heading {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  margin-bottom: 16px;
}
.section-heading h2 { margin: 0; font-size: 18px; line-height: 1.35; letter-spacing: -.02em; text-wrap: balance; }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.section-heading a { align-self: center; color: var(--accent-strong); font-size: 11px; font-weight: 800; text-underline-offset: 4px; white-space: nowrap; }

.style-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.style-card-grid > :is(label, button),
.style-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 154px;
  align-content: start;
  gap: 9px;
  padding: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.style-card-grid > :is(label, button):hover,
.style-card:hover { border-color: var(--line-strong); background: var(--surface-subtle); }
.style-card-grid input,
.choice-grid input,
.choice-list input,
.segmented-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.style-card-media,
.style-card-thumb { display: grid; width: 100%; aspect-ratio: 16 / 9; place-items: center; overflow: hidden; border-radius: 4px; background: var(--surface-muted); }
.style-card-media img,
.style-card-thumb img,
.style-card-grid picture { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.style-card-grid strong,
.style-card strong { padding-inline: 3px 28px; font-size: 12px; line-height: 1.35; }
.style-card-grid small,
.style-card small { padding: 0 28px 3px 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.style-card-grid > :is(label, button):is(:has(input:checked), [aria-checked="true"], [aria-pressed="true"], .is-selected),
.style-card:is(:has(input:checked), [aria-checked="true"], [aria-pressed="true"], .is-selected) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.style-card-grid > :is(label, button):is(:has(input:checked), [aria-checked="true"], [aria-pressed="true"], .is-selected)::after,
.style-card:is(:has(input:checked), [aria-checked="true"], [aria-pressed="true"], .is-selected)::after {
  position: absolute;
  right: 10px;
  bottom: 12px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  content: "\2713";
  font-size: 11px;
  font-weight: 900;
}
.style-card-grid > label:has(input:focus-visible),
.style-card:has(input:focus-visible) { outline: 3px solid rgba(22, 122, 69, .24); outline-offset: 2px; }
.style-card-copy { display: grid; min-width: 0; gap: 3px; }
.style-card-example { padding-inline: 3px; color: var(--accent-strong); font-size: 9px; font-weight: 800; line-height: 1.3; }
.selection-check {
  position: absolute;
  right: 10px;
  bottom: 12px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  opacity: 0;
}
.style-card:is(.is-selected, :has(input:checked)) .selection-check { opacity: 1; }
.style-card:is(.is-selected, :has(input:checked))::after { display: none; }

.color-theme-section { padding: 28px 0 32px; border-bottom: 1px solid var(--line); }
.color-theme-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.color-theme-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 126px;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--theme-border);
  border-radius: 7px;
  background: var(--theme-canvas);
  color: var(--theme-ink);
}
.color-theme-choice {
  display: grid;
  min-width: 0;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 36px 6px 12px;
  cursor: pointer;
}
.color-theme-card:hover { box-shadow: inset 0 0 0 1px var(--theme-muted); }
.color-theme-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.color-theme-palette {
  display: grid;
  width: 82px;
  height: 58px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  background: var(--theme-surface);
}
.color-theme-palette i { display: block; min-width: 0; }
.theme-swatch-canvas { background: var(--theme-canvas); }
.theme-swatch-surface { background: var(--theme-surface); }
.theme-swatch-accent { background: var(--theme-accent); }
.theme-swatch-accent-soft { background: var(--theme-accent-soft); }
.theme-swatch-ink { background: var(--theme-ink); }
.color-theme-copy { display: grid; min-width: 0; gap: 5px; }
.color-theme-copy strong { color: var(--theme-ink); font-size: 12px; line-height: 1.35; }
.color-theme-copy small { color: var(--theme-muted); font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.color-theme-meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 7px;
  color: var(--theme-muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.color-theme-meta > * { min-width: 0; }
.color-theme-meta > * + *::before { margin-right: 7px; color: var(--theme-border); content: "\00b7"; }
.color-theme-source {
  width: fit-content;
  margin: 0 36px 10px 106px;
  color: var(--theme-muted);
  font-size: 9px;
  font-weight: 750;
  line-height: 1.4;
  text-underline-offset: 2px;
}
.color-theme-source:hover { color: var(--theme-ink); }
.color-theme-check {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--theme-action-accent);
  color: var(--theme-on-accent);
  font-size: 11px;
  font-weight: 900;
  opacity: 0;
}
.color-theme-card:is(.is-selected, :has(input:checked)) {
  border-color: var(--theme-accent);
  box-shadow: inset 0 0 0 1px var(--theme-accent);
}
.color-theme-card:is(.is-selected, :has(input:checked)) .color-theme-check { opacity: 1; }
.color-theme-card:has(input:focus-visible) {
  outline: 2px solid var(--theme-ink);
  outline-offset: 2px;
  box-shadow: inset 0 0 0 1px var(--theme-accent), 0 0 0 4px var(--theme-accent);
}

.font-workbench { min-width: 0; padding: 28px 0 32px; border-bottom: 1px solid var(--line); }
.font-workbench-heading {
  display: flex;
  min-width: 0;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}
.font-workbench-heading > div { min-width: 0; }
.font-workbench-heading h2,
.font-workbench-heading h3 { margin: 0; color: var(--ink); font-size: 18px; letter-spacing: -.02em; line-height: 1.35; }
.font-workbench-heading p { max-width: 680px; margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.font-source-status {
  display: inline-flex;
  width: 112px;
  min-width: 88px;
  min-height: 26px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}
.font-source-status::before { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--quiet); content: ""; }
.font-source-status.is-loading { color: var(--warning); }
.font-source-status.is-loading::before { background: var(--warning); }
.font-source-status.is-ready { border-color: #b9d8c3; color: var(--accent-strong); }
.font-source-status.is-ready::before { background: var(--accent); }
.font-source-status.is-fallback { color: var(--muted); }
.font-source-status.is-fallback::before { background: var(--line-strong); }

.font-preset-grid { display: grid; min-width: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.font-preset-card {
  position: relative;
  display: grid;
  min-width: 0;
  height: 165px;
  grid-template-rows: 78px 56px;
  gap: 9px;
  padding: 10px 34px 10px 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.font-preset-card input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.font-preset-choice {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
}
.font-preset-choice::after { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); content: ""; opacity: 0; }
.font-preset-card:is(:hover, :has(input:checked)) { border-color: var(--line-strong); }
.font-preset-card:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.font-preset-card:has(input:checked) .font-preset-choice { border-color: var(--accent); }
.font-preset-card:has(input:checked) .font-preset-choice::after { opacity: 1; }
.font-preset-card:has(input:focus-visible) { outline: 3px solid rgba(22, 122, 69, .24); outline-offset: 2px; }
.font-preset-sample {
  display: grid;
  min-width: 0;
  height: 78px;
  align-content: center;
  gap: 6px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-subtle);
  font-family: var(--preview-heading-font, ui-sans-serif), ui-sans-serif, system-ui, sans-serif;
  font-size: 24px;
  font-weight: var(--preview-heading-weight, 700);
  line-height: 1.05;
}
.font-preset-sample > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-preset-sample small {
  color: var(--muted);
  font-family: var(--preview-body-font, ui-sans-serif), ui-sans-serif, system-ui, sans-serif;
  font-size: 10px;
  font-weight: var(--preview-body-weight, 400);
  line-height: 1.35;
}
.font-preset-copy { display: grid; min-width: 0; height: 56px; align-content: start; gap: 3px; overflow: hidden; }
.font-preset-copy strong { overflow: hidden; color: var(--ink); font-size: 11px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.font-preset-copy small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.font-preview-shell { min-width: 0; margin-top: 14px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); }
.font-preview-toolbar {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  line-height: 1.35;
}
.font-preview-toolbar > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-preview-sources { display: inline-flex; align-items: center; justify-content: end; gap: 5px; }
.font-preview-sources a { color: inherit; text-underline-offset: 2px; }
.font-preview-sources a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.font-preview-page {
  height: 360px;
  overflow: hidden;
  background: #fff;
  color: #1e2420;
  font-family: var(--preview-body-font, ui-sans-serif), ui-sans-serif, system-ui, sans-serif;
  font-weight: var(--preview-body-weight, 400);
  font-synthesis: none;
}
.font-preview-nav {
  display: grid;
  height: 58px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 0 28px;
  border-bottom: 1px solid #e2e6e1;
}
.font-preview-brand {
  min-width: 0;
  overflow: hidden;
  font-family: var(--preview-heading-font, ui-sans-serif), ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  font-weight: var(--preview-heading-weight, 700);
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.font-preview-nav-items { display: flex; min-width: 0; align-items: center; justify-content: end; gap: 20px; color: #5c665f; font-size: 10px; font-weight: var(--preview-body-strong-weight, 600); white-space: nowrap; }
.font-preview-content { display: grid; min-width: 0; align-content: start; padding: 34px 36px; }
.font-preview-eyebrow { margin: 0 0 10px; color: var(--accent-strong); font-size: 9px; font-weight: var(--preview-heading-weight, 700); line-height: 1.35; text-transform: uppercase; }
.font-preview-title {
  display: -webkit-box;
  width: min(720px, 100%);
  height: 78px;
  margin: 0;
  overflow: hidden;
  color: #172019;
  font-family: var(--preview-heading-font, ui-sans-serif), ui-sans-serif, system-ui, sans-serif;
  font-size: 30px;
  font-weight: var(--preview-heading-weight, 700);
  line-height: 1.22;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.font-preview-lede {
  display: -webkit-box;
  width: min(650px, 100%);
  height: 44px;
  margin: 9px 0 0;
  overflow: hidden;
  color: #5c665f;
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.font-preview-metrics { display: grid; width: min(650px, 100%); height: 50px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 17px; }
.font-preview-metric { display: grid; min-width: 0; align-content: start; gap: 3px; border-top: 1px solid #dfe4df; padding-top: 7px; }
.font-preview-metric strong { overflow: hidden; color: #172019; font-family: var(--preview-heading-font, ui-sans-serif), ui-sans-serif, system-ui, sans-serif; font-size: 13px; font-weight: var(--preview-heading-weight, 700); line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.font-preview-metric small { overflow: hidden; color: #6a746d; font-size: 9px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.font-preview-actions { display: flex; min-width: 0; height: 38px; align-items: stretch; gap: 8px; margin-top: 16px; }
.font-preview-primary,
.font-preview-secondary { display: inline-flex; min-width: 0; min-height: 38px; align-items: center; justify-content: center; padding: 0 13px; border-radius: 5px; font-size: 10px; font-weight: var(--preview-body-strong-weight, 600); line-height: 1.3; text-decoration: none; white-space: nowrap; }
.font-preview-primary { border: 1px solid var(--accent); background: var(--accent); color: #fff; }
.font-preview-secondary { border: 1px solid #adb5ae; background: #fff; color: #273029; }

.mode-picker { padding: 24px 0 0; }
.mode-picker-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 9px; }
.mode-picker-heading h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.mode-picker-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.intent-nav { width: 100%; }
.mode-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.mode-tabs button {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 58px;
  align-content: center;
  gap: 3px;
  padding: 9px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.mode-tabs button:last-child { border-right: 0; }
.mode-tabs button:hover { background: var(--surface-subtle); }
.mode-tabs button[aria-selected="true"] { background: var(--accent-soft); }
.mode-tabs button[aria-selected="true"]::after { position: absolute; right: 10px; bottom: 0; left: 10px; height: 3px; background: var(--accent); content: ""; }
.mode-tabs strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.mode-tabs small { overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }

.launcher-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 410px); align-items: start; gap: 42px; margin-top: 36px; }
.configuration-column,
.intent-form { min-width: 0; }
.intent-form { display: grid; gap: 64px; }
.config-section { min-width: 0; padding: 0; scroll-margin-top: var(--sticky-offset); }
.config-section + .config-section { padding: 0; border: 0; }
.config-section .section-heading > span { display: none; }
.config-section .section-heading { grid-template-columns: minmax(0, 1fr) auto; margin-bottom: 17px; }
.control-group { min-width: 0; margin: 0 0 20px; padding: 0; border: 0; }
.control-group:last-child { margin-bottom: 0; }
.control-group legend { margin-bottom: 9px; color: var(--ink); font-size: 11px; font-weight: 800; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.target-type-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choice-grid label,
.choice-list label {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, opacity .16s ease;
}
.choice-grid label { display: grid; min-height: 78px; align-content: center; gap: 5px; padding: 12px 38px 12px 12px; }
.choice-list { display: grid; gap: 8px; }
.choice-list label { display: flex; min-height: 50px; align-items: center; gap: 10px; padding: 10px 38px 10px 12px; }
.choice-list label > span { display: grid; gap: 3px; }
.choice-grid label:hover,
.choice-list label:hover { border-color: var(--line-strong); background: var(--surface-subtle); }
.choice-grid strong,
.choice-list strong { font-size: 12px; line-height: 1.35; }
.choice-grid small,
.choice-list small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.choice-grid label:not(:has(input[value="all"])):has(input:checked),
.choice-list label:not(:has(input[value="all"])):has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.choice-grid label:not(:has(input[value="all"])):has(input:checked)::after,
.choice-list label:not(:has(input[value="all"])):has(input:checked)::after {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  content: "\2713";
  font-size: 10px;
  font-weight: 900;
}
.choice-grid label:has(input:focus-visible),
.choice-list label:has(input:focus-visible),
.segmented-control label:has(input:focus-visible) { outline: 3px solid rgba(22, 122, 69, .22); outline-offset: 2px; }

.check-grid label:has(input[value="all"]),
.full-review-switch,
.comprehensive-switch {
  position: relative;
  display: grid;
  min-height: 58px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  margin-top: 5px;
  padding: 10px 58px 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-muted);
  cursor: pointer;
}
.full-review-switch input,
.comprehensive-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.full-review-switch > span,
.comprehensive-switch > span { display: grid; min-width: 0; gap: 3px; }
.full-review-switch strong,
.comprehensive-switch strong { font-size: 12px; }
.full-review-switch small,
.comprehensive-switch small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.full-review-switch:has(input:focus-visible),
.comprehensive-switch:has(input:focus-visible) { outline: 3px solid rgba(22, 122, 69, .22); outline-offset: 2px; }
.full-review-switch + .focus-options,
.comprehensive-switch + .focus-options { margin-top: 16px; }
.check-grid label:has(input[value="all"])::after,
.full-review-switch::after,
.comprehensive-switch::after { position: absolute; right: 12px; width: 38px; height: 22px; border: 1px solid var(--line-strong); border-radius: 999px; background: #cbd0cb; content: ""; }
.check-grid label:has(input[value="all"])::before,
.full-review-switch::before,
.comprehensive-switch::before {
  position: absolute;
  z-index: 1;
  right: 30px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(31, 37, 32, .25);
  content: "";
  transition: transform .16s ease;
}
.check-grid label:has(input[value="all"]:checked),
.full-review-switch:has(input:checked),
.comprehensive-switch:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.check-grid label:has(input[value="all"]:checked)::after,
.full-review-switch:has(input:checked)::after,
.comprehensive-switch:has(input:checked)::after { border-color: var(--accent); background: var(--accent); }
.check-grid label:has(input[value="all"]:checked)::before,
.full-review-switch:has(input:checked)::before,
.comprehensive-switch:has(input:checked)::before { transform: translateX(16px); }
.choice-grid label:has(input:disabled),
.choice-list label:has(input:disabled),
.choice-grid label[aria-disabled="true"],
.choice-list label[aria-disabled="true"],
.choice-grid label.is-disabled,
.choice-list label.is-disabled { border-color: var(--line); background: #eef0ed; cursor: not-allowed; opacity: .52; }
.focus-options.is-disabled > :not(legend) { opacity: .72; }
.permission-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.text-field { display: grid; gap: 7px; margin-top: 14px; scroll-margin-top: var(--sticky-offset); }
.text-field > span,
.search-field > span { color: var(--ink); font-size: 11px; font-weight: 800; }
.text-field input,
.text-field textarea,
.search-field input { width: 100%; min-width: 0; border: 1px solid var(--line-strong); border-radius: 6px; outline: 0; background: var(--surface); color: var(--ink); font-size: 13px; }
.text-field input,
.search-field input { min-height: 44px; padding: 0 12px; }
.text-field textarea { min-height: 112px; resize: vertical; padding: 12px; line-height: 1.65; }
.text-field input::placeholder,
.text-field textarea::placeholder,
.search-field input::placeholder { color: #7c847d; opacity: 1; }
.text-field input:focus,
.text-field textarea:focus,
.search-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22, 122, 69, .12); }
.field-error { min-height: 14px; color: var(--danger); font-size: 10px; }
.text-field.has-error input,
.text-field.has-error textarea,
.text-field.is-targeted input,
.text-field.is-targeted textarea { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(163, 61, 46, .1); }
.text-field.is-attention input,
.text-field.is-attention textarea,
.control-group.is-attention,
.config-section.is-attention { outline: 3px solid rgba(163, 61, 46, .16); outline-offset: 5px; }
.text-field.is-disabled { opacity: .58; }
.text-field.is-disabled input { background: var(--surface-muted); cursor: not-allowed; }
.select-field { display: grid; min-width: 0; gap: 7px; }
.select-field > span { color: var(--ink); font-size: 11px; font-weight: 800; }
.select-field select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
}
.select-field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22, 122, 69, .12); }
.decision-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.single-control { width: min(360px, 100%); margin-top: 18px; }
.token-foundation-block {
  margin-top: 16px;
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-subtle);
}
.token-foundation-heading { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.token-foundation-heading h3 { margin: 0; color: var(--ink); font-size: 12px; line-height: 1.4; }
.token-foundation-heading span { color: var(--accent-strong); font-size: 10px; font-weight: 750; line-height: 1.4; white-space: nowrap; }
.token-foundation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  gap: 24px;
  margin: 0;
  padding: 0;
}
.token-foundation > div { min-width: 0; }
.token-foundation dt { color: var(--muted); font-size: 10px; line-height: 1.4; }
.token-foundation dd { display: grid; gap: 3px; margin: 5px 0 0; overflow-wrap: anywhere; }
.token-foundation dd strong { color: var(--ink); font-size: 13px; font-weight: 750; line-height: 1.45; }
.token-foundation dd small { color: var(--accent-strong); font-size: 9px; font-weight: 700; line-height: 1.4; }
.brief-seed-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 9px; }
.brief-seed-row .text-field { margin-top: 0; }
.assist-brief-button,
.inline-primary-button {
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.assist-brief-button:hover,
.inline-primary-button:hover { border-color: var(--accent-strong); background: var(--accent-strong); }
.assist-brief-button[aria-busy="true"] { cursor: progress; opacity: .72; }
.structured-brief { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.structured-brief .text-field { margin-top: 0; }
.brief-suggestion { display: grid; gap: 12px; margin-top: 14px; padding: 14px; border: 1px solid #b9d8c3; border-radius: 6px; background: var(--accent-soft); }
.brief-suggestion > div:first-child { display: grid; gap: 3px; }
.brief-suggestion strong { font-size: 12px; }
.brief-suggestion small { color: var(--muted); font-size: 9px; }
.brief-suggestion dl { display: grid; grid-template-columns: 72px minmax(0, 1fr); margin: 0; }
.brief-suggestion dt,
.brief-suggestion dd { padding: 5px 0; border-bottom: 1px solid #c9dfcf; font-size: 10px; line-height: 1.5; }
.brief-suggestion dt { color: var(--muted); }
.brief-suggestion dd { margin: 0; color: var(--ink); }
.brief-suggestion > div:last-child { display: flex; align-items: center; gap: 12px; }
.brief-fields,
.brief-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.brief-chips,
.prompt-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.brief-chips button,
.prompt-chips button,
.brief-assist-button,
.enhance-brief { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--muted); font-size: 10px; font-weight: 750; }
.brief-chips button:hover,
.prompt-chips button:hover,
.brief-assist-button:hover,
.enhance-brief:hover { border-color: var(--accent); color: var(--accent-strong); }

.segmented-control { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-muted); }
.segmented-control label { position: relative; cursor: pointer; }
.segmented-control span { display: grid; min-height: 42px; place-items: center; padding: 6px 8px; border-radius: 3px; color: var(--muted); font-size: 11px; font-weight: 750; text-align: center; }
.segmented-control input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(32, 37, 31, .13); }
.target-type-control { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.target-field { margin-top: 10px; }
.reference-source { margin-bottom: 12px; }
.reference-content { min-height: 88px; }
.library-reference,
.upload-preview {
  display: grid;
  min-width: 0;
  min-height: 84px;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.library-reference img,
.upload-preview img { width: 76px; height: 66px; border-radius: 4px; object-fit: cover; }
.library-reference label,
.upload-preview > div { display: grid; min-width: 0; gap: 5px; }
.library-reference label span { color: var(--muted); font-size: 10px; }
.library-reference select { width: 100%; min-width: 0; min-height: 34px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); color: var(--ink); font-size: 11px; }
.library-reference a,
.library-reference button,
.upload-preview button { min-height: 36px; padding: 0 8px; border: 0; background: transparent; color: var(--accent-strong); font-size: 11px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.upload-preview strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.upload-preview small { color: var(--muted); font-size: 10px; }
.upload-zone {
  position: relative;
  display: grid;
  min-height: 94px;
  place-items: center;
  align-content: center;
  gap: 5px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: var(--surface-subtle);
  cursor: pointer;
}
.upload-zone:hover,
.upload-zone:focus-within { border-color: var(--accent); background: var(--surface); }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-zone > span { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; background: var(--dark); color: #fff; font-size: 18px; font-weight: 400; }
.upload-zone strong { font-size: 12px; }
.upload-zone small,
.privacy-note { color: var(--muted); font-size: 10px; }
.privacy-note { margin: 8px 0 0; color: var(--quiet); }
.reference-empty { margin: 0; padding: 16px; border: 1px dashed var(--line); border-radius: 5px; background: var(--surface-subtle); color: var(--muted); font-size: 11px; line-height: 1.55; }
.reference-empty p { margin: 0 0 10px; }
.reference-empty.is-skipped { border-style: solid; border-color: #b9d8c3; background: var(--accent-soft); color: #3f5546; }
.selected-case {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(210px, .8fr) minmax(0, 1.35fr) auto;
  align-items: start;
  gap: 16px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.selected-case-media { display: grid; min-width: 0; margin: 0; aspect-ratio: 4 / 3; place-items: center; overflow: hidden; border-radius: 5px; background: var(--surface-muted); }
.selected-case-media img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.selected-case-content { display: grid; min-width: 0; gap: 10px; }
.selected-case-heading { display: grid; min-width: 0; gap: 3px; }
.selected-case-heading small { color: var(--accent); font-size: 9px; font-weight: 800; }
.selected-case-heading h3 { margin: 0; font-size: 17px; line-height: 1.3; }
.selected-case-heading span { color: var(--muted); font-size: 10px; line-height: 1.4; }
.selected-case-summary { margin: 0; color: var(--ink); font-size: 11px; line-height: 1.65; }
.selected-case-facts { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--line); }
.selected-case-facts > div { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.selected-case-facts dt { color: var(--quiet); font-size: 9px; font-weight: 800; }
.selected-case-facts dd { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.selected-case-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; padding: 0; list-style: none; }
.selected-case-tags li { padding: 4px 6px; border-radius: 3px; background: var(--surface-muted); color: var(--muted); font-size: 9px; }
.selected-case-actions { display: flex; align-items: flex-start; justify-content: flex-end; }
.selected-case button { min-height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); color: var(--accent-strong); font-size: 10px; font-weight: 800; white-space: nowrap; }
.selected-case button:hover { border-color: var(--accent); background: var(--accent-soft); }
.system-control { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.system-recommendation { margin: 10px 0 0; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); color: #394c3f; font-size: 11px; line-height: 1.55; }
.lab-link { display: inline-flex; min-height: 40px; align-items: center; margin-top: 12px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--ink); font-size: 11px; font-weight: 800; text-decoration: none; }
.lab-link:hover { border-color: var(--accent); color: var(--accent-strong); }

.prompt-column { position: sticky; top: var(--sticky-offset); min-width: 0; max-height: calc(100dvh - var(--sticky-offset) - 18px); align-self: start; }
.prompt-panel {
  max-height: inherit;
  overflow: auto;
  border: 1px solid #394239;
  border-radius: 8px;
  background: var(--dark);
  color: #f4f7f3;
  box-shadow: 0 16px 38px rgba(31, 39, 32, .14);
  scrollbar-color: #59635a transparent;
}
.prompt-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; padding: 18px 18px 16px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.prompt-heading p { margin: 0; color: #aeb7ad; font-size: 9px; font-weight: 800; }
.prompt-heading h2 { margin: 5px 0 0; font-size: 18px; letter-spacing: -.02em; }
.ready-state { display: inline-flex; align-items: center; gap: 7px; color: #c0c8bf; font-size: 10px; white-space: nowrap; }
.ready-state i { width: 7px; height: 7px; border-radius: 50%; background: #8e998d; }
.ready-state.is-ready i { background: #65df90; box-shadow: 0 0 0 4px rgba(101, 223, 144, .1); }
.summary-progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, .1); list-style: none; }
.summary-progress li { position: relative; display: grid; min-width: 0; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 6px; padding: 0 8px; color: #aeb7ad; font-size: 9px; line-height: 1.4; }
.summary-progress li + li { border-left: 1px solid rgba(255, 255, 255, .12); }
.summary-progress li i { display: grid; width: 17px; height: 17px; place-items: center; border: 1px solid #69736a; border-radius: 50%; color: #bdc6bc; font-size: 8px; font-style: normal; }
.summary-progress li > span { display: grid; min-width: 0; gap: 2px; }
.summary-progress li strong { overflow: hidden; color: #e8eee6; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.summary-progress li small { overflow: hidden; color: inherit; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.summary-progress li:is(.is-complete, .is-current, .is-skipped),
.summary-progress li[data-state="complete"],
.summary-progress li[data-state="skipped"] { color: #8bd9a8; }
.summary-progress li:is(.is-complete, .is-skipped) i { border-color: #65df90; background: #65df90; color: #102116; }
.summary-progress button { min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.missing-state {
  margin: 14px 18px 0;
  padding: 9px 11px;
  overflow: hidden;
  border: 1px solid rgba(255, 211, 126, .32);
  border-radius: 5px;
  background: rgba(255, 211, 126, .08);
  color: #ffe1a4;
  font-size: 11px;
  line-height: 1.5;
}
.missing-state:empty { display: none; }
.missing-state > button,
.missing-state a { display: inline; width: auto; min-height: 28px; padding: 0 2px; border: 0; background: transparent; color: inherit; font-size: inherit; font-weight: 800; line-height: inherit; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.missing-state > button:hover,
.missing-state a:hover { color: #fff1cd; }
.task-summary { display: grid; grid-template-columns: 82px minmax(0, 1fr); margin: 0; padding: 10px 18px 13px; }
.task-summary dt,
.task-summary dd { padding: 7px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.task-summary dt { color: #9ea99d; font-size: 9px; }
.task-summary dd { min-width: 0; margin: 0; color: #edf2eb; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.task-summary dt:last-of-type,
.task-summary dd:last-of-type { border-bottom: 0; }
.prompt-preview { border-top: 1px solid rgba(255, 255, 255, .12); }
.prompt-preview-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 14px 18px 9px; }
.prompt-preview-heading h3 { margin: 0; font-size: 11px; }
.prompt-preview-heading span { display: block; margin-top: 4px; color: #9eaa9d; font-size: 9px; }
.text-button { min-height: 30px; padding: 0; border: 0; background: transparent; color: #86dea5; font-size: 9px; font-weight: 800; }
.text-button:hover { color: #b0f0c6; }
.prompt-sync-notice { margin: 0 18px 8px; padding: 7px 9px; border-left: 2px solid #e0b65d; background: rgba(224, 182, 93, .08); color: #ead39f; font-size: 9px; line-height: 1.5; }
.prompt-output {
  display: block;
  width: calc(100% - 36px);
  min-height: 210px;
  max-height: 340px;
  margin: 0 18px 16px;
  padding: 11px;
  resize: vertical;
  border: 1px solid var(--dark-line);
  border-radius: 5px;
  outline: 0;
  background: #171d18;
  color: #e9efe7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.prompt-output:focus { border-color: #65df90; box-shadow: 0 0 0 3px rgba(101, 223, 144, .13); }
.prompt-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 7px; padding: 12px; border-top: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .025); }
.primary-action-wrap { position: relative; display: block; min-width: 0; }
.prompt-actions button { min-height: 42px; padding: 0 11px; border-radius: 4px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.generate-button { width: 100%; border: 1px solid #65df90; background: #65df90; color: #102116; }
.generate-button:hover:not(:disabled) { border-color: #7fe5a1; background: #7fe5a1; }
.generate-button:disabled { border-color: #626b62; background: #4a534b; color: #cbd2ca; cursor: not-allowed; }
.secondary-button { border: 1px solid rgba(255, 255, 255, .22); background: transparent; color: #d8dfd5; }
.secondary-button:hover:not(:disabled) { border-color: rgba(255, 255, 255, .5); color: #fff; }
.secondary-button:disabled { cursor: not-allowed; opacity: .46; }
.primary-action-wrap[data-tooltip]::after,
.primary-action-wrap[data-missing]::after {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: calc(100% + 8px);
  width: max-content;
  max-width: 260px;
  padding: 7px 9px;
  border: 1px solid #5e675e;
  border-radius: 4px;
  background: #111612;
  color: #f1f5ef;
  content: attr(data-tooltip);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .14s ease, transform .14s ease;
}
.primary-action-wrap[data-missing]:not([data-tooltip])::after { content: attr(data-missing); }
.primary-action-wrap:is(:hover, :focus-within)::after { opacity: 1; transform: translateY(0); }

dialog { color: var(--ink); }
dialog::backdrop { background: rgba(22, 27, 23, .56); }
.icon-button { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); font-size: 22px; line-height: 1; }
.icon-button:hover { border-color: var(--line-strong); background: var(--surface-subtle); }

.case-picker {
  position: fixed;
  inset: 0;
  width: min(1100px, calc(100vw - 48px));
  max-width: none;
  height: min(820px, calc(100dvh - 48px));
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 72px rgba(18, 23, 19, .28);
}
.case-picker[open] { display: block; animation: modal-in .18s ease-out; }
.case-picker-shell { display: flex; width: 100%; height: 100%; min-height: 0; flex-direction: column; }
.case-picker-header { display: flex; min-height: 76px; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.case-picker-header p,
.assistant-panel > header p { margin: 0; color: var(--accent); font-size: 9px; font-weight: 800; }
.case-picker-header h2,
.assistant-panel > header h2 { margin: 4px 0 0; font-size: 18px; letter-spacing: -.02em; }
.case-picker-tools { display: grid; flex: 0 0 auto; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--surface-subtle); }
.search-field { display: grid; gap: 6px; }
.filter-group { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-group button { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--muted); font-size: 10px; font-weight: 750; }
.filter-group button:hover { border-color: var(--line-strong); color: var(--ink); }
.filter-group button:is([aria-pressed="true"], .is-active) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.case-grid { display: grid; min-height: 0; flex: 1 1 auto; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: max-content; align-content: start; align-items: start; gap: 12px; padding: 18px 20px 28px; overflow-y: auto; overscroll-behavior: contain; }
.case-grid:empty { display: none; }
.case-grid > article,
.case-card { display: flex; min-width: 0; height: max-content; align-self: start; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.case-grid > article:hover,
.case-card:hover { border-color: var(--line-strong); }
.case-card-media { display: grid !important; width: 100%; aspect-ratio: 16 / 10; place-items: center; overflow: hidden; padding: 8px !important; background: var(--surface-muted); }
.case-card-media img,
.case-grid > article .case-card-media img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.case-card-body,
.case-grid > article > .case-card-body { display: grid; min-width: 0; gap: 7px; padding: 12px; }
.case-card-media { flex: 0 0 auto; }
.case-card-body { flex: 1 0 auto; }
.case-card-body > div { display: grid; min-width: 0; gap: 3px; padding: 0; }
.case-card-body > div > small { color: var(--accent); font-size: 9px; font-weight: 800; }
.case-card h3,
.case-grid > article h3 { margin: 0; font-size: 13px; line-height: 1.4; }
.case-card p,
.case-grid > article p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.case-card-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.case-card-tags span { padding: 4px 6px; border-radius: 3px; background: var(--surface-muted); color: var(--muted); font-size: 9px; }
.case-card-body ul { display: flex; flex-wrap: wrap; gap: 5px; margin: 1px 0 0; padding: 0; list-style: none; }
.case-card-body li { padding: 4px 6px; border-radius: 3px; background: var(--surface-muted); color: var(--muted); font-size: 9px; }
.case-card-details { border-top: 1px solid var(--line); }
.case-card-details summary { padding: 9px 0 2px; color: var(--accent-strong); font-size: 9px; font-weight: 800; cursor: pointer; }
.case-card-details dl { display: grid; gap: 0; margin: 6px 0 0; }
.case-card-details dl > div { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 7px; padding: 6px 0; border-top: 1px solid var(--line); }
.case-card-details dt { color: var(--quiet); font-size: 9px; font-weight: 800; }
.case-card-details dd { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.case-card-actions {
  display: flex !important;
  flex: 0 0 auto;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 10px !important;
  padding: 10px 12px !important;
  border-top: 1px solid var(--line);
  background: var(--surface-subtle);
}
.case-card button,
.case-grid [data-use-case] { min-height: 38px; padding: 0 11px; border: 1px solid var(--accent); border-radius: 5px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; }
.case-card button:hover,
.case-grid [data-use-case]:hover { border-color: var(--accent-strong); background: var(--accent-strong); }
.case-empty { margin: auto; padding: 40px 20px; color: var(--muted); font-size: 12px; text-align: center; }
.case-empty:not([hidden]) { display: grid; min-height: 0; flex: 1 1 auto; place-items: center; margin: 0; }

.assistant-trigger {
  position: fixed;
  z-index: 70;
  right: max(8px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  display: inline-flex;
  width: 44px;
  height: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #303831;
  border-radius: 7px;
  background: var(--dark);
  color: #fff;
  box-shadow: 0 10px 28px rgba(25, 31, 26, .2);
  font-size: 10px;
  font-weight: 800;
}
.assistant-trigger > span:first-child { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 5px; background: #65df90; color: #112116; font-size: 14px; }
.assistant-trigger > span:last-child {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: max-content;
  padding: 7px 9px;
  border: 1px solid #394139;
  border-radius: 4px;
  background: var(--dark);
  color: #fff;
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .14s ease, transform .14s ease;
}
.assistant-trigger:is(:hover, :focus-visible) > span:last-child { opacity: 1; transform: translateY(0); }
.assistant-trigger:hover { background: #151b16; }
.assistant-panel {
  position: fixed;
  z-index: 80;
  inset: 0 0 0 auto;
  display: flex;
  width: var(--assistant-width);
  max-width: calc(100vw - 24px);
  height: 100dvh;
  min-height: 0;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -14px 0 36px rgba(28, 34, 29, .16);
  overflow: hidden;
}
.assistant-panel:not([hidden]) { animation: drawer-in .2s ease-out; }
.assistant-panel > header { display: flex; min-height: 72px; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.assistant-content { min-height: 0; flex: 1; padding: 16px; overflow-y: auto; overscroll-behavior: contain; }
.assistant-content > * { margin-top: 0; }
.assistant-content section,
.assistant-content article { padding: 14px 0; border-bottom: 1px solid var(--line); }
.assistant-content h3 { margin: 0; font-size: 13px; }
.assistant-content p,
.assistant-content li { color: var(--muted); font-size: 11px; line-height: 1.65; }
.assistant-content button,
.assistant-content a { display: inline-flex; min-height: 38px; align-items: center; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); color: var(--ink); font-size: 10px; font-weight: 800; text-decoration: none; }
.assistant-content button:hover,
.assistant-content a:hover { border-color: var(--accent); color: var(--accent-strong); }

@media (min-width: 821px) {
  body:has(.assistant-panel:not([hidden])) .launcher-shell,
  body.assistant-open .launcher-shell {
    width: min(1320px, calc(100% - var(--assistant-width) - 48px));
    margin-left: max(24px, calc((100vw - var(--assistant-width) - 1320px) / 2));
    margin-right: calc(var(--assistant-width) + 24px);
  }
  body:has(.assistant-panel:not([hidden])) .assistant-trigger,
  body.assistant-open .assistant-trigger { opacity: 0; pointer-events: none; }
  body:has(.assistant-panel:not([hidden])) .color-theme-grid,
  body.assistant-open .color-theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@keyframes drawer-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast { position: fixed; z-index: 100; right: 20px; bottom: 76px; max-width: min(360px, calc(100vw - 40px)); padding: 10px 13px; border: 1px solid #394139; border-radius: 5px; background: var(--dark); color: #fff; box-shadow: 0 10px 28px rgba(0, 0, 0, .18); font-size: 10px; font-weight: 750; line-height: 1.45; }

@media (max-width: 1280px) and (min-width: 821px) {
  body:has(.assistant-panel:not([hidden])) .launcher-grid,
  body.assistant-open .launcher-grid { grid-template-columns: minmax(0, 1fr); }
  body:has(.assistant-panel:not([hidden])) .prompt-column,
  body.assistant-open .prompt-column { position: static; max-height: none; }
  body:has(.assistant-panel:not([hidden])) .prompt-panel,
  body.assistant-open .prompt-panel { max-height: none; }
}
@media (max-width: 1100px) {
  .style-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .color-theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .launcher-grid { grid-template-columns: minmax(0, 1fr) minmax(300px, 340px); gap: 28px; }
  .target-type-grid,
  .system-control { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .permission-list { grid-template-columns: 1fr; }
  .brief-fields,
  .brief-grid,
  .structured-brief { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  :root { --sticky-offset: 76px; }
  .launcher-shell { width: min(100% - 32px, 980px); }
  .mode-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mode-tabs button:nth-child(3) { border-right: 0; }
  .mode-tabs button:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .mode-tabs button:last-child { border-right: 0; }
  .assistant-panel { inset: 0; width: 100vw; max-width: none; border-left: 0; }
  body:has(.assistant-panel:not([hidden])) .assistant-trigger,
  body.assistant-open .assistant-trigger { opacity: 0; pointer-events: none; }
}
@media (max-width: 760px) {
  :root { --sticky-offset: 18px; }
  .launcher-shell { width: calc(100% - 28px); padding-top: 20px; }
  .page-heading { align-items: start; flex-direction: column; gap: 16px; }
  .page-heading h1 { font-size: 27px; }
  .font-preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .font-preview-page { height: 320px; }
  .font-preview-nav { height: 52px; padding-inline: 20px; }
  .font-preview-nav-items { display: none; }
  .font-preview-content { padding: 26px 24px; }
  .font-preview-title { height: 66px; font-size: 26px; }
  .font-preview-lede { height: 42px; font-size: 11px; }
  .font-preview-metrics { height: 47px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 14px; }
  .font-preview-metric:nth-child(n + 3) { display: none; }
  .font-preview-actions { margin-top: 13px; }
  .style-direction { padding-top: 26px; }
  .mode-picker-heading { align-items: start; flex-direction: column; gap: 4px; }
  .mode-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mode-tabs button,
  .mode-tabs button:nth-child(3),
  .mode-tabs button:nth-child(n + 4) { border-top: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .mode-tabs button:nth-child(2n) { border-right: 0; }
  .mode-tabs button:last-child { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
  .launcher-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; margin-top: 32px; }
  .prompt-column { position: static; max-height: none; }
  .prompt-panel { max-height: none; }
  .case-picker {
    width: calc(100% - 24px);
    max-width: none;
    height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px);
    margin: auto;
    border-radius: 7px;
  }
}
@media (max-width: 560px) {
  .launcher-shell { width: calc(100% - 24px); padding-bottom: 88px; }
  .page-heading h1 { font-size: 24px; }
  .font-workbench-heading { align-items: start; flex-direction: column; gap: 9px; }
  .font-source-status { justify-content: start; }
  .font-preset-grid { grid-template-columns: minmax(0, 1fr); }
  .font-preset-card { height: 144px; grid-template-rows: 64px 49px; }
  .font-preset-sample { height: 64px; padding: 8px; font-size: 22px; }
  .font-preset-copy { height: 49px; }
  .font-preview-toolbar { display: grid; min-height: 54px; align-content: center; justify-content: stretch; gap: 4px; padding: 7px 10px; }
  .font-preview-toolbar > * { overflow: visible; white-space: normal; }
  .font-preview-sources { flex-wrap: wrap; justify-content: start; }
  .font-preview-page { height: 278px; }
  .font-preview-nav { height: 48px; padding-inline: 16px; }
  .font-preview-brand { font-size: 14px; }
  .font-preview-content { padding: 21px 18px; }
  .font-preview-eyebrow { margin-bottom: 7px; }
  .font-preview-title { height: 58px; font-size: 23px; }
  .font-preview-lede { height: 39px; margin-top: 7px; font-size: 10px; line-height: 1.65; }
  .font-preview-metrics { display: none; }
  .font-preview-actions { display: grid; height: 36px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 13px; }
  .font-preview-primary,
  .font-preview-secondary { min-height: 36px; padding-inline: 8px; overflow: hidden; text-overflow: ellipsis; }
  .style-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .style-card-grid > :is(label, button),
  .style-card { min-height: 136px; }
  .style-card-grid strong,
  .style-card strong { padding-right: 24px; font-size: 11px; }
  .color-theme-grid { grid-template-columns: minmax(0, 1fr); }
  .case-picker { width: calc(100% - 12px); height: calc(100dvh - 12px); max-height: calc(100dvh - 12px); border-radius: 6px; }
  .mode-picker-heading p { display: none; }
  .choice-grid,
  .target-type-grid,
  .check-grid,
  .system-control,
  .permission-list { grid-template-columns: minmax(0, 1fr); }
  .section-heading { grid-template-columns: minmax(0, 1fr); }
  .section-heading a { justify-self: start; }
  .segmented-control,
  .target-type-control { grid-template-columns: minmax(0, 1fr); }
  .decision-controls { grid-template-columns: minmax(0, 1fr); }
  .token-foundation-block { padding: 13px 14px 15px; }
  .token-foundation { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .brief-seed-row { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  .assist-brief-button { width: 100%; }
  .library-reference,
  .upload-preview { grid-template-columns: 64px minmax(0, 1fr); }
  .library-reference img,
  .upload-preview img { width: 64px; height: 58px; }
  .library-reference a,
  .library-reference button,
  .upload-preview button { grid-column: 2; justify-self: start; }
  .selected-case { grid-template-columns: minmax(0, 1fr); }
  .selected-case-media { width: 100%; max-height: 320px; }
  .selected-case-actions { justify-content: flex-start; }
  .prompt-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .primary-action-wrap { grid-column: 1 / -1; }
  .prompt-actions button { width: 100%; }
  .summary-progress { padding-inline: 8px; }
  .summary-progress li { padding-inline: 6px; }
  .task-summary { grid-template-columns: 72px minmax(0, 1fr); }
  .case-picker-header { min-height: 68px; padding: 12px 14px; }
  .case-picker-tools { padding: 13px 14px; }
  .case-grid { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .case-card-actions { align-items: stretch; flex-direction: column; }
  .case-card-actions button { width: 100%; }
  .assistant-trigger { right: 8px; bottom: 12px; }
  .toast { right: 12px; bottom: 68px; left: 12px; max-width: none; text-align: center; }
}
@media (max-width: 390px) {
  .launcher-shell { width: calc(100% - 20px); }
  .page-heading { padding-bottom: 22px; }
  .style-card-grid > :is(label, button),
  .style-card { padding: 6px; }
  .mode-tabs button { min-height: 60px; padding-inline: 9px; }
  .mode-tabs strong,
  .mode-tabs small { overflow: visible; text-overflow: clip; white-space: normal; }
  .prompt-heading { gap: 10px; padding-inline: 14px; }
  .prompt-preview-heading,
  .task-summary { padding-inline: 14px; }
  .prompt-output { width: calc(100% - 28px); margin-inline: 14px; }
  .missing-state { margin-inline: 14px; }
  .assistant-trigger { width: 44px; padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media (forced-colors: active) {
  .style-card-grid > :is(label, button):is(:has(input:checked), [aria-checked="true"], [aria-pressed="true"], .is-selected),
  .color-theme-card:is(.is-selected, :has(input:checked)),
  .font-preset-card:has(input:checked),
  .choice-grid label:has(input:checked),
  .choice-list label:has(input:checked) { outline: 2px solid Highlight; }
  .font-preset-card:has(input:focus-visible) { outline: 3px solid Highlight; }
  .font-preset-choice::after { background: Highlight; }
  .font-preview-primary { border-color: ButtonText; background: Highlight; color: HighlightText; }
}
