/* app.css - layout for the real pages, on top of theme.css (the design tokens).
   Carried over from mockups/*.html. */

.lang .lang-btn { padding: 4px 10px; font: 500 13px var(--font); color: var(--muted); text-decoration: none; }
.lang .lang-btn[aria-pressed="true"] { background: var(--accent); color: #fff; }
.small { font-size: 13px; }
.wide { width: 100%; justify-content: center; }
.hidden { display: none !important; }
button.link { border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
footer { margin-top: 56px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.error { background: var(--no-bg); color: var(--no); padding: 10px 14px; border-radius: var(--radius); margin: 12px 0; font-size: 14px; }
.error ul { margin: 6px 0 0; padding-left: 18px; }

/* front page */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
.hero .lead { font-size: 19px; color: var(--muted); max-width: 34em; }
.start p { margin-bottom: 12px; }
.start form { margin-bottom: 12px; }
h2.how { margin-top: 56px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 24px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.step .n { font: 600 13px var(--font); color: var(--accent); letter-spacing: .06em; text-transform: uppercase; }
.step svg { width: 100%; height: auto; display: block; margin: 12px 0; }
.step svg text { font-family: var(--font); }
.step p { font-size: 15px; margin: 0; }
@media (max-width: 1100px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) { .hero, .steps { grid-template-columns: 1fr; } }

/* projects */
.cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 16px; }
section + section { margin-top: 48px; }
.proj { display: flex; flex-direction: column; gap: 10px; min-height: 170px; }
.proj h3 { margin: 0; }
.proj .meta { font-size: 13px; color: var(--muted); }
.proj .actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.proj.demo { border-top: 3px solid var(--clay); }
.proj.new { border: 1.5px dashed var(--line-strong); background: transparent; padding: 0; }
.proj.new button { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; height: 100%; min-height: 170px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; color: var(--muted); }
.proj.new .plus { font-size: 34px; color: var(--accent); line-height: 1; }

/* run */
.run-layout { display: grid; grid-template-columns: 1fr 340px; gap: 40px; align-items: start; }
.convo { display: grid; gap: 16px; }
.msg { background: var(--surface); border: 1px solid var(--line); padding: 16px 20px; border-radius: var(--radius); white-space: pre-wrap; }
.msg.user { border-left: 3px solid var(--line-strong); }
.msg.app { border-left: 3px solid var(--accent); }
.msg .who { font: 500 12px var(--font); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; white-space: normal; }
.msg.ending.yes { background: var(--yes-bg); border-left-color: var(--yes-bar); }
.msg.ending.unsure { background: var(--unsure-bg); border-left-color: var(--unsure-bar); }
.msg.ending h3 { margin: 4px 0 8px; font-size: 22px; font-weight: 300; }
.msg.ending { white-space: normal; }
.msg.ending .note { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.compose { display: grid; gap: 10px; }
.compose textarea { min-height: 90px; }
.compose .row { display: flex; gap: 10px; }
.panel { position: sticky; top: 76px; }
.node-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.node-row .why { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.rule-box { margin-top: 14px; padding: 12px; background: var(--surface-2); font-size: 14px; }
@media (max-width: 900px) { .run-layout { grid-template-columns: 1fr; } .panel { position: static; } }

/* editor */
.page.editor { max-width: 1320px; }
.ptitle { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.ptitle h1 { margin: 0; font-size: 28px; }
.ptitle .status { font-size: 13px; color: var(--muted); }
.ed { display: grid; grid-template-columns: 250px 1fr 330px; gap: 20px; align-items: start; }
.outline { background: var(--surface-2); border-radius: var(--radius); padding: 14px; }
.outline h4 { font: 600 12px var(--font); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 6px; }
.outline h4.grp { color: var(--text); font-size: 13px; border-bottom: 1px solid var(--line-strong); padding-bottom: 4px; margin-top: 22px; }
.outline h4.grp:first-child { margin-top: 0; }
.outline h4.grp + h4 { margin-top: 8px; }
.outline .item { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; border: 1px solid transparent;
  background: none; border-radius: var(--radius); padding: 6px 8px; font: 400 14px var(--font); color: var(--text); cursor: pointer; }
.outline .item:hover { background: #fff; }
.outline .item[aria-current="true"] { background: #fff; border-color: var(--accent); }
.outline .add { font-size: 13px; color: var(--accent); background: none; border: 0; cursor: pointer; padding: 4px 8px; }
.node .kind { font: 600 12px var(--font); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.node h2 { margin: 4px 0 16px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 8px 12px; font: 500 14px var(--font); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--text); border-color: var(--accent); }
.tabs .count { font-size: 12px; background: var(--surface-2); padding: 0 7px; margin-left: 4px; }
.field { margin-bottom: 16px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.strip { position: relative; height: 70px; margin: 26px 8px 8px; touch-action: none; }
.strip .zone { position: absolute; top: 28px; height: 14px; }
.strip .dotx { position: absolute; top: 22px; width: 24px; height: 24px; margin-left: -12px; border-radius: 50%;
  display: grid; place-items: center; font: 700 11px var(--font); color: #fff; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.strip .dotx.exp-yes { background: var(--yes); } .strip .dotx.exp-no { background: var(--no); } .strip .dotx.exp-none { background: #A8A49A; }
.strip .dotx.wrong { outline: 3px solid #C39A55; outline-offset: 1px; }
.strip .handle { position: absolute; top: 12px; width: 4px; height: 46px; margin-left: -2px; background: var(--text); cursor: ew-resize; }
.strip .handle::after { content: ""; position: absolute; inset: -6px -10px; }
.strip .handle span { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font: 600 12px var(--font); white-space: nowrap; }
.strip .axis { position: absolute; top: 52px; left: 0; right: 0; display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.calrow { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 18px; font-size: 14px; }
.calrow select { width: auto; padding: 4px 8px; font-size: 14px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); }
th { text-align: left; font: 500 12px var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px; border-bottom: 1px solid var(--line-strong); vertical-align: bottom; }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.changed { background: #F5EEDC; } tr.fail { background: #FBF6EC; }
.scroll { overflow-x: auto; }
.expect { display: inline-flex; border: 1px solid var(--line); overflow: hidden; }
.expect button { border: 0; background: #fff; font: 600 12px var(--font); padding: 2px 8px; cursor: pointer; color: var(--muted); }
.expect button[aria-pressed="true"].y { background: var(--yes); color: #fff; }
.expect button[aria-pressed="true"].n { background: var(--no); color: #fff; }
.histlist { list-style: none; margin: 0; padding: 0; }
.histlist li { display: grid; grid-template-columns: 70px 1fr auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; align-items: start; }
.histlist .when { color: var(--muted); font-size: 12px; }
.sentence { font-size: 16px; line-height: 2.2; }
.group { display: inline; }
.cond { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1.5px solid var(--line); padding: 1px 8px; margin: 2px 0; }
.cond select { width: auto; border: 0; padding: 2px 4px; font-size: 15px; background: transparent; }
.neg { border: 1.5px dashed var(--line); background: var(--surface-2); padding: 0 8px; font: 600 13px var(--font); cursor: pointer; color: var(--muted); }
.neg[aria-pressed="true"] { border-style: solid; border-color: var(--no); background: var(--no-bg); color: var(--no); }
.op { border: 0; background: var(--accent-soft); color: var(--accent); padding: 2px 8px; font: 600 13px var(--font); cursor: pointer; }
.x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 2px; }
.routes .route { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.routes select { width: auto; padding: 4px 8px; font-size: 14px; }
.try { position: sticky; top: 76px; }
.try textarea { min-height: 80px; font-size: 15px; }
.try .res { margin-top: 12px; padding: 12px; }
.try .res.yes { background: var(--yes-bg); } .try .res.no { background: var(--no-bg); } .try .res.unsure { background: var(--unsure-bg); }
.try .res h4 { margin: 0 0 6px; font: 400 17px var(--font); }
.try ul { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.try li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
@media (max-width: 1100px) { .ed { grid-template-columns: 220px 1fr; } .try { grid-column: 1 / -1; position: static; } }
@media (max-width: 720px) { .ed { grid-template-columns: 1fr; } }

/* tests */
.score { font: 300 44px var(--font); }
.score small { font-size: 16px; }
.head { display: flex; align-items: baseline; gap: 20px; flex-wrap: wrap; margin-bottom: 8px; }
.note { font-size: 14px; color: var(--muted); max-width: 46em; }
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 8px; }
.trace { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.trace li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.allp { max-height: 420px; overflow: auto; border: 1px solid var(--line); background: var(--surface); }
.allp .row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; font-size: 13px; border-bottom: 1px solid var(--line); align-items: center; }
.exp { font-size: 12px; color: var(--muted); display: block; }
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; } }

/* buttons that read as links inside sentences and lists */
button.add { font: 400 13px var(--font); color: var(--accent); background: none; border: 0; cursor: pointer; padding: 2px 6px; }
button.add:hover { text-decoration: underline; }
.trace li { align-items: flex-start; }
.trace .pill, .node-row .pill { align-self: center; }

/* the panel layout (vibe check) */
.vibe-layout { display: grid; grid-template-columns: 340px 1fr; gap: 32px; align-items: start; }
.vibe-layout .side { position: sticky; top: 76px; display: grid; gap: 16px; }
.vibe-layout .msg { margin-bottom: 10px; }
.time { font-size: 13px; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; display: inline-block; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.chip .y { color: var(--yes); margin-left: 4px; } .chip .n { color: var(--no); margin-left: 2px; }
.chip[aria-pressed="true"] .y, .chip[aria-pressed="true"] .n { color: #fff; }
.summary { display: flex; gap: 16px; font-size: 14px; margin-bottom: 10px; }
.plist { border: 1px solid var(--line); background: #fff; }
.prow { display: grid; grid-template-columns: 22px 1fr 140px 44px; gap: 12px; align-items: center; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 15px; }
.prow:first-child { border-top: 0; }
.prow.yes { background: var(--yes-bg); }
.prow .ic { font-weight: 700; text-align: center; }
.prow .tags { font-size: 12px; color: var(--muted); margin-left: 6px; }
.bar { height: 6px; background: var(--surface-2); position: relative; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; }
.bar .th { position: absolute; top: -3px; bottom: -3px; width: 1.5px; background: rgba(0,0,0,.35); }
.prow .num { font: 600 14px var(--font); text-align: right; font-variant-numeric: tabular-nums; }
.fold { display: flex; justify-content: space-between; align-items: center; width: 100%; border: 0; border-top: 1px solid var(--line);
  background: var(--unsure-bg); color: var(--unsure); font: 500 14px var(--font); padding: 10px 14px; cursor: pointer; text-align: left; }
.fold.no { background: var(--no-bg); color: var(--no); }
.levers .lrow { display: flex; justify-content: space-between; margin-top: 8px; }
.levers input[type=range] { width: 100%; accent-color: var(--accent); }
.msg.ending .trace { margin: 8px 0 12px; }
@media (max-width: 900px) {
  .vibe-layout { grid-template-columns: 1fr; } .vibe-layout .side { position: static; }
  .prow { grid-template-columns: 22px 1fr 44px; } .prow .bar { display: none; }
}

/* ending tones, scale/choice readings, big inputs */
.msg.ending.warn { background: var(--no-bg); border-left-color: var(--no-bar); }
.msg.ending.neutral { background: var(--surface-2); border-left-color: var(--line-strong); }
.msg.ending ul.also { margin: 0 0 10px; padding-left: 18px; }
.pill.reading { background: var(--accent-soft); color: var(--accent); }
textarea.big { min-height: 260px; font: 13px/1.5 ui-monospace, "SFMono-Regular", Menlo, monospace; }
.msg.user.mono { font: 12.5px/1.5 ui-monospace, "SFMono-Regular", Menlo, monospace; max-height: 520px; overflow: auto; }
