:root {
  color-scheme: light;
  --paper: #f6f4f0;
  --surface: #fffefa;
  --ink: #36313c;
  --muted: #77717b;
  --line: #e4dfe5;
  --accent: #755470;
  --soft: #f0e9ef;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); font-size: 14px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 4px; }
button, summary, .import-label { cursor: pointer; }
button, a, input, select, textarea, summary { touch-action: manipulation; }
button:disabled { opacity: .48; cursor: not-allowed; }
:focus-visible { outline: 3px solid #a282a3; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 600; }
h2 { font-size: 15px; }
fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 10; padding: 10px 20px; background: white; }
.skip-link:focus { top: 10px; }
.page-width { width: min(1520px, calc(100% - 64px)); margin-inline: auto; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar { min-height: 68px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 21px; font-weight: 650; text-decoration: none; letter-spacing: -.5px; }
.brand-mark { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; font-family: Georgia, serif; background: var(--accent); color: white; line-height: 1; }
.brand-section { font-size: 12px; font-weight: 400; letter-spacing: 0; color: var(--muted); padding-left: 15px; margin-left: 5px; border-left: 1px solid var(--line); }
.back-link { font-size: 12px; text-decoration: none; white-space: nowrap; }
.intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 33px 0 17px; }
.eyebrow { font-size: 10px; letter-spacing: .12em; color: var(--accent); font-weight: 650; }
h1 { font-size: clamp(25px, 2.8vw, 36px); letter-spacing: -.045em; margin: 5px 0 8px; line-height: 1.5; }
.intro-copy { color: var(--muted); font-size: 13px; }
.intro-note { flex-shrink: 0; font-size: 12px; text-align: right; color: var(--accent); }
.intro-note p { color: var(--muted); font-size: 11px; margin-top: 6px; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #819a84; margin-right: 6px; vertical-align: middle; }
.status-line { min-height: 25px; color: var(--accent); font-size: 12px; margin-bottom: 17px; }
.notice { padding: 12px 16px; margin-bottom: 16px; border: 1px solid; border-radius: 9px; overflow-wrap: anywhere; }
.error { color: #933c3c; background: #fff0eb; border-color: #e8c7bc; }
.warning { color: #806020; background: #fff4df; border-color: #e6d4b1; }
.workspace { display: grid; grid-template-columns: 270px minmax(0, 1fr) 260px; align-items: start; gap: 18px; }
.workspace > *, .section-heading > *, .conversation-heading > * { min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.panel-section { padding: 18px; }
.setup-panel .panel-section + .panel-section { border-top: 1px solid var(--line); }
.model-note { border-top: 1px solid var(--line); }
.model-note p { color: var(--muted); font-size: 11px; margin-top: 8px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.step { color: #948c96; font-size: 10px; white-space: nowrap; }
.help { display: block; color: var(--muted); font-size: 11px; line-height: 1.8; margin-top: 7px; overflow-wrap: anywhere; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 15px; }
.preset { padding: 12px 9px; background: #faf8f6; border: 1px solid var(--line); border-radius: 8px; text-align: left; min-width: 0; }
.preset[aria-pressed="true"] { border-color: #9c7d98; background: var(--soft); }
.preset:hover:not(:disabled) { border-color: var(--accent); }
.preset-mark { display: block; font-family: Georgia, serif; font-size: 19px; color: var(--accent); line-height: 1.3; margin-bottom: 6px; }
.preset strong { display: block; font-size: 12px; font-weight: 550; }
.preset small { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
.field-label { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; justify-content: space-between; margin: 15px 0 6px; font-size: 12px; font-weight: 550; }
.field-label:first-child { margin-top: 0; }
.field-label span { font-size: 10px; color: var(--muted); font-weight: 400; }
input:not([type="checkbox"]), textarea, select { width: 100%; min-width: 0; border: 1px solid #d8d0d9; border-radius: 7px; background: var(--surface); padding: 9px 10px; font-size: 12px; }
textarea { display: block; resize: vertical; }
textarea::placeholder { color: #948b98; }
select { min-height: 42px; }
input[type="checkbox"] { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--accent); margin: 3px 0 0; }
summary { font-size: 12px; color: var(--accent); min-height: 36px; padding: 8px 0; }
details { margin-top: 8px; }
.button { padding: 9px 13px; min-height: 40px; background: var(--surface); border: 1px solid #d8d0d9; border-radius: 7px; font-size: 12px; font-weight: 500; }
.button:hover:not(:disabled) { border-color: var(--accent); background: var(--soft); }
.primary { background: var(--accent); color: white; border-color: var(--accent); }
.primary:hover:not(:disabled) { background: #61445c; color: white; }
.full { width: 100%; margin-top: 15px; display: flex; justify-content: space-between; gap: 6px; }
.text-button { padding: 6px 0; background: none; border: 0; color: var(--accent); font-size: 11px; text-align: left; min-height: 36px; text-decoration: underline; text-decoration-color: #cdbdce; text-underline-offset: 4px; }
.danger { color: #994b4b; }
.conversation-heading { padding: 20px 24px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.conversation-heading h2 { font-size: 20px; margin-top: 3px; overflow-wrap: anywhere; }
.model-label { padding: 4px 8px; border: 1px solid var(--line); border-radius: 5px; font: 10px ui-monospace, monospace; color: var(--muted); overflow-wrap: anywhere; }
.active-summary { margin: 0 24px; padding-bottom: 14px; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.active-summary summary { font-size: 11px; }
.branch-notice { padding: 10px 14px; margin: 14px 24px 0; color: var(--accent); background: var(--soft); font-size: 11px; border-radius: 6px; }
.empty-conversation { min-height: 368px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 22px; }
.story-mark { width: 102px; height: 100px; position: relative; margin-bottom: 20px; }
.story-mark span { display: grid; place-items: center; position: absolute; inset: 12px; border-radius: 28px 28px 28px 8px; background: #ede3ed; color: #947591; font: 83px Georgia, serif; padding-top: 13px; line-height: 1; transform: rotate(-9deg); }
.story-mark i { position: absolute; width: 13px; height: 13px; background: #d6bc9e; border-radius: 50%; right: 0; top: 7px; }
.story-mark b { position: absolute; width: 28px; height: 28px; border: 1px solid #c6b7c7; border-radius: 50%; bottom: 0; left: 0; }
.empty-conversation h3 { font-size: 16px; margin-bottom: 10px; }
.empty-conversation p { color: var(--muted); font-size: 12px; }
.starter-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 23px; }
.starter-list button { font-size: 11px; background: transparent; border: 1px solid var(--line); padding: 7px 10px; border-radius: 20px; }
.turns { padding: 0 24px; max-height: 760px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.turn { padding: 23px 0 17px; border-bottom: 1px solid var(--line); }
.turn:last-child { border-bottom: 0; }
.turn-label { color: var(--muted); font-size: 10px; margin: 0 0 7px; }
.user-message { background: #f1edf2; padding: 11px 14px; border-radius: 10px 10px 2px 10px; margin: 0 0 18px 32px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.assistant-message { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.95; }
.turn-actions { display: flex; flex-wrap: wrap; gap: 3px 16px; margin-top: 8px; }
.turn-provenance { margin-top: 2px; }
.turn-provenance summary { color: var(--muted); font-size: 10px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.8 ui-monospace, monospace; background: #f6f3f6; padding: 12px; border-radius: 6px; max-height: 300px; overflow-y: auto; }
.generating { padding: 16px 24px; font-size: 11px; color: var(--accent); }
.composer-area { border-top: 1px solid var(--line); padding: 18px 24px; }
#message { padding: 12px 14px; min-height: 100px; font-size: 13px; background: white; border-radius: 8px 8px 0 0; border-bottom: 0; }
.composer-bottom { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 0 9px 9px 13px; background: white; border: 1px solid #d8d0d9; border-top: 0; border-radius: 0 0 8px 8px; }
.composer-bottom .help { font-size: 10px; margin: 0; }
#send { min-width: 87px; }
.consent { display: flex; align-items: flex-start; gap: 8px; margin-top: 13px; font-size: 10px; color: var(--muted); }
.context-details { margin-top: 10px; }
.context-details summary { font-size: 11px; }
.quota-note { font-size: 10px; margin-top: 4px; }
.choices { display: grid; gap: 7px; margin-bottom: 12px; }
.choices:empty { display: none; }
.choices button { background: #faf7f9; border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; text-align: left; font-size: 12px; overflow-wrap: anywhere; }
.choices button::before { content: '↳'; margin-right: 9px; color: var(--accent); }
#ending { margin-bottom: 12px; }
.library-panel { display: grid; gap: 14px; }
.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 13px; }
.button-row .button { padding-inline: 6px; }
.branch-list, .session-list { display: grid; gap: 7px; margin-top: 10px; max-height: 320px; overflow-y: auto; }
.branch-button, .session-button { width: 100%; text-align: left; background: transparent; border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; font-size: 11px; overflow-wrap: anywhere; }
.branch-button[aria-current="true"], .session-button[aria-current="true"] { border-color: #a78ba3; background: var(--soft); }
.branch-button strong, .session-button strong { display: block; font-weight: 500; }
.branch-button small, .session-button small { color: var(--muted); font-size: 10px; }
.import-label { display: block; font-size: 11px; margin-top: 16px; }
#import-json { font-size: 10px; margin-top: 6px; padding: 6px; }
.legacy-note { border-top: 1px solid var(--line); padding-top: 5px; }
.legacy-note summary { font-size: 11px; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 27px 0; color: var(--muted); font-size: 11px; }
@media (min-width: 1600px) { .workspace { grid-template-columns: 290px minmax(0, 1fr) 280px; gap: 22px; } }
@media (max-width: 1199px) {
  .page-width { width: calc(100% - 40px); }
  .workspace { grid-template-columns: 245px minmax(0, 1fr); }
  .library-panel { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .intro-note { display: none; }
}
@media (max-width: 760px) {
  .page-width { width: calc(100% - 28px); }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .intro { padding-top: 25px; }
  .setup-panel .panel-section { padding: 16px; }
  .preset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .model-note { display: none; }
  .library-panel { grid-template-columns: minmax(0, 1fr); }
  .conversation-heading { padding: 20px 18px 12px; }
  .active-summary { margin-inline: 18px; }
  .branch-notice { margin-inline: 18px; }
  .composer-area { padding: 16px 18px; }
  .turns { padding-inline: 18px; max-height: 70vh; }
  input:not([type="checkbox"]), textarea, select, #message { font-size: 16px; }
  .empty-conversation { min-height: 330px; }
  .site-footer { flex-direction: column; gap: 6px; }
}
@media (max-width: 420px) {
  .brand-section { display: none; }
  .brand { font-size: 20px; }
  h1 { font-size: 24px; }
  .preset-grid { grid-template-columns: 1fr 1fr; }
  .conversation-heading { flex-wrap: wrap; }
  .composer-bottom { align-items: flex-end; }
  .composer-bottom .help { max-width: 145px; }
  .user-message { margin-left: 14px; }
}
