/* KLARO standalone, Rork-identical restyle (v1.2.1).
   Tokens sampled from the live Rork app (computed styles + pixel samples, 2026-11-23). */
:root {
  --bg: #F7F1E5;
  --card: #FDF9F0;
  --ink: #3D2F22;
  --muted: #8D7A63;
  --line: #E6DBC6;
  --primary: #B27A43;
  --grad: linear-gradient(135deg, #C08A4E, #A56B38);
  --tan: #F3E7D6;
  --tan2: #EFE6D4;
  --insight: #F5EBDB;
  --accent2: #C27139;
  --chipbg: #F7E9D5;
  --green: #738255;
  --green-tint: #EDF0E4;
  --send-off: #D4B593;
  --input-ph: #98A2B3;
  --shadow: 0 1px 2px rgba(61, 47, 34, .04);
}
html[data-theme="dark"] {
  --bg: #221A13;
  --card: #2E251B;
  --ink: #F1E7D7;
  --muted: #B3A189;
  --line: #473824;
  --tan: #3B2D1E;
  --tan2: #3B2D1E;
  --insight: #382B1D;
  --chipbg: #3B2D1E;
  --green-tint: #2E3626;
  --send-off: #6E5738;
  --shadow: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
  padding-bottom: 102px;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input { font: inherit; color: inherit; }
.ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

/* header */
.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 40px; height: 40px; border-radius: 50%; }
.brand-name { font-size: 17px; font-weight: 700; line-height: 1.15; }
.brand-sub { font-size: 11px; font-weight: 500; color: var(--muted); }
.avatar-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: #EADAC3; color: #A56B38;
  display: flex; align-items: center; justify-content: center;
}
html[data-theme="dark"] .avatar-btn { background: #3B2D1E; color: #D9B98A; }
.avatar-btn .ic { width: 20px; height: 20px; }

main { padding: 0 16px; max-width: 560px; margin: 0 auto; }
.view { padding-top: 14px; }

.page-title { font-size: 28px; font-weight: 700; margin: 6px 0 4px; letter-spacing: -.01em; }
.page-title.centered, .page-sub.centered { text-align: center; }
.page-sub { font-size: 15px; color: var(--muted); margin: 0 0 14px; }
.section-label { font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--muted); margin: 20px 0 8px; }
.helper { font-size: 13px; color: var(--muted); margin: 10px 0; }
.helper.centered { text-align: center; }
.updated { font-size: 13px; color: var(--muted); margin: 0 0 14px; }

/* generic card + buttons */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 16px; margin: 0 0 14px; box-shadow: var(--shadow);
}
.card-title { font-size: 16px; font-weight: 700; }
.card-sub { font-size: 13px; color: var(--muted); margin: 4px 0 10px; }
.card-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ic-muted { color: var(--muted); width: 22px; height: 22px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--muted); margin: 12px 0 6px; }
.pill-in {
  width: 100%; padding: 12px 16px; margin: 0 0 10px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  font-size: 16px; outline: none;
}
.pill-in:focus { border-color: var(--primary); }
.pill-in::placeholder { color: var(--input-ph); }
.btn-primary {
  display: block; width: 100%; padding: 15px; margin: 14px 0 6px;
  background: var(--grad); color: #fff; border-radius: 999px;
  font-size: 16px; font-weight: 600; text-align: center;
}
.btn-primary:disabled { background: var(--tan2); color: var(--muted); }
.btn-gradient {
  background: var(--grad); color: #fff; border-radius: 999px;
  padding: 12px 22px; font-size: 15px; font-weight: 700; white-space: nowrap;
}
.btn-gradient.block { display: block; width: 100%; margin-top: 4px; }
.btn-outline {
  display: block; width: 100%; padding: 14px; margin: 8px 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  font-size: 16px; font-weight: 600; text-align: center;
}

/* chat */
#view-chat { display: flex; flex-direction: column; min-height: calc(100dvh - 168px); }
.chat-hero { text-align: center; padding: 52px 6px 6px; }
.ic-fill { fill: currentColor; stroke: none; }
.hero-logo { width: 92px; height: 92px; }
.hero-title { font-size: 24px; font-weight: 700; margin: 18px 0 8px; }
.hero-sub { font-size: 15px; color: var(--muted); margin: 0 auto; max-width: 330px; line-height: 1.5; }
.chips { display: flex; flex-direction: column; gap: 10px; margin: 26px 0 0; }
.chip {
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 14px 18px; font-size: 15px; font-weight: 500; text-align: center; color: var(--ink);
}
.fineprint { font-size: 11px; color: var(--muted); text-align: center; margin: 18px 12px 0; line-height: 1.5; }
.chat-log { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.msg-row { display: flex; gap: 8px; align-items: flex-start; }
.msg-avatar { width: 28px; height: 28px; border-radius: 50%; flex: none; margin-top: 2px; }
.msg.assistant {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 6px 16px; font-size: 16px; line-height: 1.55; flex: 1; min-width: 0;
}
.msg.assistant h2, .msg.assistant h3, .msg.assistant h4 { font-size: 19px; font-weight: 700; margin: 14px 0 6px; }
.msg.assistant p { margin: 8px 0; }
.msg.assistant ul { list-style: none; margin: 8px 0; padding: 0; }
.msg.assistant ul li {
  background: var(--insight); border-radius: 14px; padding: 10px 14px; margin: 8px 0; font-size: 15px;
}
.msg.assistant table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 14px; }
.msg.assistant th, .msg.assistant td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.msg.user {
  align-self: flex-end; background: var(--grad); color: #fff;
  border-radius: 20px; padding: 11px 18px; font-size: 16px; max-width: 85%;
}
.msg.system-note {
  align-self: center; background: var(--insight); color: var(--ink);
  border-radius: 14px; padding: 10px 14px; font-size: 14px; text-align: center; max-width: 92%;
}
.chat-dock { margin-top: auto; padding-top: 10px; }
.medical-link { border-top: 1px solid var(--line); text-align: center; padding: 10px 0 4px; }
.medical-link a { color: var(--muted); font-size: 12px; text-decoration: none; }
.chat-status { text-align: center; color: var(--muted); font-size: 14px; padding: 6px 0; }
.chat-form { display: flex; gap: 10px; align-items: center; padding: 6px 0 4px; }
.chat-form input {
  flex: 1; padding: 14px 18px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); font-size: 16px; outline: none; min-width: 0;
}
.chat-form input::placeholder { color: var(--input-ph); }
.send-btn {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  background: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.send-btn:disabled { background: var(--send-off); }
.send-btn .ic { width: 21px; height: 21px; }

/* boost */
.progress-row { display: flex; align-items: center; gap: 12px; margin: 8px 0 16px; }
.progress-track { flex: 1; height: 8px; background: var(--tan2); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent2); border-radius: 999px; width: 4%; transition: width .25s ease; }
.progress-count { font-size: 13px; font-weight: 700; }
.boost-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 24px;
  padding: 20px; box-shadow: var(--shadow);
}
.boost-top { display: flex; justify-content: space-between; align-items: center; }
.icon-chip {
  width: 44px; height: 44px; border-radius: 14px; background: var(--chipbg);
  display: flex; align-items: center; justify-content: center; color: var(--accent2);
}
.icon-chip .ic { width: 22px; height: 22px; }
.cat-pill {
  background: var(--chipbg); color: var(--accent2);
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  padding: 7px 12px; border-radius: 999px; text-transform: uppercase;
}
.boost-title { font-size: 20px; font-weight: 700; margin: 16px 0 8px; }
.boost-body { font-size: 16px; line-height: 1.55; margin: 0 0 16px; }
.insight-box { background: var(--insight); border-radius: 16px; padding: 14px 16px; }
.insight-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--accent2); margin-bottom: 6px; }
.insight-box p { margin: 0; font-size: 15px; line-height: 1.5; }
.boost-nav { display: flex; gap: 12px; align-items: center; margin-top: 18px; }
.round-btn {
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  background: var(--card); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--ink);
}
.round-btn:disabled { color: #C9BBA3; }
.round-btn .ic { width: 22px; height: 22px; }
.ask-btn {
  flex: 1; background: var(--grad); color: #fff; border-radius: 999px;
  padding: 15px; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.ask-glyph { width: 21px; height: 18px; object-fit: contain; }

/* screening */
.intro-badge {
  width: 88px; height: 88px; border-radius: 50%; background: var(--green);
  margin: 26px auto 18px; display: flex; align-items: center; justify-content: center; color: #fff;
}
.ic-badge { width: 42px; height: 42px; }
.check-row { display: flex; gap: 12px; align-items: flex-start; margin: 26px 0 6px; cursor: pointer; }
.check-row input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
  width: 27px; height: 27px; flex: none; border: 2px solid #D8C9A8; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; color: #fff; margin-top: 1px;
}
.check-box .ic { width: 16px; height: 16px; stroke-width: 3; opacity: 0; }
.check-row input:checked + .check-box { background: var(--green); border-color: var(--green); }
.check-row input:checked + .check-box .ic { opacity: 1; }
.check-text { font-size: 14px; line-height: 1.45; }
#screenStart { margin-top: 20px; }
.steps-bar { display: flex; justify-content: space-between; margin: 6px 0 20px; }
.step-dot { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 1; }
.step-dot .dot {
  width: 40px; height: 40px; border-radius: 50%; background: var(--tan2); color: var(--muted);
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700;
}
.step-dot .dot-label { font-size: 11px; color: var(--muted); }
.step-dot.active .dot { background: var(--green); color: #fff; }
.step-dot.active .dot-label { color: var(--ink); font-weight: 600; }
.step-dot.done .dot { background: #DCE3D2; color: var(--green); }
html[data-theme="dark"] .step-dot.done .dot { background: #2E3626; }
.step-head { display: flex; align-items: center; gap: 10px; }
.step-head h2 { font-size: 22px; font-weight: 700; margin: 0; }
.ic-step { color: var(--green); width: 26px; height: 26px; }
.step-sub { font-size: 15px; color: var(--muted); margin: 8px 0 16px; line-height: 1.5; }
.word-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.word-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 24px 8px; text-align: center; font-size: 20px; font-weight: 700;
}
.word-card.hidden-word { color: var(--muted); opacity: .45; }
.timer-row { display: flex; align-items: center; gap: 12px; margin: 20px 0 4px; }
.timer-track { flex: 1; height: 9px; background: var(--tan2); border-radius: 999px; overflow: hidden; }
.timer-fill { height: 100%; width: 100%; background: var(--green); border-radius: 999px; transition: width 1s linear; }
.timer-label { font-size: 14px; font-weight: 600; color: var(--muted); min-width: 30px; text-align: right; }
.pill-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.pill {
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 16px; font-size: 15px; font-weight: 500;
}
.pill.selected { background: var(--primary); border-color: var(--primary); color: #fff; }
.centered-card { text-align: center; }
.clock { width: 210px; height: 210px; }
.clock-face { fill: var(--card); stroke: var(--line); stroke-width: 2; }
.clock .tick { stroke: var(--muted); stroke-width: 2; }
.clock .hand { stroke: var(--ink); stroke-linecap: round; }
.clock .hand.hour { stroke-width: 7; }
.clock .hand.minute { stroke-width: 5; }
.clock-dot { fill: var(--primary); }
.stepper-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.stepper-label { font-size: 14px; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--line); font-size: 20px; line-height: 1;
}
.stepper span { font-size: 17px; font-weight: 700; min-width: 30px; }
.grid-board { display: grid; gap: 8px; max-width: 300px; margin: 6px auto; }
.grid-cell { aspect-ratio: 1; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.grid-cell.lit { background: var(--primary); border-color: var(--primary); }
.grid-cell.picked { background: var(--green); border-color: var(--green); }
.grid-cell.wrong { background: #B3261E; border-color: #B3261E; }
.score-list { list-style: none; margin: 0; padding: 0; }
.score-list li {
  display: flex; justify-content: space-between; padding: 11px 2px;
  border-bottom: 1px solid var(--line); font-size: 16px;
}
.score-list li:last-child { border-bottom: none; }
.score-list b { font-weight: 700; }

/* profile */
.hero-card {
  background: var(--grad); border-radius: 28px; padding: 20px;
  display: flex; gap: 16px; align-items: center; color: #fff; margin-bottom: 14px;
}
.hero-avatar {
  width: 54px; height: 74px; flex: none; border-radius: 18px; background: #FFF9EE;
  display: flex; align-items: center; justify-content: center; color: #A56B38;
}
.hero-avatar .ic { width: 30px; height: 30px; }
.hero-day { font-size: 12px; font-weight: 700; letter-spacing: .14em; opacity: .85; }
.hero-name { font-size: 28px; font-weight: 800; line-height: 1.15; margin: 2px 0 4px; }
.hero-text p { margin: 0; font-size: 14px; line-height: 1.45; opacity: .92; }
.name-row { display: flex; gap: 10px; align-items: stretch; }
.name-row .pill-in { margin: 0; }
.grow { flex: 1; min-width: 0; }
.menu-card { padding: 4px 16px; }
.menu-row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.menu-row:last-child { border-bottom: none; }
.menu-icon {
  width: 42px; height: 42px; flex: none; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
}
.menu-icon .ic { width: 21px; height: 21px; }
.tint-tan { background: var(--chipbg); }
.tint-green { background: var(--green-tint); }
.menu-glyph { width: 21px; height: 18px; object-fit: contain; }
.menu-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.menu-title { font-size: 16px; font-weight: 600; }
.menu-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ic-chev { color: #C9BBA3; width: 20px; height: 20px; }

/* settings lists */
.list-card { padding: 4px 16px; }
.list-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 16px; color: var(--ink);
  text-decoration: none;
}
.list-row:last-child { border-bottom: none; }
.list-row .ic { width: 22px; height: 22px; color: var(--muted); }
.list-row span { flex: 1; }
.list-row .ic-check { color: var(--accent2); width: 20px; height: 20px; display: none; }
.list-row.selected { color: var(--accent2); font-weight: 600; }
.list-row.selected .ic { color: var(--accent2); }
.list-row.selected .ic-check { display: block; }
.list-row .ic-chev { display: block; color: #C9BBA3; width: 20px; height: 20px; }

/* tabs + about + legal */
.tabs { display: flex; gap: 8px; margin: 12px 0 18px; flex-wrap: wrap; }
.tab {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 14px; font-weight: 600; color: var(--muted); background: transparent;
}
.tab .ic { width: 17px; height: 17px; }
.tab-glyph { width: 17px; height: 15px; object-fit: contain; }
.tab.active { background: var(--tan); color: var(--ink); border-color: var(--tan); }
html[data-theme="dark"] .tab-glyph, html[data-theme="dark"] .tab-glyph { filter: invert(0.9) sepia(0.25); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .13em; color: #B49B72; margin: 4px 0 8px; }
.panel-title { font-size: 24px; font-weight: 700; line-height: 1.25; margin: 0 0 10px; }
.panel-sub { font-size: 15px; color: var(--muted); line-height: 1.6; margin: 0 0 16px; }
.mini-card h3 { font-size: 17px; font-weight: 700; margin: 0 0 6px; }
.mini-card p { font-size: 15px; color: var(--muted); line-height: 1.55; margin: 0; }
.tab-panel.legal h3, #disclaimerBody h3 { font-size: 16px; font-weight: 700; margin: 18px 0 6px; }
.tab-panel.legal p, #disclaimerBody p { font-size: 15px; line-height: 1.6; color: var(--muted); margin: 0 0 8px; }

/* bottom tab bar: floating card plus separate round profile button */
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  max-width: 560px; margin: 0 auto;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
}
.tabbar {
  flex: 1;
  display: flex; justify-content: space-around; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 10px 28px rgba(61, 47, 34, .14);
  padding: 7px 8px;
}
.tab-profile-btn {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(61, 47, 34, .14);
  color: var(--primary);
}
.tab-profile-btn .ic { width: 24px; height: 24px; }
.tab-item {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 999px; color: var(--muted);
  font-size: 13px; font-weight: 600;
}
.tab-item .ic { width: 21px; height: 21px; }
.tab-glyph { width: 21px; height: 18px; object-fit: contain; }
.tab-item.active { background: var(--tan); color: var(--ink); }
html[data-theme="dark"] .tab-glyph, html[data-theme="dark"] .menu-glyph { filter: invert(0.9) sepia(0.25); }
