:root {
    --ink: #151713;
    --muted: #687064;
    --line: #dfe4db;
    --paper: #f4f5ef;
    --card: #ffffff;
    --accent: #d8ff57;
    --accent-dark: #213016;
    --lime-soft: #f0ffd0;
    --warm: #fff7e9;
    --danger: #bf3e38;
    --shadow: 0 18px 55px rgba(31, 40, 25, .08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "DM Sans", sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, strong { font-family: "Manrope", sans-serif; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 26px 18px; background: #11130f; color: #fff; display: flex; flex-direction: column; justify-content: space-between; }
.brand-row { display: flex; gap: 12px; align-items: center; padding: 0 9px 28px; }
.brand-row div:last-child { display: flex; flex-direction: column; gap: 2px; }
.brand-row span { color: #9da696; font-size: 12px; }
.brand-mark { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; background: var(--accent); color: #111; font-family: "Manrope"; font-weight: 800; letter-spacing: -.06em; box-shadow: 0 10px 30px rgba(216,255,87,.22); }
.brand-mark.small { width: 42px; height: 42px; border-radius: 13px; }
#step-nav { display: grid; gap: 6px; }
.step-link { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; border: 0; border-radius: 14px; background: transparent; color: #9da696; text-align: left; }
.step-link b { width: 30px; height: 30px; border-radius: 10px; background: #252921; display: grid; place-items: center; font-size: 12px; }
.step-link span { display: flex; flex-direction: column; gap: 2px; }
.step-link strong { font-size: 14px; }
.step-link small { font-size: 11px; color: #727a6d; }
.step-link.active { background: #24291f; color: #fff; }
.step-link.active b { background: var(--accent); color: #111; }
.step-link.done b { background: #40502d; color: var(--accent); }
.sidebar-footer { display: flex; align-items: center; gap: 9px; color: #aab3a4; font-size: 12px; padding: 10px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #d59445; box-shadow: 0 0 0 4px rgba(213,148,69,.12); }
.status-dot.online { background: #a8d943; box-shadow: 0 0 0 4px rgba(168,217,67,.12); }
.workspace { min-width: 0; padding: 36px clamp(20px, 4vw, 64px) 80px; }
.topbar { max-width: 1180px; margin: 0 auto 26px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar h1 { margin-bottom: 0; font-size: clamp(28px, 4vw, 44px); letter-spacing: -.045em; }
.eyebrow { margin-bottom: 8px; color: #718058; font-family: "Manrope"; font-size: 11px; font-weight: 800; letter-spacing: .15em; }
.top-actions, .button-group { display: flex; gap: 10px; }
.step-panel { display: none; max-width: 1180px; margin: 0 auto; }
.step-panel.active { display: block; animation: enter .28s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
.section-grid { display: grid; gap: 18px; }
.section-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section-grid.tight { gap: 12px; }
.card { padding: 24px; margin-bottom: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 8px 30px rgba(31,40,25,.035); }
.accent-card { background: linear-gradient(145deg, #fff 55%, var(--lime-soft)); }
.hero-card { padding: 38px; background: linear-gradient(125deg, #151713 0%, #26331a 100%); color: #fff; overflow: hidden; position: relative; }
.hero-card:after { content: "✦"; position: absolute; right: 30px; top: 3px; font-size: 150px; color: rgba(216,255,87,.12); }
.hero-card p:not(.eyebrow) { max-width: 600px; color: #bec7b6; }
.hero-card .eyebrow { color: var(--accent); }
.card-heading { display: flex; gap: 13px; align-items: flex-start; margin-bottom: 20px; }
.card-heading h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.025em; }
.card-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.card-icon { flex: 0 0 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--lime-soft); color: #40541e; font: 800 12px "Manrope"; }
.card-icon.success { background: #ddf5dc; color: #2b6d2a; }
label { display: grid; gap: 7px; margin-bottom: 15px; font-size: 13px; font-weight: 600; }
.optional { color: #92998d; font-size: 11px; font-weight: 400; }
input, textarea, select { width: 100%; border: 1px solid #d8ded3; border-radius: 12px; padding: 12px 13px; background: #fbfcf9; color: var(--ink); outline: none; transition: .18s border, .18s box-shadow; }
textarea { resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { border-color: #8fa94c; box-shadow: 0 0 0 4px rgba(143,169,76,.13); }
.upload-zone { margin: 2px 0 0; padding: 20px; border: 1px dashed #bec8b5; border-radius: 16px; background: #fafcf7; text-align: center; place-items: center; cursor: pointer; }
.upload-zone small { font-weight: 400; color: var(--muted); }
.upload-icon { width: 35px; height: 35px; border-radius: 50%; background: var(--lime-soft); display: grid; place-items: center; font-size: 22px; }
.image-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.image-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.record-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.record-button { padding: 11px 15px; border: 1px solid #e5b4b1; border-radius: 12px; background: #fff4f3; color: #a43732; font-weight: 700; }
.record-button.recording { color: white; background: #c44740; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(196,71,64,.12); } }
.muted { color: var(--muted); font-size: 13px; }
.truth-note { display: flex; gap: 10px; padding: 13px; margin-top: 16px; border-radius: 12px; background: rgba(255,255,255,.75); font-size: 12px; }
.truth-note strong { color: #526d25; }
.button { border: 0; border-radius: 12px; padding: 11px 17px; font-weight: 700; transition: .18s transform, .18s background; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.primary { color: #111; background: var(--accent); box-shadow: 0 8px 20px rgba(156,192,49,.18); }
.button.primary:hover:not(:disabled) { background: #c9f13b; }
.button.secondary { color: #fff; background: #1a1d17; }
.button.ghost { color: #434a3f; background: #e9ede5; }
.action-bar { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 18px; }
.notice { max-width: 1180px; margin: 0 auto 18px; padding: 13px 16px; border-radius: 13px; background: #fff5d9; border: 1px solid #ecd89f; color: #72561d; font-size: 13px; }
.notice.error { background: #fff0ef; border-color: #e9c0bd; color: #8f332e; }
.choice-grid { display: grid; gap: 10px; }
.choice-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.choice-card { padding: 16px 10px; border: 1px solid var(--line); border-radius: 14px; background: #fafbf8; text-align: center; font-weight: 700; color: #535b4f; }
.choice-card.selected { background: var(--lime-soft); border-color: #9bb654; color: #293516; box-shadow: inset 0 0 0 1px #9bb654; }
.voice-card { background: #fffdf9; }
.result-card { margin-top: 18px; }
.truth-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.truth-grid label.full { grid-column: 1 / -1; }
.source-chip { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: #edf1e8; color: #65705f; font-size: 11px; margin: 0 6px 6px 0; }
.hooks-list { display: grid; gap: 12px; }
.hook-card { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: #fff; cursor: pointer; }
.hook-card:hover, .hook-card.selected { border-color: #98b34f; box-shadow: 0 8px 28px rgba(71,91,32,.08); }
.hook-card.selected { background: var(--lime-soft); }
.hook-card input { width: 18px; height: 18px; margin-top: 3px; accent-color: #75932a; }
.hook-card p { margin: 0 0 7px; font-size: 17px; font-weight: 600; }
.hook-card small { color: var(--muted); }
.empty-state { padding: 46px 20px; text-align: center; border: 1px dashed #cbd2c5; border-radius: 17px; background: #fafbf8; }
.empty-state span { font-size: 34px; color: #8fa94c; }
.script-card textarea { font-size: 15px; }
.storyboard-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.story-choice { grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 18px; margin: 0; border: 1px solid var(--line); border-radius: 16px; cursor: pointer; }
.story-choice.selected { border-color: #92ad49; background: var(--lime-soft); }
.story-choice input { width: 18px; margin-top: 2px; accent-color: #76902c; }
.story-choice span { display: grid; gap: 5px; }
.story-choice small { color: var(--muted); font-weight: 400; line-height: 1.4; }
.storyboard-list { display: grid; gap: 15px; }
.shot-card { display: grid; grid-template-columns: 96px minmax(0, 1fr) 230px; gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.shot-time { color: #667254; font: 800 13px "Manrope"; }
.shot-card h3 { margin-bottom: 6px; }
.shot-card p { margin-bottom: 10px; color: #50574d; line-height: 1.5; font-size: 13px; }
.shot-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.shot-meta span { padding: 5px 8px; background: #eff2ec; border-radius: 8px; color: #60695b; font-size: 10px; }
.prompt-box { padding: 12px; background: #f5f7f2; border-radius: 12px; font-size: 11px; line-height: 1.45; color: #646c60; }
.shot-image { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 13px; background: #edf0e9; }
.shot-visual { display: grid; gap: 9px; align-content: start; }
.loading-overlay { position: fixed; inset: 0; z-index: 20; background: rgba(17,19,15,.74); backdrop-filter: blur(7px); color: white; display: grid; place-items: center; align-content: center; gap: 12px; }
.loading-overlay[hidden] { display: none; }
.loader { width: 44px; height: 44px; border-radius: 50%; border: 4px solid rgba(255,255,255,.22); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay span { color: #c8d0c1; font-size: 13px; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 60% 10%, #eaff9e, transparent 28%), #11130f; }
.login-card { width: min(420px, 100%); padding: 38px; background: #fff; border-radius: 24px; box-shadow: var(--shadow); }
.login-card .brand-mark { margin-bottom: 25px; }
.error-text { color: var(--danger); font-size: 13px; }

@media (max-width: 960px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; padding: 16px; }
    .sidebar > div:first-child { display: flex; align-items: center; gap: 18px; overflow-x: auto; }
    .brand-row { padding: 0; min-width: 210px; }
    #step-nav { display: flex; min-width: max-content; }
    .step-link { width: auto; }
    .step-link span { display: none; }
    .sidebar-footer { display: none; }
    .workspace { padding-top: 24px; }
    .choice-grid.five { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
    .section-grid.two, .truth-grid, .storyboard-options { grid-template-columns: 1fr; }
    .choice-grid.five { grid-template-columns: repeat(2, 1fr); }
    .topbar { align-items: flex-start; }
    .top-actions { flex-direction: column; }
    .shot-card { grid-template-columns: 1fr; }
    .shot-visual { max-width: 240px; }
    .action-bar { align-items: stretch; flex-direction: column-reverse; }
    .button-group { display: grid; }
}
@media print {
    body { background: white; }
    .sidebar, .topbar, .notice, .action-bar, .storyboard-options, #generate-storyboard, .loading-overlay { display: none !important; }
    .app-shell { display: block; }
    .workspace { padding: 0; }
    .step-panel { display: none !important; }
    .step-panel[data-panel="4"], .step-panel[data-panel="5"] { display: block !important; }
    .card, .shot-card { box-shadow: none; break-inside: avoid; }
    #script-empty { display: none !important; }
    #script-editor { display: block !important; }
    input, textarea { border: 0; padding: 0; background: white; resize: none; }
}
