:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f4f7fa;
  --border: #e4eaf0;
  --text: #07111f;
  --muted: #66788c;
  --faint: #8a98a8;
  --brand: #17bebb;
  --link: #2e86de;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --surface: #161616;
    --border: #262626;
    --text: #ededed;
    --muted: #a6a6a6;
    --faint: #7a7a7a;
    --link: #6db3f2;
  }
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  -webkit-text-size-adjust: 100%;
}

.masthead {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 14px 20px;
}

.brand { align-items: center; color: var(--text); display: flex; font-weight: 800; gap: 9px; text-decoration: none; }
.brand img { height: 26px; width: 26px; }
.cta {
  background: var(--brand);
  border-radius: 999px;
  color: #07111f;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 15px;
  text-decoration: none;
  white-space: nowrap;
}

main { margin: 0 auto; max-width: 760px; padding: 26px 20px 70px; }
h1 { font-size: 1.7rem; line-height: 1.25; margin: 0 0 8px; }
.meta { color: var(--faint); font-size: 0.82rem; margin-bottom: 26px; }
.meta span + span::before { content: "·"; margin: 0 7px; }

.turn { border-top: 1px solid var(--border); padding: 20px 0; }
.turn:first-of-type { border-top: 0; padding-top: 4px; }
.turn-label {
  color: var(--faint);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  margin: 0 0 10px;
  text-transform: uppercase;
}
.turn.user { background: var(--surface); border-radius: 12px; margin: 18px 0; padding: 16px 18px; }
.turn.user .turn-label { color: var(--brand); }
.turn p { margin: 0 0 12px; overflow-wrap: anywhere; }
.turn h3 { font-size: 1.15rem; margin: 22px 0 8px; }
.turn h4 { font-size: 1rem; margin: 18px 0 6px; }
.turn ul, .turn ol { margin: 0 0 12px; padding-left: 22px; }
.turn li { margin-bottom: 5px; }
.turn a { color: var(--link); }
.turn blockquote {
  border-left: 3px solid var(--brand);
  color: var(--muted);
  margin: 0 0 12px;
  padding-left: 12px;
}
.turn hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

pre.code, pre.output {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.5;
  margin: 0 0 12px;
  overflow-x: auto;
  padding: 12px;
}
pre.output { color: var(--muted); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

details { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 12px; padding: 10px 12px; }
details summary { color: var(--muted); cursor: pointer; font-size: 0.8rem; font-weight: 700; }
details[open] summary { margin-bottom: 10px; }
details p { color: var(--muted); font-size: 0.88rem; white-space: pre-wrap; }

aside { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 10px; }
aside h3 { color: var(--faint); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.09em; margin: 0 0 8px; text-transform: uppercase; }
aside ul { list-style: none; margin: 0; padding: 0; }
aside li { margin-bottom: 6px; overflow-wrap: anywhere; }
aside a { color: var(--link); }
aside span { color: var(--faint); font-size: 0.78rem; }

.footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 34px;
  padding-top: 22px;
}
.footer a { color: var(--link); }
.notice { color: var(--faint); font-size: 0.78rem; margin-top: 10px; }
