@font-face {
  font-family: "Xuan Serif";
  src: url("/fonts/noto-serif-sc-ui.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f6f1e7;
  --paper-deep: #eddfc5;
  --rail: #ece4d3;
  --panel: #fcf9f1;
  --surface: #fffdf7;
  --surface-bright: #fffefb;
  --ink: #2b261e;
  --ink-soft: #4e453a;
  --muted: #685e4f;
  --muted-light: #897d6c;
  --line: #cfc3af;
  --line-soft: #ded4c3;
  --strong-line: #4d4335;
  --amber: #a95e1c;
  --amber-dark: #7b4318;
  --amber-hover: #8b4b16;
  --amber-light: #f1dfc4;
  --amber-pale: #fbf0dc;
  --green: #3f6a4f;
  --green-pale: #e9f0e7;
  --danger: #8f3e32;
  --danger-pale: #f7e8e3;
  --focus: #854c21;
  --shadow-hard: 4px 4px 0 rgba(43, 38, 30, 0.9);
  --shadow-card: 2px 2px 0 rgba(43, 38, 30, 0.18);
  --serif: "Xuan Serif", "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--paper);
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 76% -15%, rgba(199, 151, 84, 0.2), transparent 31%),
    radial-gradient(circle at 20% 105%, rgba(169, 94, 28, 0.065), transparent 27%),
    var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  overflow-x: hidden;
}

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: var(--amber-dark);
}

img {
  display: block;
  max-width: 100%;
}

p,
h1,
h2,
h3,
h4,
ul,
ol,
dl,
dd {
  margin-top: 0;
}

svg {
  display: block;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

::selection {
  background: var(--amber-light);
  color: var(--ink);
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--surface);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.paper-grain {
  position: fixed;
  z-index: -1;
  inset: 0;
  opacity: 0.42;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(78, 69, 58, 0.012) 0,
      rgba(78, 69, 58, 0.012) 1px,
      transparent 1px,
      transparent 5px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.12) 0,
      rgba(255, 255, 255, 0.12) 1px,
      transparent 1px,
      transparent 4px
    );
}

.app-shell {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 100vh;
  max-height: 100vh;
  flex-direction: column;
  align-self: start;
  border-right: 1px solid var(--strong-line);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.14), transparent 36%),
    var(--rail);
}

.sidebar-brand {
  display: flex;
  min-height: 84px;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  width: 41px;
  height: 45px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--ink);
  background: var(--ink);
  box-shadow: 3px 3px 0 #bf9566;
  color: var(--surface);
  font: 700 20px/1 var(--serif);
  letter-spacing: 0.03em;
}

.sidebar-brand > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.sidebar-brand strong {
  font: 700 23px/1.1 var(--serif);
  letter-spacing: 0.06em;
}

.sidebar-brand small {
  color: var(--muted);
  font: 700 9px/1 var(--mono);
  letter-spacing: 0.14em;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
}

.icon-button:hover {
  border-color: var(--line);
  background: var(--surface);
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-close {
  display: none;
  margin-left: auto;
}

.new-choice-button {
  display: flex;
  min-height: 66px;
  align-items: center;
  gap: 12px;
  margin: 17px 15px 10px;
  padding: 10px 12px;
  border: 1px solid var(--strong-line);
  background: var(--surface);
  box-shadow: 3px 3px 0 var(--ink);
  text-align: left;
  transition:
    transform 180ms var(--ease),
    box-shadow 180ms var(--ease),
    background 180ms var(--ease);
}

.new-choice-button:hover {
  background: var(--surface-bright);
  box-shadow: 5px 5px 0 var(--ink);
  transform: translate(-1px, -1px);
}

.new-choice-button:active {
  box-shadow: 1px 1px 0 var(--ink);
  transform: translate(2px, 2px);
}

.new-choice-plus {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  background: var(--amber);
  color: #fff;
  font-size: 24px;
  line-height: 1;
}

.new-choice-button > span:last-child {
  display: grid;
  gap: 2px;
}

.new-choice-button strong {
  font-size: 14px;
  font-weight: 700;
}

.new-choice-button small {
  color: var(--muted);
  font-size: 11px;
}

.side-nav {
  display: grid;
  gap: 4px;
  padding: 7px 15px 0;
}

.side-nav-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  min-height: 43px;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.side-nav-item:hover {
  border-color: var(--line-soft);
  background: rgba(255, 253, 247, 0.55);
  color: var(--ink);
}

.side-nav-item.is-active {
  border-color: var(--strong-line);
  background: var(--surface);
  box-shadow: inset 3px 0 var(--amber);
  color: var(--ink);
  font-weight: 700;
}

.side-nav-item svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-nav-item small {
  color: var(--muted-light);
  font: 700 9px/1 var(--mono);
  letter-spacing: 0.08em;
}

.sidebar-section {
  min-height: 0;
  margin-top: 25px;
  padding: 0 15px;
  overflow: auto;
}

.sidebar-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.sidebar-section-head button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted-light);
  font-size: 10px;
}

.sidebar-section-head button:hover {
  color: var(--danger);
}

.recent-list {
  display: grid;
  gap: 6px;
  padding-top: 10px;
}

.recent-empty {
  margin: 4px;
  color: var(--muted-light);
  font-size: 11px;
  line-height: 1.7;
}

.recent-item {
  display: grid;
  width: 100%;
  gap: 4px;
  padding: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.recent-item:hover {
  border-color: var(--line);
  background: rgba(255, 253, 247, 0.6);
}

.recent-item strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item span {
  color: var(--muted);
  font-size: 10px;
}

.recent-item em {
  color: var(--amber-dark);
  font-size: 10px;
  font-style: normal;
}

.sidebar-footer {
  display: grid;
  gap: 11px;
  margin-top: auto;
  padding: 15px;
  border-top: 1px solid var(--line);
}

.privacy-note {
  display: flex;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 253, 247, 0.35);
}

.privacy-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(63, 106, 79, 0.11);
}

.privacy-note p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.privacy-note strong {
  color: var(--ink-soft);
  font-weight: 700;
}

.sidebar-link {
  display: flex;
  min-height: 37px;
  align-items: center;
  gap: 9px;
  padding: 5px 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

.sidebar-link:hover {
  background: rgba(255, 253, 247, 0.58);
  color: var(--ink);
}

.sidebar-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.sidebar-edition {
  margin: 0;
  color: #9a8e7d;
  font: 9px/1.4 var(--mono);
  letter-spacing: 0.05em;
}

.sidebar-scrim {
  position: fixed;
  z-index: 19;
  inset: 0;
  background: rgba(37, 31, 24, 0.42);
  backdrop-filter: blur(2px);
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 12;
  top: 0;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 30px;
  border-bottom: 1px solid var(--strong-line);
  background: rgba(252, 249, 241, 0.94);
  backdrop-filter: blur(14px);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 11px;
}

.mobile-menu {
  display: none;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.breadcrumb i {
  color: var(--line);
  font-style: normal;
}

.breadcrumb strong {
  color: var(--ink-soft);
  font-weight: 700;
}

.engine-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 7px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.engine-pill:hover {
  border-color: var(--strong-line);
  color: var(--ink);
}

.engine-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(63, 106, 79, 0.11);
}

.engine-pill.is-busy .engine-dot {
  background: var(--amber);
  animation: pulse-dot 1.1s infinite ease-in-out;
}

@keyframes pulse-dot {
  50% {
    box-shadow: 0 0 0 6px rgba(169, 94, 28, 0.08);
    opacity: 0.55;
  }
}

.main-content {
  min-height: calc(100vh - 58px);
}

.view {
  display: none;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(34px, 4.2vw, 68px) clamp(24px, 4.2vw, 70px) 60px;
}

.view.is-active {
  display: block;
  animation: view-in 420ms var(--ease) both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow,
.section-index,
.mini-kicker {
  margin-bottom: 11px;
  color: var(--amber-dark);
  font: 700 10px/1.35 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.62fr);
  align-items: end;
  gap: clamp(35px, 6vw, 90px);
  min-height: 345px;
  padding: 14px 0 52px;
}

.hero-copy h1 {
  max-width: 830px;
  margin: 0;
  font: 700 clamp(62px, 7.4vw, 108px)/0.98 var(--serif);
  letter-spacing: -0.065em;
}

.hero-copy h1 span {
  color: var(--amber-dark);
}

.hero-lead {
  max-width: 670px;
  margin: 25px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 22px;
  margin-top: 28px;
}

.hero-facts span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.hero-facts b {
  color: var(--amber-dark);
  font: 700 9px/1 var(--mono);
  letter-spacing: 0.07em;
}

.choice-note {
  position: relative;
  padding: 18px;
  border: 1px solid var(--strong-line);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.54), transparent 42%),
    #f0e3cc;
  box-shadow: 5px 5px 0 rgba(72, 61, 47, 0.86);
  transform: rotate(1.3deg);
  transition: transform 500ms var(--ease);
}

.choice-note:hover {
  transform: rotate(0);
}

.choice-note::before {
  position: absolute;
  top: -8px;
  left: 50%;
  width: 70px;
  height: 15px;
  background: rgba(219, 194, 151, 0.72);
  box-shadow: 0 1px 1px rgba(70, 56, 39, 0.08);
  content: "";
  transform: translateX(-50%) rotate(-2deg);
}

.choice-note-top,
.choice-note-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mini-kicker,
.note-index {
  margin: 0;
  color: var(--muted);
  font: 700 8px/1 var(--mono);
  letter-spacing: 0.11em;
}

.choice-note-body {
  position: relative;
  min-height: 122px;
  margin: 20px 0 16px;
  padding: 17px 14px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.choice-note-body p {
  position: relative;
  z-index: 1;
  max-width: 230px;
  margin: 12px 0 0;
  color: var(--ink-soft);
  font: 700 18px/1.5 var(--serif);
}

.choice-stamp {
  position: absolute;
  top: 10px;
  right: 6px;
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border: 2px solid rgba(143, 62, 50, 0.52);
  color: rgba(143, 62, 50, 0.55);
  font: 700 38px/1 var(--serif);
  transform: rotate(-10deg);
}

.choice-stamp::after {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(143, 62, 50, 0.33);
  content: "";
}

.choice-note-meter {
  display: grid;
  gap: 8px;
}

.choice-note-meter span {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 7px;
  color: var(--muted);
  font-size: 9px;
}

.choice-note-meter span::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: rgba(77, 67, 53, 0.13);
  content: "";
}

.choice-note-meter span::before {
  position: absolute;
  z-index: 1;
  right: calc(100% - var(--value));
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--amber);
  content: "";
}

.choice-note-foot {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
}

.choice-note-foot b {
  color: var(--green);
  font-size: 9px;
}

.composer-card {
  border: 1px solid var(--strong-line);
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.58), transparent 45%),
    var(--panel);
  box-shadow: var(--shadow-hard);
}

.composer-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.composer-heading h2,
.panel-heading h2 {
  margin: 0;
  font: 700 26px/1.2 var(--serif);
  letter-spacing: -0.025em;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--amber-dark);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.text-button:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.text-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.composer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.36fr) minmax(280px, 0.64fr);
}

.upload-column {
  padding: 22px 24px;
  border-right: 1px solid var(--line);
}

.drop-zone {
  display: grid;
  min-height: 158px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 17px;
  padding: 24px;
  border: 1px dashed #9f896e;
  background:
    radial-gradient(circle at 90% 20%, rgba(169, 94, 28, 0.06), transparent 25%),
    var(--paper);
  transition:
    border-color 180ms var(--ease),
    background 180ms var(--ease),
    transform 180ms var(--ease);
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--amber);
  background: var(--amber-pale);
}

.drop-zone.is-dragging {
  transform: scale(1.006);
}

.upload-symbol {
  display: grid;
  width: 57px;
  height: 57px;
  place-items: center;
  border: 1px solid var(--strong-line);
  background: var(--surface);
  box-shadow: 2px 2px 0 var(--ink);
  color: var(--amber-dark);
}

.upload-symbol svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drop-zone-copy {
  display: grid;
  gap: 5px;
}

.drop-zone-copy strong {
  font-size: 15px;
}

.drop-zone-copy small {
  color: var(--muted);
  font-size: 11px;
}

.paste-hint {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted-light);
  font-size: 9px;
}

.paste-hint kbd {
  padding: 2px 5px;
  border: 1px solid var(--line);
  background: var(--surface);
  font: 8px/1.3 var(--mono);
}

.paste-hint i {
  font-style: normal;
}

.upload-mobile-actions {
  display: none;
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}

.file-preview {
  position: relative;
  width: 84px;
  height: 98px;
  flex: 0 0 auto;
  padding: 4px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  background: var(--rail);
}

.file-number {
  position: absolute;
  bottom: 6px;
  left: 6px;
  display: grid;
  min-width: 19px;
  height: 19px;
  place-items: center;
  background: var(--ink);
  color: var(--surface);
  font: 700 8px/1 var(--mono);
}

.file-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
}

.file-remove:hover {
  background: var(--danger);
  color: #fff;
}

.file-remove svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.context-column {
  display: flex;
  flex-direction: column;
  padding: 22px 24px;
}

.context-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.context-label span {
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 400;
}

.context-column textarea,
.chat-form textarea {
  width: 100%;
  min-height: 116px;
  padding: 13px 14px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.7;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.8);
}

.context-column textarea:focus,
.chat-form textarea:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(169, 94, 28, 0.08);
}

.context-column textarea::placeholder,
.chat-form textarea::placeholder {
  color: #9a8e7d;
}

.context-suggestions,
.inline-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.context-suggestions button,
.inline-prompts button {
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 10px;
}

.context-suggestions button:hover,
.inline-prompts button:hover {
  border-color: var(--amber);
  background: var(--amber-pale);
  color: var(--amber-dark);
}

.context-help {
  margin: auto 0 0;
  padding-top: 13px;
  color: var(--muted-light);
  font-size: 10px;
  line-height: 1.6;
}

.composer-actions {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 24px;
  border-top: 1px solid var(--line);
  background: rgba(236, 228, 211, 0.33);
}

.composer-actions p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted-light);
  font-size: 9px;
}

.composer-actions p svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--green);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-button,
.outline-button,
.small-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 15px;
  border: 1px solid var(--strong-line);
  border-radius: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 160ms var(--ease),
    box-shadow 160ms var(--ease),
    background 160ms var(--ease);
}

.primary-button {
  background: var(--amber);
  box-shadow: 3px 3px 0 var(--ink);
  color: #fff;
}

.primary-button:hover:not(:disabled) {
  background: var(--amber-hover);
  box-shadow: 4px 4px 0 var(--ink);
  transform: translate(-1px, -1px);
}

.primary-button:active:not(:disabled) {
  box-shadow: 1px 1px 0 var(--ink);
  transform: translate(2px, 2px);
}

.primary-button:disabled {
  border-color: #bdaf9a;
  background: #e7ddcc;
  box-shadow: none;
  color: #8c8171;
}

.outline-button,
.small-button {
  background: var(--surface);
  color: var(--ink);
}

.outline-button:hover {
  background: var(--amber-light);
}

.small-button {
  min-height: 36px;
  padding: 6px 11px;
  font-size: 11px;
}

.primary-button svg,
.outline-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.analyze-button {
  min-width: 142px;
}

.use-cases {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 34px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.use-cases article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  padding: 20px 22px;
}

.use-cases article + article {
  border-left: 1px solid var(--line);
}

.use-case-number {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--amber-dark);
  font: 700 10px/1 var(--mono);
}

.use-cases h3 {
  margin: 2px 0 5px;
  font: 700 15px/1.3 var(--serif);
}

.use-cases p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

/* Loading */

.loading-stage {
  display: grid;
  max-width: 760px;
  min-height: calc(100vh - 180px);
  align-content: center;
  justify-items: center;
  margin: 0 auto;
  text-align: center;
}

.loading-visual {
  position: relative;
  width: 172px;
  height: 155px;
  margin-bottom: 32px;
}

.scan-card {
  position: absolute;
  width: 105px;
  height: 136px;
  border: 1px solid var(--strong-line);
  background: var(--surface);
  box-shadow: 3px 3px 0 rgba(43, 38, 30, 0.75);
}

.scan-card-back {
  top: 7px;
  left: 17px;
  background: var(--rail);
  transform: rotate(-8deg);
}

.scan-card-front {
  top: 3px;
  right: 18px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 28px 13px;
  overflow: hidden;
  transform: rotate(5deg);
}

.scan-card-front span {
  display: block;
  height: 4px;
  background: var(--line);
}

.scan-card-front span:nth-child(1) {
  width: 68%;
  height: 8px;
  background: var(--amber-light);
}

.scan-card-front span:nth-child(2) {
  width: 90%;
}

.scan-card-front span:nth-child(3) {
  width: 53%;
}

.scan-line {
  position: absolute;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--amber);
  box-shadow: 0 0 9px rgba(169, 94, 28, 0.5);
  animation: scan 2.2s infinite var(--ease);
}

@keyframes scan {
  0%,
  12% {
    top: 7%;
    opacity: 0;
  }
  22% {
    opacity: 1;
  }
  78% {
    opacity: 1;
  }
  90%,
  100% {
    top: 92%;
    opacity: 0;
  }
}

.loading-seal {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 2px solid rgba(143, 62, 50, 0.56);
  background: rgba(246, 241, 231, 0.8);
  color: rgba(143, 62, 50, 0.72);
  font: 700 25px/1 var(--serif);
  transform: rotate(-9deg);
}

.loading-stage h1 {
  margin: 0;
  font: 700 clamp(38px, 5vw, 62px)/1.12 var(--serif);
  letter-spacing: -0.05em;
}

.loading-note {
  max-width: 480px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 14px;
}

.loading-steps {
  display: grid;
  width: min(540px, 100%);
  gap: 0;
  margin: 33px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.loading-steps li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 50px;
  min-height: 45px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-light);
  font-size: 12px;
}

.loading-steps li span {
  color: var(--muted-light);
  font: 700 9px/1 var(--mono);
}

.loading-steps li b {
  font-weight: 400;
}

.loading-steps li i {
  position: relative;
  display: block;
  width: 48px;
  height: 2px;
  overflow: hidden;
  background: var(--line-soft);
}

.loading-steps li i::after {
  position: absolute;
  inset: 0;
  background: var(--amber);
  content: "";
  transform: translateX(-100%);
}

.loading-steps li.is-current {
  color: var(--ink);
}

.loading-steps li.is-current span {
  color: var(--amber-dark);
}

.loading-steps li.is-current i::after {
  animation: progress-line 2.6s infinite var(--ease);
}

.loading-steps li.is-done {
  color: var(--green);
}

.loading-steps li.is-done i::after {
  transform: translateX(0);
}

@keyframes progress-line {
  0% {
    transform: translateX(-100%);
  }
  75%,
  100% {
    transform: translateX(0);
  }
}

.loading-cancel {
  margin-top: 25px;
  color: var(--muted);
}

/* Shared view headers */

.view-header,
.result-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 23px;
}

.view-header h1,
.result-header h1 {
  margin: 0;
  font: 700 clamp(40px, 5vw, 64px)/1.08 var(--serif);
  letter-spacing: -0.05em;
}

.view-subtitle {
  max-width: 700px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.review-meta {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.status-label {
  padding: 3px 7px;
  border: 1px solid rgba(63, 106, 79, 0.22);
  background: var(--green-pale);
  color: var(--green);
  font-weight: 700;
}

.meta-divider {
  width: 1px;
  height: 12px;
  background: var(--line);
}

.inline-edit-note {
  margin-left: auto;
  font-size: 10px;
}

.review-callout {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #d6b37b;
  background: var(--amber-pale);
  color: #6f4c22;
  font-size: 11px;
  line-height: 1.65;
}

.review-callout.is-warning {
  border-color: #c28b7c;
  background: var(--danger-pale);
  color: var(--danger);
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin-top: 20px;
}

.option-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition:
    border-color 180ms var(--ease),
    box-shadow 180ms var(--ease),
    transform 180ms var(--ease);
}

.option-card:hover {
  border-color: #ad9474;
  box-shadow: 3px 3px 0 rgba(43, 38, 30, 0.16);
  transform: translateY(-2px);
}

.option-card.is-winner {
  border-color: var(--amber);
  box-shadow: 3px 3px 0 var(--amber);
}

.option-card-top {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(236, 228, 211, 0.32);
  color: var(--muted);
  font-size: 9px;
}

.option-number {
  color: var(--amber-dark);
  font: 700 9px/1 var(--mono);
  letter-spacing: 0.08em;
}

.confidence-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.confidence-tag::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.confidence-tag.medium::before {
  background: #be792f;
}

.confidence-tag.low::before {
  background: var(--danger);
}

.option-editor-button {
  position: absolute;
  z-index: 1;
  top: 38px;
  right: 9px;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  opacity: 0;
  transition: opacity 150ms var(--ease);
}

.option-card:hover .option-editor-button,
.option-editor-button:focus-visible {
  opacity: 1;
}

.option-editor-button svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.option-source-preview {
  position: relative;
  height: 105px;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
  background: var(--rail);
}

.option-source-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  filter: saturate(0.86);
}

.option-source-preview::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(43, 38, 30, 0.2));
  content: "";
  pointer-events: none;
}

.option-source-preview span {
  position: absolute;
  z-index: 1;
  right: 8px;
  bottom: 7px;
  padding: 2px 5px;
  background: rgba(255, 253, 247, 0.9);
  color: var(--muted);
  font: 8px/1.3 var(--mono);
}

.option-body {
  display: grid;
  flex: 1;
  align-content: start;
  gap: 11px;
  padding: 14px;
}

.option-title {
  margin: 0;
  font: 700 17px/1.35 var(--serif);
}

.option-seller {
  margin: -5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.option-price-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.option-price {
  display: grid;
  gap: 1px;
}

.option-price span {
  color: var(--muted-light);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.option-price strong {
  color: var(--amber-dark);
  font: 700 22px/1.1 var(--serif);
}

.unit-price {
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.option-facts {
  display: grid;
  gap: 6px;
  margin: 0;
}

.option-facts div {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.option-facts dt {
  color: var(--muted-light);
}

.option-facts dd {
  margin: 0;
  overflow: hidden;
  color: var(--ink-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.option-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.option-flags span {
  padding: 3px 6px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
}

.option-flags span.is-risk {
  border-color: #d5aaa0;
  background: var(--danger-pale);
  color: var(--danger);
}

.review-warnings {
  display: grid;
  gap: 7px;
  margin-top: 15px;
}

.review-warning {
  padding: 9px 12px;
  border-left: 3px solid #c68d34;
  background: var(--amber-pale);
  color: #715226;
  font-size: 10px;
}

.review-actions,
.result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.review-actions > div,
.result-actions > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.review-actions > div > p {
  margin: 0 8px 0 0;
  color: var(--muted);
  font-size: 10px;
}

/* Questions */

.question-shell {
  max-width: 1080px;
  min-height: calc(100vh - 185px);
  margin: 0 auto;
}

.question-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font: 700 9px/1 var(--mono);
  letter-spacing: 0.08em;
}

.question-dots {
  display: flex;
  gap: 6px;
}

.question-dots i {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--line);
}

.question-dots i.is-current {
  background: var(--amber);
}

.question-dots i.is-done {
  background: var(--green);
}

.question-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.62fr) minmax(0, 1.38fr);
  min-height: 540px;
  margin-top: 24px;
  border: 1px solid var(--strong-line);
  background: var(--panel);
  box-shadow: var(--shadow-hard);
}

.question-aside {
  position: relative;
  padding: 32px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 15% 95%, rgba(169, 94, 28, 0.13), transparent 30%),
    var(--rail);
}

.question-index {
  display: block;
  margin-bottom: 60px;
  color: rgba(123, 67, 24, 0.18);
  font: 700 112px/0.8 var(--serif);
  letter-spacing: -0.08em;
}

.question-why {
  max-width: 260px;
  margin-bottom: 26px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.8;
}

.question-mini-options {
  display: grid;
  gap: 6px;
}

.question-mini-options span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(77, 67, 53, 0.12);
  color: var(--muted);
  font-size: 9px;
}

.question-mini-options b {
  max-width: 150px;
  overflow: hidden;
  color: var(--ink-soft);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.question-main {
  display: flex;
  flex-direction: column;
  padding: clamp(30px, 4vw, 55px);
}

.question-main h1 {
  max-width: 650px;
  margin: 0 0 27px;
  font: 700 clamp(34px, 4.2vw, 52px)/1.17 var(--serif);
  letter-spacing: -0.045em;
}

.question-options {
  display: grid;
  gap: 9px;
}

.question-option {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 66px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  transition:
    border-color 160ms var(--ease),
    background 160ms var(--ease),
    box-shadow 160ms var(--ease),
    transform 160ms var(--ease);
}

.question-option:hover {
  border-color: var(--amber);
  background: #fffaf0;
  box-shadow: 2px 2px 0 rgba(43, 38, 30, 0.12);
  transform: translateX(2px);
}

.question-option.is-selected {
  border-color: var(--amber);
  background: var(--amber-pale);
  box-shadow: inset 3px 0 var(--amber);
}

.question-radio {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid #9c8d7a;
  border-radius: 50%;
}

.question-option.is-selected .question-radio {
  border-color: var(--amber);
  box-shadow: inset 0 0 0 5px var(--surface);
  background: var(--amber);
}

.question-option-copy {
  display: grid;
  gap: 2px;
}

.question-option-copy strong {
  font-size: 14px;
}

.question-option-copy small {
  color: var(--muted);
  font-size: 10px;
}

.question-option > svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--muted-light);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.question-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: auto;
  padding-top: 25px;
}

/* Result */

.verdict-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--strong-line);
  background:
    radial-gradient(circle at 95% 0%, rgba(169, 94, 28, 0.13), transparent 30%),
    linear-gradient(135deg, #fffdf7 0%, #f9f1e3 72%, #efdfc6 100%);
  box-shadow: 5px 5px 0 rgba(43, 38, 30, 0.88);
}

.verdict-card::after {
  position: absolute;
  z-index: 0;
  right: -85px;
  bottom: -115px;
  width: 270px;
  height: 270px;
  border: 1px solid rgba(77, 67, 53, 0.11);
  content: "";
  transform: rotate(23deg);
}

.verdict-card > * {
  position: relative;
  z-index: 1;
}

.verdict-top {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 9px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.45);
}

.verdict-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.verdict-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(63, 106, 79, 0.1);
}

.confidence-pill {
  padding: 2px 7px;
  border: 1px solid rgba(63, 106, 79, 0.22);
  background: var(--green-pale);
  color: var(--green);
  font-size: 9px;
  font-weight: 400;
}

.verdict-serial {
  color: var(--muted-light);
  font: 700 8px/1 var(--mono);
  letter-spacing: 0.09em;
}

.verdict-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 38px;
  align-items: end;
  padding: clamp(30px, 4.5vw, 60px) clamp(25px, 4vw, 48px) 32px;
}

.verdict-kicker {
  margin-bottom: 7px;
  color: var(--amber-dark);
  font: 700 9px/1 var(--mono);
  letter-spacing: 0.18em;
}

.verdict-copy h2 {
  max-width: 760px;
  margin: 0;
  font: 700 clamp(44px, 6vw, 82px)/1.05 var(--serif);
  letter-spacing: -0.06em;
  overflow-wrap: normal;
  word-break: normal;
}

.name-token {
  white-space: nowrap;
}

.verdict-summary {
  max-width: 690px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.verdict-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

.verdict-tags span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.6);
  color: var(--muted);
  font-size: 9px;
}

.verdict-price {
  display: grid;
  min-width: 160px;
  justify-items: end;
  gap: 4px;
  text-align: right;
}

.verdict-price span {
  color: var(--muted);
  font-size: 9px;
}

.verdict-price strong {
  color: var(--amber-dark);
  font: 700 clamp(32px, 4vw, 52px)/1 var(--serif);
  letter-spacing: -0.04em;
}

.verdict-price small {
  color: var(--muted);
  font-size: 9px;
}

.result-stamp {
  position: absolute;
  right: clamp(15px, 4vw, 52px);
  top: -6px;
  display: grid;
  width: 88px;
  height: 88px;
  place-items: center;
  border: 2px solid rgba(143, 62, 50, 0.44);
  color: rgba(143, 62, 50, 0.47);
  font: 700 24px/1 var(--serif);
  letter-spacing: 0.08em;
  opacity: 0;
  transform: rotate(-12deg) scale(1.4);
}

.result-stamp::after {
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(143, 62, 50, 0.3);
  content: "";
}

.is-stamped .result-stamp {
  animation: stamp-in 520ms 420ms var(--ease) forwards;
}

@keyframes stamp-in {
  0% {
    opacity: 0;
    transform: rotate(-12deg) scale(1.4);
  }
  70% {
    opacity: 0.95;
    transform: rotate(-12deg) scale(0.94);
  }
  100% {
    opacity: 0.85;
    transform: rotate(-12deg) scale(1);
  }
}

.verdict-reasons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.44);
}

.reason-item {
  min-height: 138px;
  padding: 20px;
}

.reason-item + .reason-item {
  border-left: 1px solid var(--line);
}

.reason-item span {
  color: var(--amber-dark);
  font: 700 8px/1 var(--mono);
}

.reason-item h3 {
  margin: 10px 0 7px;
  font: 700 15px/1.35 var(--serif);
}

.reason-item p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.75;
}

.verdict-bottom {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: rgba(236, 228, 211, 0.32);
}

.verdict-bottom > div {
  padding: 18px 22px;
}

.verdict-bottom > div + div {
  border-left: 1px solid var(--line);
}

.verdict-bottom span {
  color: var(--muted-light);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.verdict-bottom p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(260px, 0.52fr);
  gap: 16px;
  margin-top: 28px;
}

.comparison-panel,
.confirm-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-card);
}

.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px 15px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  font-size: 20px;
}

.comparison-table {
  display: grid;
}

.comparison-row {
  display: grid;
  grid-template-columns: 36px minmax(160px, 1.2fr) minmax(84px, 0.45fr) minmax(
      110px,
      0.65fr
    ) minmax(100px, 0.65fr);
  min-height: 71px;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.comparison-row:last-child {
  border-bottom: 0;
}

.comparison-row.is-winner {
  background: #fff9ec;
  box-shadow: inset 3px 0 var(--amber);
}

.comparison-rank {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--muted);
  font: 700 9px/1 var(--mono);
}

.comparison-row.is-winner .comparison-rank {
  border-color: var(--amber);
  background: var(--amber);
  color: #fff;
}

.comparison-name {
  min-width: 0;
}

.comparison-name strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison-name span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.comparison-metric {
  display: grid;
  gap: 2px;
}

.comparison-metric span {
  color: var(--muted-light);
  font-size: 8px;
}

.comparison-metric strong {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.comparison-verdict {
  justify-self: end;
  padding: 3px 7px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}

.comparison-row.is-winner .comparison-verdict {
  border-color: rgba(169, 94, 28, 0.25);
  background: var(--amber-light);
  color: var(--amber-dark);
}

.confirm-panel ul {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.confirm-panel li {
  position: relative;
  margin: 0;
  padding: 13px 18px 13px 32px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.confirm-panel li::before {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #b36f2e;
  content: "";
}

.assumption-note {
  margin: 14px;
  padding: 12px;
  border: 1px solid #dcc39d;
  background: #fbf4e8;
}

.assumption-note span {
  color: var(--amber-dark);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.assumption-note p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

.assistant-inline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
  padding: 23px 24px;
  border: 1px solid var(--strong-line);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.45), transparent 50%),
    var(--rail);
  box-shadow: 3px 3px 0 rgba(43, 38, 30, 0.75);
}

.assistant-inline-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid var(--strong-line);
  background: var(--surface);
  color: var(--amber-dark);
}

.assistant-inline-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
}

.assistant-inline h2 {
  margin: 0 0 5px;
  font: 700 21px/1.3 var(--serif);
}

.assistant-inline p:not(.eyebrow) {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.inline-prompts {
  margin-top: 9px;
}

.result-actions {
  margin-top: 28px;
}

/* Assistant drawer */

.assistant-drawer {
  position: fixed;
  z-index: 80;
  inset: 0;
  visibility: hidden;
  pointer-events: none;
}

.assistant-drawer.is-open {
  visibility: visible;
  pointer-events: auto;
}

.assistant-scrim {
  position: absolute;
  inset: 0;
  background: rgba(37, 31, 24, 0.36);
  opacity: 0;
  backdrop-filter: blur(2px);
  transition: opacity 220ms var(--ease);
}

.assistant-drawer.is-open .assistant-scrim {
  opacity: 1;
}

.assistant-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  width: min(440px, calc(100% - 20px));
  height: 100dvh;
  flex-direction: column;
  border-left: 1px solid var(--strong-line);
  background: var(--panel);
  box-shadow: -14px 0 45px rgba(43, 38, 30, 0.2);
  transform: translateX(102%);
  transition: transform 300ms var(--ease);
}

.assistant-drawer.is-open .assistant-panel {
  transform: translateX(0);
}

.assistant-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 22px 17px;
  border-bottom: 1px solid var(--line);
}

.assistant-header h2 {
  margin: 0;
  font: 700 27px/1.2 var(--serif);
  letter-spacing: -0.035em;
}

.assistant-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--rail);
}

.assistant-context span {
  color: var(--muted);
  font-size: 9px;
}

.assistant-context strong {
  max-width: 260px;
  overflow: hidden;
  color: var(--amber-dark);
  font: 700 13px/1.2 var(--serif);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-log {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 0;
  flex: 1;
  padding: 22px;
  overflow: auto;
}

.chat-message {
  display: grid;
  gap: 5px;
  max-width: 92%;
}

.chat-message.user {
  justify-self: end;
  justify-items: end;
}

.chat-message span {
  color: var(--muted-light);
  font: 700 8px/1 var(--mono);
  letter-spacing: 0.08em;
}

.chat-message p {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
}

.chat-message.user p {
  border-color: var(--strong-line);
  background: var(--ink);
  color: var(--surface);
}

.chat-message.is-thinking p {
  color: var(--muted);
}

.thinking-dots {
  display: inline-flex;
  gap: 3px;
  margin-left: 6px;
}

.thinking-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--amber);
  animation: thinking 900ms infinite ease-in-out;
}

.thinking-dots i:nth-child(2) {
  animation-delay: 150ms;
}

.thinking-dots i:nth-child(3) {
  animation-delay: 300ms;
}

@keyframes thinking {
  50% {
    opacity: 0.25;
    transform: translateY(-2px);
  }
}

.assistant-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 22px 10px;
}

.assistant-quick-prompts button {
  padding: 5px 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 9px;
}

.assistant-quick-prompts button:hover {
  border-color: var(--amber);
  background: var(--amber-pale);
  color: var(--amber-dark);
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: end;
  gap: 8px;
  padding: 0 22px;
}

.chat-form textarea {
  min-height: 70px;
  max-height: 150px;
}

.chat-form button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--strong-line);
  background: var(--amber);
  box-shadow: 2px 2px 0 var(--ink);
  color: #fff;
}

.chat-form button:hover {
  background: var(--amber-hover);
}

.chat-form button:disabled {
  background: #c4b7a3;
  box-shadow: none;
}

.chat-form button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assistant-disclaimer {
  margin: 0;
  padding: 9px 22px 18px;
  color: var(--muted-light);
  font-size: 8px;
  text-align: center;
}

/* Dialogs */

.modal {
  width: min(860px, calc(100% - 32px));
  max-height: min(90vh, 940px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--strong-line);
  border-radius: 0;
  background: var(--panel);
  box-shadow: 8px 8px 0 rgba(43, 38, 30, 0.9);
  color: var(--ink);
}

.modal::backdrop {
  background: rgba(37, 31, 24, 0.48);
  backdrop-filter: blur(3px);
}

.compact-modal {
  width: min(620px, calc(100% - 32px));
}

.option-modal {
  width: min(980px, calc(100% - 32px));
}

.modal[open] {
  animation: modal-in 220ms var(--ease);
}

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

.modal-shell {
  display: flex;
  max-height: min(90vh, 940px);
  flex-direction: column;
  margin: 0;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.modal-header h2 {
  margin: 0;
  font: 700 29px/1.2 var(--serif);
  letter-spacing: -0.035em;
}

.history-list,
.settings-content,
.option-editor-list {
  min-height: 0;
  padding: 20px 24px;
  overflow: auto;
}

.history-list {
  display: grid;
  gap: 9px;
}

.history-empty {
  padding: 48px 20px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

.history-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 15px;
  padding: 15px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
}

.history-entry:hover {
  border-color: var(--amber);
  background: #fffaf0;
}

.history-entry button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.history-entry h3 {
  margin: 0 0 5px;
  font: 700 16px/1.35 var(--serif);
}

.history-entry p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.history-entry-meta {
  display: grid;
  justify-items: end;
  gap: 8px;
  color: var(--muted-light);
  font-size: 8px;
}

.delete-history {
  color: var(--muted-light) !important;
}

.delete-history:hover {
  color: var(--danger) !important;
}

.settings-content {
  display: grid;
  gap: 16px;
}

.settings-block {
  padding: 17px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.settings-block h3 {
  margin: 0 0 13px;
  font: 700 17px/1.3 var(--serif);
}

.settings-facts {
  margin: 0;
}

.settings-facts div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 11px;
}

.settings-facts div:last-child {
  border-bottom: 0;
}

.settings-facts dd {
  margin: 0;
  color: var(--ink-soft);
  font-weight: 700;
  text-align: right;
}

.method-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.method-list li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}

.method-list li:last-child {
  border-bottom: 0;
}

.method-list span {
  color: var(--amber-dark);
  font: 700 8px/1.7 var(--mono);
}

.method-list p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.method-list strong {
  display: block;
  margin-bottom: 1px;
  color: var(--ink);
}

.settings-copy {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.75;
}

.option-editor-list {
  display: grid;
  gap: 10px;
}

.option-editor-card {
  display: grid;
  grid-template-columns: 28px minmax(150px, 1.6fr) minmax(90px, 0.6fr) minmax(
      90px,
      0.6fr
    ) minmax(140px, 1fr);
  align-items: end;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.option-editor-index {
  align-self: center;
  color: var(--amber-dark);
  font: 700 10px/1 var(--mono);
}

.editor-field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
}

.editor-field input {
  width: 100%;
  height: 37px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  background: var(--paper);
  color: var(--ink);
  font-size: 11px;
}

.editor-field input:focus {
  border-color: var(--amber);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: var(--rail);
}

.modal-footer > p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.modal-footer > div {
  display: flex;
  gap: 8px;
}

.email-content {
  padding: 22px 24px;
}

.mail-preview {
  display: flex;
  gap: 13px;
  margin-bottom: 22px;
  padding: 14px;
  border: 1px solid #d1b78e;
  background: var(--amber-pale);
}

.mail-preview-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--strong-line);
  background: var(--surface);
  color: var(--amber-dark);
}

.mail-preview-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mail-preview strong {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
}

.mail-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.email-content input {
  width: 100%;
  height: 43px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  background: var(--surface);
  font-size: 13px;
}

.email-content input:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(169, 94, 28, 0.08);
}

.form-message {
  min-height: 17px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.form-message.is-error {
  color: var(--danger);
}

.form-message.is-success {
  color: var(--green);
}

/* Toast */

.toast-region {
  position: fixed;
  z-index: 150;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: min(360px, calc(100vw - 44px));
  padding: 11px 14px;
  border: 1px solid var(--strong-line);
  background: var(--surface);
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--ink);
  font-size: 11px;
  line-height: 1.55;
  animation: toast-in 250ms var(--ease);
}

.toast.is-error {
  background: var(--danger-pale);
  color: var(--danger);
}

.toast.is-success {
  background: var(--green-pale);
  color: var(--green);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Responsive */

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 218px minmax(0, 1fr);
  }

  .view {
    padding-right: 34px;
    padding-left: 34px;
  }

  .hero-grid {
    gap: 35px;
  }

  .choice-note {
    min-width: 250px;
  }

  .option-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .verdict-reasons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reason-item:nth-child(3) {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 940px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 40;
    top: 0;
    bottom: 0;
    left: 0;
    width: 260px;
    max-height: none;
    transform: translateX(-103%);
    transition: transform 260ms var(--ease);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-close,
  .mobile-menu {
    display: inline-grid;
  }

  .topbar {
    padding: 0 18px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: 0;
  }

  .choice-note {
    width: min(420px, 90%);
    margin-left: auto;
  }

  .hero-copy h1 {
    font-size: clamp(58px, 12vw, 92px);
  }

  .composer-grid {
    grid-template-columns: 1fr;
  }

  .upload-column {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .context-column {
    min-height: 235px;
  }

  .use-cases {
    grid-template-columns: 1fr;
  }

  .use-cases article + article {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .question-layout {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .question-aside {
    padding: 26px 22px;
  }

  .question-index {
    margin-bottom: 40px;
    font-size: 84px;
  }

  .question-main {
    padding: 35px 28px;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .assistant-inline {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .assistant-inline > .primary-button {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .option-editor-card {
    grid-template-columns: 24px repeat(2, minmax(0, 1fr));
  }

  .option-editor-card .editor-field:first-of-type {
    grid-column: span 2;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 15px;
  }

  .topbar {
    min-height: 54px;
    padding: 0 13px;
  }

  .breadcrumb span,
  .breadcrumb i {
    display: none;
  }

  .engine-pill {
    max-width: 125px;
  }

  #engine-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .view {
    padding: 28px 16px 45px;
  }

  .hero-grid {
    gap: 28px;
    padding-top: 4px;
    padding-bottom: 34px;
  }

  .hero-copy h1 {
    font-size: clamp(51px, 16.8vw, 76px);
    line-height: 1;
    letter-spacing: -0.07em;
  }

  .hero-lead {
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.8;
  }

  .hero-facts {
    gap: 8px 14px;
    margin-top: 20px;
  }

  .choice-note {
    width: calc(100% - 10px);
    margin: 0 0 0 auto;
    transform: rotate(0.7deg);
  }

  .choice-note-body {
    min-height: 105px;
  }

  .choice-note-body p {
    font-size: 16px;
  }

  .choice-stamp {
    width: 61px;
    height: 61px;
    font-size: 32px;
  }

  .composer-heading {
    align-items: flex-start;
    padding: 18px 16px 15px;
  }

  .composer-heading h2 {
    font-size: 23px;
  }

  .demo-button {
    margin-top: 4px;
    font-size: 10px;
  }

  .upload-column,
  .context-column {
    padding: 16px;
  }

  .drop-zone {
    min-height: 148px;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 12px;
    padding: 20px 15px;
    text-align: center;
  }

  .paste-hint {
    display: none;
  }

  .upload-mobile-actions {
    display: flex;
    gap: 8px;
    margin-top: 9px;
  }

  .upload-mobile-actions button {
    flex: 1;
  }

  .file-preview {
    width: 70px;
    height: 83px;
  }

  .context-column {
    min-height: 225px;
  }

  .composer-actions {
    align-items: stretch;
    flex-direction: column;
    padding: 14px 16px;
  }

  .composer-actions .analyze-button {
    width: 100%;
  }

  .use-cases {
    margin-top: 25px;
  }

  .use-cases article {
    padding: 17px 12px;
  }

  .view-header,
  .result-header {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 20px;
  }

  .view-header h1,
  .result-header h1 {
    font-size: clamp(37px, 11vw, 50px);
  }

  .view-header .outline-button,
  .result-header .outline-button {
    width: 100%;
  }

  .review-meta {
    flex-wrap: wrap;
  }

  .inline-edit-note {
    width: 100%;
    margin: 2px 0 0;
  }

  .option-grid {
    grid-template-columns: 1fr;
  }

  .option-source-preview {
    height: 118px;
  }

  .option-editor-button {
    opacity: 1;
  }

  .review-actions,
  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .review-actions > .outline-button {
    order: 2;
  }

  .review-actions > div {
    align-items: stretch;
    flex-direction: column;
  }

  .review-actions > div > p {
    margin: 0 0 8px;
  }

  .review-actions .primary-button,
  .result-actions .primary-button {
    width: 100%;
  }

  .question-shell {
    min-height: calc(100vh - 135px);
  }

  .question-layout {
    grid-template-columns: 1fr;
    margin-top: 15px;
    box-shadow: 3px 3px 0 rgba(43, 38, 30, 0.88);
  }

  .question-aside {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    align-items: start;
    gap: 10px 13px;
    padding: 17px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .question-index {
    grid-row: 1 / span 2;
    margin: 0;
    font-size: 58px;
  }

  .question-aside .eyebrow {
    margin: 7px 0 0;
    font-size: 8px;
  }

  .question-why {
    grid-column: 2;
    margin: 0;
    font-size: 10px;
    line-height: 1.6;
  }

  .question-mini-options {
    display: none;
  }

  .question-main {
    min-height: 460px;
    padding: 25px 17px 19px;
  }

  .question-main h1 {
    margin-bottom: 21px;
    font-size: clamp(31px, 9.8vw, 42px);
  }

  .question-option {
    min-height: 66px;
    padding: 11px;
  }

  .question-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .verdict-top {
    padding: 8px 12px;
  }

  .verdict-serial {
    display: none;
  }

  .verdict-main {
    grid-template-columns: 1fr;
    gap: 23px;
    padding: 30px 18px 24px;
  }

  .verdict-copy h2 {
    max-width: 94%;
    font-size: clamp(36px, 10.8vw, 54px);
    overflow-wrap: break-word;
  }

  .verdict-price {
    justify-items: start;
    text-align: left;
  }

  .verdict-price strong {
    font-size: 35px;
  }

  .result-stamp {
    top: 20px;
    right: 14px;
    width: 70px;
    height: 70px;
    font-size: 20px;
  }

  .verdict-reasons {
    grid-template-columns: 1fr;
  }

  .reason-item {
    min-height: 0;
    padding: 16px;
  }

  .reason-item + .reason-item,
  .reason-item:nth-child(3) {
    grid-column: auto;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .verdict-bottom {
    grid-template-columns: 1fr;
  }

  .verdict-bottom > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .result-grid {
    margin-top: 22px;
  }

  .comparison-row {
    grid-template-columns: 31px minmax(0, 1fr) auto auto;
    gap: 9px;
    padding: 11px 12px;
  }

  .comparison-metric:nth-of-type(3) {
    display: none;
  }

  .comparison-verdict {
    font-size: 7px;
  }

  .assistant-inline {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
  }

  .assistant-inline-icon {
    width: 46px;
    height: 46px;
  }

  .assistant-inline h2 {
    font-size: 19px;
  }

  .result-actions > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .result-actions .outline-button {
    width: 100%;
    padding-right: 9px;
    padding-left: 9px;
    font-size: 11px;
  }

  .assistant-panel {
    width: 100%;
    border-left: 0;
  }

  .assistant-header {
    padding: 20px 17px 15px;
  }

  .assistant-header h2 {
    font-size: 23px;
  }

  .assistant-context {
    padding: 10px 17px;
  }

  .chat-log {
    padding: 17px;
  }

  .assistant-quick-prompts {
    padding: 0 17px 10px;
  }

  .chat-form {
    padding: 0 17px;
  }

  .modal {
    width: calc(100% - 18px);
    max-height: calc(100dvh - 18px);
  }

  .modal-shell {
    max-height: calc(100dvh - 18px);
  }

  .modal-header {
    padding: 17px 16px 14px;
  }

  .modal-header h2 {
    font-size: 24px;
  }

  .history-list,
  .settings-content,
  .option-editor-list {
    padding: 14px;
  }

  .option-editor-card {
    grid-template-columns: 24px 1fr 1fr;
    padding: 11px;
  }

  .option-editor-card .editor-field:first-of-type {
    grid-column: 2 / -1;
  }

  .modal-footer {
    align-items: stretch;
    flex-direction: column;
    padding: 12px 14px;
  }

  .modal-footer > div {
    width: 100%;
  }

  .modal-footer .primary-button,
  .modal-footer .outline-button {
    flex: 1;
  }

  .email-content {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
