/* Planning Studio v2: the docked conversation and the design-package stages. Builds on styles.css. */
:root {
  --convo: 380px;
  --glass: rgba(14, 15, 17, 0.55);
  --glass-line: rgba(255, 255, 255, 0.14);
  --paper: #ece6dc;
  --lit: 0 0 0 2px var(--accent), 0 0 28px rgba(240, 169, 59, 0.35);
}

/* ---------- shell with the conversation dock ---------- */
.shell { position: relative; }
.convo {
  width: var(--convo); flex: none; display: flex; flex-direction: column; min-height: 0;
  border-left: 1px solid var(--line); background: var(--bg-2);
}
.convo.collapsed { width: 48px; }
.convo-tab {
  flex: 1; width: 100%; border: 0; background: none; cursor: pointer; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 0;
}
.convo-tab:hover { background: var(--surface); color: var(--text); }
.convo-tab .vert { writing-mode: vertical-rl; font-weight: 600; font-size: 13px; letter-spacing: .04em; }
.convo-tab .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.convo-tab .dot.on { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(240, 169, 59, 0.04); } }
.convo-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.convo-head .avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 750; color: var(--accent-ink);
  background: conic-gradient(from 200deg, var(--accent), #ffd79a, var(--accent));
}
.convo-head b { font-size: 14px; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-2); }
.convo-body { flex: 1; overflow-y: auto; padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 14px; }
.convo-empty { color: var(--muted); font-size: 14px; padding: 8px 4px; }

.turn { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.turn.editing { border-color: var(--accent-line); }
.turn-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.turn .question { font-family: var(--font-display); font-size: 19px; line-height: 1.32; font-weight: 620; margin: 0 0 8px; }
.turn .why { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.turn .options { gap: 8px; }
.option.compact { padding: 12px 14px 12px 44px; }
.option.compact .check { left: 14px; top: 14px; width: 20px; height: 20px; }
.option.compact h3 { font-size: 14.5px; margin: 0 0 2px; }
.option.compact p { font-size: 13px; }
.option.compact .rec { font-size: 12px; margin-top: 8px; }
.turn textarea.say { margin-top: 12px; min-height: 64px; font-size: 14px; }
.turn-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 12px; }
.turn.done .question { font-size: 16px; }
.part-chip {
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted); border-radius: 99px; height: 24px; padding: 0 10px;
  font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.part-chip:hover { color: var(--text); border-color: var(--accent-line); }
.part-chip.lit { color: var(--accent); border-color: var(--accent); }
.show-me { margin-top: 12px; padding: 10px; border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--accent-line); font-size: 13px; }
.show-me .show-pic { display: block; width: 100%; padding: 0; border: 0; border-radius: 8px; overflow: hidden; margin-bottom: 10px; cursor: zoom-in; aspect-ratio: 16/9; background: var(--surface-2); }
.show-me .show-pic img { width: 100%; height: 100%; object-fit: cover; }
.show-me .show-pic.pending { display: grid; place-items: center; gap: 8px; color: var(--muted); cursor: default; align-content: center; }
.row.tight { gap: 8px; }
.banner.compact { padding: 10px 12px; font-size: 13px; }
.muted-link { color: var(--muted); }

.convo-history h4 { margin: 8px 2px 8px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.convo-history ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.hist {
  width: 100%; display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: start; text-align: left;
  padding: 9px 8px; border-radius: 10px; border: 1px solid transparent; background: none; cursor: pointer;
}
.hist:hover { background: var(--surface); }
.convo-history li.viewing .hist { background: var(--surface); border-color: var(--line-2); }
.hist .n { width: 22px; height: 22px; border-radius: 7px; background: var(--surface-2); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted); }
.hist .qa { display: flex; flex-direction: column; min-width: 0; }
.hist .q { font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist .a { font-size: 13.5px; font-weight: 550; }
.hist .a em { color: var(--faint); font-weight: 400; font-style: normal; font-size: 12px; }
.part-dot { font-size: 11px; color: var(--faint); padding: 2px 7px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; }
.part-dot.lit { color: var(--accent); border-color: var(--accent); }

/* Package updates light up where they land. */
.step.lit .dot { box-shadow: var(--lit); animation: litpulse 1.2s ease-in-out 4; }
.step.lit .label small { color: var(--accent); }
@keyframes litpulse { 50% { box-shadow: 0 0 0 5px rgba(240, 169, 59, 0.18); } }
.lit { animation: litflash 2.4s ease; }
@keyframes litflash { 0%, 30% { box-shadow: var(--lit); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- shared page pieces ---------- */
.page.wide { max-width: 1440px; }
.v2-section { margin-top: 44px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head p { margin: 4px 0 0; max-width: 70ch; }
.sub-h { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin: 0 0 12px; font-weight: 650; }
.empty-part { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 36px; display: flex; align-items: center; gap: 18px; color: var(--muted); margin: 8px 0 24px; }
.empty-part p { margin: 0; flex: 1; }
.empty-part .glyph { font-size: 26px; color: var(--accent); }
.btn.icon { width: 32px; padding: 0; }
.btn.wide { width: 100%; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #1b0906; }
.btn.danger-text { color: var(--danger); }
.btn.glass, .pill.glass { background: var(--glass); border-color: var(--glass-line); color: #f4f2ee; backdrop-filter: blur(8px); }
.pill.glass { border: 1px solid var(--glass-line); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 99px; font-size: 12.5px; font-weight: 550;
  background: var(--surface-2); border: 1px solid var(--line-2); color: #d6d5d1; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: #4a5058; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip-img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; margin-left: -6px; }
.fact { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.fact:first-of-type { border-top: 0; }
.fact > span { color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding-top: 2px; }
.fact ul { margin: 0; padding-left: 18px; }
.fact blockquote { margin: 0 0 6px; }
.problems ul { margin: 6px 0 0; padding-left: 18px; }
.mono { font-family: var(--mono); }

/* ---------- picture cards ---------- */
.art-grid { display: grid; gap: 20px; }
.art-grid.two { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.art-grid.three { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.art-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.art-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.art-card .frame { position: relative; background: var(--surface-2); }
.art-card .frame.wide { aspect-ratio: 16/9; }
.art-card .frame.square { aspect-ratio: 1; }
.art-card .pic { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; overflow: hidden; display: block; }
.art-card .pic img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.art-card .pic:hover img { transform: scale(1.02); }
.art-card .frame.square .pic img { object-fit: contain; background: var(--paper); }
.art-card .pic.pending, .art-card .pic.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); cursor: default; font-size: 13px; }
.art-card .pic.empty { border: 1px dashed var(--line-2); border-radius: var(--radius) var(--radius) 0 0; background: repeating-linear-gradient(135deg, transparent 0 14px, rgba(255,255,255,.015) 14px 28px); }
.art-card .badge { position: absolute; top: 12px; left: 12px; pointer-events: none; }
.art-card .count { position: absolute; top: 12px; right: 12px; height: 26px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--glass-line); background: var(--glass); color: #eee; font-size: 12px; font-weight: 600; cursor: pointer; backdrop-filter: blur(6px); }
.art-meta { padding: 14px 18px 4px; }
.art-meta h3 { font-size: 16px; }
.art-meta p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.art-meta .chips { margin-top: 10px; }
.art-actions { display: flex; gap: 8px; padding: 10px 18px 16px; flex-wrap: wrap; }
.art-card > .error, .art-card > .note-box { margin: 0 18px 16px; }
.art-card .note-box { grid-template-columns: 1fr; }
.art-card.hero-card { border-radius: 18px; }
.title-wrap { max-width: 1040px; }
.strip { display: flex; gap: 8px; flex-wrap: wrap; }
.strip .mini { width: 64px; height: 42px; padding: 0; border-radius: 8px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: var(--surface-2); }
.strip .mini img { width: 100%; height: 100%; object-fit: cover; }
.strip .mini.on { border-color: var(--accent); }

/* ---------- Vision: the store page ---------- */
.store { position: relative; border-radius: 22px; overflow: hidden; min-height: 460px; display: flex; align-items: flex-end; border: 1px solid var(--line); background: var(--surface); }
.store-art { position: absolute; inset: 0; }
.store-art img { width: 100%; height: 100%; object-fit: cover; }
.store-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,11,13,0) 30%, rgba(10,11,13,.55) 62%, rgba(10,11,13,.94)), linear-gradient(90deg, rgba(10,11,13,.6), transparent 60%); }
.store-art-empty { position: absolute; inset: 0; background: radial-gradient(ellipse at 70% 20%, #2c3038, #121316 70%); }
.store-painting { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); z-index: 1; background: rgba(10,11,13,.4); }
.store-copy { position: relative; padding: 40px 44px; max-width: 900px; z-index: 1; }
.store-title { font-size: clamp(44px, 5.4vw, 76px); line-height: 1; font-weight: 750; letter-spacing: -0.02em; text-shadow: 0 4px 30px rgba(0,0,0,.5); }
.tagline { font-size: 19px; color: #e8e4dc; margin: 14px 0 18px; max-width: 58ch; text-shadow: 0 2px 16px rgba(0,0,0,.6); }
.store .pills { gap: 8px; }
.store-tools { position: absolute; top: 18px; right: 18px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; z-index: 2; max-width: 60%; }
.store-tools .error { max-width: 420px; }
.glass-note { color: #ddd; background: var(--glass); padding: 5px 10px; border-radius: 99px; backdrop-filter: blur(6px); }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 18px 0 0; border-radius: var(--radius); }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; display: flex; gap: 14px; }
.feature .n { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--accent); line-height: 1; }
.feature p { margin: 0; font-size: 15px; }
.feature.empty p { color: var(--faint); }
.vision-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; margin-top: 24px; align-items: start; }
.doc { padding: 30px 36px; }
.doc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.doc-name { font-family: var(--mono); font-size: 12.5px; color: var(--faint); }
.doc-md { font-size: 15px; max-width: 76ch; }
.doc-md h1 { font-size: 30px; }
.doc-md h2 { font-size: 19px; }
.vision-facts { display: grid; gap: 16px; position: sticky; top: 0; }
.vision-facts h3 { margin-bottom: 8px; }

/* ---------- Look ---------- */
.look-strip { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; padding: 16px 20px; margin-bottom: 36px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.look-strip .fact { border: 0; padding: 0; grid-template-columns: auto 1fr; }
.palette { display: flex; }
.palette .sw { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface); margin-left: -8px; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.palette .sw:first-child { margin-left: 0; }
.sound-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; border-radius: var(--radius); }
.sound { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.sound .prompt { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.sound .grow { min-width: 0; }
.sound-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.play {
  width: 44px; height: 44px; border-radius: 50%; flex: none; border: 0; cursor: pointer; font-size: 15px;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(240,169,59,.25);
}
.play:hover { background: #f5b751; }
.play.off { background: var(--surface-3); color: var(--faint); box-shadow: none; cursor: default; }
.play.on { background: var(--text); }
.eq { display: flex; gap: 3px; align-items: flex-end; height: 16px; }
.eq i { width: 3px; background: var(--accent-ink); border-radius: 2px; animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 16px; } }
.versions { display: flex; gap: 6px; margin-top: 8px; }
.ver { height: 24px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted); font-size: 12px; cursor: pointer; }
.ver.cur { border-color: var(--accent-line); color: var(--text); }
.ver.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.sound .note-box { grid-template-columns: 1fr; margin-top: 10px; }

/* ---------- World ---------- */
.world-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.map-card .frame.wide { aspect-ratio: 16/9; }
.pin {
  position: absolute; transform: translate(-50%, -36px); border: 0; background: none; padding: 0; cursor: pointer; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
}
.pin span {
  position: relative; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: #fbf6ec; color: #2a2118; font-weight: 800; font-size: 12px; box-shadow: 0 4px 12px rgba(0,0,0,.45); border: 2px solid #2a2118;
}
.pin span::after { content: ""; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); border: 6px solid transparent; border-top-color: #2a2118; border-bottom: 0; }
.pin em {
  font-style: normal; font-size: 12px; font-weight: 650; color: #fff; background: rgba(20,16,12,.78); padding: 2px 8px; border-radius: 99px;
  margin-top: 4px; white-space: nowrap; opacity: 0; transition: opacity .15s; pointer-events: none;
}
.pin:hover em, .pin.on em { opacity: 1; }
.pin.slice span { background: var(--accent); }
.pin.on span { background: #fff; outline: 3px solid var(--accent); }
.place-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; max-height: 620px; overflow-y: auto; }
.side-head { display: flex; align-items: baseline; justify-content: space-between; margin: 2px 4px 12px; }
.side-head h2 { font-size: 18px; }
.place-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.place-row { width: 100%; display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; border: 1px solid transparent; background: none; text-align: left; cursor: pointer; }
.place-row:hover { background: var(--surface-2); }
.place-row.on { background: var(--surface-2); border-color: var(--accent-line); }
.place-row .num { width: 22px; height: 22px; border-radius: 50%; background: #fbf6ec; color: #2a2118; font-size: 11px; font-weight: 800; display: grid; place-items: center; flex: none; }
.place-row .thumb { width: 52px; height: 36px; border-radius: 6px; overflow: hidden; background: var(--surface-3); flex: none; }
.place-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.place-row .grow { min-width: 0; display: flex; flex-direction: column; }
.place-row b { font-size: 14px; }
.place-row small { color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Cast: dex cards ---------- */
.dex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.dex {
  text-align: left; padding: 0; cursor: pointer; border-radius: 18px; overflow: hidden; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #1f2227, #17191c); border: 1px solid var(--line); transition: transform .15s, border-color .15s;
}
.dex:hover { transform: translateY(-3px); border-color: var(--line-2); }
.dex.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 16px 40px rgba(0,0,0,.4); }
.dex-pic { position: relative; aspect-ratio: 1; background: radial-gradient(circle at 50% 38%, #fbf7f0, var(--paper) 70%); display: grid; place-items: center; overflow: hidden; }
.dex-pic img { width: 100%; height: 100%; object-fit: contain; }
.dex-empty { font-family: var(--font-display); font-size: 64px; font-weight: 750; color: #cfc6b8; }
.dex-no { position: absolute; top: 10px; left: 12px; font-family: var(--mono); font-size: 12px; font-weight: 700; color: #6d6356; }
.dex-ok { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.dex-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.dex-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dex-name b { font-family: var(--font-display); font-size: 19px; }
.role { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 3px 8px; border-radius: 6px; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.role.player { background: var(--accent); color: var(--accent-ink); }
.role.mentor, .role.partner { background: #2a9d8f; color: #06201c; }
.role.rival, .role.enemy, .role.boss { background: var(--danger); color: #1b0906; }
.dex-blurb { margin: 0; font-size: 13.5px; color: var(--muted); }
.dex-line { margin: auto 0 0; font-size: 13px; font-style: italic; color: #d8d0c4; }
.stats { display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; margin: 0; font-size: 12px; align-items: center; }
.stats dt { color: var(--faint); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.stats dd { margin: 0; display: flex; align-items: center; gap: 8px; }
.stats dd i { flex: 1; height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.stats dd i b { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #ffd79a); border-radius: 6px; }
.stats dd span { width: 26px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 650; }
.stats dd span.txt { width: auto; text-align: left; font-weight: 500; }
.cast-detail { display: grid; grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr); gap: 28px; margin-top: 36px; padding-top: 32px; border-top: 1px solid var(--line); align-items: start; }
.bio { display: flex; flex-direction: column; gap: 14px; }
.bio-name { font-size: 40px; font-weight: 720; }
.bio .lead { margin: 0; }
.bio .stats { max-width: 420px; font-size: 13px; }
.lines blockquote { margin: 0 0 8px; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 10px 10px 0; font-style: italic; }
.lines h3 { margin-bottom: 10px; }

/* ---------- Story: the beat board ---------- */
.beat-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; border-radius: var(--radius); }
.beat { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; cursor: grab; transition: transform .15s, opacity .15s; }
.beat:active { cursor: grabbing; }
.beat.dragging { opacity: .4; }
.beat.drop-before::before, .beat.drop-after::after { content: ""; position: absolute; top: 8px; bottom: 8px; width: 4px; border-radius: 4px; background: var(--accent); z-index: 3; }
.beat.drop-before::before { left: 2px; } .beat.drop-after::after { right: 2px; }
.beat img { -webkit-user-drag: none; user-select: none; }
.beat-pic { position: relative; aspect-ratio: 16/9; background: var(--surface-2); }
.beat-pic .pic { position: absolute; inset: 0; padding: 0; border: 0; width: 100%; height: 100%; cursor: zoom-in; background: none; overflow: hidden; }
.beat-pic .pic img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.beat-pic .pic.pending { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 13px; cursor: default; }
.moment-btn {
  position: absolute; inset: 10px; border: 1px dashed var(--line-2); border-radius: 10px; background: none; color: var(--muted); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 600; font-size: 13.5px;
}
.moment-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.moment-btn small { font-weight: 500; color: var(--faint); }
.beat-no { position: absolute; left: 10px; top: 10px; width: 30px; height: 30px; border-radius: 50%; background: rgba(12,13,15,.8); color: #fff; display: grid; place-items: center; font-weight: 750; font-size: 13px; border: 1px solid var(--glass-line); }
.beat-slice { position: absolute; right: 10px; top: 12px; }
.beat-body { padding: 14px 16px 12px; display: flex; flex-direction: column; flex: 1; }
.beat-body h3 { font-size: 16.5px; margin-bottom: 6px; }
.beat-body p { margin: 0 0 10px; color: var(--muted); font-size: 13.5px; }
.beat-body .caption { font-style: italic; color: var(--faint); font-size: 12.5px; }
.beat-foot { display: flex; align-items: center; gap: 4px; margin-top: auto; padding-top: 6px; }
.beat.editing { cursor: default; border-color: var(--accent-line); }
.beat.editing .field { margin-top: 10px; }
.beat.editing .field > span { margin-bottom: 5px; font-size: 12px; }
.beat.editing textarea.input { min-height: 80px; }
.beat.add { cursor: pointer; border-style: dashed; background: none; min-height: 260px; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-weight: 600; }
.beat.add:hover { border-color: var(--accent); color: var(--accent); }
.beat.add .plus { font-size: 36px; font-weight: 300; line-height: 1; }
.tick-label { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
select.input { color: var(--text); font: inherit; }
select.input option { background: var(--surface); color: var(--text); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

/* ---------- Mechanics ---------- */
.systems { display: grid; gap: 18px; }
.system { display: grid; grid-template-columns: minmax(0, 1fr) 320px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.sys-main { padding: 24px 26px; }
.sys-no { font-family: var(--mono); color: var(--accent); font-weight: 700; font-size: 13px; }
.system h2 { font-size: 22px; }
.system .what { color: var(--muted); margin: 8px 0 12px; max-width: 70ch; }
.verbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.verb { font-size: 12.5px; padding: 4px 10px; border-radius: 7px; background: var(--bg-2); border: 1px solid var(--line-2); font-family: var(--mono); color: #d6d5d1; }
.checks h3 { font-size: 14px; margin-bottom: 8px; }
.checks ol { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.checks li { display: flex; align-items: center; gap: 10px; }
.checks .tick { width: 22px; height: 22px; border-radius: 6px; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--accent); background: var(--accent-soft); }
.check-input { padding: 7px 10px; font-size: 14px; background: transparent; border-color: transparent; }
.check-input:hover { border-color: var(--line-2); }
.check-input:focus { background: var(--bg-2); }
.proto { background: var(--bg-2); border-left: 1px solid var(--line); padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.proto.ready { background: linear-gradient(180deg, rgba(240,169,59,.10), var(--bg-2) 60%); }
.proto-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.proto-copy { margin: 0; color: var(--muted); font-size: 14px; }
.proto .msg { margin: 0; }
.proto .field > span { font-size: 12px; }
.proto textarea.input { min-height: 70px; }
.est { display: flex; align-items: baseline; gap: 10px; }
.est b { font-family: var(--font-display); font-size: 28px; color: var(--text); }
.est span { color: var(--faint); font-size: 12.5px; }

/* phase timeline (milestones and prototypes) */
.phases { list-style: none; margin: 22px 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; counter-reset: p; }
.phases li { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-right: 8px; color: var(--faint); font-size: 13px; }
.phases li::before { content: ""; position: absolute; left: 34px; right: 6px; top: 15px; height: 2px; background: var(--line-2); }
.phases li:last-child::before { display: none; }
.phases li.done::before { background: var(--accent); }
.phases li i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 750; font-size: 13px; border: 2px solid var(--line-2); background: var(--bg); position: relative; z-index: 1; }
.phases li span { font-weight: 650; color: var(--muted); font-size: 14px; }
.phases li small { font-size: 12px; }
.phases li.done i { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.phases li.done span { color: var(--text); }
.phases li.now i { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.phases li.now span { color: var(--accent); }
.phases li.failed i { border-color: var(--danger); background: var(--danger); color: #1b0906; }
.phases li.failed span { color: var(--danger); }
.phases.compact { margin: 4px 0; }
.phases.compact li::before { left: 22px; top: 10px; }
.phases.compact li i { width: 22px; height: 22px; font-size: 10.5px; }
.phases.compact li span { font-size: 11px; }
.workers { display: grid; gap: 10px; }
.worker { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.proto .worker { background: var(--surface); }
.worker-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.worker .avatar { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-3); display: grid; place-items: center; font-weight: 750; font-size: 12px; color: var(--accent); }
.worker b { font-size: 14px; }
.branch { font-family: var(--mono); font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.logtail.mini { margin: 10px 0 0; max-height: 72px; overflow: hidden; padding: 8px 12px; font-size: 11.5px; line-height: 1.55; }
.logtail.mini.open { max-height: 320px; overflow: auto; }

/* ---------- Milestones ---------- */
.outline { border-radius: var(--radius); }
.ms-track { list-style: none; margin: 0; padding: 0 0 6px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; }
.ms-card {
  width: 100%; height: 100%; text-align: left; cursor: pointer; padding: 16px 18px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; position: relative;
}
.ms-card:hover { border-color: var(--line-2); }
.ms-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.ms-card p { margin: 0; font-size: 14px; color: #d6d5d1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ms-card.done { opacity: .75; }
.ms-id { font-family: var(--font-display); font-size: 20px; color: var(--accent); }
.ms-detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; margin-top: 28px; align-items: start; }
.ms-main { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px 28px; }
.goal-input {
  width: 100%; resize: vertical; border: 1px solid transparent; border-radius: 10px; background: transparent; outline: none; padding: 6px 8px; margin: 0 -8px 10px;
  font-family: var(--font-display); font-size: 26px; font-weight: 650; line-height: 1.25; color: var(--text);
  field-sizing: content; min-height: 2.6em;
}
.goal-input:hover { border-color: var(--line-2); }
.goal-input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--bg-2); }
.goal-read { font-family: var(--font-display); font-size: 24px; font-weight: 650; line-height: 1.3; margin: 0 0 14px; }
.picker { margin-top: 18px; }
.picker h4, .list-edit h4 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.picker h4 span { text-transform: none; letter-spacing: 0; font-weight: 500; }
.ms-main .two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
.list-edit ol { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 6px; counter-reset: li; }
.list-edit li { display: flex; gap: 6px; align-items: center; }
.list-edit .input { padding: 8px 10px; font-size: 13.5px; }
.ms-side { position: sticky; top: 0; }
.build-card .allow { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 8px; }
.allow-input { width: 140px; font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--accent); padding: 6px 12px; }
.allow-read { font-family: var(--font-display); font-size: 34px; color: var(--accent); }
.build-card .btn + .btn { margin-top: 8px; }
.build-card .btn.big { margin-top: 10px; }

/* ---------- Build: the milestone loop ---------- */
.build-hero.ms .content { padding: 34px 38px; }
.ms-goal { font-size: 32px; line-height: 1.2; max-width: 30ch; margin: 10px 0 8px; }
.ms-stats { display: flex; gap: 36px; flex-wrap: wrap; margin-top: 22px; align-items: flex-end; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat > span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }
.stat > b { font-size: 18px; font-variant-numeric: tabular-nums; }
.mini-bar { display: block; width: 180px; height: 5px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.mini-bar b { display: block; height: 100%; background: var(--accent); }
.shots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.shot { padding: 0; border: 0; border-radius: 12px; overflow: hidden; aspect-ratio: 16/9; cursor: zoom-in; background: var(--surface-2); outline: 1px solid var(--line); }
.shot.big { grid-column: span 2; grid-row: span 2; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.shot:hover img { transform: scale(1.03); }
.review-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; margin-top: 28px; align-items: start; }
.report { padding: 28px 32px; }
.report .md { font-size: 14.5px; }
.playtest { position: sticky; top: 0; display: flex; flex-direction: column; gap: 12px; }
.playtest h2 { margin: -4px 0 2px; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.checklist label.on { border-color: var(--accent-line); background: var(--accent-soft); }
.checklist input { margin-top: 3px; accent-color: var(--accent); }
.playtest textarea.input { min-height: 90px; }
.old-notes blockquote { margin: 0 0 6px; padding: 8px 12px; border-left: 3px solid var(--line-2); color: var(--muted); font-size: 13px; }
.saved-note { margin: 0; color: var(--accent); font-size: 13.5px; }

/* ---------- Build: review of a milestone version (W24) ---------- */
.versions { display: flex; align-items: center; gap: 12px; margin: -8px 0 18px; min-width: 0; }
.versions-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); flex: none; }
.versions-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: none; min-width: 0; }
.versions-row::-webkit-scrollbar { display: none; }
.version { position: relative; flex: none; display: flex; align-items: baseline; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; font-size: 13.5px; }
.version:hover { border-color: #4a5058; }
.version.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.version .mono { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.version.on .mono { color: var(--accent); opacity: .8; }
.version.no-build { opacity: .6; }
.version .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); align-self: center; }
.version .count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; align-self: center; }
.kept-note { margin: 16px 0 0; }
.rv-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "main play" "main notes"; grid-template-rows: auto 1fr; gap: 24px; margin-top: 28px; align-items: start; }
.rv-play { grid-area: play; display: flex; flex-direction: column; gap: 10px; }
.rv-play h2 { margin: -4px 0 2px; }
.rv-play p { margin: 0; }
.rv-play code { font-family: var(--mono); font-size: 12px; color: var(--text); }
.rv-notes { grid-area: notes; position: static; }
.rv-main { grid-area: main; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.rv-main > .v2-section:first-child, .rv-main > div:first-child > .v2-section { margin-top: 0; }
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.video { margin: 0; border-radius: 12px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.video video { display: block; width: 100%; aspect-ratio: 16/9; background: #000; }
.video figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 12px; font-size: 13.5px; }
.video figcaption b { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video figcaption span { flex: none; }
.video-errors { margin-top: 8px; }
.video-errors ul { margin: 6px 0 0; padding-left: 18px; }
.fb-list { display: grid; gap: 12px; }
.fb-note { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.fb-note.resolved { opacity: .55; }
.fb-shot { padding: 0; border: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 16/9; background: var(--surface-2); cursor: zoom-in; outline: 1px solid var(--line); }
.fb-shot img { width: 100%; height: 100%; object-fit: cover; }
.fb-shot.empty { display: grid; place-items: center; cursor: default; }
.fb-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fb-text { margin: 0; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip.static { cursor: default; font-size: 12px; padding: 3px 9px; }
.chip.static:hover { border-color: var(--line-2); }
.fb-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: auto; }
.danger-text { color: var(--danger); }
/* The conversation docked beside the page leaves too little width for two columns. */
@media (max-width: 1600px) {
  body.convo-open .rv-grid { grid-template-columns: 1fr; grid-template-areas: "play" "main" "notes"; grid-template-rows: none; }
}
@media (max-width: 1100px) {
  .rv-grid { grid-template-columns: 1fr; grid-template-areas: "play" "main" "notes"; grid-template-rows: none; }
}
/* Phone (the designer reviews from the sofa): one column, full-width media, thumb-sized buttons. */
@media (max-width: 640px) {
  /* A phone is for reviewing: the page gets the whole width (stages and the conversation stay on the PC). */
  .rail, .convo.collapsed, body.with-convo .shell::after { display: none !important; }
  main#view { overflow-x: hidden; }
  .topbar .crumb { min-width: 0; overflow: hidden; white-space: nowrap; }
  .page.build-page { padding: 14px 12px 48px; }
  .build-hero.ms .content { padding: 20px 18px; }
  .ms-goal { font-size: 21px; max-width: none; }
  .ms-stats { gap: 16px 22px; margin-top: 14px; }
  .stat > b { font-size: 15px; }
  .mini-bar { width: 120px; }
  .versions { margin: 0 0 12px; gap: 8px; }
  .versions-label { display: none; }
  .version { padding: 9px 14px; }
  .rv-grid { gap: 16px; margin-top: 16px; }
  .videos { grid-template-columns: 1fr; }
  .fb-note { grid-template-columns: 1fr; gap: 10px; }
  .fb-actions .btn { min-height: 38px; }
  .shots { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .report { padding: 18px 16px; }
  .report .md { font-size: 14px; overflow-wrap: anywhere; }
  .report .md table { display: block; overflow-x: auto; }
  .v2-section .section-head { flex-wrap: wrap; gap: 8px; }
}

/* plain picture viewer */
.lightbox.plain { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
.plain-bar { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface); }

/* ---------- home: v2 cards carry their key art ---------- */
.session-card.v2 .thumb { aspect-ratio: 16/10; }
.session-card.v2 .thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(10,11,13,.75)); }
.session-card .thumb .tagline { position: absolute; left: 14px; right: 14px; bottom: 10px; z-index: 1; margin: 0; font-size: 12.5px; color: #eee; text-shadow: 0 1px 8px rgba(0,0,0,.8); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- responsive ---------- */
@media (max-width: 1440px) {
  body.convo-open { --convo: 360px; }
  .shots { grid-template-columns: repeat(3, 1fr); }
}
/* With the conversation docked, the rail shrinks to its dots so the board keeps its width. */
@media (max-width: 1400px) {
  body.convo-open { --rail: 72px; }
  body.convo-open .step .label, body.convo-open .rail h6 { display: none; }
  body.convo-open .rail { padding: 18px 10px; }
  .vision-grid { grid-template-columns: 1fr; }
  .vision-facts { position: static; }
  .review-grid, .ms-detail { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 1280px) {
  .system { grid-template-columns: 1fr; }
  .proto { border-left: 0; border-top: 1px solid var(--line); }
  .world-layout { grid-template-columns: 1fr; }
  .place-side { max-height: none; }
  .place-list { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .features { grid-template-columns: 1fr; }
  .cast-detail { grid-template-columns: 1fr 1fr; }
}
/* Narrow windows: the conversation opens over the page as a drawer. */
@media (max-width: 1100px) {
  .convo:not(.collapsed) { position: absolute; right: 0; top: 0; bottom: 0; z-index: 30; box-shadow: -24px 0 60px rgba(0,0,0,.55); width: min(400px, 92vw); }
  body.with-convo .shell::after { content: ""; width: 48px; flex: none; }
  body.with-convo:not(.convo-open) .shell::after { display: none; }
  .review-grid, .ms-detail, .cast-detail { grid-template-columns: 1fr; }
  .ms-side, .playtest { position: static; }
  .store { min-height: 380px; }
  .store-copy { padding: 28px; }
  .store-tools { position: relative; top: auto; right: auto; max-width: none; }
  .store { flex-direction: column-reverse; align-items: stretch; }
  .store-tools { padding: 16px 28px 0; justify-content: flex-start; }
  .sound-grid { grid-template-columns: 1fr; }
  .shots { grid-template-columns: repeat(2, 1fr); }
  .ms-main .two { grid-template-columns: 1fr; }
  .art-grid.two { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .page { padding: 24px 22px 60px; }
  .phases li small { display: none; }
}
