:root {
  --bg: #f7efe3;
  --card: #fffaf2;
  --text: #17352d;
  --muted: #6f7a73;
  --accent: #d79a2b;
  --accent-dark: #a66c12;
  --green: #14342b;
  --line: rgba(20, 52, 43, 0.14);
  --danger: #b23b2f;
  --warn: #a66c12;
  --ok: #1f7a4d;
  --shadow: 0 18px 55px rgba(25, 43, 36, 0.12);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: radial-gradient(circle at top left, #fff7df 0, var(--bg) 45%, #f4e3cf 100%);
  color: var(--text);
}
button, input, select { font: inherit; }
button, a.primary-btn, a.secondary-btn { cursor: pointer; text-decoration: none; }
.page-shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 40px; }
.hero {
  background: linear-gradient(135deg, #14342b, #1d5143);
  color: #fff;
  border-radius: 34px;
  padding: 34px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.hero:after { content: ''; position: absolute; width: 310px; height: 310px; border-radius: 999px; background: rgba(244, 199, 107, 0.16); right: -110px; top: -120px; }
.topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; position: relative; z-index: 2; }
.topbar { display: flex; gap: 18px; align-items: center; position: relative; z-index: 1; }
.brand-mark { width: 62px; height: 62px; border-radius: 21px; background: #f4c76b; color: var(--green); font-weight: 900; display: grid; place-items: center; font-size: 22px; flex: 0 0 auto; }
.eyebrow { margin: 0 0 8px; color: #f4c76b; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 12px; }
h1 { margin: 0; font-size: clamp(30px, 5vw, 56px); line-height: 1.02; letter-spacing: -.04em; }
.hero-text { max-width: 850px; margin: 20px 0 0; font-size: 18px; line-height: 1.55; color: rgba(255,255,255,.86); position: relative; z-index: 1; }
.card { background: rgba(255,250,242,.92); border: 1px solid rgba(20, 52, 43, .12); border-radius: 30px; box-shadow: var(--shadow); }
.app-card { padding: clamp(22px, 4vw, 42px); min-height: 520px; }
.step { display: none; } .step.active { display: block; }
.section-head { margin-bottom: 24px; }
.section-head h2 { font-size: clamp(28px, 4vw, 42px); margin: 12px 0 8px; letter-spacing: -.03em; }
.section-head p { margin: 0; color: var(--muted); font-size: 17px; }
.step-pill { display: inline-flex; padding: 8px 12px; border-radius: 999px; background: rgba(215,154,43,.16); color: var(--accent-dark); font-weight: 800; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
label span { display: block; font-weight: 800; margin-bottom: 8px; }
input, select { width: 100%; border: 1px solid var(--line); border-radius: 18px; padding: 16px 17px; background: #fff; color: var(--text); outline: none; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(215,154,43,.14); }
.primary-btn, .secondary-btn, .danger-btn { border: 0; border-radius: 18px; padding: 15px 20px; font-weight: 900; display: inline-flex; align-items:center; justify-content:center; }
.primary-btn { background: var(--green); color: #fff; }
.secondary-btn { background: rgba(20,52,43,.08); color: var(--green); }
.danger-btn { background: rgba(178,59,47,.1); color: var(--danger); }
.primary-btn:disabled, .secondary-btn:disabled { opacity: .45; cursor: not-allowed; }
.wide { grid-column: 1 / -1; }
.progress { height: 12px; background: rgba(20,52,43,.09); border-radius: 999px; overflow: hidden; margin-top: 15px; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .25s ease; }
.auto-note { margin-top: 12px!important; }
.question-box { background: #fff; border-radius: 28px; padding: clamp(22px, 4vw, 36px); border: 1px solid var(--line); }
.question-category { margin: 0 0 12px; font-weight: 900; color: var(--accent-dark); }
.question-box h3 { margin: 0 0 24px; font-size: clamp(24px, 4vw, 36px); line-height: 1.18; letter-spacing: -.02em; }
.answers { display: grid; gap: 12px; }
.answer-btn { text-align: left; border: 1px solid var(--line); background: #fffaf4; padding: 17px 18px; border-radius: 18px; color: var(--text); font-weight: 800; transition: all .14s ease; }
.answer-btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.answer-btn.selected { background: #14342b; color: #fff; border-color: #14342b; }
.nav-row { display: flex; justify-content: space-between; align-items:center; gap: 14px; margin-top: 22px; }
.tap-hint { color: var(--muted); font-size: 14px; }
.success-box { text-align: center; max-width: 850px; margin: 0 auto; padding: 40px 0; }
.success-icon { width: 82px; height: 82px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: #14342b; color: #fff; font-size: 44px; font-weight: 900; }
.success-box h2 { font-size: clamp(30px, 5vw, 46px); margin: 0 0 15px; }
.success-box p { font-size: 18px; line-height: 1.65; color: var(--text); }
.muted { color: var(--muted) !important; }
.success-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
footer { color: var(--muted); text-align: center; padding: 22px; }
.hidden { display: none !important; }
.language-switch { display: inline-flex; gap: 6px; padding: 5px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); flex: 0 0 auto; }
.language-switch button { border: 0; border-radius: 999px; padding: 9px 13px; font-weight: 900; color: #fff; background: transparent; }
.language-switch button.active { background: #f4c76b; color: #14342b; }
.admin-footer-link { display: inline-flex; margin-top: 10px; font-size: 13px; color: rgba(83, 59, 42, 0.58); text-decoration: none; border-bottom: 1px dashed rgba(83, 59, 42, 0.28); }
.patient-result { margin-top: 22px; text-align: left; }
.mini-report, .printable-report { background: #fffaf2; border: 1px solid rgba(20,52,43,.12); border-radius: 28px; overflow:hidden; }
.mini-report { padding: 22px; }
.mini-report h3 { margin: 12px 0 10px; color: #14342b; }
.report-summary-inline { font-weight: 700; color: #14342b; }
.mini-report-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(20,52,43,.12); }
.mini-report-block h4 { margin: 0 0 8px; color: #14342b; }
.report-warning { margin-top: 18px; padding: 16px; color: #8a3b2b; background: rgba(178,59,47,.08); border-radius: 18px; line-height: 1.5; }
.risk-badge { display: inline-flex; margin-top: 16px; padding: 10px 14px; border-radius: 999px; background: #f4c76b; color: var(--green); font-weight: 900; }
.dx-row { display:flex; justify-content:space-between; gap:14px; padding:12px 0; border-top:1px solid rgba(20,52,43,.1); }
.dx-row:first-child { border-top:0; }
.dx-row.high strong { color: var(--danger); }
.dx-row.medium strong { color: var(--warn); }
.dx-row.low strong { color: var(--ok); }
.admin-layout { display: grid; grid-template-columns: 400px 1fr; gap: 22px; align-items: start; }
.admin-list-card, .report-card { padding: 20px; }
.admin-tools { display: grid; gap: 10px; margin-bottom: 16px; }
.submission-list { display: grid; gap: 10px; }
.submission-row { width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 18px; padding: 15px; display: grid; gap: 6px; color: var(--text); }
.submission-row span, .submission-row small { color: var(--muted); }
.submission-row.active { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(215,154,43,.12); }
.empty-state, .empty-list { padding: 28px; text-align: center; color: var(--muted); }
.report-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.report-header { background: var(--green); color: #fff; padding: 28px; }
.report-header h2 { margin: 0; font-size: 34px; line-height: 1.08; }
.report-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); }
.report-meta div { background: #fff; padding: 16px; }
.report-meta span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.report-summary, .report-block { margin: 18px; padding: 18px; background: #fff; border-radius: 18px; line-height: 1.6; }
.report-block h3 { margin:0 0 8px; }
.ghost-button { border: 1px solid rgba(255,255,255,.28); color: #fff; border-radius: 999px; padding: 12px 18px; font-weight: 800; background: rgba(255,255,255,.08); }
.login-card { max-width: 460px; margin: 80px auto; padding: 34px; text-align: center; }
.login-card h1 { color: var(--green); font-size: 42px; margin: 10px 0 8px; }
.login-card p { color: var(--muted); line-height: 1.55; }
.login-mark { margin: 0 auto 14px; }
.login-card input { margin: 12px 0; text-align: center; }
.login-error { color: var(--danger) !important; font-weight: 800; margin-bottom: 0; }
.db-status { padding: 12px; border-radius: 14px; margin-bottom: 14px; font-weight: 700; line-height:1.45; }
.db-status.ok { background: rgba(31,122,77,.12); color: var(--ok); }
.db-status.warn { background: rgba(166,108,18,.12); color: var(--warn); }
.stats-grid { display:grid; grid-template-columns: repeat(2,1fr); gap:10px; margin-bottom:16px; }
.stats-grid div { background:#fff; border:1px solid var(--line); border-radius:16px; padding:14px; }
.stats-grid strong { display:block; font-size:28px; color:var(--green); }
.stats-grid span { color:var(--muted); font-size:13px; }
@media (max-width: 840px) {
  .form-grid, .admin-layout, .report-meta { grid-template-columns: 1fr; }
  .hero { padding: 24px; border-radius: 24px; }
  .topline { flex-direction: column; }
  .language-switch { align-self: flex-start; }
  .nav-row { flex-direction:column; align-items:stretch; }
  .dx-row { flex-direction:column; }
}
