@font-face {
  font-family: Spectral;
  src: url(fonts/spectral.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Spectral;
  src: url(fonts/spectral-medium.woff2) format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url(fonts/dm-sans.woff2) format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif SC";
  src: url(fonts/noto-serif-sc.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans SC";
  src: url(fonts/noto-sans-sc.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root[data-design="reader"] {
  --sans:
    "DM Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: Spectral, "Noto Serif SC", "Songti SC", "Noto Serif CJK SC", serif;
  --prose: var(--serif);
  --reader-text: 1.0625rem;
  --measure: 43.5rem;
  --bg: #faf9f6;
  --panel: #fffefa;
  --sub: #f1efe8;
  --user: #eeece5;
  --ink: #282823;
  --body: #39372f;
  --muted: #726f65;
  --line: #e2dfd6;
  --strong-line: #cec9bc;
  --accent: #a44c30;
  --soft: #f3e6d9;
  --on-mark: #fffcf5;
  --ok: #4c6951;
  --bad: #92513e;
  --addbg: #edf1e9;
  --delbg: #f6eae2;
  --focus: #a44c30;
  --shadow: 0 1px 3px #44332207, 0 7px 20px -10px #59422b25;
}
:root[data-design="reader"][data-theme="dark"] {
  --bg: #222320;
  --panel: #2b2c28;
  --sub: #31322d;
  --user: #32332e;
  --ink: #f0eee4;
  --body: #e2dfd4;
  --muted: #aba99c;
  --line: #3d3e37;
  --strong-line: #53554a;
  --accent: #e29d79;
  --soft: #44362c;
  --on-mark: #2e211a;
  --ok: #a3c09e;
  --bad: #e1a58d;
  --addbg: #303b30;
  --delbg: #3d3029;
  --focus: #e29d79;
  --shadow: 0 4px 16px #0002;
}
:root[data-font="sans"] {
  --prose: var(--sans);
}
:root[data-font="system"] {
  --prose: system-ui, sans-serif;
}
body {
  font: 0.90625rem/1.55 var(--sans);
}
.reader-shell {
  container: reader / inline-size;
  font-size: 1rem;
}
.reader-shell .topbar {
  height: 3.75rem;
  padding: 0 clamp(1rem, 3vw, 3.25rem);
  gap: 1rem;
  background: var(--bg);
  border-color: var(--line);
}
.reader-shell .brand {
  font: 500 1.65rem/1 var(--serif);
  letter-spacing: -0.054em;
  gap: 0.3rem;
}
.reader-mark {
  color: var(--accent);
}
.brand .reader-mark {
  width: 1.85rem;
  height: 1.85rem;
}
.reader-shell .top-start,
.reader-shell .top-end {
  gap: 0.7rem;
}
.head-divider {
  width: 1px;
  height: 1rem;
  background: var(--line);
  margin-inline: 0.3rem;
}
.project-link,
.history-link,
.header-new,
.host,
.entry-project {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  font: 500 0.8125rem/1.25 var(--sans);
}
.project-link,
.history-link,
.host {
  border-radius: 0.5rem;
  padding: 0.4rem 0.45rem;
  color: var(--muted);
}
.project-link {
  color: var(--body);
}
.project-link:hover,
.history-link:hover,
.host:hover {
  background: var(--sub);
  color: var(--ink);
}
.host {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.host .status-dot {
  width: 0.38rem;
  height: 0.38rem;
}
.header-new {
  padding: 0.48rem 0.8rem;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--strong-line);
  border-radius: 0.6rem;
}
.header-new:hover {
  background: var(--sub);
  color: var(--ink);
}
.reader-shell .icon-btn {
  width: 2.15rem;
  height: 2.15rem;
  min-width: 0;
  min-height: 0;
}
.reader-shell .topbar .icon {
  width: 1.05rem;
  height: 1.05rem;
}
.reader-shell .settings-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: auto;
  padding-inline: 0.45rem;
  font: 500 0.8125rem/1.25 var(--sans);
}
.reader-shell .topbar .project-link svg:last-child {
  width: 0.72rem;
}
.reader-shell .mobile-menu {
  display: none;
}
.reader-frame {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
}
.reader-frame .transcript {
  width: 100%;
}
.reader-shell .scroll-area {
  flex: 1 1 auto;
  scrollbar-gutter: stable both-edges;
}
.reader-shell .reading-column,
.reader-shell .composer-wrap,
.starters {
  width: min(var(--measure), calc(100% - 3rem));
  margin-inline: auto;
}
.reader-shell .reading-column {
  padding: clamp(1.5rem, 4.7vh, 3.4rem) 0 0.1rem;
}
.entry-heading {
  margin-bottom: 1.05rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}
.entry-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font: 500 0.74rem/1.3 var(--sans);
  font-variant-numeric: tabular-nums;
}
.entry-meta::before {
  content: "";
  width: 1.15rem;
  height: 2px;
  background: var(--accent);
}
.entry-meta i,
.byline-dot {
  display: block;
  width: 0.16rem;
  height: 0.16rem;
  background: currentColor;
  border-radius: 50%;
}
.entry-project {
  display: none;
  color: var(--body);
}
.heading-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.45rem;
}
.heading-row h1 {
  margin: 0;
  color: var(--ink);
  font: 400 clamp(1.95rem, 1.65rem + 1.12vw, 2.6rem)/1.34 var(--serif);
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
  min-width: 0;
}
.page-outline {
  display: none;
}
.outline-trigger {
  flex: none;
}
.reader-shell .turn {
  outline: none;
}
.reader-shell .turn + .turn {
  margin-top: 1.12rem;
}
.reader-shell .user-turn {
  margin: 0 0 0.72rem;
  align-items: flex-end;
}
.reader-shell .user-message {
  font: 400 calc(var(--reader-text) - 0.09rem)/1.62 var(--prose);
  max-width: 85%;
  padding: 0.48rem 0.84rem;
  border-radius: 0.92rem 0.92rem 0.28rem 0.92rem;
  background: var(--user);
  color: var(--ink);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  text-wrap: pretty;
}
.reader-shell .assistant-identity {
  gap: 0.42rem;
  color: var(--muted);
}
.reader-shell .assistant-identity strong {
  font: 500 1.15rem/1.2 var(--serif);
  color: var(--ink);
  letter-spacing: -0.035em;
}
.reader-shell .assistant-identity time {
  margin: 0;
  font: 450 0.72rem/1.25 var(--sans);
  font-variant-numeric: tabular-nums;
}
.reader-shell .agent-symbol {
  width: 1.58rem;
  height: 1.58rem;
  border-radius: 0.46rem;
  background: var(--soft);
}
.agent-symbol .reader-mark {
  width: 1.32rem;
  height: 1.32rem;
}
.reader-shell .assistant-body {
  margin: 0.3rem 0 0 2rem;
}
.reader-shell .assistant-body p,
.type-specimen p {
  margin: 0;
  max-width: none;
  font: 400 var(--reader-text)/1.73 var(--prose);
  color: var(--body);
  text-wrap: pretty;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-break: strict;
  font-optical-sizing: auto;
}
.reader-shell .assistant-body p + p {
  margin-top: 0.26em;
}
.assistant-body code.inline,
.type-specimen p code {
  font: 400 0.8em/1.4 var(--mono);
  background: var(--sub);
  color: var(--body);
  border-radius: 0.28em;
  padding: 0.1em 0.32em;
}
.reader-shell .assistant-body .pending-reply {
  font: 400 0.85rem/1.65 var(--sans);
  color: var(--muted);
}
.reader-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.reader-proof button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 1.97rem;
  padding: 0.3rem 0.56rem;
  color: var(--body);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--panel);
  font: 500 0.76rem/1.25 var(--sans);
}
.reader-proof button:hover,
.reader-proof button[aria-expanded="true"] {
  background: var(--sub);
  border-color: var(--strong-line);
  color: var(--ink);
}
.reader-proof button svg:first-child {
  width: 0.91rem;
  height: 0.91rem;
  color: var(--accent);
}
.reader-proof button[data-result$="tests"] svg:first-child {
  color: var(--ok);
}
.reader-proof button svg:last-child {
  width: 0.72rem;
  height: 0.72rem;
  color: var(--muted);
}
.reader-proof button[aria-expanded="true"] svg:last-child {
  transform: rotate(180deg);
}
.reader-proof button[data-result$="diff"] span {
  font: 400 0.74rem var(--mono);
}
.diff-count {
  font: 0.68rem var(--mono);
  color: var(--ok);
}
.diff-count i {
  font-style: normal;
  color: var(--bad);
}
.inline-proof {
  margin-top: 0.4rem;
  border-radius: 0.6rem;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}
.inline-proof .file-bar {
  font-size: 0.76rem;
  padding: 0.5rem 0.7rem;
}
.inline-proof .code-row {
  font: 0.76rem/1.68 var(--mono);
  grid-template-columns: 2rem 0.95rem 1fr;
}
.inline-proof .code-row span,
.inline-proof .counts,
.inline-proof .ok-label {
  font-size: 0.68rem;
}
.inline-proof .test-list {
  font-size: 0.83rem;
  padding: 0.55rem 0.8rem;
}
.reader-shell .composer-wrap {
  padding: 0.95rem 0 max(1rem, env(safe-area-inset-bottom));
}
.jump-latest:not([hidden]) {
  position: absolute;
  bottom: calc(100% - 0.3rem);
  right: 0.2rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--strong-line);
  border-radius: 1rem;
  color: var(--body);
  background: var(--panel);
  font-size: 0.76rem;
  box-shadow: var(--shadow);
}
.reader-shell .composer {
  padding: 0.53rem 0.55rem 0.4rem 0.8rem;
  border-radius: 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--strong-line);
  background: var(--panel);
}
.reader-shell .composer:focus-within {
  border-color: var(--accent);
  box-shadow:
    var(--shadow),
    0 0 0 2px color-mix(in srgb, var(--accent) 13%, transparent);
}
.reader-shell .composer textarea {
  field-sizing: content;
  font: 400 1rem/1.5 var(--sans);
  padding: 0.16rem 0.16rem 0.3rem;
  min-height: 2rem;
  max-height: min(8rem, 22dvh);
  height: auto;
}
.reader-shell .composer textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
.reader-shell .composer-tools {
  gap: 0.25rem;
}
.reader-shell .composer-tools .v-rule {
  display: none;
}
.reader-shell .engine {
  font-size: 0.82rem;
  margin-left: auto;
  padding: 0.3rem 0.5rem;
  min-height: 2rem;
  min-width: 0;
}
.reader-shell .engine svg {
  width: 0.9rem;
  height: 0.9rem;
}
.reader-shell .send {
  margin-left: 0.15rem;
  width: 2.1rem;
  height: 2.1rem;
  min-width: 0;
  min-height: 0;
  border-radius: 0.67rem;
}
.reader-shell .send:disabled {
  background: var(--sub);
  color: var(--muted);
  filter: none;
}
.reader-shell .send svg {
  width: 1.1rem;
  height: 1.1rem;
}
.reader-shell .attached {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 0.75rem;
}
.reader-frame.empty .reading-column {
  padding-top: clamp(2rem, 15vh, 9rem);
}
.empty-heading {
  border: none;
  padding: 0;
  margin: 0;
}
.empty-heading > .reader-mark {
  width: 2.7rem;
  height: 2.7rem;
  margin-bottom: 0.8rem;
}
.empty-heading .entry-meta::before {
  display: none;
}
.empty-heading .entry-date {
  display: none;
}
.empty-heading .entry-project {
  display: inline-flex;
}
.reader-frame.empty .composer-wrap {
  padding-bottom: 0.5rem;
}
.starters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.starters button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  padding: 0.38rem 0.65rem;
  font-size: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}
.starters button:hover {
  background: var(--sub);
  color: var(--ink);
}
#dialog {
  width: min(26.5rem, calc(100% - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  border-color: var(--line);
  border-radius: 1.05rem;
}
#dialog::backdrop {
  background: #16171161;
}
.dialog-head {
  padding: 0.8rem 0.85rem 0.65rem 1.15rem;
}
.dialog-head h2 {
  font: 500 1.28rem/1.4 var(--serif);
}
.dialog-head .icon-btn {
  height: 2rem;
  width: 2rem;
}
.dialog-body {
  max-height: calc(100dvh - 6rem);
  padding: 0.8rem;
}
.option {
  padding: 0.63rem;
  gap: 0.65rem;
}
.option b {
  font-size: 0.92rem;
}
.option small,
.dialog-note,
.facts dt,
.facts dd {
  font-size: 0.78rem;
}
.option b,
.option small,
.facts dd {
  overflow-wrap: anywhere;
}
.sheet-outline .outline-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-align: left;
  padding: 0.65rem;
  border-radius: 0.45rem;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}
.sheet-outline .outline-item[aria-current="location"] {
  background: var(--soft);
  color: var(--accent);
}
.preferences {
  padding: 0.05rem 0.3rem 0.1rem;
}
.type-specimen {
  background: var(--sub);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  padding: 0.72rem 0.9rem;
  margin-bottom: 0.8rem;
}
.specimen-label {
  font-size: 0.7rem;
  color: var(--muted);
}
.type-specimen p {
  margin-top: 0.19rem;
}
.choice-field {
  margin: 0 0 0.8rem;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}
.choice-field legend {
  margin-bottom: 0.38rem;
  padding: 0;
  font-size: 0.84rem;
  color: var(--ink);
}
.choice-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
  border-radius: 0.6rem;
  background: var(--sub);
}
.choice-group label {
  position: relative;
  cursor: pointer;
}
.choice-group input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.choice-group span {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  min-height: 2.1rem;
  border: 1px solid transparent;
  border-radius: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.choice-group svg {
  width: 1em;
  height: 1em;
}
.choice-group input:checked + span {
  background: var(--panel);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: 0 1px 3px #0001;
}
.choice-group input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.step-field,
.preferences-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.step-field {
  min-height: 2.85rem;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
}
.step-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}
.step-control button {
  width: 2.05rem;
  height: 1.9rem;
  display: grid;
  place-items: center;
}
.step-control button:disabled {
  opacity: 0.32;
}
.step-control output {
  min-width: 3.4rem;
  font-size: 0.79rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.preferences-footer {
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
  margin-top: 0.1rem;
  font-size: 0.84rem;
}
.preferences-footer button {
  padding: 0.4rem 0.25rem;
  color: var(--muted);
}
.preferences-footer .done {
  color: var(--on-mark);
  background: var(--accent);
  border-radius: 0.5rem;
  padding: 0.45rem 1.05rem;
}
@container reader (min-width: 69rem) {
  .page-outline {
    display: block;
    position: absolute;
    left: max(1.4rem, calc((100% - var(--measure)) / 2 - 13.8rem));
    top: clamp(2rem, 5.2vh, 3.6rem);
    width: 10rem;
    z-index: 1;
  }
  .page-outline h2 {
    display: flex;
    align-items: center;
    gap: 0.42rem;
    margin: 0 0 0.6rem;
    color: var(--muted);
    font: 500 0.75rem/1.5 var(--sans);
  }
  .page-outline nav {
    display: flex;
    flex-direction: column;
    max-height: 55dvh;
    overflow: auto;
    padding: 1px 0 1px 3px;
    scrollbar-width: thin;
  }
  .page-outline .outline-item {
    border-left: 1px solid var(--line);
    padding: 0.35rem 0.6rem;
    text-align: left;
    font: 400 0.8rem/1.5 var(--sans);
    color: var(--muted);
  }
  .page-outline .outline-item span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .page-outline .outline-item[aria-current="location"] {
    border-color: var(--accent);
    color: var(--accent);
  }
  .page-outline .outline-item:hover {
    color: var(--ink);
  }
  .reader-shell .outline-trigger {
    display: none;
  }
}
@container reader (max-width: 42rem) {
  .reader-shell .topbar {
    height: 3.25rem;
    padding-inline: max(0.4rem, env(safe-area-inset-left))
      max(0.55rem, env(safe-area-inset-right));
    gap: 0.2rem;
  }
  .reader-shell .top-start,
  .reader-shell .top-end {
    gap: 0.08rem;
  }
  .reader-shell .mobile-menu {
    display: inline-grid;
  }
  .reader-shell .mobile-menu,
  .reader-shell .top-end .icon-btn,
  .reader-shell .header-new {
    min-width: 40px;
    min-height: 44px;
  }
  .reader-shell .brand {
    font-size: 1.42rem;
    gap: 0.17rem;
  }
  .brand .reader-mark {
    width: 1.38rem;
    height: 1.38rem;
  }
  .reader-shell .project-link,
  .reader-shell .project-divider,
  .host,
  .host-divider,
  .history-link,
  .settings-link span,
  .header-new span {
    display: none;
  }
  .header-new {
    justify-content: center;
    padding: 0;
    border: none;
    background: none;
    color: var(--accent);
  }
  .reader-shell .scroll-area {
    scrollbar-gutter: auto;
  }

  .reader-shell .reading-column,
  .reader-shell .composer-wrap,
  .starters {
    width: calc(100% - 2rem);
  }
  .reader-shell .reading-column {
    padding: 1rem 0 0.15rem;
  }
  .reader-shell .entry-heading {
    margin-bottom: 0.8rem;
    padding-bottom: 0.63rem;
  }
  .entry-meta {
    gap: 0.42rem;
  }
  .entry-meta::before,
  .entry-date {
    display: none;
  }
  .entry-project {
    display: inline-flex;
    min-height: 1.55rem;
  }
  .heading-row {
    margin-top: 0.2rem;
  }
  .heading-row h1 {
    font-size: 1.9rem;
  }
  .reader-shell .turn + .turn {
    margin-top: 0.95rem;
  }
  .reader-shell .user-turn {
    margin-bottom: 0.58rem;
  }
  .reader-shell .user-message {
    max-width: 89%;
    padding: 0.43rem 0.71rem;
  }
  .reader-shell .assistant-body {
    margin: 0.3rem 0 0;
  }
  .reader-shell .assistant-body p {
    line-height: 1.65;
  }
  .reader-proof {
    gap: 0.36rem;
    margin-top: 0.47rem;
  }
  .reader-proof button {
    min-height: max(2rem, 38px);
  }
  .reader-shell .composer-wrap {
    padding: 0.7rem 0 max(0.6rem, env(safe-area-inset-bottom));
  }
  .reader-shell .send,
  .reader-shell .composer-tools .icon-btn,
  .reader-shell .engine {
    min-height: 42px;
    min-width: 42px;
  }
  .reader-shell .composer textarea {
    font-size: max(1rem, 16px);
  }
  .reader-frame.empty .reading-column {
    padding-top: min(13dvh, 5rem);
  }
  .reader-frame.empty .entry-heading {
    padding: 0;
    margin: 0;
  }
}
@container reader (max-width: 20rem) {
  .brand .reader-mark {
    display: none;
  }
  .reader-shell .brand {
    font-size: 1.25rem;
  }
  .reader-shell .reading-column,
  .reader-shell .composer-wrap,
  .starters {
    width: calc(100% - 1.25rem);
  }
  .diff-count {
    display: none;
  }
}
@media (max-width: 600px) {
  #dialog {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    max-height: 95dvh;
    border-radius: 1rem 1rem 0 0;
    border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .dialog-body {
    max-height: calc(95dvh - 4.4rem - env(safe-area-inset-bottom));
  }
  .choice-group span,
  .step-control button,
  .preferences-footer button {
    min-height: 40px;
  }
  .step-control button {
    min-width: 42px;
  }
}
@media (max-height: 570px) {
  .reader-shell .reading-column,
  .reader-frame.empty .reading-column {
    padding-top: 0.6rem;
  }
  .reader-frame.empty .empty-heading > .reader-mark {
    display: none;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .reader-proof svg:last-child {
    transition: transform 0.15s;
  }
  .inline-proof:not([hidden]) {
    animation: reveal-proof 0.16s ease-out;
  }
  @keyframes reveal-proof {
    from {
      opacity: 0.45;
      transform: translateY(-2px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}
.read-code {margin:.5rem 0; border:1px solid var(--line); border-radius:.6rem; background:var(--panel); overflow:hidden; min-width:0;}
.read-code-head,.demo-controls,.task-state {display:flex;align-items:center;flex-wrap:wrap;gap:.45rem .65rem;font:400 .8rem/1.45 var(--sans);color:var(--muted);}
.read-code-head {justify-content:space-between;padding:.23rem .65rem;border-bottom:1px solid var(--line);}
.read-code-head button,.demo-controls button,.task-state button {display:inline-flex;align-items:center;gap:.28rem;padding:.32rem .45rem;color:var(--accent);border-radius:.3rem;}
.read-code-head button:hover,.demo-controls button:hover,.task-state button:hover {background:var(--sub);}
.read-code pre {margin:0;padding:.65rem .8rem;overflow:auto;white-space:pre;word-break:normal;font:.84rem/1.6 var(--mono);}
.read-code pre code {font:inherit;}
.task-state {margin:.18rem 0; min-height:1.6rem;}
.task-state small {font:.68rem var(--mono);}
.task-state[data-phase="failed"],.task-state[data-phase="blocked"],.task-state[data-phase="unconfirmed"] {color:var(--accent);}
.demo-controls {justify-content:space-between;margin-bottom:.35rem;}
.demo-controls select {background:var(--panel);border:1px solid var(--line);border-radius:.4rem;padding:.25rem;color:var(--ink);font:inherit;}


:root[data-design="reader"] {
  --inline-ink:#823e2b; --inline-bg:#f4e9df;
  --code-ink:#32342f; --code-bg:#f4f3ee; --code-header:#eeede6;
  --syntax-key:#714586; --syntax-str:#346348; --syntax-num:#835024; --syntax-name:#315f81; --syntax-comment:#67695e;
  --patch-add:#215b37; --patch-add-bg:#e2f0e4; --patch-del:#8b3835; --patch-del-bg:#f8e6e3;
  --patch-meta:#465c7b; --patch-meta-bg:#e6ebf2;
}
:root[data-design="reader"][data-theme="dark"] {
  --inline-ink:#f1bca2; --inline-bg:#40312b;
  --code-ink:#e2e2d6; --code-bg:#20221f; --code-header:#292c27;
  --syntax-key:#d8b4eb; --syntax-str:#a8d4aa; --syntax-num:#efc193; --syntax-name:#a7cde5; --syntax-comment:#aaa99a;
  --patch-add:#c1eac8; --patch-add-bg:#283d2d; --patch-del:#f5bab4; --patch-del-bg:#452e2e;
  --patch-meta:#baceed; --patch-meta-bg:#2b3542;
}
.assistant-body code.inline,.type-specimen p code {color:var(--inline-ink);background:var(--inline-bg);padding:.08em .32em;font-size:.86em;}
.read-code {max-width:100%;color:var(--code-ink);background:var(--code-bg);}
.read-code .read-code-head {background:var(--code-header);color:var(--muted);}
.read-code pre,.evidence-output .read-code pre {margin:0;padding:.65rem .8rem;background:var(--code-bg);color:var(--code-ink);border-radius:0;tab-size:4;line-height:1.6;}
.read-code pre code {font:inherit;background:transparent;color:inherit;padding:0;}
.read-code .hljs-comment,.read-code .hljs-quote {color:var(--syntax-comment);}
.read-code .hljs-keyword,.read-code .hljs-selector-tag,.read-code .hljs-meta {color:var(--syntax-key);}
.read-code .hljs-string,.read-code .hljs-regexp,.read-code .hljs-addition {color:var(--syntax-str);}
.read-code .hljs-number,.read-code .hljs-literal,.read-code .hljs-attribute,.read-code .hljs-symbol {color:var(--syntax-num);}
.read-code .hljs-title,.read-code .hljs-built_in,.read-code .hljs-attr,.read-code .hljs-name {color:var(--syntax-name);}
.read-code.patch-block pre {padding:.25rem 0;}
.patch-block code {display:block;width:max-content;min-width:100%;}
.patch-line {display:inline-block;min-width:100%;padding:0 .7rem;box-sizing:border-box;}
.patch-plus {color:var(--patch-add);background:var(--patch-add-bg);}
.patch-minus {color:var(--patch-del);background:var(--patch-del-bg);}
.patch-hunk,.patch-file {color:var(--patch-meta);background:var(--patch-meta-bg);}
.patch-file {font-weight:500;}
.patch-path {margin:.5rem 0 .18rem;overflow-wrap:anywhere;font:500 .84rem/1.5 var(--mono);}
.patch-path small {font:400 .78rem var(--sans);color:var(--muted);margin-right:.4rem;}

.file-link { display:inline; padding:0; border:0; background:none; color:var(--accent); font:inherit; text-align:start; overflow-wrap:anywhere; text-decoration:underline; text-underline-offset:.15em; cursor:pointer; }
#download-form { display:grid; gap:.8rem; }
#download-form input { width:100%; box-sizing:border-box; font:inherit; }
#download-form button { justify-self:end; }
.att-tag { max-width:100%; }
.att-tag > span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
