/* Carbon vibe testing: a quiet take on the Huggiverse "paper" style.
   Paper background, ink outlines, one accent (DNA + primary actions), yellow used once in the title. */
:root {
  --bg: #F4F1EA;        /* paper */
  --surface: #FBF8F1;   /* cards */
  --ink: #232323;
  --soft: #55524B;
  --muted: #8A867C;
  --line: #D8D3C8;
  --accent: #1F6F5C;    /* DNA + primary actions */
  --accent-ink: #164F42;
  --accent-tint: #DDEFE7;
  --yellow: #FFD21E;
  --bad: #B3402F;
  --bad-tint: #F6E0DA;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
  --sans: "Source Sans 3", -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); display: flex; flex-direction: column; }
code { font-family: var(--mono); font-size: .9em; }
.muted { color: var(--soft); }
.small { font-size: 13px; }

/* buttons */
button { font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--ink); padding: 6px 14px; border-radius: 8px; cursor: pointer; }
button:hover { background: #fff; }
button.small { font-size: 13px; padding: 4px 10px; }
button.ghost { border-color: var(--line); color: var(--soft); background: transparent; }
button.ghost:hover { border-color: var(--ink); color: var(--ink); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
button:disabled, button:disabled:hover { opacity: .4; cursor: default; background: var(--surface); color: var(--ink); border-color: var(--line); }
button.primary:disabled { background: var(--accent); color: #fff; }
textarea, input[type=text] { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; }
textarea:focus, input[type=text]:focus { outline: none; border-color: var(--accent); }

/* header */
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 28px; border-bottom: 1.5px solid var(--line); background: var(--bg); }
.brand { display: flex; align-items: baseline; gap: 10px; }
.wordmark { font-weight: 700; font-size: 22px; letter-spacing: -.01em; }
.pill { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); border: 1.5px solid var(--line); border-radius: 999px; padding: 1px 9px; }
.top-right { display: flex; align-items: center; gap: 12px; }
.badge { font-family: var(--mono); font-size: 11.5px; color: #6b5a09; background: #FFF1C6; border: 1.5px solid #E8D27A; border-radius: 999px; padding: 2px 10px; }

/* layout: one centered column */
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; max-width: 920px; margin: 0 auto; padding: 0 28px; }

/* chat */
.messages { flex: 1; overflow-y: auto; padding: 28px 6px 12px 0; }
.flow { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 0; margin: 0 0 22px; font-weight: 600; font-size: 15px; }
.flow li { display: flex; align-items: center; gap: 8px; }
.flow li + li::before { content: "→"; color: var(--muted); font-weight: 400; margin-right: 14px; }
.flow .n { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--ink); display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 12px; font-weight: 500; }
.empty h1 { font-size: 34px; line-height: 1.15; margin: 8px 0 10px; letter-spacing: -.01em; }
.empty h1 mark { background: var(--yellow); color: var(--ink); padding: 0 .12em; border-radius: 4px; }
.lede, .checkpoint-note, .detect-note { font-size: 17px; color: var(--soft); max-width: 720px; margin: 0 0 8px; }
.detect-note { margin-bottom: 18px; }
.detect-note code { color: var(--accent-ink); background: var(--accent-tint); padding: 0 4px; border-radius: 4px; }
.examples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ex { background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 14px 11px; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.ex:hover { border-color: var(--ink); }
.ex .t { font-weight: 700; font-size: 15.5px; }
.ex .d { color: var(--soft); font-size: 13.5px; line-height: 1.4; }
.ex .actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 8px; }
.ex .try { font-size: 13px; padding: 3px 12px; }
.ex details { font-size: 13px; color: var(--soft); }
.ex details summary { cursor: pointer; color: var(--soft); font-family: var(--mono); font-size: 11.5px; list-style: none; }
.ex details summary::-webkit-details-marker { display: none; }
.ex details summary::before { content: "▸ "; }
.ex details[open] summary::before { content: "▾ "; }
.ex details p { margin: 6px 0 0; color: var(--ink); line-height: 1.4; }

.msg { display: grid; grid-template-columns: 76px 1fr; gap: 14px; padding: 16px 0; border-top: 1.5px solid var(--line); }
.msg:first-child { border-top: none; }
.role { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding-top: 4px; }
.msg.assistant .role { color: var(--accent); }
.content { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.content.markdown { white-space: normal; }
.content.markdown > :first-child { margin-top: 0; }
.content.markdown > :last-child { margin-bottom: 0; }
.content.markdown p { margin: 0 0 12px; }
.content.markdown ul, .content.markdown ol { margin: 8px 0 14px; padding-left: 26px; }
.content.markdown li { margin: 4px 0; }
.content.markdown li > p { margin: 6px 0; }
.content.markdown strong { font-weight: 700; }
.content.markdown h1, .content.markdown h2, .content.markdown h3 { font-size: 1.1em; line-height: 1.4; margin: 18px 0 8px; }
.content.markdown :not(pre) > code { background: var(--accent-tint); color: var(--accent-ink); padding: 1px 5px; border-radius: 4px; }
.content.markdown pre { max-width: 100%; overflow-x: auto; white-space: pre; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.content.markdown blockquote { margin: 12px 0; border-left: 3px solid var(--line); padding-left: 14px; color: var(--soft); }
.content.markdown a { color: var(--accent-ink); text-decoration: underline; }
.content.markdown table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 12px 0; }
.content.markdown th, .content.markdown td { text-align: left; border: 1px solid var(--line); padding: 6px 10px; }
.content.markdown th { background: var(--surface); }
.content.streaming::after { content: "▍"; color: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* issue tags (share dialog) */
.issue-tags { margin-top: 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag { font-size: 12.5px; padding: 1px 9px; border-radius: 999px; border-color: var(--line); color: var(--soft); background: transparent; }
.tag.on { border-color: var(--ink); color: var(--ink); background: var(--surface); }

.composer { padding: 12px 6px 18px 0; border-top: 1.5px solid var(--line); }
.field { position: relative; }
.field textarea { padding-right: 50px; resize: none; overflow-y: auto; max-height: 40vh; line-height: 1.5; display: block; border-color: var(--ink); background: var(--surface); }
.send { position: absolute; right: 8px; bottom: 8px; width: 32px; height: 32px; padding: 0; border-radius: 8px; background: var(--ink); color: var(--bg); border: none; display: flex; align-items: center; justify-content: center; }
.send:hover { background: var(--accent); color: #fff; }
.send:disabled { opacity: .25; }
.composer-row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 12px; }
.hint { font-family: var(--mono); font-size: 12px; color: var(--muted); min-height: 1.4em; }
.composer-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.share-cta { display: flex; align-items: center; gap: 10px; }
.cta-text { font-size: 14px; color: var(--soft); }
.hint .n { color: var(--accent); }

/* dna */
.dna-inline { font-family: var(--mono); color: var(--accent-ink); background: var(--accent-tint); padding: 1px 5px; border-radius: 4px; letter-spacing: .02em; }
.dna-block { border: 1.5px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; margin: 8px 0; background: var(--surface); white-space: normal; }
.dna-head { display: flex; align-items: center; gap: 10px; padding: 6px 10px; font-family: var(--mono); font-size: 12px; color: var(--soft); }
.dna-head .label { color: var(--accent); font-weight: 500; letter-spacing: .06em; }
.dna-head .spacer { flex: 1; }
.dna-head button.icon { border: none; padding: 0; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; color: var(--soft); border-radius: 5px; background: transparent; }
.dna-head button.icon:hover { background: var(--line); color: var(--ink); }
.dna-head button.icon.copied { color: var(--accent) !important; background: none !important; }
.dna-body { padding: 4px 10px 10px; font-family: var(--mono); font-size: 13px; line-height: 1.6; overflow-x: auto; max-height: 340px; overflow-y: auto; }
.dna-line { display: flex; gap: 14px; white-space: pre; }
.dna-pos { color: var(--muted); width: 6ch; text-align: right; flex: none; user-select: none; }
.dna-seq .g { margin-right: 1ch; }
.dna-preview { padding: 0 10px 8px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.dna-preview .partial { color: var(--ink); }
.copied { color: var(--accent) !important; border-color: var(--accent) !important; }

/* share dialog */
.dialog { border: 1.5px solid var(--ink); border-radius: 14px; background: var(--bg); color: var(--ink); width: min(620px, 92vw); padding: 22px 24px; }
.dialog::backdrop { background: rgba(35, 35, 35, .35); }
.dialog h2 { margin: 0 0 6px; font-size: 22px; }
.dialog label { display: block; font-weight: 600; margin: 14px 0 5px; font-size: 14.5px; }
.dialog label .muted { font-weight: 400; }
.reason { border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; margin: 14px 0 0; }
.reason legend { font-weight: 600; font-size: 14.5px; padding: 0 4px; }
.reason label { display: flex; align-items: baseline; gap: 6px; font-weight: 400; margin: 6px 0 0; font-size: 15px; cursor: pointer; }
.reason label .muted { font-size: 13.5px; }
.share-summary { margin-top: 14px; font-family: var(--mono); font-size: 12.5px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 12px; color: var(--soft); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .chat { padding: 0 16px; }
  .examples { grid-template-columns: 1fr; }
  .cta-text { display: none; }
  .top { padding: 12px 16px; }
  .msg { grid-template-columns: 1fr; gap: 4px; }
}

.selectors { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px 16px; padding: 18px 0 12px; border-bottom: 1.5px solid var(--line); }
.selectors label { min-width: 0; font-size: 13px; font-weight: 600; color: var(--soft); }
.selectors select { display: block; width: 100%; margin-top: 5px; padding: 9px 10px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: 13px var(--sans); }
.selectors select:focus { outline: 2px solid var(--accent); }
#selection-status { margin: 0; font-size: 12px; color: var(--soft); align-self: center; }
#refresh-repos { justify-self: end; }
@media (max-width: 600px) { .selectors { grid-template-columns: 1fr; } .top { flex-wrap: wrap; } }
