:root {
  --ink: #10231f;
  --ink-soft: #40534e;
  --paper: #f7faf6;
  --white: #ffffff;
  --line: rgba(17, 57, 48, 0.12);
  --mint: #a9e4cc;
  --mint-strong: #43ad88;
  --teal: #176c5d;
  --teal-dark: #0d4e43;
  --lime: #dfff8f;
  --amber: #f4c67b;
  --rose: #f2a7a1;
  --shadow: 0 28px 70px rgba(24, 74, 61, 0.12);
  --radius-xl: 8px;
  --radius-lg: 8px;
  --radius-md: 8px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, #f7f7f1 0%, #f3f6f0 52%, #eef3ef 100%);
  font-family: var(--font);
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.hidden { display: none !important; }
.ambient { display: none; }
.ambient-one { width: 430px; height: 430px; background: rgba(86, 204, 164, .08); left: -160px; top: 44%; }
.ambient-two { width: 300px; height: 300px; background: rgba(223, 255, 143, .15); right: -90px; top: 18%; }

.site-header { position: sticky; top: 0; z-index: 30; height: 76px; display: flex; align-items: center; justify-content: space-between; background: rgba(247,247,241,.86); backdrop-filter: blur(16px); }
.brand { color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 11px; font-size: 20px; letter-spacing: 0; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; color: var(--teal); background: rgba(255,255,255,.86); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(19, 88, 74, .08); }
.brand-mark svg { width: 30px; height: 30px; }
.brand strong { font-weight: 780; }
.brand em { display: block; margin-top: 1px; font-style: normal; color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.header-meta { display: flex; align-items: center; gap: 12px; }
.privacy-pill, .mode-badge, .evidence-badge, .source-badge, .confidence-pill { border-radius: 999px; font-weight: 700; font-size: 12px; }
.privacy-pill { display: flex; gap: 8px; align-items: center; padding: 9px 13px; color: var(--teal-dark); background: rgba(255,255,255,.65); border: 1px solid var(--line); }
.privacy-pill i { width: 7px; height: 7px; background: #52be8a; border-radius: 50%; box-shadow: 0 0 0 4px rgba(82,190,138,.14); }
.ghost-button, .primary-small, .back-link, .text-button { border: 0; }
.ghost-button { padding: 10px 15px; border: 1px solid var(--line); color: var(--ink); background: rgba(255,255,255,.72); border-radius: 8px; font-weight: 700; }
.ghost-button:hover { background: white; }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 430px); gap: 24px 54px; align-items: end; text-align: left; max-width: 1180px; margin: 46px auto 30px; padding: 18px 0 0; }
.eyebrow, .step-label, .section-kicker { color: var(--teal); font-size: 11px; line-height: 1; font-weight: 850; letter-spacing: .18em; }
.hero h1 { max-width: 720px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(46px, 6vw, 74px); line-height: 1; margin: 14px 0 18px; letter-spacing: 0; font-weight: 500; }
.hero h1 span { color: var(--teal); font-style: italic; }
.hero > p { max-width: 620px; margin: 0; font-size: 18px; line-height: 1.62; color: var(--ink-soft); }
.dictionary-card { grid-column: 2; grid-row: 1 / span 3; max-width: none; margin: 0; padding: 22px 24px 24px; text-align: left; border: 1px solid rgba(16,35,31,.16); border-radius: 4px; background: rgba(255,255,255,.9); box-shadow: 0 18px 44px rgba(24,74,61,.08); }
.dictionary-headword { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; }
.dictionary-headword span { font-family: Georgia, "Times New Roman", serif; color: #172d28; font-size: 36px; line-height: .95; font-weight: 700; }
.dictionary-headword strong { color: #63756f; font-family: Georgia, "Times New Roman", serif; font-size: 16px; font-weight: 500; }
.dictionary-rule { height: 1px; margin: 13px 0 12px; background: linear-gradient(90deg, rgba(16,35,31,.22), transparent); }
.dictionary-card p { position: relative; margin: 0; padding-left: 26px; color: #304740; font-family: Georgia, "Times New Roman", serif; font-size: 17px; line-height: 1.6; }
.dictionary-card p::before { content: "1"; position: absolute; left: 0; top: .15em; color: #6f817b; font-size: 13px; font-weight: 700; }
.dictionary-card em { color: #6d7774; font-style: italic; }
.dictionary-card b { color: var(--teal-dark); font-weight: 700; }
.hero-trust { grid-column: 1 / -1; margin-top: 6px; display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 10px; color: #536660; font-size: 13px; }
.hero-trust span { display: flex; align-items: center; gap: 8px; }
.hero-trust b { display: grid; place-items: center; width: 27px; height: 27px; color: var(--teal); font-size: 10px; border: 1px solid rgba(23,108,93,.18); border-radius: 50%; background: rgba(255,255,255,.55); }

.glass-card { background: rgba(255,255,255,.86); border: 1px solid rgba(17,57,48,.1); box-shadow: 0 16px 50px rgba(24, 74, 61, 0.08); backdrop-filter: blur(18px); }
.workspace { display: block; }
.control-card { width: 100%; border-radius: var(--radius-xl); padding: 26px; }
.control-card form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .72fr); gap: 0 32px; align-items: start; }
.control-card .source-panel, .control-card .source-tabs { grid-column: 1 / -1; }
.control-card .divider { grid-column: 1 / -1; }
.form-panel { min-height: 100%; padding: 20px; border-radius: 8px; background: rgba(246,248,244,.78); border: 1px solid rgba(17,57,48,.08); }
.lens-panel { display: flex; flex-direction: column; }
.lens-panel .section-heading { margin-bottom: 20px; }
.lens-panel .primary-button { margin-top: auto; }
.card-heading, .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
h2 { letter-spacing: -.035em; }
.card-heading h2, .section-heading h2 { margin: 7px 0 0; font-size: 24px; }
.mode-badge { padding: 8px 11px; background: #e9f4ef; color: var(--teal); }
.mode-badge.live { background: #def7e9; color: #28744e; }
.mode-badge.demo { background: #fff3d8; color: #8a611e; }
.source-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin: 20px 0 18px; background: #edf4f0; border-radius: 8px; }
.source-tab { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border: 0; border-radius: 10px; background: transparent; color: #677772; font-weight: 750; }
.source-tab svg { width: 18px; }
.source-tab.active { color: var(--teal-dark); background: white; box-shadow: 0 5px 14px rgba(21,77,64,.08); }
label { display: block; margin: 0 0 8px; color: #3b514b; font-size: 13px; font-weight: 750; }
.input-wrap, .select-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > svg, .select-wrap > svg:not(.chevron) { position: absolute; left: 15px; width: 18px; color: #6e827b; pointer-events: none; }
.input-wrap input, .select-wrap select { width: 100%; height: 52px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.9); color: var(--ink); outline: none; }
.input-wrap input { padding: 0 16px 0 44px; }
.select-wrap select { padding: 0 45px 0 44px; appearance: none; }
.input-wrap input:focus, .select-wrap select:focus, .question-form textarea:focus { border-color: rgba(36,142,115,.5); box-shadow: 0 0 0 4px rgba(60,174,141,.10); }
.chevron { position: absolute; right: 14px; width: 16px; pointer-events: none; }
.field-note, .section-copy { color: #74857f; font-size: 12px; line-height: 1.55; }
.field-note { margin: 8px 2px 0; }
.divider { height: 1px; background: var(--line); margin: 27px 0; }
.text-button { background: transparent; color: var(--teal); font-size: 12px; font-weight: 800; padding: 5px 0; }
.section-copy { margin: 11px 0 17px; }
.detail-grid { display: grid; gap: 10px; }
.detail-row { display: grid; grid-template-columns: minmax(110px, 1fr) 174px; align-items: center; gap: 14px; }
.detail-row .detail-label { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 780; color: #314a43; }
.detail-icon { width: 32px; height: 32px; display: grid; place-items: center; color: var(--teal); background: #ecf6f1; border-radius: 9px; font-size: 11px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; background: #edf4f0; border-radius: 11px; }
.segmented button { border: 0; background: transparent; color: #76847f; padding: 8px; border-radius: 8px; font-size: 12px; font-weight: 800; }
.segmented button.active { background: white; color: var(--teal); box-shadow: 0 4px 11px rgba(27,79,66,.08); }
.drop-zone { min-height: 174px; border: 1.5px dashed rgba(32,117,96,.28); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(239,248,243,.65); margin: 0; transition: .2s ease; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--mint-strong); background: rgba(225,246,236,.9); transform: translateY(-1px); }
.drop-zone input { display: none; }
.upload-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: var(--teal); background: white; box-shadow: 0 8px 22px rgba(29,102,84,.1); margin-bottom: 10px; }
.drop-zone strong { font-size: 14px; }
.drop-zone > span:not(.upload-icon) { font-size: 12px; color: #71837d; margin-top: 4px; }
.drop-zone small { color: #94a19d; margin-top: 10px; }
.file-chip { margin-top: 10px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #edf7f2; color: #35564d; border-radius: 11px; font-size: 12px; }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip button { border: 0; background: transparent; color: #6c7b77; font-size: 20px; }
.primary-button { width: 100%; height: 57px; display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 25px; border: 0; border-radius: 8px; color: white; background: linear-gradient(135deg, var(--teal) 0%, #238b73 100%); box-shadow: 0 16px 30px rgba(20,108,89,.18); font-weight: 820; }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 18px 34px rgba(20,108,89,.28); }
.primary-button:disabled, #questionButton:disabled { opacity: .65; cursor: wait; }
.primary-button svg { width: 19px; transition: transform .2s; }
.primary-button:hover svg { transform: translateX(3px); }
.form-error { margin-top: 12px; padding: 11px 13px; border-radius: 11px; background: #fff0ef; color: #9b4540; font-size: 12px; line-height: 1.5; }
.privacy-note { display: flex; gap: 10px; margin-top: 20px; padding: 13px 14px; background: rgba(240,246,243,.75); border-radius: 13px; color: #667872; }
.privacy-note svg { flex: 0 0 auto; width: 19px; margin-top: 1px; color: var(--teal); }
.privacy-note p { margin: 0; font-size: 11px; line-height: 1.55; }
.privacy-note strong { color: #435c54; }

.loading-state { min-height: 620px; display: grid; place-items: center; }
.loading-card { width: min(600px, 100%); padding: 55px; border-radius: var(--radius-xl); text-align: center; }
.pulse-logo { width: 82px; height: 82px; margin: 0 auto 28px; border-radius: 24px; background: #e3f6ed; display: grid; place-items: center; transform: rotate(8deg); }
.pulse-logo span { width: 24px; height: 24px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 0 rgba(23,108,93,.3); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(23,108,93,.3)} 70%{box-shadow:0 0 0 22px rgba(23,108,93,0)} 100%{box-shadow:0 0 0 0 rgba(23,108,93,0)} }
.loading-card h2 { margin: 13px 0 9px; font-size: 31px; }.loading-card > p:not(.eyebrow) { color: #6b7e78; }
.progress-track { height: 7px; margin: 30px 0 17px; border-radius: 10px; overflow: hidden; background: #e2ede8; }
.progress-track span { display: block; width: 8%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint-strong), #9dcc52); transition: width .7s ease; }
.loading-steps { display: flex; justify-content: space-between; color: #9aa7a3; font-size: 11px; font-weight: 700; }.loading-steps span.active{color:var(--teal)}

.results { padding-top: 18px; }
.result-header { position: sticky; top: 76px; z-index: 20; display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding: 12px 0; background: rgba(247,247,241,.92); backdrop-filter: blur(14px); }
.back-link { background: transparent; color: #4e645e; padding: 8px 0; font-weight: 750; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.primary-small { padding: 11px 15px; border-radius: 8px; color: white; background: var(--teal); font-weight: 760; }
.paper-hero { border-radius: var(--radius-xl); padding: 28px 32px; background: #fff; border: 1px solid rgba(17,57,48,.1); box-shadow: 0 12px 38px rgba(15,49,41,.06); }
.paper-meta-row { display: flex; flex-wrap: wrap; gap: 8px; }
.evidence-badge, .source-badge, .confidence-pill { padding: 8px 11px; }
.evidence-badge { color: var(--teal-dark); background: #dff3e9; }.source-badge{color:#6e5e31;background:#f8edcb}
.paper-hero h1 { max-width: 980px; margin: 18px 0 10px; font-family: Georgia, "Times New Roman", serif; font-weight: 500; font-size: clamp(30px, 4vw, 48px); line-height: 1.1; letter-spacing: 0; }
.citation { color: #647771; font-size: 14px; line-height: 1.55; }
.paper-demographics { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.paper-demographics div { display: flex; flex-direction: column; gap: 5px; }.paper-demographics span{color:#81908b;font-size:10px;text-transform:uppercase;letter-spacing:.13em;font-weight:800}.paper-demographics strong{font-size:13px;line-height:1.4}
.result-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; margin-top: 20px; }
.brief-column { display: grid; gap: 14px; }
.take-home-card { display: flex; gap: 18px; padding: 30px; border-radius: var(--radius-lg); color: white; background: #123f37; box-shadow: 0 18px 44px rgba(18,97,81,.16); }
.take-home-icon { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; color: var(--lime); background: rgba(255,255,255,.12); border-radius: 8px; }
.take-home-card span { color: #bcefd9; font-size: 10px; font-weight: 850; letter-spacing: .16em; }.take-home-card h2{margin:7px 0 0;font-size:clamp(24px,3vw,34px);line-height:1.28}
.signal-strip { display: grid; grid-template-columns: 1.25fr .48fr 1fr; gap: 1px; padding: 0; overflow: hidden; border-radius: 8px; background: rgba(17,57,48,.12); }
.signal-card { min-height: 132px; padding: 22px; background: #fff; }
.signal-card span { display: block; margin-bottom: 10px; color: #6e807a; font-size: 9px; line-height: 1; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.signal-card strong { display: block; color: #1b332d; font-size: 17px; line-height: 1.45; font-weight: 780; }
.primary-signal { background: #eef9f3; }
.primary-signal strong { color: #0d4e43; font-size: 20px; line-height: 1.42; }
.caution-signal { background: #fff7e8; }
.caution-signal strong { color: #634b1d; font-size: 15px; line-height: 1.48; }
.summary-section, .practice-card, .appraisal-card { padding: 30px; border-radius: var(--radius-lg); }
.summary-section { background: #fff; border: 1px solid rgba(17,57,48,.1); box-shadow: 0 12px 34px rgba(27,74,63,.06); }
.summary-section-header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.summary-number { width: 37px; height: 37px; display: grid; place-items: center; flex: 0 0 37px; border-radius: 11px; background: #e5f5ed; color: var(--teal); font-size: 12px; font-weight: 850; }
.summary-section h2 { margin: 0; font-size: 24px; }.summary-section h3{margin:2px 0 0;color:#687c75;font-size:13px;font-weight:600;letter-spacing:0}
.section-key-point { position: relative; margin-bottom: 0; padding: 22px 74px 22px 22px; border-left: 5px solid var(--teal); border-radius: 8px; background: #f0fbf5; }
.section-key-point span, .section-detail-label { display: block; color: var(--teal); font-size: 9px; line-height: 1; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.section-key-point strong { display: block; margin-top: 8px; color: #183d35; font-size: 20px; line-height: 1.5; font-weight: 790; }
.section-detail-label { margin-bottom: 8px; color: #758881; }
.section-detail { margin-top: 16px; border-top: 1px solid var(--line); }
.section-detail summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0 6px; color: var(--teal-dark); cursor: pointer; list-style: none; font-weight: 820; }
.section-detail summary::-webkit-details-marker { display: none; }
.section-detail summary b { padding: 7px 10px; border-radius: 999px; background: #edf7f2; color: var(--teal); font-size: 11px; }
.section-detail[open] summary b::before { content: "Hide "; }
.summary-narrative { color: #344c45; line-height: 1.74; font-size: 15px; white-space: pre-line; }
.sentence-unit { position: relative; display: block; padding: 12px 86px 12px 0; border-bottom: 1px solid rgba(17,57,48,.08); }
.sentence-unit:last-child { border-bottom: 0; }
.summary-points { margin: 20px 0 0; padding: 0; list-style: none; display: grid; gap: 11px; }
.summary-points li { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; color: #425a53; line-height: 1.55; font-size: 14px; }.summary-points li::before{display:none}
.high-yield-panel { margin-top: 18px; padding: 16px; border-radius: 12px; background: #f8fbf9; }
.high-yield-panel > span { display: block; color: #758881; font-size: 9px; line-height: 1; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.ask-inline { flex: 0 0 auto; min-width: 48px; height: 29px; padding: 0 10px; border: 1px solid rgba(23,108,93,.18); border-radius: 999px; background: #fff; color: var(--teal); font-size: 11px; font-weight: 850; box-shadow: 0 5px 13px rgba(22,87,72,.06); transition: opacity .16s ease, transform .16s ease, background .16s ease; }
.ask-inline:hover { background: #e8f6ef; border-color: rgba(23,108,93,.28); }
.section-key-point .ask-inline { position: absolute; top: 18px; right: 18px; }
.sentence-unit .ask-inline { position: absolute; top: 9px; right: 0; opacity: 0; transform: translateX(4px); }
.sentence-unit:hover .ask-inline, .sentence-unit:focus-within .ask-inline { opacity: 1; transform: translateX(0); }
.topic-link { display: inline; padding: 0 2px; border: 0; border-bottom: 1.5px solid rgba(23,108,93,.35); background: linear-gradient(transparent 56%, rgba(169,228,204,.36) 56%); color: var(--teal-dark); font-weight: 800; cursor: pointer; }
.topic-link:hover { background: rgba(169,228,204,.45); }
.practice-card h2, .appraisal-card h2 { margin: 8px 0 18px; font-size: 28px; }
.practice-list { display: grid; gap: 10px; }
.practice-item { display: flex; gap: 12px; align-items: center; padding: 13px 14px; border-radius: 8px; background: #f0f7f3; color: #3c554d; font-size: 14px; line-height: 1.5; }
.practice-item span { width: 25px; height: 25px; flex: 0 0 25px; display: grid; place-items: center; border-radius: 8px; background: white; color: var(--teal); font-size: 11px; font-weight: 850; box-shadow: 0 4px 10px rgba(36,91,76,.07); }
.practice-item > div { flex: 1; }
.boundary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.boundary-grid > div { padding: 16px; border-radius: 8px; background: #edf7f2; }.boundary-grid .boundary-warning{background:#fff4e5}
.boundary-grid span { font-size: 10px; letter-spacing: .12em; font-weight: 850; color: #567169; text-transform: uppercase; }.boundary-grid p{margin:7px 0 0;color:#435950;font-size:13px;line-height:1.5}
.appraisal-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }.confidence-pill{background:#e3f4eb;color:var(--teal);text-transform:capitalize}
.appraisal-card > p { color: #5b6f68; line-height: 1.6; }
.appraisal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 18px; }
.appraisal-grid > div { padding: 17px; border-radius: 14px; background: #f3f8f5; }.appraisal-grid > div:last-child{background:#fff5ed}
.appraisal-grid h3 { margin: 0 0 10px; font-size: 13px; }.appraisal-grid ul{margin:0;padding-left:18px;color:#51645e;font-size:13px;line-height:1.55}.appraisal-grid li+li{margin-top:7px}
.verification-note { padding: 15px 17px; border-radius: 8px; color: #66736f; background: rgba(255,255,255,.72); border: 1px solid var(--line); font-size: 12px; line-height: 1.55; }
.question-column { position: sticky; top: 148px; }
.brief-nav { margin-bottom: 12px; padding: 14px; border-radius: 8px; background: rgba(255,255,255,.92); }
.brief-nav span { display: block; margin: 0 0 7px; color: #7b8c86; font-size: 9px; line-height: 1; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.brief-nav a { display: block; padding: 9px 10px; border-left: 3px solid transparent; border-radius: 0 9px 9px 0; color: #3f5c54; text-decoration: none; font-size: 12px; font-weight: 780; }
.brief-nav a:hover { border-left-color: var(--teal); background: #eef7f2; color: var(--teal-dark); }
.question-card { border-radius: var(--radius-lg); padding: 20px; }
.question-heading { display: flex; align-items: center; gap: 12px; }.chat-icon{width:42px;height:42px;display:grid;place-items:center;border-radius:12px;background:#e3f4ec;color:var(--teal)}
.question-heading span { color: var(--teal); font-size: 9px; letter-spacing: .14em; font-weight: 850; }.question-heading h2{margin:3px 0 0;font-size:22px}
.question-card > p { color: #788781; line-height: 1.55; font-size: 12px; }
.topic-cloud { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 18px; }
.topic-chip { border: 1px solid var(--line); padding: 8px 10px; border-radius: 999px; color: #436259; background: #f5f9f7; font-size: 11px; font-weight: 700; text-align:left; }
.topic-chip:hover { color: var(--teal); background: #e8f6ef; border-color: rgba(38,139,112,.22); }
.chat-thread { display: grid; gap: 10px; max-height: 430px; overflow-y: auto; padding-right: 3px; }
.chat-message { padding: 12px 13px; border-radius: 14px; font-size: 12px; line-height: 1.55; }
.chat-message.user { margin-left: 30px; color: white; background: var(--teal); border-bottom-right-radius: 5px; }
.chat-message.assistant { margin-right: 12px; background: #eef6f2; color: #3f554e; border-bottom-left-radius: 5px; }
.chat-message.assistant strong { color: var(--teal-dark); }.chat-message ul{margin:8px 0 0;padding-left:17px}.chat-message li+li{margin-top:5px}
.chat-meta { display: block; margin-top: 8px; color: #81918c; font-size: 10px; }
.suggested-questions { display: grid; gap: 6px; margin-top: 9px; }.suggested-questions button{padding:8px 9px;border:1px solid var(--line);border-radius:9px;background:white;color:#527068;text-align:left;font-size:10px}
.question-form { display: flex; align-items: flex-end; gap: 8px; margin-top: 15px; padding: 7px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.question-form textarea { width: 100%; border: 0; outline: none; resize: none; padding: 8px; color: var(--ink); line-height: 1.4; font-size: 12px; }
#questionButton { width: 40px; height: 40px; flex: 0 0 40px; border: 0; border-radius: 11px; display: grid; place-items: center; background: var(--teal); color: white; }
.chat-disclaimer { margin-bottom: 0 !important; font-size: 9px !important; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translateX(-50%); max-width: calc(100% - 30px); padding: 12px 16px; border-radius: 12px; color: white; background: #183d34; box-shadow: 0 12px 35px rgba(15,49,41,.25); font-size: 12px; }
footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-top: 60px; padding-bottom: 35px; color: #7a8b86; font-size: 12px; }
.footer-brand { display: flex; flex-direction: column; gap: 4px; }.footer-brand strong{color:#38534b}

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 18px; margin-top: 34px; }
  .dictionary-card { grid-column: auto; grid-row: auto; }
  .control-card form { grid-template-columns: 1fr; gap: 18px; }
  .control-card .divider { margin: 18px 0 0; }
  .result-layout { grid-template-columns: 1fr; }
  .question-column { position: static; }
  .question-card { max-width: none; }
  .signal-strip { grid-template-columns: 1fr; }
  .brief-nav { display: flex; gap: 8px; overflow-x: auto; padding: 12px; }
  .brief-nav span { flex: 0 0 auto; align-self: center; margin: 0 4px 0 0; }
  .brief-nav a { flex: 0 0 auto; border-left: 0; border-bottom: 3px solid transparent; border-radius: 9px; white-space: nowrap; }
  .brief-nav a:hover { border-bottom-color: var(--teal); }
}
@media (max-width: 680px) {
  .shell { width: min(100% - 24px, 1180px); }
  .site-header { height: 72px; }.privacy-pill{display:none}
  .hero { margin: 24px auto 22px; }.hero h1{font-size:42px}.hero>p{font-size:15px}.hero-trust{gap:10px;justify-content:flex-start;text-align:left}.hero-trust span{width:100%}
  .control-card, .paper-hero { padding: 18px; border-radius: 8px; }
  .form-panel { padding: 18px; }
  .detail-row { grid-template-columns: 1fr; }.segmented{width:100%}
  .paper-demographics { grid-template-columns: 1fr; }.paper-demographics div+div{padding-top:10px;border-top:1px solid var(--line)}
  .paper-hero h1 { font-size: 34px; }
  .result-header { align-items:flex-start;gap:12px}.result-actions{flex-direction:column}.result-actions button{font-size:11px}
  .take-home-card { padding: 21px; }.take-home-card h2{font-size:22px}
  .signal-card { min-height: auto; padding: 18px; }
  .primary-signal strong { font-size: 18px; }
  .summary-section, .practice-card, .appraisal-card { padding: 21px; }
  .section-key-point { padding: 18px; }
  .section-key-point .ask-inline, .sentence-unit .ask-inline { position: static; margin-top: 9px; }
  .sentence-unit { padding-right: 0; }
  .summary-points li, .practice-item { align-items: flex-start; flex-direction: column; }
  .boundary-grid, .appraisal-grid { grid-template-columns: 1fr; }
  .appraisal-header { flex-direction: column; }
  footer { flex-direction: column; align-items: flex-start; }
}

@media print {
  body { background: white; }
  .site-header, .hero, .workspace, .result-header, .question-column, footer, .ambient { display: none !important; }
  .results { display: block !important; padding: 0; }
  .shell { width: 100%; }
  .glass-card, .summary-section, .take-home-card { box-shadow: none; backdrop-filter: none; }
  .paper-hero, .summary-section, .practice-card, .appraisal-card { break-inside: avoid; border: 1px solid #ddd; }
  .result-layout { display: block; }
  .brief-column { gap: 12px; }
}

/* Production beta additions */
.account-button { padding: 10px 14px; border-radius: 12px; color: white; background: var(--teal); font-weight: 780; box-shadow: 0 8px 20px rgba(23,108,93,.16); }
.consent-row { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 4px; padding: 13px 14px; border-radius: 13px; background: #f0f7f3; color: #52675f; font-size: 11px; line-height: 1.45; cursor: pointer; }
.consent-row input { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 1px; accent-color: var(--teal); }

.visual-abstract-card { padding: 26px; border-radius: var(--radius-lg); overflow: hidden; background: #ffffff; border: 1px solid rgba(17,57,48,.1); box-shadow: 0 14px 42px rgba(28,82,68,.07); }
.visual-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.visual-header h2 { margin: 7px 0 0; max-width: 720px; font-family: Georgia, "Times New Roman", serif; font-size: 29px; line-height: 1.2; }
.visual-question { margin: 18px 0; padding: 15px 17px; border-left: 4px solid var(--mint-strong); border-radius: 0 8px 8px 0; background: #f6fbf8; color: #3d574f; font-size: 15px; line-height: 1.6; }
.visual-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.visual-meta-grid > div, .visual-node { padding: 15px; border-radius: 8px; background: rgba(255,255,255,.86); border: 1px solid #dbeae3; }
.visual-meta-grid span, .visual-node span, .visual-result span, .visual-message span, .visual-caution span { display: block; margin-bottom: 7px; color: #668078; font-size: 9px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.visual-meta-grid strong, .visual-node strong { color: #2e4941; font-size: 13px; line-height: 1.45; }
.visual-flow { display: grid; grid-template-columns: minmax(0,1fr) 28px minmax(0,1fr) 28px minmax(0,1fr); gap: 9px; align-items: center; margin-top: 13px; }
.visual-node { min-height: 112px; display: flex; flex-direction: column; justify-content: center; }
.visual-node.comparator { background: #f4f7f5; }.visual-node.outcome{background:#eef8f3}
.flow-arrow { color: var(--mint-strong); text-align: center; font-size: 25px; font-weight: 900; }
.visual-result-row { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(220px,.55fr); gap: 12px; margin-top: 13px; }
.visual-result { padding: 18px; border-radius: 8px; background: #ddf3e8; }
.visual-result[data-direction="benefit"] { background: #dcf4e5; }.visual-result[data-direction="harm"]{background:#fee7e1}.visual-result[data-direction="mixed"]{background:#fff0d7}.visual-result[data-direction="no clear difference"]{background:#e8f0f7}
.visual-result strong { color: #25463d; font-size: 17px; line-height: 1.5; }
.visual-numbers { display: grid; gap: 8px; }
.visual-numbers > div { min-height: 64px; display: flex; flex-direction: column; justify-content: center; padding: 11px 13px; border-radius: 8px; background: white; border: 1px solid #d9e7e0; }
.visual-numbers strong { color: var(--teal-dark); font-size: 18px; }.visual-numbers span{margin-top:3px;color:#75847f;font-size:10px;line-height:1.3}
.visual-message { margin-top: 13px; padding: 18px; border-radius: 8px; color: white; background: #14564c; }
.visual-message span { color: #c9efdf; }.visual-message strong{font-size:17px;line-height:1.48}
.visual-caution { margin-top: 10px; padding: 12px 15px; border-radius: 8px; background: #fff4e5; }
.visual-caution span { color: #8a6a27; }.visual-caution p{margin:0;color:#665635;font-size:12px;line-height:1.5}

.source-anchors { margin-top: 20px; padding-top: 16px; border-top: 1px dashed #cfded7; display: grid; gap: 7px; }
.source-anchors > span { color: #758881; font-size: 9px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.source-anchors > div { display: grid; grid-template-columns: minmax(120px,.3fr) minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 9px 11px; border-radius: 8px; background: #f4f8f6; }
.source-anchors strong { color: var(--teal-dark); font-size: 11px; }.source-anchors p{margin:0;color:#63736e;font-size:11px;line-height:1.4}
.source-anchors .ask-inline { opacity: 0; transform: translateX(4px); }
.source-anchors > div:hover .ask-inline, .source-anchors > div:focus-within .ask-inline { opacity: 1; transform: translateX(0); }

.modal { width: min(500px, calc(100% - 28px)); max-height: calc(100vh - 34px); overflow: auto; padding: 34px; border: 0; border-radius: 24px; color: var(--ink); background: #fbfdfc; box-shadow: 0 30px 90px rgba(12,52,43,.3); }
.modal::backdrop { background: rgba(11,39,33,.48); backdrop-filter: blur(5px); }
.wide-modal { width: min(780px, calc(100% - 28px)); }
.modal-close { position: absolute; right: 15px; top: 13px; width: 34px; height: 34px; border-radius: 10px; color: #6b7c76; background: #edf4f0; font-size: 21px; }
.modal h2 { margin: 8px 0 20px; font-size: 29px; }.modal > p{color:#687a74}
.auth-tabs { display: flex; gap: 6px; padding: 5px; margin-bottom: 18px; border-radius: 13px; background: #edf4f0; }
.auth-tabs button { flex: 1; padding: 9px; border-radius: 9px; color: #698078; background: transparent; font-weight: 750; }.auth-tabs button.active{color:var(--teal-dark);background:white;box-shadow:0 4px 12px rgba(31,83,70,.08)}
.modal-form { display: grid; gap: 13px; }.modal-form label{display:grid;gap:6px;color:#445b54;font-size:11px;font-weight:750}.modal-form input{width:100%;padding:12px 13px;border:1px solid var(--line);border-radius:11px;background:white;color:var(--ink);outline:none}.modal-form input:focus{border-color:var(--mint-strong);box-shadow:0 0 0 3px rgba(67,173,136,.12)}
.danger-button { padding: 11px 14px; border-radius: 11px; color: #8a3f36; background: #feeae6; font-weight: 750; }.account-limits{padding:12px 14px;border-radius:12px;background:#eef6f2;font-size:12px;line-height:1.5}
.history-list { display: grid; gap: 9px; }
.history-item { width: 100%; padding: 15px 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; border: 1px solid var(--line); border-radius: 14px; text-align: left; background: white; }
.history-item:hover { border-color: rgba(23,108,93,.28); box-shadow: 0 8px 22px rgba(25,76,64,.07); transform: translateY(-1px); }
.history-item > span { color: var(--teal); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }.history-item strong{font-size:14px;line-height:1.4}.history-item small{color:#778781;line-height:1.35}
.dialog-loading,.empty-state { padding: 28px; border-radius: 14px; color: #71827c; background: #f0f6f3; text-align: center; }.empty-state.error{color:#8e4b43;background:#fff0ed}
.admin-card-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }.admin-card-grid > div{padding:16px;border-radius:14px;background:#eef6f2;display:flex;flex-direction:column;gap:5px}.admin-card-grid span{color:#73847e;font-size:10px;text-transform:uppercase;font-weight:800;letter-spacing:.1em}.admin-card-grid strong{font-size:25px}.admin-card-grid small{color:#71817b}
.admin-stats h3{margin-top:24px}.admin-users{display:grid;gap:7px}.admin-users>div{display:grid;grid-template-columns:1fr 1fr auto;gap:12px;padding:10px 12px;border-bottom:1px solid var(--line);font-size:11px}.admin-users span{color:#6c7d77}.admin-users small{text-transform:uppercase;color:var(--teal);font-weight:800}
.footer-links { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; }.footer-links a{color:#60736c;text-decoration:none}.footer-links a:hover{color:var(--teal)}
.ad-region { margin: 18px 0 0; padding: 12px; min-height: 118px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.7); }
.ad-region.compact { position: sticky; top: 86px; min-height: 280px; margin-top: 14px; }
.ad-label { display: block; margin-bottom: 8px; color: #8a9994; font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

@media (max-width: 760px) {
  .header-meta .privacy-pill { display: none; }
  .header-meta { gap: 6px; }.header-meta button{padding:9px 10px;font-size:11px}
  .visual-meta-grid, .visual-result-row { grid-template-columns: 1fr; }
  .visual-flow { grid-template-columns: 1fr; }.flow-arrow{transform:rotate(90deg)}
  .visual-node { min-height: auto; }
  .source-anchors > div { grid-template-columns: 1fr; gap: 4px; }
  .visual-header { flex-direction: column; }.visual-header .ghost-button{align-self:flex-start}
  .ad-region.compact { position: static; min-height: 120px; }
  .admin-card-grid { grid-template-columns: 1fr 1fr; }.admin-users>div{grid-template-columns:1fr}.modal{padding:28px 20px}
}

@media print {
  .visual-abstract-card { break-inside: avoid; }
  .visual-header button, .source-anchors button { display: none !important; }
  .ad-region { display: none !important; }
  .modal { display: none !important; }
}
