/* apps/studio/src/styles.css */
:root {
  --topbar: 48px;
  --subhead: 44px;
  --font-ui: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-story: "Newsreader", "Iowan Old Style", Georgia, serif;
  --bg: #f5f2eb;
  --surface: #fdfbf6;
  --surface-2: #f0ebe1;
  --surface-3: #e8e2d5;
  --border: #e2dbcc;
  --border-strong: #cfc6b4;
  --text: #24211b;
  --text-2: #5d5648;
  --text-3: #8a8272;
  --accent: #b56a10;
  --accent-strong: #9a5808;
  --accent-soft: #b56a101a;
  --accent-ink: #fffaf0;
  --good: #3f7d4a;
  --good-soft: #3f7d4a1c;
  --bad: #b3432f;
  --bad-soft: #b3432f1a;
  --warn: #93700f;
  --warn-soft: #93700f1c;
  --info: #3c6c9c;
  --diff-add: #3f7d4a21;
  --diff-add-strong: #3f7d4a47;
  --diff-del: #b3432f1c;
  --diff-del-strong: #b3432f42;
  --shadow: 0 1px 2px #281e0a0f, 0 8px 24px #281e0a14;
  --shadow-lg: 0 24px 64px #281e0a2e;
  --radius: 8px;
  --radius-sm: 5px;
  --buncss-light: initial;
  --buncss-dark: ;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12110f;
    --surface: #191815;
    --surface-2: #201f1b;
    --surface-3: #2a2823;
    --border: #2b2924;
    --border-strong: #3b3832;
    --text: #ebe5d8;
    --text-2: #b0a796;
    --text-3: #7a7264;
    --accent: #e8a74a;
    --accent-strong: #f3b860;
    --accent-soft: #e8a74a1f;
    --accent-ink: #1b1508;
    --good: #86c08a;
    --good-soft: #86c08a1f;
    --bad: #e7806c;
    --bad-soft: #e7806c1f;
    --warn: #dcb862;
    --warn-soft: #dcb8621f;
    --info: #8db4dc;
    --diff-add: #86c08a1a;
    --diff-add-strong: #86c08a3d;
    --diff-del: #e7806c1a;
    --diff-del-strong: #e7806c3d;
    --shadow: 0 1px 2px #0000004d, 0 8px 24px #00000040;
    --shadow-lg: 0 24px 64px #00000080;
    --buncss-light: ;
    --buncss-dark: initial;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #12110f;
  --surface: #191815;
  --surface-2: #201f1b;
  --surface-3: #2a2823;
  --border: #2b2924;
  --border-strong: #3b3832;
  --text: #ebe5d8;
  --text-2: #b0a796;
  --text-3: #7a7264;
  --accent: #e8a74a;
  --accent-strong: #f3b860;
  --accent-soft: #e8a74a1f;
  --accent-ink: #1b1508;
  --good: #86c08a;
  --good-soft: #86c08a1f;
  --bad: #e7806c;
  --bad-soft: #e7806c1f;
  --warn: #dcb862;
  --warn-soft: #dcb8621f;
  --info: #8db4dc;
  --diff-add: #86c08a1a;
  --diff-add-strong: #86c08a3d;
  --diff-del: #e7806c1a;
  --diff-del-strong: #e7806c3d;
  --shadow: 0 1px 2px #0000004d, 0 8px 24px #00000040;
  --shadow-lg: 0 24px 64px #00000080;
  --buncss-light: ;
  --buncss-dark: initial;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html, body, #root {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 13px / 1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  margin: 0;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-radius: 4px;
}

::selection {
  background: var(--accent-soft);
}

code, .mono {
  font-family: var(--font-mono);
  font-size: .92em;
}

.btn {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
  align-items:  center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  transition: background .12s, border-color .12s, color .12s;
  font-size: 12.5px;
  font-weight: 500;
}

.btn:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn.primary:hover:not(:disabled) {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.btn.ghost {
  color: var(--text-2);
  background: none;
  border-color: #0000;
}

.btn.ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.btn.danger {
  color: var(--bad);
}

.btn.sm {
  height: 24px;
  padding: 0 8px;
  font-size: 12px;
}

.btn .kbd {
  color: inherit;
  opacity: .6;
  font-size: 11px;
  font-family: var(--font-mono);
}

.icon-btn {
  display: inline-grid;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  cursor: pointer;
  background: none;
  border: 0;
  place-items:  center;
  width: 26px;
  height: 26px;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

svg.i {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  width: 15px;
  height: 15px;
}

.input, .textarea, .select {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  outline: none;
  width: 100%;
  padding: 6px 9px;
  transition: border-color .12s, box-shadow .12s;
}

.input, .select {
  height: 32px;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 6.5L8 10l3.5-3.5' fill='none' stroke='%238a8272' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 9px center;
  background-repeat: no-repeat;
  background-size: 14px 14px;
  padding-right: 30px;
}

.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.textarea {
  resize: none;
  line-height: 1.5;
}

.label {
  display: block;
  color: var(--text-2);
  margin: 0 0 5px;
  font-size: 11.5px;
  font-weight: 500;
}

.pill {
  display: inline-flex;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--text-2);
  border-radius: 999px;
  align-items:  center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  font-size: 11.5px;
  font-weight: 500;
}

.pill.good {
  background: var(--good-soft);
  color: var(--good);
}

.pill.bad {
  background: var(--bad-soft);
  color: var(--bad);
}

.pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.pill.accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.dot {
  background: currentColor;
  border-radius: 50%;
  flex: none;
  width: 6px;
  height: 6px;
}

.muted {
  color: var(--text-2);
}

.faint {
  color: var(--text-3);
}

.eyebrow {
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
}

.spacer {
  flex: 1;
}

.row {
  display: flex;
  align-items:  center;
  gap: 8px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scroll {
  overflow: auto;
  min-height: 0;
}

.spin {
  animation: spin .7s linear infinite;
  border: 2px solid;
  border-right-color: #0000;
  border-radius: 50%;
  flex: none;
  width: 13px;
  height: 13px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.app {
  display: grid;
  grid-template-rows: var(--topbar) 1fr;
  height: 100%;
}

.topbar {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  align-items:  center;
  gap: 10px;
  min-width: 0;
  padding: 0 12px 0 14px;
}

.brand {
  display: flex;
  letter-spacing: -.01em;
  cursor: pointer;
  background: none;
  border: 0;
  align-items:  center;
  gap: 9px;
  padding: 0;
  font-weight: 600;
}

.brand-mark {
  display: grid;
  background: linear-gradient(#2b2721, #15130f);
  border-radius: 6px;
  flex: none;
  place-items:  center;
  width: 24px;
  height: 24px;
  box-shadow: inset 0 0 0 1px #ffffff12;
}

.brand-mark svg {
  fill: #e8a74a;
  width: 20px;
  height: 20px;
}

.brand-mark svg .cut {
  stroke: #1b1a17;
  fill: #1b1a17;
}

.crumb-sep {
  color: var(--text-3);
}

.project-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
  font-weight: 500;
}

.rev-chip {
  display: inline-flex;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  color: var(--text-2);
  border-radius: 999px;
  align-items:  center;
  gap: 6px;
  height: 24px;
  padding: 0 8px;
  font-size: 11.5px;
}

.rev-chip b {
  color: var(--text);
  font-weight: 500;
}

.mode-switch {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 2px;
}

.mode-switch button {
  color: var(--text-2);
  cursor: pointer;
  display: inline-flex;
  background: none;
  border: 0;
  border-radius: 5px;
  align-items:  center;
  gap: 6px;
  height: 26px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 500;
}

.mode-switch button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px #0000001f;
}

.workspace {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 380px;
  min-height: 0;
}

.pane {
  display: flex;
  background: var(--surface);
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.pane + .pane {
  border-left: 1px solid var(--border);
}

.pane.center {
  background: var(--bg);
}

.pane-head {
  display: flex;
  height: var(--subhead);
  border-bottom: 1px solid var(--border);
  flex: none;
  align-items:  center;
  gap: 6px;
  padding: 0 10px 0 12px;
}

.tabs {
  display: flex;
  gap: 2px;
}

.tab {
  border-radius: var(--radius-sm);
  color: var(--text-3);
  cursor: pointer;
  display: inline-flex;
  background: none;
  border: 0;
  align-items:  center;
  gap: 6px;
  height: 26px;
  padding: 0 8px;
  font-size: 12.5px;
  font-weight: 500;
}

.tab:hover {
  color: var(--text);
}

.tab[aria-selected="true"] {
  color: var(--text);
  background: var(--surface-2);
}

.tab .count {
  background: var(--surface-3);
  color: var(--text-2);
  border-radius: 999px;
  padding: 0 5px;
  font-size: 10.5px;
}

.tab .count.bad {
  background: var(--bad-soft);
  color: var(--bad);
}

.tree {
  padding: 6px;
}

.tree-group {
  margin-bottom: 2px;
}

.tree-row {
  display: flex;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  color: var(--text-2);
  background: none;
  border: 0;
  align-items:  center;
  gap: 6px;
  width: 100%;
  height: 26px;
  padding: 0 8px;
  font-size: 12.5px;
}

.tree-row:hover {
  background: var(--surface-2);
  color: var(--text);
}

.tree-row[aria-current="true"] {
  background: var(--accent-soft);
  color: var(--text);
}

.tree-row .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.tree-row .badge {
  font-size: 10.5px;
  font-weight: 600;
}

.tree-row .badge.bad {
  color: var(--bad);
}

.tree-row .badge.warn {
  color: var(--warn);
}

.tree-row .badge.changed {
  color: var(--accent);
}

.tree-row .chev {
  color: var(--text-3);
  transition: transform .12s;
}

.tree-row .chev.open {
  transform: rotate(90deg);
}

.tree-row.dir {
  color: var(--text);
  font-weight: 500;
}

.ext {
  font-family: var(--font-mono);
  text-align: center;
  color: var(--text-3);
  letter-spacing: .02em;
  flex: none;
  width: 26px;
  font-size: 9.5px;
  font-weight: 500;
}

.ext.md {
  color: var(--info);
}

.ext.yaml {
  color: var(--accent);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
}

.list-item {
  display: block;
  text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: none;
  border: 0;
  width: 100%;
  padding: 8px 10px;
}

.list-item:hover {
  background: var(--surface-2);
}

.list-item[aria-current="true"] {
  background: var(--accent-soft);
}

.list-item .title {
  display: flex;
  align-items:  center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
}

.list-item .meta {
  color: var(--text-3);
  display: flex;
  gap: 8px;
  margin-top: 2px;
  font-size: 11.5px;
}

.who {
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--surface-3);
  color: var(--text-2);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 600;
}

.who.assistant {
  background: var(--accent-soft);
  color: var(--accent);
}

.editor-head {
  display: flex;
  height: var(--subhead);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex: none;
  align-items:  center;
  gap: 8px;
  padding: 0 10px 0 14px;
}

.editor-path {
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.editor-path b {
  color: var(--text);
  font-weight: 500;
}

.editor-body {
  position: relative;
  flex: 1;
  min-height: 0;
}

.editor-body .cm-editor {
  height: 100%;
}

.editor-foot {
  display: flex;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-3);
  flex: none;
  align-items:  center;
  gap: 12px;
  height: 26px;
  padding: 0 14px;
  font-size: 11.5px;
}

.readonly-banner {
  display: flex;
  background: var(--warn-soft);
  color: var(--warn);
  border-bottom: 1px solid var(--border);
  align-items:  center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 12px;
}

.empty {
  display: grid;
  text-align: center;
  color: var(--text-2);
  place-items:  center;
  height: 100%;
  padding: 32px;
}

.empty h3 {
  color: var(--text);
  margin: 10px 0 4px;
  font-size: 14px;
  font-weight: 600;
}

.empty p {
  max-width: 340px;
  margin: 0;
}

.issues {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}

.issue {
  display: grid;
  grid-template-columns: 14px 1fr;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  text-align: left;
  cursor: pointer;
  border: 0;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
}

.issue:hover {
  background: var(--surface-3);
}

.issue .sev {
  border-radius: 50%;
  width: 8px;
  height: 8px;
  margin-top: 4px;
}

.issue.error .sev {
  background: var(--bad);
}

.issue.warning .sev {
  background: var(--warn);
}

.issue .loc {
  font-family: var(--font-mono);
  color: var(--text-3);
  font-size: 11px;
}

.issue .msg {
  color: var(--text);
  word-break: break-word;
  margin-top: 1px;
  font-size: 12.5px;
}

.issue .fix {
  margin-top: 6px;
}

.assistant {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.thread {
  overflow: auto;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 14px;
  padding: 14px 14px 6px;
}

.msg-user {
  background: var(--surface-3);
  white-space: pre-wrap;
  word-break: break-word;
  animation: rise .18s ease-out;
  border-radius: 12px 12px 3px;
  align-self:  flex-end;
  max-width: 88%;
  padding: 8px 12px;
}

.msg-user .ctx {
  display: block;
  color: var(--text-3);
  margin-top: 3px;
  font-size: 11.5px;
}

.msg-ai {
  display: flex;
  animation: rise .18s ease-out;
  flex-direction: column;
  gap: 8px;
}

.ai-head {
  display: flex;
  color: var(--text-3);
  align-items:  center;
  gap: 7px;
  font-size: 11.5px;
}

.ai-avatar {
  background: var(--accent-soft);
  display: grid;
  color: var(--accent);
  border-radius: 5px;
  place-items:  center;
  width: 18px;
  height: 18px;
}

.ai-avatar svg {
  fill: currentColor;
  width: 11px;
  height: 11px;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-left: 2px;
}

.step {
  display: flex;
  color: var(--text-3);
  align-items:  center;
  gap: 7px;
  font-size: 12px;
  line-height: 1.5;
}

.step .tick {
  display: grid;
  place-items:  center;
  width: 15px;
}

.ai-text {
  white-space: pre-wrap;
  color: var(--text-2);
}

.proposal {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.proposal-head {
  padding: 11px 12px 9px;
}

.proposal-summary {
  color: var(--text);
  font-weight: 500;
  line-height: 1.45;
}

.proposal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.proposal-files {
  border-top: 1px solid var(--border);
}

.pfile {
  display: flex;
  font-family: var(--font-mono);
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
  background: none;
  border: 0;
  align-items:  center;
  gap: 8px;
  width: 100%;
  padding: 6px 12px;
  font-size: 11.5px;
}

.pfile:hover {
  background: var(--surface-2);
  color: var(--text);
}

.pfile[aria-current="true"] {
  background: var(--accent-soft);
  color: var(--text);
}

.pfile .kind {
  text-align: center;
  width: 14px;
  font-weight: 600;
}

.kind.add {
  color: var(--good);
}

.kind.delete {
  color: var(--bad);
}

.kind.modify, .kind.rename {
  color: var(--accent);
}

.pfile .stat {
  margin-left: auto;
  font-size: 10.5px;
}

.stat .plus {
  color: var(--good);
}

.stat .minus {
  color: var(--bad);
  margin-left: 5px;
}

.preview {
  display: flex;
  border-top: 1px solid var(--border);
  align-items:  flex-start;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
}

.preview.good {
  color: var(--good);
  background: var(--good-soft);
}

.preview.bad {
  color: var(--bad);
  background: var(--bad-soft);
}

.preview ul {
  color: var(--text-2);
  margin: 4px 0 0;
  padding-left: 16px;
}

.proposal-actions {
  display: flex;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  gap: 6px;
  padding: 9px 12px;
}

.proposal-questions {
  border-top: 1px solid var(--border);
  color: var(--text-2);
  padding: 9px 12px;
  font-size: 12px;
}

.proposal-questions ul {
  margin: 4px 0 0;
  padding-left: 16px;
}

.proposal.applied {
  opacity: .82;
}

.proposal-state {
  display: flex;
  align-items:  center;
  gap: 6px;
  font-size: 12px;
}

.composer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex: none;
  padding: 10px 12px 12px;
}

.composer-box {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .12s, box-shadow .12s;
}

.composer-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.composer-box textarea {
  outline: none;
  resize: none;
  background: none;
  border: 0;
  width: 100%;
  min-height: 56px;
  max-height: 180px;
  padding: 9px 11px 4px;
  line-height: 1.5;
}

.composer-bar {
  display: flex;
  align-items:  center;
  gap: 6px;
  padding: 4px 6px 6px 8px;
}

.ctx-chip {
  display: inline-flex;
  background: var(--surface-2);
  color: var(--text-2);
  border-radius: 4px;
  align-items:  center;
  gap: 5px;
  max-width: 200px;
  height: 22px;
  padding: 0 4px 0 7px;
  font-size: 11.5px;
}

.ctx-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ctx-chip button {
  color: var(--text-3);
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0 2px;
  line-height: 1;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.suggestion {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}

.suggestion:hover {
  border-color: var(--accent);
  color: var(--text);
}

.assistant-intro {
  padding: 4px 2px 8px;
}

.assistant-intro h4 {
  margin: 0 0 4px;
  font-size: 13.5px;
  font-weight: 600;
}

.assistant-intro p {
  color: var(--text-2);
  margin: 0 0 12px;
}

.assistant-note {
  color: var(--text-3);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  margin-bottom: 12px;
  padding: 8px 10px;
  font-size: 11.5px;
}

.review-head {
  display: flex;
  height: var(--subhead);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex: none;
  align-items:  center;
  gap: 10px;
  padding: 0 10px 0 14px;
}

.review-head .summary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.diff-scroll {
  overflow: auto;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 14px;
  padding: 14px;
}

.diff-file {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  flex: none;
}

.diff-file-head {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  align-items:  center;
  gap: 8px;
  min-height: 38px;
  padding: 0 8px 0 12px;
  font-size: 12.5px;
}

.diff-file-head .mono {
  font-size: 11px;
}

.diff-file .cm-editor {
  font-size: 12.5px;
}

.diff-file .cm-mergeView {
  max-height: none;
}

.playtest {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  min-height: 0;
}

.stage {
  display: flex;
  background: var(--bg);
  flex-direction: column;
  min-height: 0;
}

.stage-head {
  display: flex;
  height: var(--subhead);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex: none;
  align-items:  center;
  gap: 10px;
  padding: 0 14px 0 18px;
}

.transcript {
  overflow: auto;
  flex: 1;
}

.transcript-inner {
  font-family: var(--font-story);
  max-width: 660px;
  margin: 0 auto;
  padding: 36px 28px 24px;
  font-size: 17.5px;
  line-height: 1.65;
}

.t-scene {
  text-align: center;
  margin-bottom: 28px;
}

.t-scene .where {
  font-family: var(--font-ui);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
}

.t-scene .title {
  letter-spacing: -.01em;
  margin-top: 4px;
  font-size: 26px;
  font-weight: 500;
}

.t-scene .rule {
  background: var(--border-strong);
  width: 36px;
  height: 1px;
  margin: 16px auto 0;
}

.t-narration {
  color: var(--text-2);
  animation: rise .25s ease-out;
  margin: 0 0 16px;
  font-style: italic;
}

.t-line {
  animation: rise .25s ease-out;
  margin: 0 0 16px;
}

.t-speaker {
  display: block;
  font-family: var(--font-ui);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1px;
  font-size: 11px;
  font-weight: 600;
}

.t-line.player .t-speaker {
  color: var(--text-3);
}

.t-line.player .t-text {
  color: var(--text-2);
}

.t-system {
  font-family: var(--font-ui);
  color: var(--text-3);
  text-align: center;
  margin: 8px 0 18px;
  font-size: 12px;
}

.t-error {
  font-family: var(--font-ui);
  color: var(--bad);
  background: var(--bad-soft);
  border-radius: var(--radius-sm);
  margin: 8px 0 18px;
  padding: 10px 12px;
  font-size: 12.5px;
}

.caret {
  display: inline-block;
  vertical-align: -2px;
  background: var(--accent);
  animation: blink 1s steps(2) infinite;
  width: 2px;
  height: 1em;
  margin-left: 2px;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 20px;
}

.choice {
  font-family: var(--font-ui);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  color: var(--text);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 13px;
}

.choice:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.play-input {
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex: none;
  padding: 12px 18px 14px;
}

.play-input-inner {
  max-width: 660px;
  margin: 0 auto;
}

.play-row {
  display: flex;
  align-items:  flex-end;
  gap: 8px;
}

.play-row .textarea {
  font-family: var(--font-story);
  min-height: 42px;
  max-height: 140px;
  padding: 9px 12px;
  font-size: 16px;
}

.addressee {
  display: flex;
  color: var(--text-3);
  align-items:  center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 12px;
}

.addressee button {
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  color: var(--text-2);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
}

.addressee button[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-soft);
}

.inspector {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 14px;
}

.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 12px;
  font-size: 12px;
}

.kv dt {
  color: var(--text-3);
}

.kv dd {
  font-family: var(--font-mono);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
  font-size: 11.5px;
}

.events {
  display: flex;
  font-family: var(--font-mono);
  flex-direction: column;
  font-size: 11px;
}

.ev {
  display: grid;
  grid-template-columns: 64px 1fr;
  border-bottom: 1px dashed var(--border);
  color: var(--text-2);
  gap: 8px;
  padding: 3px 0;
}

.ev .k {
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ev .s {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.binding {
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-2);
  padding: 10px 12px;
  font-size: 12px;
}

.binding .mono {
  color: var(--text);
}

.setup {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chip-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  color: var(--text-2);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
}

.chip-toggle[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.chip-toggle:disabled {
  cursor: default;
}

.section-title {
  display: flex;
  align-items:  center;
  gap: 8px;
  margin-bottom: 8px;
}

.home {
  overflow: auto;
}

.home-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 56px 32px 80px;
}

.hero {
  display: flex;
  align-items:  flex-end;
  gap: 24px;
  margin-bottom: 32px;
}

.hero h1 {
  font-family: var(--font-story);
  letter-spacing: -.015em;
  margin: 0 0 8px;
  font-size: 40px;
  font-weight: 500;
  line-height: 1.1;
}

.hero p {
  color: var(--text-2);
  max-width: 520px;
  margin: 0;
  font-size: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.card h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.card .meta {
  display: flex;
  color: var(--text-3);
  flex-wrap: wrap;
  align-items:  center;
  gap: 8px;
  font-size: 12px;
}

.card.new {
  color: var(--text-2);
  border-style: dashed;
  justify-content: center;
  align-items:  center;
  min-height: 132px;
}

.card.new:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border);
  gap: 1px;
  margin-top: 44px;
}

.flow div {
  background: var(--surface);
  padding: 14px 16px;
}

.flow b {
  display: block;
  margin-bottom: 3px;
  font-size: 12.5px;
}

.flow span {
  color: var(--text-2);
  font-size: 12px;
}

.flow .n {
  font-family: var(--font-mono);
  color: var(--accent);
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
}

.scrim {
  position: fixed;
  display: grid;
  z-index: 50;
  animation: fade .12s ease-out;
  background: #0f0c066b;
  place-items:  center;
  padding: 16px;
  inset: 0;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.dialog {
  overflow: auto;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: rise .16s ease-out;
  border-radius: 12px;
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
}

.dialog-head {
  padding: 18px 20px 4px;
}

.dialog-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.dialog-head p {
  color: var(--text-2);
  margin: 4px 0 0;
}

.dialog-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 20px;
}

.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 18px;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.template {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 11px;
}

.template b {
  font-size: 12.5px;
}

.template span {
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.4;
}

.template[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.snap-list {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-direction: column;
}

.snap {
  display: flex;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  align-items:  center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
}

.snap:last-child {
  border-bottom: 0;
}

.snap:hover {
  background: var(--surface-2);
}

.snap[aria-pressed="true"] {
  background: var(--accent-soft);
}

.snap .radio {
  border: 1.5px solid var(--border-strong);
  display: grid;
  border-radius: 50%;
  flex: none;
  place-items:  center;
  width: 14px;
  height: 14px;
}

.snap[aria-pressed="true"] .radio {
  border-color: var(--accent);
}

.snap[aria-pressed="true"] .radio:after {
  content: "";
  background: var(--accent);
  border-radius: 50%;
  width: 6px;
  height: 6px;
}

.toasts {
  position: fixed;
  display: flex;
  z-index: 60;
  pointer-events: none;
  flex-direction: column;
  gap: 8px;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.toast {
  pointer-events: auto;
  display: flex;
  border-radius: var(--radius);
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow-lg);
  animation: rise .16s ease-out;
  align-items:  center;
  gap: 10px;
  min-width: 260px;
  max-width: 520px;
  padding: 9px 12px;
  font-size: 12.5px;
}

.toast.bad .dot {
  color: var(--bad);
}

.toast.good .dot {
  color: var(--good);
}

.cm-editor {
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}

.cm-editor.cm-focused {
  outline: none;
}

.cm-scroller {
  font-family: var(--font-mono) !important;
  line-height: 1.6 !important;
}

.cm-gutters {
  background: var(--bg) !important;
  color: var(--text-3) !important;
  border-right: 0 !important;
}

.cm-activeLineGutter {
  color: var(--text) !important;
  background: none !important;
}

.cm-activeLine {
  background: color-mix(in srgb, var(--surface-2) 55%, transparent) !important;
}

.cm-cursor {
  border-left-color: var(--accent) !important;
  border-left-width: 2px !important;
}

.cm-selectionBackground, .cm-focused .cm-selectionBackground {
  background: var(--accent-soft) !important;
}

.cm-content {
  caret-color: var(--accent);
  padding: 14px 0 !important;
}

.cm-line {
  padding: 0 18px 0 6px !important;
}

.cm-panels {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

.cm-searchMatch {
  outline: 1px solid var(--warn);
  background: var(--warn-soft) !important;
}

.cm-lintRange-error {
  text-decoration: underline wavy var(--bad);
  background-image: none !important;
}

.diff-file .cm-editor {
  background: var(--surface);
}

.diff-file .cm-gutters {
  background: var(--surface) !important;
}

.cm-changedLine, .cm-insertedLine {
  background: var(--diff-add) !important;
}

.cm-deletedChunk, .cm-deletedLine {
  background: var(--diff-del) !important;
}

.cm-changedText, .cm-insertedText {
  background: var(--diff-add-strong) !important;
  text-decoration: none !important;
}

.cm-deletedText, .cm-deletedChunk del {
  background: var(--diff-del-strong) !important;
  text-decoration: none !important;
}

.cm-changeGutter {
  width: 3px !important;
  padding: 0 !important;
}

.cm-changedLineGutter {
  background: var(--good) !important;
}

.cm-deletedLineGutter {
  background: var(--bad) !important;
}

.cm-collapsedLines {
  font-family: var(--font-ui);
  font-size: 11.5px;
  background: var(--surface-2) !important;
  color: var(--text-3) !important;
  padding: 3px 12px !important;
}

@media (width <= 1100px) {
  .workspace {
    grid-template-columns: 210px minmax(0, 1fr) 330px;
  }

  .playtest {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .playtest > .pane:last-child {
    display: none;
  }
}

.form-scroll {
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.form {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 28px 48px;
}

.form-title {
  margin-bottom: 18px;
}

.form-title h2 {
  font-family: var(--font-story);
  letter-spacing: -.01em;
  margin: 2px 0 0;
  font-size: 28px;
  font-weight: 500;
}

.form-section {
  border-top: 1px solid var(--border);
  padding: 18px 0 6px;
}

.form-section h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
}

.field {
  margin-bottom: 14px;
}

.field-help {
  color: var(--text-3);
  margin: 5px 0 0;
  font-size: 11.5px;
}

.form-section > .field-help {
  margin: -6px 0 10px;
}

.form .input, .form .textarea, .form .select {
  background: var(--surface);
}

.textarea.prose {
  font-family: var(--font-story);
  resize: vertical;
  padding: 10px 12px;
  font-size: 16px;
  line-height: 1.6;
}

.list-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.list-editor-row {
  display: flex;
  align-items:  center;
  gap: 6px;
}

.list-editor-row .input {
  flex: 1;
}

.conn-name {
  flex: 1;
  font-weight: 500;
}

.add-row {
  align-self:  flex-start;
}

.form-alert {
  display: flex;
  border-radius: var(--radius);
  background: var(--warn-soft);
  color: var(--text);
  flex-direction: column;
  align-items:  flex-start;
  gap: 6px;
  padding: 14px;
}

.form-foot {
  margin-top: 18px;
  font-size: 12px;
}

.linkish {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: inherit;
  background: none;
  border: 0;
  padding: 0;
}

.seg {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
}

.seg button {
  color: var(--text-2);
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 4px;
  height: 22px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
}

.seg button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px #0000001a;
}

.outline-section {
  margin-bottom: 10px;
}

.outline-head {
  display: flex;
  align-items:  center;
  height: 26px;
  padding: 0 2px 0 10px;
}

.outline-empty {
  padding: 2px 10px 4px;
  font-size: 12px;
}

.outline-advanced {
  display: flex;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  cursor: pointer;
  text-align: left;
  background: none;
  align-items:  center;
  gap: 7px;
  width: 100%;
  margin-top: 8px;
  padding: 9px 10px;
  font-size: 12px;
}

.outline-advanced:hover {
  color: var(--text);
  border-color: var(--text-3);
}

.diff-title {
  font-family: var(--font-ui);
  font-weight: 500;
}

.diff-stat {
  border-bottom: 1px solid var(--border);
  padding: 6px 12px;
  font-size: 11.5px;
}

.diff-stat .plus {
  color: var(--good);
}

.diff-stat .minus {
  color: var(--bad);
}

.field-changes {
  display: flex;
  flex-direction: column;
}

.fc {
  display: grid;
  grid-template-columns: 160px 1fr;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  padding: 10px 14px;
}

.fc:last-child {
  border-bottom: 0;
}

.fc-label {
  color: var(--text-2);
  padding-top: 2px;
  font-size: 12px;
  font-weight: 500;
}

.fc-vals {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.fc-before, .fc-after {
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 4px;
  padding: 5px 9px;
  font-size: 13px;
}

.fc-before {
  background: var(--diff-del);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--bad) 50%, transparent);
  color: var(--text-2);
}

.fc-after {
  background: var(--diff-add);
}

.editor-path {
  font-size: 12.5px;
}

.editor-path:not(:has(.faint)) {
  font-family: var(--font-mono);
  font-size: 12px;
}

.t-action {
  animation: rise .25s ease-out;
  margin: 0 0 16px;
}

.t-action .t-text {
  color: var(--text-2);
  font-style: italic;
}

.t-action .t-text:before {
  content: "— ";
  color: var(--text-3);
  font-style: normal;
}

.t-action.player .t-speaker {
  color: var(--text-3);
}

.retake {
  margin: -6px 0 16px;
}

.retake .btn {
  font-family: var(--font-ui);
}

.textarea.do {
  font-style: italic;
}

.engine-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.engine-pick button {
  display: flex;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  flex-direction: column;
  align-items:  flex-start;
  gap: 1px;
  padding: 8px 10px;
}

.engine-pick button b {
  font-size: 12.5px;
  font-weight: 600;
}

.engine-pick button span {
  color: var(--text-3);
  font-size: 11px;
}

.engine-pick button[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.engine-pick button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.addressee .seg {
  margin-right: 2px;
}

.addressee .seg button {
  border: 0;
  border-radius: 4px;
  padding: 0 10px;
}

.idea-progress {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.idea-pitch {
  font-family: var(--font-story);
  color: var(--text-2);
  border-left: 2px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px;
  font-size: 16px;
  line-height: 1.5;
}

.idea-progress .step {
  font-family: var(--font-ui);
  color: var(--text-2);
  font-size: 12.5px;
}

.player-page {
  display: grid;
  grid-template-rows: var(--topbar) 1fr;
  height: 100%;
}

.player-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  align-items:  center;
  gap: 10px;
  padding: 0 16px;
}

.player-title {
  font-family: var(--font-story);
  font-size: 18px;
  font-weight: 500;
}

.player-stage {
  min-height: 0;
}

.player-stage .stage-head {
  justify-content: center;
}

.player-cover {
  display: grid;
  overflow: auto;
  place-items:  center;
  padding: 32px 16px;
}

.cover {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items:  center;
  gap: 18px;
  width: min(560px, 100%);
}

.cover h1 {
  font-family: var(--font-story);
  letter-spacing: -.02em;
  margin: 0;
  font-size: clamp(34px, 6vw, 52px);
  font-weight: 500;
  line-height: 1.05;
}

.cover-choose {
  display: flex;
  flex-direction: column;
  align-items:  center;
  gap: 6px;
}

.cover-choose .chips {
  justify-content: center;
}

.cover-start {
  height: 40px;
  padding: 0 22px;
  font-size: 14px;
}

.cover-note {
  margin: 0;
  font-size: 12px;
}

@media (width <= 640px) {
  .transcript-inner {
    padding: 24px 16px;
    font-size: 16.5px;
  }

  .play-input {
    padding: 10px 12px;
  }
}

.list-editor-row .input.narrow {
  text-align: right;
  flex: none;
  width: 72px;
}

.list-editor-row .icon-btn {
  flex: none;
}

.dialog .textarea.prose {
  resize: none;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
}

.hero {
  align-items:  center;
}

.hero h1 {
  margin-bottom: 6px;
}

.card .meta {
  font-variant-numeric: tabular-nums;
}

.ev {
  grid-template-columns: 1fr;
}

.ev .s {
  color: var(--text-2);
}

.ev .s b {
  color: var(--text);
  font-weight: 500;
}

.editor-path {
  line-height: 1;
}

.composer-bar .btn, .composer-bar .ctx-chip {
  flex: none;
}

.addressee .seg button {
  padding: 0 10px;
}

.t-line .t-speaker {
  margin-bottom: 2px;
}

.setup .chips .chip-toggle {
  line-height: 1.4;
}

.kv dd {
  font-variant-numeric: tabular-nums;
}

.pane-head .eyebrow {
  line-height: 1;
}

::view-transition-old(root) {
  animation-duration: .18s;
  animation-timing-function: cubic-bezier(.2, .8, .2, 1);
}

::view-transition-new(root) {
  animation-duration: .18s;
  animation-timing-function: cubic-bezier(.2, .8, .2, 1);
}

.toast.leaving {
  animation: toast-out .2s ease-in forwards;
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}

.dialog {
  animation: rise .18s cubic-bezier(.2, .8, .2, 1);
}

.scrim {
  animation: fade .15s ease-out;
}

.proposal, .msg-ai, .msg-user, .t-line, .t-narration, .t-action {
  animation-timing-function: cubic-bezier(.2, .8, .2, 1);
}

.tab, .tree-row, .list-item, .pfile, .chip-toggle, .suggestion, .seg button, .mode-switch button, .btn {
  transition-duration: .15s;
  transition-timing-function: cubic-bezier(.2,.8,.2,1);
}

.editor-body, .form-scroll, .diff-scroll, .issues, .list, .tree {
  animation: fade .16s ease-out;
}

.stage > .transcript, .setup {
  animation: fade .2s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after {
    animation-duration: 1ms !important;
    animation-delay: 0s !important;
    transition-duration: 1ms !important;
  }

  ::view-transition-group(*) {
    animation: none !important;
  }

  ::view-transition-old(*) {
    animation: none !important;
  }

  ::view-transition-new(*) {
    animation: none !important;
  }
}

:root {
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .28 0 0 0 0 .18 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.transcript, .form-scroll {
  background-image: var(--paper-grain);
}

.ink-wet {
  color: color-mix(in srgb, currentColor 55%, var(--accent));
  transition: color .4s ease-out;
}

.ink-caret {
  display: inline-block;
  vertical-align: -.15em;
  background: var(--accent);
  animation: ink-blink 1.05s steps(2, start) infinite;
  border-radius: 1px;
  width: 1.5px;
  height: 1.05em;
  margin-left: 1px;
}

@keyframes ink-blink {
  to {
    visibility: hidden;
  }
}

.t-writing {
  display: flex;
  font-family: var(--font-story);
  color: var(--text-3);
  animation: fade .2s ease-out;
  align-items:  center;
  gap: 8px;
  margin: 0 0 18px;
  font-size: 15px;
  font-style: italic;
}

.quill {
  color: var(--accent);
  transform-origin: 20% 90%;
  animation: quill-write 1.1s ease-in-out infinite;
  width: 18px;
  height: 18px;
}

@keyframes quill-write {
  0%, 100% {
    transform: rotate(-6deg)translateX(0);
  }

  25% {
    transform: rotate(4deg)translateX(1.5px);
  }

  50% {
    transform: rotate(-3deg)translateX(3px);
  }

  75% {
    transform: rotate(5deg)translateX(1.5px);
  }
}

.ai-text {
  font-family: var(--font-ui);
}

@media (prefers-reduced-motion: reduce) {
  .quill, .ink-caret {
    animation: none;
  }
}

.retake {
  animation: fade .3s ease-out .15s both;
}

.proposal {
  animation: rise .22s cubic-bezier(.2, .8, .2, 1);
}

.build {
  background: var(--bg);
  min-height: 0;
}

.build-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 36px 32px 72px;
}

.build-head {
  display: flex;
  align-items:  flex-start;
  gap: 16px;
  margin-bottom: 8px;
}

.build-head h1 {
  font-family: var(--font-story);
  letter-spacing: -.015em;
  margin: 4px 0 8px;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.15;
}

.build-head p {
  max-width: 620px;
  margin: 0;
  font-size: 14px;
}

.build-section {
  border-top: 1px solid var(--border);
  margin-top: 28px;
  padding: 28px 0 4px;
}

.build-section:first-of-type {
  border-top: 0;
  margin-top: 8px;
}

.build-section h2 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
}

.build-foot {
  margin: 12px 0 0;
  font-size: 12.5px;
}

.build-callout {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  align-items:  center;
  gap: 18px;
  padding: 18px 20px;
}

.build-callout h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.build-callout p {
  max-width: 620px;
  margin: 0;
}

.idea-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.idea-card {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  flex-direction: column;
  gap: 6px;
  padding: 16px;
}

.idea-card b {
  font-size: 13.5px;
}

.idea-card p {
  color: var(--text-2);
  flex: 1;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
}

.idea-uses {
  font-size: 11.5px;
}

.idea-icon {
  display: grid;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 7px;
  place-items:  center;
  width: 28px;
  height: 28px;
  margin-bottom: 2px;
}

.provides {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border);
  gap: 1px;
}

.fact {
  background: var(--surface);
  min-width: 0;
  padding: 14px 16px;
}

.fact .n {
  font-family: var(--font-story);
  font-size: 26px;
  line-height: 1;
}

.fact .l {
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 500;
}

.fact .s {
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
  font-size: 11.5px;
}

.provides-list {
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 16px 0 0;
  padding-left: 18px;
}

.provides-list b {
  color: var(--text);
  font-weight: 600;
}

.see-box {
  display: flex;
  border-radius: var(--radius);
  background: var(--surface-2);
  align-items:  center;
  gap: 16px;
  margin-top: 16px;
  padding: 14px 16px;
}

.see-box p {
  margin: 3px 0 0;
  font-size: 12.5px;
}

.see-box > div {
  flex: 1;
}

.steps-row {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 14px;
  padding: 0;
}

.steps-row li {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-2);
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  font-size: 12.5px;
}

.steps-row li b {
  color: var(--text);
  font-size: 13.5px;
}

.steps-row .n {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 11px;
}

.code-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.code-head {
  display: flex;
  height: var(--subhead);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  align-items:  center;
  gap: 8px;
  padding: 0 8px 0 10px;
}

.code {
  overflow: auto;
  font-family: var(--font-mono);
  color: var(--text);
  background: var(--bg);
  tab-size: 2;
  max-height: 420px;
  margin: 0;
  padding: 14px 16px;
  font-size: 12px;
  line-height: 1.65;
}

.console {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  height: 440px;
}

.console-story {
  display: flex;
  border-right: 1px solid var(--border);
  background: var(--bg);
  background-image: var(--paper-grain);
  flex-direction: column;
  min-height: 0;
}

.console-start {
  display: flex;
  flex-direction: column;
  align-items:  flex-start;
  padding: 20px;
}

.console-lines {
  overflow: auto;
  font-family: var(--font-story);
  flex: 1;
  padding: 18px 20px 4px;
  font-size: 16px;
  line-height: 1.6;
}

.console-lines .t-line, .console-lines .t-narration {
  margin-bottom: 12px;
}

.console-input {
  display: flex;
  border-top: 1px solid var(--border);
  background: var(--surface);
  gap: 6px;
  padding: 10px;
}

.console-raw {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.console-raw-head {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex: none;
  align-items:  center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
}

.console-raw-head .mono {
  font-size: 11px;
}

.console-raw-body {
  overflow: auto;
  font-family: var(--font-mono);
  flex: 1;
  padding: 8px 12px;
  font-size: 11px;
  line-height: 1.55;
}

.raw {
  display: grid;
  grid-template-columns: 44px 66px 1fr;
  border-bottom: 1px dashed var(--border);
  gap: 8px;
  padding: 2px 0;
}

.raw .t {
  color: var(--text-3);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.raw .e {
  color: var(--accent);
  white-space: nowrap;
}

.raw.out .e {
  color: var(--good);
}

.raw .d {
  color: var(--text-2);
  word-break: break-all;
}

.notes {
  display: flex;
  color: var(--text-2);
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.notes b {
  color: var(--text);
}

@media (width <= 1100px) {
  .idea-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .provides {
    grid-template-columns: repeat(3, 1fr);
  }
}
