:root {
  --ink: #1e1a16;
  --ink-soft: #5e564c;
  --paper: #f3eee6;
  --paper-2: #fffcf7;
  --line: #e3d9cb;
  --copper: #8f3d24;
  --pine: #1f4f49;
  --pine-soft: #e4f0ed;
  --danger: #8d2b2b;
  --ok: #1d5c3a;
  --shadow: 0 18px 40px rgba(48, 32, 16, 0.08);
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.03em; line-height: 1.15; }
h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: 0 0 0.6rem; }
h2 { font-size: 1.45rem; margin: 0 0 0.45rem; }
p { margin: 0 0 0.8rem; }
a { color: var(--pine); }
a:hover { color: var(--copper); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
::selection { background: #f0d2c4; }
.skip {
  position: absolute;
  left: 0.8rem;
  top: -3rem;
  background: var(--paper-2);
  padding: 0.4rem 0.7rem;
  z-index: 3;
}
.skip:focus { top: 0.8rem; }
.wrap { width: min(1080px, calc(100% - 2rem)); margin: 0 auto; }
.narrow { width: min(440px, calc(100% - 2rem)); }
.mast { border-bottom: 1px solid var(--line); background: rgba(255, 252, 247, 0.92); }
.mast-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; font-family: var(--serif); font-size: 1.35rem; letter-spacing: -0.03em; }
.mark { width: 1.45rem; height: 1.45rem; display: block; }
.mast-nav, .side { display: flex; align-items: center; gap: 0.85rem; }
.mast-nav a { color: var(--ink); text-decoration: none; }
.button, button, .mast-nav .button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper-2);
  text-decoration: none;
  padding: 0.5rem 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.button:hover, button:hover { background: var(--copper); color: white; }
button.secondary, a.secondary {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}
button.danger { background: var(--danger); color: white; }
button:disabled { opacity: 0.65; cursor: progress; }
.hero { padding: 4.2rem 0 1.5rem; display: grid; gap: 0.8rem; }
.hero h1 { font-size: clamp(2.8rem, 7vw, 5rem); max-width: 14ch; }
.lede { color: var(--ink-soft); font-size: 1.15rem; max-width: 42rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.75rem; color: var(--copper); margin: 0 0 0.35rem; }
.features, .quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.9rem; margin: 1.2rem 0 2rem; }
.feature, .quote, .card, .empty, .ticket, .message {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.05rem;
}
.quote p { font-family: var(--serif); font-size: 1.3rem; margin-bottom: 0.6rem; }
.quote cite { color: var(--ink-soft); font-style: normal; font-size: 0.92rem; }
.section { padding: 0.4rem 0 1.4rem; }
.site-footer { border-top: 1px solid var(--line); padding: 1.2rem 0 2rem; color: var(--ink-soft); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.prices, .incidents { display: grid; gap: 0.9rem; }
.prices { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 0.4rem 0 1rem; }
.incident { background: var(--paper-2); border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.05rem; }
.status-ok { color: var(--ok); }
.docs-layout { display: grid; grid-template-columns: 180px 1fr; gap: 1.4rem; padding: 2rem 0 3rem; }
.docs-nav { flex-direction: column; align-items: stretch; }
.auth, .account { padding: 2.4rem 0 3rem; }
.auth form, .stack, .card form { display: grid; gap: 0.8rem; }
label { display: grid; gap: 0.3rem; font-size: 0.92rem; }
input, select, textarea {
  width: 100%;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
}
textarea { min-height: 7.5rem; resize: vertical; }
.hint, .meta, .foot, .status { color: var(--ink-soft); }
.form-error { color: var(--danger); margin: 0; }
.form-error.is-good { color: var(--ok); }
.banner, .notice {
  margin: 1rem auto;
  width: min(1080px, calc(100% - 2rem));
  background: var(--pine-soft);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}
.check { display: flex; align-items: center; gap: 0.5rem; }
.check input { width: auto; }
.app { min-height: 100vh; }
.workspace { width: min(1180px, calc(100% - 1.5rem)); margin: 0 auto; display: grid; grid-template-columns: 200px 1fr; gap: 1.4rem; padding: 1.3rem 0 3rem; }
.side { flex-direction: column; align-items: stretch; position: sticky; top: 1rem; align-self: start; }
.side a { color: var(--ink); text-decoration: none; padding: 0.4rem 0.55rem; border-radius: 8px; }
.side a[aria-current="page"], .switcher a[aria-current="page"] { background: var(--ink); color: var(--paper-2); }
.panel-head { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: 1rem; }
.rows, .plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.rows a, .plain a { display: grid; gap: 0.15rem; text-decoration: none; color: inherit; background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px; padding: 0.8rem 0.9rem; }
.rows a:hover { border-color: var(--copper); }
.title { font-family: var(--serif); font-size: 1.2rem; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; vertical-align: top; padding: 0.75rem 0.45rem; border-bottom: 1px solid var(--line); }
.table th { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }
.inline { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: end; }
.inline label { min-width: 9rem; }
code, .mono { font-family: var(--mono); font-size: 0.92rem; }
.reveal { background: #241c16; color: #f6f1e7; border-radius: 16px; padding: 1rem 1.1rem; margin: 0 0 1rem; }
.reveal a, .reveal button { color: #f6f1e7; }
.reveal code { display: block; white-space: pre-wrap; overflow-wrap: anywhere; background: transparent; margin: 0.6rem 0; }
.document-text, .message-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.document-text { font-family: var(--serif); font-size: 1.05rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: 16px; padding: 1.15rem 1.2rem; }
.thread { display: grid; gap: 0.7rem; margin-bottom: 1rem; }
.message.user { background: var(--pine-soft); }
.who { margin: 0 0 0.35rem; color: var(--ink-soft); font-size: 0.82rem; }
.citations { display: grid; gap: 0.6rem; margin: 0.4rem 0 0.2rem; }
.citations blockquote { margin: 0; padding: 0.7rem 0.8rem; border-left: 3px solid var(--copper); background: white; border-radius: 0 12px 12px 0; }
.switcher { position: relative; }
.switcher summary { cursor: pointer; list-style: none; font-family: var(--serif); }
.switcher summary::-webkit-details-marker { display: none; }
.switcher ul { position: absolute; z-index: 2; background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px; margin: 0.4rem 0 0; padding: 0.4rem; min-width: 14rem; box-shadow: var(--shadow); list-style: none; }
.switcher a { display: block; padding: 0.4rem 0.55rem; color: var(--ink); text-decoration: none; border-radius: 8px; }
.pager { margin-top: 0.8rem; }
.split { display: grid; grid-template-columns: 220px 1fr; gap: 1rem; }
.tools { color: var(--ink-soft); font-size: 0.88rem; margin: 0.2rem 0 0; }
@media (max-width: 860px) {
  .workspace, .split, .docs-layout { grid-template-columns: 1fr; }
  .side { position: static; flex-direction: row; overflow: auto; }
  .mast-inner { align-items: flex-start; padding: 0.7rem 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
