:root {
  --ink: #171714;
  --muted: #6e6d65;
  --paper: #f6f4ed;
  --card: #fffefa;
  --accent: #ff5a36;
  --accent-dark: #e84421;
  --line: rgba(23, 23, 20, 0.11);
  --soft: #ebe7dc;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar {
  height: 72px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; color: white; background: var(--accent); font-size: 15px; }
.tagline { color: var(--muted); font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.main-nav { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 12px; background: var(--soft); }
.main-nav button { padding: 8px 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; }
.main-nav button.active { color: var(--ink); background: white; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.persona-entry { padding: 9px 13px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--ink); font-size: 12px; font-weight: 700; cursor: pointer; }
.auth-entry { min-width: 72px; }
.auth-dialog { width: min(440px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 24px; background: var(--card); box-shadow: 0 28px 90px rgba(23,23,20,.22); }
.auth-dialog::backdrop { background: rgba(23,23,20,.52); backdrop-filter: blur(4px); }
#auth-form { display: grid; gap: 16px; padding: 34px; }
#auth-form h2 { margin: 0; font-size: 30px; }
.auth-copy { margin: -4px 0 4px; color: var(--muted); font-size: 13px; line-height: 1.65; }
#auth-form .field { display: grid; gap: 7px; }
#auth-form .field input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: white; }
#auth-form .primary-button, #auth-form .secondary-button { width: 100%; }
.extension-connect { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; margin: 0 0 70px; padding: 26px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); }
.extension-connect h2 { margin: 0 0 8px; font-size: 24px; }
.extension-connect p { margin: 0; color: var(--muted); }
.extension-token-result { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px; border-radius: 14px; background: var(--soft); }
.extension-token-result code { overflow-wrap: anywhere; font-size: 13px; }
.extension-token-result small { flex-basis: 100%; color: var(--muted); }
#extension-token-error { grid-column: 1 / -1; }

main { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.persona-panel { margin: 24px 0 42px; padding: clamp(24px, 4vw, 42px); background: var(--card); border: 1px solid var(--line); border-radius: 26px; }
.persona-panel-head { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 28px; }
.persona-panel-head h2 { font-size: 34px; }
.close-button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--soft); cursor: pointer; font-size: 22px; }
#persona-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
#persona-form > button { grid-column: 1 / -1; }
.hero { min-height: 510px; padding: 104px 0 76px; position: relative; }
.hero::after { content: ""; position: absolute; right: 5%; top: 16%; width: 220px; height: 220px; border-radius: 50%; background: var(--accent); opacity: .08; filter: blur(2px); }
.eyebrow { margin: 0 0 14px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; max-width: 800px; font-size: clamp(44px, 7vw, 82px); line-height: 1.06; letter-spacing: -.055em; }
h1 span { color: var(--accent); }
.hero-copy { margin: 28px 0; color: var(--muted); font-size: 17px; }
.module-view { padding: 70px 0 100px; }
.module-heading { margin-bottom: 42px; }
.module-heading > p:last-child { color: var(--muted); }
.cases-split { display: grid; grid-template-columns: 1.25fr .75fr; gap: 22px; }
.cases-split > section { padding: 26px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); }
.cases-split h2 { margin-bottom: 20px; font-size: 24px; }
.saved-reference { padding: 14px 0; border-bottom: 1px solid var(--line); }
.saved-reference:last-child { border-bottom: 0; }
.saved-reference strong, .saved-reference span { display: block; }
.saved-reference span { margin: 5px 0 10px; color: var(--muted); font-size: 12px; }
.task-entries { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 38px; }
.task-entries article { display: flex; flex-direction: column; align-items: flex-start; padding: 28px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); }
.task-entries h2 { font-size: 25px; line-height: 1.25; }
.task-entries p { flex: 1; color: var(--muted); line-height: 1.75; }
.recent-projects { margin-top: 34px; }
.mini-heading { display: flex; align-items: center; justify-content: space-between; }
.mini-heading h2 { font-size: 22px; }
.project-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.project-row div { min-width: 0; }
.project-row strong, .project-row span { display: block; }
.project-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-row div span, .empty-projects { margin-top: 4px; color: var(--muted); font-size: 12px; }
.project-status { padding: 5px 9px; border-radius: 999px; background: var(--soft); font-size: 12px; }
.project-status.ready_to_shoot { color: #155b3e; background: #eaf7f0; }
.project-status.filmed { color: #075985; background: #e0f2fe; }
.project-status.published { color: #6b3fa0; background: #f3e8ff; }
.hook-card small { display: block; margin-top: 10px; color: var(--muted); font-size: 12px; }
.shoot-plan { margin-top: 24px; padding: 24px; border: 1px solid #bde5cf; border-radius: 20px; background: linear-gradient(145deg, #f5fcf8, #fff); }
.shoot-plan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.shoot-plan-head h3 { margin: 3px 0 18px; }
.shoot-progress { padding: 6px 10px; border-radius: 999px; color: #155b3e; background: #dff4e8; font-weight: 700; }
.shoot-date { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; font-weight: 650; }
.shoot-date input { padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; font: inherit; }
.shoot-tasks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.shoot-tasks button { display: flex; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: white; color: var(--ink); text-align: left; cursor: pointer; }
.shoot-tasks button > span:last-child { display: flex; flex-direction: column; gap: 4px; }
.shoot-tasks small { color: var(--muted); line-height: 1.45; }
.task-check { display: grid; flex: 0 0 22px; width: 22px; height: 22px; place-items: center; border: 1px solid #b7c2bb; border-radius: 50%; color: transparent; }
.shoot-tasks button.completed { border-color: #97d7b3; background: #edf9f2; }
.shoot-tasks button.completed .task-check { border-color: #23965f; background: #23965f; color: white; }
.shoot-plan-status { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.studio-entry { margin-top: 18px; }
.recording-studio { margin-top: 22px; padding-top: 22px; border-top: 1px solid #cfe8da; }
.studio-head, .teleprompter-head, .studio-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.studio-head h3 { margin: 3px 0 16px; }
.studio-layout { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(320px, 1.2fr); gap: 16px; }
.camera-stage { position: relative; min-height: 440px; overflow: hidden; border-radius: 18px; background: #111; }
.camera-stage video { width: 100%; height: 100%; min-height: 440px; object-fit: cover; }
.camera-placeholder { position: absolute; inset: 0; display: grid; margin: 0; place-items: center; color: #bbb; }
.recording-badge { position: absolute; top: 14px; left: 14px; padding: 7px 10px; border-radius: 999px; background: rgba(0,0,0,.72); color: white; font-size: 12px; }
.recording-badge i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: #ff3b30; animation: status-pulse 1s infinite; }
.teleprompter { display: flex; min-height: 440px; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #101214; color: white; }
.teleprompter-head { padding: 14px 16px; border-bottom: 1px solid #303236; }
.teleprompter-head > div { display: flex; align-items: center; gap: 10px; }
.import-script-button { padding: 5px 9px; border: 1px solid #4a4f55; border-radius: 8px; background: #25282c; color: white; cursor: pointer; font: inherit; font-size: 12px; }
.import-script-button:hover { border-color: #7c858f; background: #30343a; }
.teleprompter-head span { overflow: hidden; color: #9ca3af; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.teleprompter-script { flex: 1; max-height: 380px; overflow-y: auto; padding: 38% 22px; font-size: 32px; line-height: 1.55; scroll-behavior: smooth; }
.teleprompter-script p { margin: 0 0 22px; color: #697079; transition: color .2s, transform .2s; }
.teleprompter-script p.active { color: white; transform: scale(1.02); }
.teleprompter-script p[contenteditable="true"] { border-radius: 7px; outline: none; }
.teleprompter-script p[contenteditable="true"]:focus { color: white; background: #202328; box-shadow: 0 0 0 6px #202328; }
.teleprompter-script .prompter-empty { color: #8a9199; }
.teleprompter-controls { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid #303236; }
.teleprompter-controls label { display: flex; align-items: center; gap: 6px; margin-right: auto; color: #aaa; font-size: 12px; }
.teleprompter .text-button { color: white; }
.studio-actions { justify-content: flex-start; margin-top: 16px; flex-wrap: wrap; }
.studio-actions .danger-button { color: white; border-color: #c63229; background: #d83a31; }
.studio-status { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.quick-editor { margin-top: 20px; padding: 20px; border: 1px solid #d9d2cc; border-radius: 18px; background: #fffaf7; }
.quick-editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.quick-editor-head h4 { margin: 3px 0 16px; font-size: 20px; }
.quick-editor-head > span { padding: 6px 10px; border-radius: 999px; background: #f1e8e2; color: var(--muted); font-size: 12px; font-weight: 700; }
.template-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.template-options button { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: white; color: var(--ink); text-align: left; cursor: pointer; }
.template-options button.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(225,91,50,.12); }
.template-options small, .edit-status { color: var(--muted); font-size: 12px; }
.edit-control-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; }
.edit-control-grid label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.edit-control-grid input[type="number"], .edit-control-grid input[type="text"], .edit-control-grid input:not([type]) { padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: white; font: inherit; }
.edit-control-grid .edit-check { display: flex; align-items: center; flex-direction: row; }
.edit-check input { width: auto; height: auto; }
.edited-preview { display: flex; align-items: flex-start; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.edited-preview video { width: min(100%, 300px); aspect-ratio: 9 / 16; border-radius: 14px; background: #111; }
.edited-preview a { display: inline-flex; text-decoration: none; }
@media (max-width: 720px) { .shoot-tasks { grid-template-columns: 1fr; } .shoot-date { align-items: flex-start; flex-direction: column; } }
@media (max-width: 820px) { .studio-layout { grid-template-columns: 1fr; } .camera-stage, .camera-stage video { min-height: 360px; } .template-options, .edit-control-grid { grid-template-columns: 1fr; } }
.primary-link { color: var(--ink); text-underline-offset: 6px; text-decoration-thickness: 1px; font-weight: 700; }
.primary-link span { color: var(--accent); margin-left: 8px; }

.library { padding: 64px 0 100px; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 32px; }
h2 { margin: 0; font-size: clamp(30px, 4vw, 46px); letter-spacing: -.04em; }
.data-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.filter-button { border: 0; background: transparent; color: var(--muted); padding: 8px 13px; border-radius: 999px; cursor: pointer; }
.filter-button.active { color: var(--ink); background: var(--soft); font-weight: 600; }
.case-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.viral-discovery-panel { margin: 26px 0 50px; padding: 24px; border: 1px solid #bde5cf; border-radius: 22px; background: linear-gradient(145deg,#f4fbf7,#fff); }
.viral-discovery-panel .mini-heading { align-items: flex-start; }
.viral-discovery-panel h2 { font-size: 30px; }
#viral-discovery-status { color: var(--muted); font-size: 12px; }
.viral-card-cover { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: #ece7e2; }
.viral-score { color: #156b48; font-weight: 800; }
.personalized-recommendations { padding: 52px 0 68px; border-top: 1px solid var(--line); }
#personalized-recommendation-status { color: var(--muted); font-size: 12px; }
.recommendation-group { margin-top: 34px; }
.recommendation-group-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.recommendation-group-heading h3 { margin: 0; font-size: 25px; }
.recommendation-group-heading span { color: var(--muted); font-size: 12px; }
.recommendation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.recommendation-card { overflow: hidden; display: grid; grid-template-columns: minmax(160px, 180px) minmax(0, 1fr); min-height: 300px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); }
.recommendation-cover { position: relative; display: grid; min-width: 0; min-height: 300px; place-items: center; overflow: hidden; background: #eceff3; }
.recommendation-cover > img { display: block; width: 100%; height: 100%; max-height: 100%; object-fit: contain; object-position: center; }
.recommendation-cover-placeholder { width: 100%; height: 100%; min-height: 300px; padding: 18px; place-items: center; color: var(--muted); background: var(--soft); text-align: center; font-size: 12px; font-weight: 800; }
.recommendation-cover-placeholder:not([hidden]) { display: grid; }
.recommendation-card-body { min-width: 0; padding: 20px; }
.recommendation-card h4 { margin: 0 0 9px; font-size: 19px; line-height: 1.35; }
.recommendation-author { margin: 0; color: var(--muted); font-size: 12px; }
.recommendation-metrics { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 12px 0; color: var(--muted); font-size: 12px; }
.recommendation-reason { padding: 12px; border-radius: 12px; background: #f5f1e8; }
.recommendation-reason span, .recommendation-borrow > span { font-size: 11px; font-weight: 800; color: var(--muted); }
.recommendation-reason p { margin: 5px 0 0; font-size: 13px; line-height: 1.55; }
.recommendation-borrow { margin-top: 12px; }
.recommendation-borrow div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.recommendation-borrow b { padding: 5px 8px; border-radius: 999px; background: #eef7f1; color: #216340; font-size: 11px; }
.recommendation-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.recommendation-source-link { display: inline-flex; align-items: center; justify-content: center; color: var(--ink); text-decoration: none; }
.feedback-button, .recommendation-feedback-reasons button { padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: white; cursor: pointer; font-size: 11px; }
.recommendation-feedback-reasons { margin-top: 10px; padding: 10px; border-radius: 10px; background: var(--soft); }
.recommendation-feedback-reasons span { display: block; margin-bottom: 7px; font-size: 11px; color: var(--muted); }
.recommendation-feedback-reasons button { margin: 0 5px 5px 0; }
.recommendation-feedback-status { display: block; min-height: 16px; margin-top: 7px; color: #216340; }
@media (max-width: 1080px) {
  .recommendation-grid { grid-template-columns: 1fr; }
  .recommendation-card { grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); }
}
.demo-section-heading { margin-top: 12px; }
.link-parser { margin-bottom: 26px; padding: 26px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; }
.link-parser h3 { margin: 0 0 18px; font-size: 22px; }
#link-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.parser-status { min-height: 0; margin: 16px 0 0; padding: 14px 16px; border-left: 5px solid #ff5a36; border-radius: 10px; background: #fff0e9; color: #77240f; font-size: 16px; font-weight: 650; line-height: 1.6; }
.parser-status:empty { display: none; }
.parser-status.is-loading::before { content: "●"; display: inline-block; margin-right: 9px; color: #ff4f29; animation: status-pulse 1s ease-in-out infinite; }
.parser-status.is-success { border-left-color: #23845b; background: #eaf7f0; color: #155b3e; }
.parser-status.is-success::before { content: "✓"; margin-right: 9px; font-weight: 800; }
.parser-status.is-error { border-left-color: #c93620; background: #fff0ee; color: #8f2415; }
.parser-status.is-error::before { content: "!"; display: inline-grid; width: 20px; height: 20px; margin-right: 9px; place-items: center; border-radius: 50%; background: #c93620; color: white; font-size: 13px; }
@keyframes status-pulse { 50% { opacity: .3; transform: scale(.82); } }
.manual-fallback { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.manual-fallback > p { color: var(--muted); font-size: 13px; }
.fallback-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
#manual-case-form, #manual-text-fields { display: grid; gap: 10px; }
#manual-case-form textarea { min-height: 88px; }
.metric-inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.upload-box { display: grid; place-items: center; min-height: 120px; border: 1px dashed #aaa69b; border-radius: 14px; color: var(--muted); cursor: pointer; }
.upload-box input { display: none; }
.case-card { min-height: 350px; padding: 24px; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 22px; transition: transform .2s ease, box-shadow .2s ease; }
.case-card:hover { transform: translateY(-3px); box-shadow: 0 18px 46px rgba(37, 31, 22, .08); }
.card-meta, .platform-line { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.platform-badge { color: var(--ink); padding: 4px 8px; border-radius: 7px; background: var(--soft); font-weight: 700; }
.low-follower-badge { color: white; padding: 4px 8px; border-radius: 7px; background: var(--accent); font-weight: 800; }
.demo-badge { color: #6f6659; background: #eee9df; }
.creator-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.creator-line strong { color: var(--ink); }
.explosion-rate { color: var(--accent-dark); font-weight: 800; }
.source-evidence { margin-top: 24px; padding: 20px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.evidence-heading, .evidence-stats { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.evidence-heading { justify-content: space-between; }
.evidence-heading a { color: var(--accent-dark); font-size: 13px; font-weight: 700; }
.evidence-stats { margin: 14px 0; }
.evidence-stats span { padding: 6px 9px; border-radius: 8px; background: #f1eee7; color: #645d52; font-size: 12px; }
.evidence-details { padding: 12px 0; border-top: 1px solid var(--line); }
.evidence-details summary { cursor: pointer; font-weight: 750; }
.evidence-details > p { white-space: pre-wrap; line-height: 1.8; color: var(--muted); }
.evidence-comments blockquote { margin: 12px 0 0; padding-left: 12px; border-left: 2px solid var(--accent); line-height: 1.6; }
.evidence-comments small { display: block; margin-top: 4px; color: var(--muted); }
.evidence-note { display: block; margin-top: 8px; color: var(--muted); line-height: 1.5; }
.evidence-retry { margin: 0 0 12px; }
.reference-blueprint { margin: 10px 0; padding-left: 22px; color: var(--ink); line-height: 1.8; }
.reference-blueprint b { color: var(--accent-dark); }
.case-card h3 { margin: 24px 0 12px; font-size: 23px; line-height: 1.35; letter-spacing: -.025em; }
.card-preview { margin: 0; color: var(--muted); line-height: 1.75; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0; }
.content-tag { color: #7d4a3d; background: #fff0eb; padding: 5px 8px; border-radius: 6px; font-size: 11px; }
.card-actions { display: flex; gap: 9px; margin-top: auto; }
.card-actions button { flex: 1; border-radius: 11px; padding: 11px; cursor: pointer; font-weight: 700; }
.outline-button { border: 1px solid var(--line); background: transparent; }
.solid-small { border: 1px solid var(--ink); background: var(--ink); color: white; }
.card-actions .delete-case { flex: 0 0 auto; padding-left: 9px; padding-right: 9px; border: 0; background: transparent; color: var(--muted); font-weight: 600; }
.card-actions .delete-case:hover { color: #b43a23; background: #fff0eb; }
.empty-state { padding: 70px; text-align: center; color: var(--muted); }

.workspace { padding: 40px 0 100px; }
.back-button { margin-bottom: 34px; padding: 8px 0; color: var(--muted); border: 0; background: transparent; cursor: pointer; }
.case-detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: start; }
.detail-intro { position: static; padding: 28px 0 10px; }
.detail-intro .original-copy { max-width: 980px; }
.detail-intro h2 { margin: 22px 0 18px; font-size: clamp(34px, 4vw, 54px); line-height: 1.15; }
.original-copy { color: var(--muted); font-size: 16px; line-height: 1.9; }
.analysis-panel, .composer, .result { width: 100%; padding: clamp(24px, 4vw, 42px); background: var(--card); border: 1px solid var(--line); border-radius: 26px; }
.analysis-panel h3, .composer h3, .result h3 { margin: 0; font-size: 30px; letter-spacing: -.035em; }
.decision-summary { display: grid; grid-template-columns: 180px 1fr 1fr; gap: 12px; margin: 28px 0; }
.recommend-score, .decision-card { padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.recommend-score { grid-row: span 2; display: flex; flex-direction: column; justify-content: space-between; background: var(--ink); color: white; }
.recommend-score span, .decision-card span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.recommend-score strong { font-size: 50px; }
.recommend-score small { font-size: 14px; color: #aaa99f; }
.decision-card ol { margin: 12px 0 0; padding-left: 20px; line-height: 1.7; }
.decision-card p { margin: 12px 0 0; line-height: 1.7; }
.decision-card.advice { grid-column: 2 / -1; background: #fff4ef; }
.full-analysis { margin-bottom: 24px; }
.full-analysis summary { padding: 15px 0; cursor: pointer; font-weight: 750; }
.analysis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 28px 0; background: var(--line); border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.analysis-item { min-height: 130px; padding: 20px; background: var(--card); }
.analysis-item span, .hook-card span, .structure-box > span { display: block; margin-bottom: 9px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.analysis-item p { margin: 0; font-size: 14px; line-height: 1.7; }
.structure-box { padding: 22px; margin-bottom: 24px; border-radius: 15px; background: var(--ink); color: white; }
.structure-box > span { color: #aaa99f; }
.structure-box ol { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: flow; }
.structure-box li { counter-increment: flow; display: flex; align-items: center; gap: 6px; font-size: 13px; }
.structure-box li::before { content: counter(flow); display: grid; place-items: center; width: 21px; height: 21px; color: var(--ink); background: white; border-radius: 50%; font-size: 10px; font-weight: 800; }
.structure-box li:not(:last-child)::after { content: "→"; margin-left: 4px; color: #77776f; }
.learning-guide { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px; }
.learning-card { padding: 18px; border: 1px solid var(--line); border-radius: 14px; }
.learning-card:last-child { grid-column: 1 / -1; }
.rhythm-card { grid-column: 1 / -1; }
.rhythm-list { display: grid; gap: 9px; }
.rhythm-list p { display: grid; grid-template-columns: 90px 110px 1fr; gap: 8px; align-items: baseline; }
.rhythm-list small { color: var(--muted); }
.learning-card span { display: block; margin-bottom: 9px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.learning-card p, .learning-card li { margin: 0; font-size: 13px; line-height: 1.7; }
.learning-card ul { margin: 0; padding-left: 18px; }
.difficulty-stars { color: var(--accent); letter-spacing: 2px; }
.primary-button, .secondary-button, .text-button { border: 0; border-radius: 12px; padding: 14px 20px; cursor: pointer; font-weight: 700; }
.primary-button { background: var(--accent); color: white; }
.primary-button:hover { background: var(--accent-dark); }
.secondary-button { color: var(--ink); background: var(--soft); }
.text-button { color: var(--muted); background: transparent; }

.composer, .result { max-width: none; margin: 28px 0 0; }
.composer-heading > p:last-child { color: var(--muted); }
.guided-chat { max-width: 820px; margin-top: 26px; padding: 22px; border: 1px solid #ead8ce; border-radius: 18px; background: #fffaf7; }
.guided-chat-head { display: flex; justify-content: space-between; align-items: start; gap: 18px; padding-bottom: 16px; border-bottom: 1px solid #efe2da; }
.guided-chat-head span, .guided-chat-head strong { display: block; }
.guided-chat-head span { font-weight: 800; }
.guided-chat-head strong { margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 600; }
.guided-chat-head button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.chat-thread { display: grid; gap: 12px; padding: 20px 0 16px; }
.chat-bubble { width: fit-content; max-width: 88%; padding: 12px 15px; border-radius: 14px; line-height: 1.65; }
.chat-bubble.assistant { border-bottom-left-radius: 4px; background: #f0ebe5; }
.chat-bubble.user { justify-self: end; border-bottom-right-radius: 4px; background: #ffebe2; color: #6f2817; }
.guide-choices { display: flex; flex-wrap: wrap; gap: 9px; }
.guide-choices button { padding: 10px 14px; border: 1px solid #e5c9bb; border-radius: 10px; background: white; color: var(--ink); font-weight: 700; cursor: pointer; }
.guide-choices button:hover { border-color: var(--accent); background: #fff2ec; }
.guide-answer textarea { min-height: 96px; background: white; }
.guide-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.guide-actions .primary-button { min-width: 120px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.creation-reference { margin-top: 24px; padding: 18px; border-radius: 14px; background: var(--soft); }
.creation-reference > span, .ai-explanation > span { display: block; margin-bottom: 10px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.reference-promise { margin: 0; font-size: 16px; line-height: 1.65; }
.reference-note, .reference-persona { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.reference-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.reference-grid p { margin: 0; font-size: 12px; line-height: 1.6; }
.reference-grid strong { display: block; color: var(--muted); font-size: 10px; }
#script-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 28px; }
.material-guide { padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: #fff; }
.guide-title { display: block; margin-bottom: 12px; font-weight: 800; }
.material-modes { display: flex; flex-wrap: wrap; gap: 10px; }
.material-modes button { padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font-weight: 700; cursor: pointer; }
.material-modes button:hover, .material-modes button.active { color: var(--accent-dark); border-color: var(--accent); background: #fff4ef; }
.personal-example { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--soft); }
.personal-example p { margin: 5px 0 0; color: var(--muted); line-height: 1.55; }
.personal-example button { flex: 0 0 auto; padding: 9px 12px; border: 0; border-radius: 9px; color: white; background: var(--ink); font-weight: 750; cursor: pointer; }
.field { display: grid; gap: 9px; }
.field-wide { grid-column: 1 / -1; }
.field > span { font-size: 13px; font-weight: 700; }
.field small { color: var(--muted); font-size: 11px; line-height: 1.6; }
.voice-capture { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.voice-capture button { min-height: 36px; }
.voice-capture button.is-recording { background: var(--accent); border-color: var(--accent); color: white; }
.voice-capture span { color: var(--muted); font-size: 11px; }
.inline-dictation { display: flex; align-items: center; gap: 8px; margin-top: -2px; }
.inline-dictation button { min-height: 32px; padding: 6px 10px; font-size: 12px; }
.inline-dictation button.is-recording { background: var(--accent); border-color: var(--accent); color: white; }
.inline-dictation span { color: var(--muted); font-size: 11px; line-height: 1.4; }
.field b { color: var(--accent); font-size: 10px; margin-left: 4px; }
.field em { color: var(--muted); font-size: 10px; font-style: normal; margin-left: 4px; }
textarea, input, select { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #faf9f5; color: var(--ink); outline: none; }
textarea { min-height: 134px; padding: 16px; resize: vertical; line-height: 1.7; }
input, select { height: 48px; padding: 0 14px; }
textarea:focus, input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 90, 54, .1); }
.form-error { grid-column: 1 / -1; min-height: 18px; margin: -4px 0; color: #bf3217; font-size: 12px; }
.follow-up { grid-column: 1 / -1; padding: 18px; border-radius: 14px; background: #fff0eb; }
.generate-button { grid-column: 1 / -1; min-height: 52px; position: relative; }
.loader { display: none; width: 18px; height: 18px; margin: auto; border: 2px solid rgba(255,255,255,.4); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
.is-loading .button-label { display: none; }
.is-loading .loader { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.result-top { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.fallback-banner { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; padding: 18px; border: 1px solid #e6b35d; border-radius: 14px; background: #fff7e6; }
.fallback-banner[hidden] { display: none; }
.fallback-banner strong { color: #8a5710; white-space: nowrap; }
.fallback-banner p { flex: 1; margin: 0; color: #725326; line-height: 1.6; }
.script-modes { display: flex; gap: 8px; margin-top: 24px; padding: 5px; border-radius: 13px; background: var(--soft); width: fit-content; }
.blind-test { display: flex; align-items: center; gap: 8px; margin-top: 20px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #faf9f5; }
.blind-test[hidden] { display: none; }
.blind-test div { flex: 1; }
.blind-test strong, .blind-test span { display: block; }
.blind-test span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.blind-test > button:not(.text-button) { padding: 9px 14px; border: 1px solid var(--line); border-radius: 9px; background: white; cursor: pointer; font-weight: 800; }
.blind-test > button.active { color: white; border-color: var(--ink); background: var(--ink); }
.script-modes button { border: 0; border-radius: 9px; padding: 10px 14px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; }
.script-modes button.active { background: white; color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.script-section p::selection { background: #ffd5c7; }
.ready-button { margin-left: auto; background: #23845b; }
.generation-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(23,23,20,.52); backdrop-filter: blur(4px); }
.generation-overlay[hidden] { display: none; }
.generation-overlay > div { min-width: 280px; padding: 30px; border-radius: 20px; background: white; text-align: center; }
.generation-overlay .loader { display: block; margin: 0 auto 16px; border-color: #ead8ce; border-top-color: var(--accent); }
.result { position: relative; }
.result-refining { position: absolute; inset: 0; z-index: 20; display: grid; place-items: start center; padding-top: min(28vh, 280px); border-radius: inherit; background: rgba(244,247,252,.68); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.result-refining[hidden] { display: none; }
.result-refining > div { position: sticky; top: 120px; display: grid; justify-items: center; gap: 10px; min-width: 300px; padding: 26px 32px; border: 1px solid rgba(255,255,255,.88); border-radius: 22px; background: rgba(255,255,255,.88); box-shadow: var(--glass-shadow); text-align: center; }
.result-refining .loader { display: block; margin-bottom: 4px; }
.result-refining small { color: var(--muted); }
#selected-preview { padding: 13px; border-radius: 10px; background: var(--soft); color: var(--muted); line-height: 1.6; }
#rewrite-form { position: relative; padding: 28px; }
#rewrite-form h3 { margin: 0 0 18px; }
#manual-replacement { min-height: 90px; margin: 14px 0 0; }
.rewrite-instruction-label { display: flex; align-items: baseline; gap: 8px; margin-top: 20px; font-weight: 650; }
.rewrite-instruction-label span, .rewrite-instruction-tip { color: var(--muted); font-size: 13px; font-weight: 400; }
.rewrite-instruction-tip { margin: 8px 2px 0; line-height: 1.55; }
.variant-edit-note { margin: 10px 2px 18px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.direction-panel { margin-top: 24px; padding: 28px; border: 1px solid rgba(255,255,255,.8); border-radius: 26px; background: rgba(255,255,255,.62); box-shadow: var(--glass-shadow); }
.direction-source-summary { margin: 18px 0; padding: 16px 18px; border-radius: 16px; background: rgba(232,237,246,.7); color: var(--muted); line-height: 1.65; }
.direction-cards { display: grid; gap: 14px; }
.direction-card { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; width: 100%; padding: 20px; border: 1px solid rgba(30,38,52,.1); border-radius: 18px; background: rgba(255,255,255,.78); text-align: left; cursor: pointer; }
.direction-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(20,112,240,.12); }
.direction-card input { margin-top: 5px; }
.direction-card strong, .direction-card span, .direction-card small { display: block; }
.direction-card span { margin-top: 8px; line-height: 1.55; }
.direction-card small { margin-top: 10px; color: var(--muted); line-height: 1.5; }
.direction-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.direction-custom { margin-top: 18px; }
.title-candidates { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.title-candidates button { padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.duration-chip { white-space: nowrap; padding: 6px 10px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 11px; }
.hook-card { margin: 26px 0 20px; padding: 20px; background: #fff0eb; border-radius: 15px; }
.hook-card span { color: var(--accent-dark); }
.hook-card p { margin: 0; font-size: 20px; font-weight: 800; line-height: 1.5; }
.script-section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.script-section:last-child { border-bottom: 0; }
.script-label { margin-bottom: 7px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.script-section p { margin: 0; font-size: 16px; line-height: 1.95; white-space: pre-line; }
.ai-explanation { margin-top: 20px; padding: 18px; border-radius: 14px; background: #f2efe6; }
.ai-explanation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ai-explanation p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.ai-explanation strong { color: var(--ink); }
.evidence-research-panel, .evidence-references { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(31, 38, 35, .12); }
.evidence-research-panel > p, .evidence-candidate p, .evidence-references p { margin: 8px 0; }
.evidence-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.evidence-actions button { width: auto; min-height: 36px; padding: 8px 12px; }
.evidence-candidate { margin-top: 12px; padding: 14px; border: 1px solid rgba(31, 38, 35, .12); border-radius: 12px; background: rgba(255,255,255,.65); }
.evidence-candidate small, .evidence-references small { color: var(--muted); }
.evidence-loading { color: var(--muted); }
.evidence-references a { color: var(--accent); font-weight: 700; }
.result-actions { display: flex; gap: 8px; margin-top: 26px; flex-wrap: wrap; }
.copy-status { min-height: 18px; margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.feedback-panel { display: grid; gap: 18px; margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.asset-save-prompt { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding: 16px; border-radius: 14px; background: #eef7f1; }
.asset-save-prompt[hidden] { display: none; }
.asset-save-prompt div { flex: 1; }
.asset-save-prompt p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.video-maker { margin-top: 28px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fffaf7; }
.video-maker-head, .video-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.video-maker-head h3 { margin: 3px 0 0; font-size: 21px; }
.video-maker-note { color: var(--muted); font-size: 13px; line-height: 1.7; }
.asset-picker { display: grid; gap: 8px; margin: 18px 0; padding: 16px; border: 1px dashed #d9b9aa; border-radius: 13px; background: white; }
.asset-picker span { font-weight: 800; }
.asset-picker input { height: auto; padding: 0; border: 0; background: transparent; }
.asset-picker small, #video-status { color: var(--muted); font-size: 12px; }
.video-preview { margin-top: 20px; }
.video-preview video { display: block; width: min(100%, 360px); aspect-ratio: 9 / 16; margin-bottom: 12px; border-radius: 16px; background: #171714; box-shadow: 0 14px 35px rgba(34,24,19,.16); }
.video-preview .secondary-button { display: inline-flex; text-decoration: none; }
.feedback-panel span { display: block; margin-bottom: 9px; font-size: 13px; font-weight: 700; }
.choice-row, .score-row { display: flex; flex-wrap: wrap; gap: 7px; }
.choice-row button, .score-row button, .reason-grid button { padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.choice-row button.selected, .score-row button.selected, .reason-grid button.selected { color: white; border-color: var(--ink); background: var(--ink); }
dialog { width: min(520px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 22px; background: var(--card); box-shadow: 0 24px 80px rgba(0,0,0,.2); }
dialog::backdrop { background: rgba(23,23,20,.42); backdrop-filter: blur(3px); }
#personalize-form { position: relative; padding: 28px; }
#personalize-form h3 { margin: 0 0 18px; font-size: 26px; }
.dialog-close { position: absolute; top: 18px; right: 18px; }
.reason-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
#personalize-note { min-height: 90px; margin-bottom: 12px; }
#regenerate-dialog { overflow: hidden; }
#regenerate-form {
  position: relative;
  box-sizing: border-box;
  max-height: min(760px, calc(100vh - 40px));
  padding: 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#regenerate-form .eyebrow { margin-bottom: 14px; padding-right: 64px; }
#regenerate-form h3 { margin: 0 0 14px; font-size: 26px; line-height: 1.25; }
#regenerate-form .reference-note { margin: 0 0 16px; }
#regenerate-form .reason-grid { margin-bottom: 16px; }
#regenerate-note { min-height: 112px; margin-bottom: 16px; }
#apply-regenerate { display: block; width: fit-content; max-width: 100%; }
footer { padding: 40px 28px 60px; text-align: center; color: var(--muted); font-size: 12px; }

/* Apple-inspired glass visual system */
:root {
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --paper: #f5f5f7;
  --card: rgba(255, 255, 255, .72);
  --accent: #0071e3;
  --accent-dark: #0066cc;
  --line: rgba(29, 29, 31, .10);
  --soft: rgba(118, 118, 128, .10);
  --glass-shadow: 0 18px 55px rgba(25, 33, 48, .08), 0 2px 8px rgba(25, 33, 48, .04);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 4%, rgba(123, 180, 255, .22), transparent 30%),
    radial-gradient(circle at 88% 14%, rgba(202, 170, 255, .16), transparent 26%),
    linear-gradient(180deg, #f9fbff 0%, #f4f5f8 44%, #eef1f5 100%);
  background-attachment: fixed;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -.008em;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 50;
  height: 64px;
  margin-top: 12px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 20px;
  background: rgba(255,255,255,.64);
  box-shadow: 0 10px 35px rgba(31,38,55,.07);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
}
.brand { font-weight: 700; letter-spacing: -.02em; }
.brand-mark { border-radius: 9px; background: linear-gradient(145deg, #2997ff, #0066cc); box-shadow: 0 5px 14px rgba(0,113,227,.25); }
.main-nav { border: 1px solid rgba(255,255,255,.66); border-radius: 11px; background: rgba(118,118,128,.09); }
.main-nav button { border-radius: 8px; font-weight: 600; transition: .2s ease; }
.main-nav button.active { background: rgba(255,255,255,.88); box-shadow: 0 2px 10px rgba(0,0,0,.07); }
.persona-entry { border-color: rgba(29,29,31,.12); border-radius: 999px; background: rgba(255,255,255,.45); }

main { max-width: 1240px; }
.hero { min-height: 480px; padding-top: 94px; }
.hero::after { width: 280px; height: 280px; background: #2997ff; opacity: .10; filter: blur(38px); }
.eyebrow { color: var(--accent); font-weight: 700; letter-spacing: .12em; }
h1 { max-width: 880px; font-weight: 700; line-height: 1.03; letter-spacing: -.06em; }
h1 span { background: linear-gradient(90deg, #0066cc, #6e5ce6); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2, .detail-intro h2, .analysis-panel h3, .composer h3, .result h3 { font-weight: 680; letter-spacing: -.04em; }
.hero-copy { max-width: 720px; font-size: 18px; line-height: 1.7; }

.persona-panel,
.cases-split > section,
.task-entries article,
.link-parser,
.case-card,
.source-evidence,
.analysis-panel,
.composer,
.result,
.creation-reference,
.material-guide,
.guided-chat,
.video-maker,
.decision-card,
.recommend-score,
.learning-card,
.ai-explanation {
  border: 1px solid rgba(255,255,255,.72);
  background: rgba(255,255,255,.64);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
}
.persona-panel, .analysis-panel, .composer, .result { border-radius: 28px; }
.cases-split > section, .task-entries article, .link-parser, .case-card { border-radius: 22px; }
.case-card { min-height: 340px; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.case-card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,.95); box-shadow: 0 24px 60px rgba(25,33,48,.12); }
.card-preview, .original-copy, .evidence-details > p { line-height: 1.85; }

.primary-button, .secondary-button, .text-button, .card-actions button {
  border-radius: 999px;
  font-weight: 620;
  letter-spacing: -.01em;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.primary-button { background: linear-gradient(180deg, #1683ed, #0071e3); box-shadow: 0 7px 18px rgba(0,113,227,.20); }
.primary-button:hover { background: linear-gradient(180deg, #0878e5, #0066cc); box-shadow: 0 9px 24px rgba(0,113,227,.27); transform: translateY(-1px); }
.primary-button:active, .secondary-button:active, .card-actions button:active { transform: scale(.98); }
.secondary-button { background: rgba(118,118,128,.11); }
.solid-small { border-color: #1d1d1f; background: #1d1d1f; }
.ready-button { background: linear-gradient(180deg, #32a66d, #248a5a); box-shadow: 0 7px 18px rgba(36,138,90,.18); }

textarea, input, select {
  border: 1px solid rgba(29,29,31,.11);
  border-radius: 14px;
  background: rgba(255,255,255,.60);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
textarea { padding: 17px 18px; line-height: 1.8; }
input, select { height: 50px; }
textarea:focus, input:focus, select:focus { border-color: rgba(0,113,227,.56); box-shadow: 0 0 0 4px rgba(0,113,227,.12), inset 0 1px 0 rgba(255,255,255,.8); }
.field > span { font-size: 14px; font-weight: 620; }
.field small, .voice-capture span, .inline-dictation span { color: #77777c; font-size: 12px; }

.structure-box, .recommend-score { background: rgba(29,29,31,.92); border-color: rgba(255,255,255,.12); }
.decision-card.advice, .hook-card, .follow-up { background: rgba(0,113,227,.07); border: 1px solid rgba(0,113,227,.10); }
.hook-card span, .script-label { color: var(--accent); }
.hook-card p { font-weight: 680; letter-spacing: -.02em; }
.script-section { padding: 22px 2px; }
.script-section p { max-width: 900px; font-size: 17px; line-height: 2; letter-spacing: .005em; }
.script-modes { padding: 4px; border: 1px solid rgba(255,255,255,.7); background: rgba(118,118,128,.10); }
.script-modes button.active { background: rgba(255,255,255,.92); box-shadow: 0 2px 9px rgba(0,0,0,.07); }
.content-tag { color: #285b8f; background: rgba(0,113,227,.08); border-radius: 999px; }
.platform-badge, .evidence-stats span, .duration-chip, .project-status { border-radius: 999px; background: rgba(118,118,128,.10); }
.low-follower-badge { border-radius: 999px; background: #0071e3; }
.parser-status { border: 1px solid rgba(0,113,227,.12); border-left: 4px solid var(--accent); background: rgba(0,113,227,.07); color: #174c7d; }

dialog {
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 26px;
  background: rgba(250,250,252,.84);
  box-shadow: 0 30px 100px rgba(20,25,40,.25);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
  backdrop-filter: blur(30px) saturate(170%);
}
dialog::backdrop { background: rgba(18,22,30,.28); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.generation-overlay { background: rgba(225,230,239,.52); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.generation-overlay > div { border: 1px solid rgba(255,255,255,.82); background: rgba(255,255,255,.78); box-shadow: var(--glass-shadow); -webkit-backdrop-filter: blur(26px); backdrop-filter: blur(26px); }
.choice-row button, .score-row button, .reason-grid button { border-radius: 999px; background: rgba(255,255,255,.48); }
.choice-row button.selected, .score-row button.selected, .reason-grid button.selected { border-color: #0071e3; background: #0071e3; }
.script-section p::selection { background: rgba(0,113,227,.18); }

@media (max-width: 860px) {
  .case-grid { grid-template-columns: 1fr 1fr; }
  .case-detail { grid-template-columns: 1fr; }
  .detail-intro { position: static; }
  .composer, .result { max-width: none; }
}
@media (max-width: 620px) {
  .topbar, main { padding-left: 18px; padding-right: 18px; }
  .tagline { display: none; }
  .topbar { flex-wrap: wrap; }
  .main-nav { order: 3; width: 100%; justify-content: stretch; }
  .main-nav button { flex: 1; }
  .persona-entry { padding: 8px 10px; font-size: 11px; }
  #persona-form { grid-template-columns: 1fr; }
  #persona-form > button, #persona-form .field-wide { grid-column: auto; }
  .hero { min-height: 430px; padding-top: 82px; }
  #regenerate-form { max-height: calc(100vh - 24px); padding: 26px 20px 22px; }
  #regenerate-form .dialog-close { top: 14px; right: 14px; }
  #apply-regenerate { width: 100%; }
  .task-entries { grid-template-columns: 1fr; }
  .cases-split { grid-template-columns: 1fr; }
  .task-entries article { padding: 20px; }
  .project-row { grid-template-columns: minmax(0, 1fr) auto; }
  .project-row button { grid-column: 1 / -1; }
  .section-heading { align-items: start; flex-direction: column; }
  .filters { justify-content: flex-start; }
  .case-grid, .analysis-grid { grid-template-columns: 1fr; }
  .recommendation-grid { grid-template-columns: 1fr; }
  .recommendation-card { grid-template-columns: 1fr; }
  .recommendation-cover { min-height: 0; aspect-ratio: 16 / 10; }
  .recommendation-cover > img { position: absolute; inset: 0; }
  .recommendation-cover-placeholder { min-height: 0; }
  .decision-summary { grid-template-columns: 1fr; }
  .recommend-score { grid-row: auto; min-height: 150px; }
  .decision-card.advice { grid-column: auto; }
  #link-form, .metric-inputs { grid-template-columns: 1fr; }
  .learning-guide, .reference-grid, .ai-explanation-grid { grid-template-columns: 1fr; }
  .learning-card:last-child { grid-column: auto; }
  .case-card { min-height: 320px; }
  #script-form { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .personal-example { align-items: flex-start; flex-direction: column; }
  .guided-chat { padding: 16px; }
  .guided-chat-head { flex-direction: column; }
  .chat-bubble { max-width: 96%; }
  .form-error, .generate-button { grid-column: auto; }
  .result-top { flex-direction: column; }
  .fallback-banner { align-items: stretch; flex-direction: column; }
  .video-maker-head, .video-actions { align-items: flex-start; flex-direction: column; }
  .asset-save-prompt { align-items: stretch; flex-direction: column; }
  .result-actions button { flex: 1 1 auto; }
  .ready-button { margin-left: 0; }
  .script-modes { width: 100%; overflow-x: auto; }
  .blind-test { align-items: stretch; flex-wrap: wrap; }
  .blind-test div { flex-basis: 100%; }
  .script-modes button { flex: 0 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
