:root {
  color-scheme: light dark;
  --canvas: #f6f7f4;
  --sheet: #fffefa;
  --ink: #182622;
  --secondary: #51635c;
  --line: #d5ddd6;
  --field-line: #a2b2a9;
  --accent: #005e66;
  --soft: #e7f0eb;
  --on-accent: white;
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #151a18; --sheet: #1c2420; --ink: #eaf1eb;
    --secondary: #b0c1b7; --line: #3c4942; --field-line: #667b6e;
    --accent: #84d9d4; --soft: #283c34; --on-accent: #102721;
  }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--canvas); overflow-wrap: anywhere; }
main { width: min(100%, 62rem); margin: auto; padding: 0 clamp(1rem, 4vw, 3rem) 4rem; }
.mast { display: flex; align-items: center; gap: .75rem; min-height: 4.25rem; border-bottom: 1px solid var(--line); }
.mast a, .mast .brand { display: inline-flex; align-items: center; min-height: 44px; gap: .55rem; text-decoration: none; }
.brand { font-weight: 700; color: var(--ink); letter-spacing: -.03em; }
.brand::before { content: ""; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--accent); }
.brand::after { content: ""; position: absolute; margin-left: .43rem; width: .7rem; height: .84rem; background: var(--on-accent); clip-path: polygon(100% 0, 72% 100%, 48% 65%, 0 64%); }
.mast a[data-return-chat] { margin-left: auto; font-size: .9rem; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); letter-spacing: -.045em; line-height: 1.18; margin: clamp(2rem, 6vw, 4rem) 0 1.5rem; }
h2 { font-size: 1.25rem; letter-spacing: -.025em; line-height: 1.4; margin: 0 0 1rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 .4rem; }
a { color: var(--accent); text-underline-offset: .2em; }
p, small { color: var(--secondary); }
small { display: block; margin-top: .6rem; }
section, main > details, #detail > form, #detail > details {
  margin: 1rem 0; padding: clamp(1rem, 3vw, 1.8rem);
  border: 1px solid var(--line); border-radius: 1.25rem; background: var(--sheet);
}
form, .row { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; }
form h2, form .wide, label:has(textarea) { flex-basis: 100%; }
form h2 { margin-bottom: 0; }
label { display: inline-grid; gap: .3rem; max-width: 100%; min-width: 0; font-size: .9rem; color: var(--secondary); }
form label { flex: 1 1 11rem; }
label.check { display: flex; flex: 0 0 100%; gap: .5rem; align-items: center; }
button, input, select, textarea, .action {
  max-width: 100%; font: inherit; color: var(--ink); border-radius: .7rem; min-height: 44px;
}
input, select, textarea { min-width: 0; width: 100%; border: 1px solid var(--field-line); padding: .5rem .7rem; background: var(--sheet); font-size: 1rem; }
input[type=checkbox] { width: 1.15rem; min-height: 1.15rem; accent-color: var(--accent); margin: 0; }
textarea { display: block; resize: vertical; min-height: 6rem; }
button, .action { border: 1px solid var(--line); background: var(--canvas); font-weight: 570; padding: .45rem .95rem; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .5; cursor: default; }
.primary, .action { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.action { display: inline-flex; align-items: center; text-decoration: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
summary { cursor: pointer; font-weight: 650; min-height: 44px; align-content: center; }
details[open] > summary { margin-bottom: .75rem; }
pre, code { font: .88rem/1.65 ui-monospace, "SFMono-Regular", monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
pre:not(:empty) { border-radius: .7rem; padding: .9rem; background: var(--canvas); max-height: 28rem; overflow: auto; }
output:not(:empty) { display: block; padding: .7rem 0; color: var(--ink); }
ul, ol { padding-inline-start: 1.3rem; }
li { margin-block: .4rem; }
#runs:is(nav) { display: flex; flex-wrap: wrap; gap: .5rem; }
#current, #home, #price { margin: 1rem 0; }
#current > button, #validation button { margin: .25rem .2rem .25rem 0; }
#current > details, #price > details { margin: 1rem 0; }
.invitation { max-width: 32rem; }
.invitation form { display: grid; align-items: stretch; }
.result-list { padding: 0; list-style: none; }
.result-list li { padding: .65rem 0; border-top: 1px solid var(--line); }
.result-list small { margin-top: .2rem; }
progress { width: 100%; accent-color: var(--accent); }
@media (max-width: 600px) {
  body { font-size: 1rem; }
  main { padding-bottom: max(2rem, env(safe-area-inset-bottom)); }
  form label, .row label { flex-basis: 100%; width: 100%; }
  form br { display: none; }
  .mast { min-height: 3.5rem; }
}

/* Keep the route back to the originating conversation reachable on long forms. */
html:has(.mast [data-return-chat]) { scroll-padding-top: 4.75rem; }
.mast:has([data-return-chat]) {
  position: sticky; top: 0; z-index: 5; background: var(--canvas);
  box-shadow: 0 0 0 100vmax var(--canvas);
  clip-path: inset(0 -100vmax);
}
.mast a[data-return-chat] { flex-shrink: 0; padding-inline: .4rem; font-weight: 600; }
.mast a[data-return-chat]::before {
  content: ""; width: .54rem; height: .54rem; border: solid currentColor;
  border-width: 0 0 2px 2px; transform: rotate(45deg);
}
.mast a[data-return-chat]:hover { text-decoration: underline; }
.mast .mast-title, .mast.show-title .brand { display: none; }
.mast.show-title .mast-title {
  display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 600px), (max-height: 450px) {
  .mast:has([data-return-chat]) { min-height: 3.5rem; }
  .mast + h1 { margin-block: 1.25rem 1rem; }
  html:has(.mast [data-return-chat]) { scroll-padding-top: 4rem; }
}
@media (max-width: 600px) {
  form > button.primary, .row > label + button:only-of-type { width: 100%; }
  label.check { min-height: 44px; }
}
