
:root{
  --orange:#ff6a00;
  --black:#0d0d0f;
  --charcoal:#1b1b1f;
  --soft:#f3f4f6;
  --line:#dedfe3;
  --text:#141416;
  --muted:#666a73;
  --white:#fff;
  --green:#1f8f4e;
  --red:#be2f2f;
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  background:#d9d9db;
  color:var(--text);
}
#app{
  width:100%;
  max-width:520px;
  min-height:100vh;
  margin:0 auto;
  background:var(--soft);
  box-shadow:0 0 40px rgba(0,0,0,.18);
}
.screen{display:none;min-height:100vh}
.screen.active{display:block}
.topbar{
  display:flex;justify-content:space-between;align-items:center;
  padding:20px 20px 12px;background:var(--black);color:#fff;
}
.brand{font-size:25px;font-weight:900;letter-spacing:-1.2px}
.brand span{color:var(--orange)}
.pill,.status-badge{
  border:1px solid rgba(255,255,255,.25);
  border-radius:999px;padding:7px 10px;font-size:11px;font-weight:800;letter-spacing:.8px
}
.hero{
  background:linear-gradient(160deg,#0b0b0d 0%,#19191d 100%);
  color:white;padding:34px 22px 30px;
}
.eyebrow{color:var(--orange);font-size:11px;font-weight:900;letter-spacing:1.4px;margin-bottom:7px}
.hero h1{font-size:38px;line-height:.98;margin:6px 0 14px;letter-spacing:-1.7px}
.hero p{color:#d6d6d8;font-size:17px;line-height:1.45;margin-bottom:26px}
button{
  font:inherit;cursor:pointer;border:0;border-radius:14px;
  min-height:52px;font-weight:850;
}
.primary{
  width:100%;background:var(--orange);color:white;padding:14px 18px;
  box-shadow:0 6px 18px rgba(255,106,0,.2)
}
.secondary{
  width:100%;background:#fff;color:var(--black);border:1px solid #d8d8dc;padding:14px 18px;margin-top:10px
}
.hero .secondary{background:transparent;color:#fff;border:1px solid #55565d}
.card{
  background:white;border-radius:20px;margin:16px;padding:20px;
  box-shadow:0 5px 22px rgba(0,0,0,.055)
}
.steps h2{margin-top:0}
.step{display:flex;gap:14px;align-items:center;padding:13px 0;border-top:1px solid #ececf0}
.step:first-of-type{border-top:0}
.step span{
  flex:0 0 34px;height:34px;border-radius:50%;display:grid;place-items:center;
  background:#fff2e8;color:var(--orange);font-weight:900
}
.step small{display:block;color:var(--muted);margin-top:3px}
.screen-head{
  display:flex;gap:10px;align-items:flex-start;padding:18px 16px 8px;background:var(--black);color:white
}
.screen-head h2{margin:0 0 10px;font-size:24px}
.back{
  width:42px;height:42px;min-height:auto;border-radius:50%;
  background:#2c2c31;color:#fff;font-size:30px;font-weight:400;line-height:1
}
label{display:block;font-size:13px;font-weight:800;margin:16px 0 7px}
input,select,textarea{
  width:100%;border:1px solid var(--line);border-radius:12px;background:#fff;
  padding:13px 14px;font-size:16px;outline:none
}
input:focus,select:focus,textarea:focus{border-color:var(--orange);box-shadow:0 0 0 3px rgba(255,106,0,.1)}
.photo{
  width:100%;background:#f8f8fa;color:#333;border:1px dashed #bbbcc1;margin:15px 0;padding:12px
}
.photo small{display:block;font-weight:600;color:#888;margin-top:2px}
.symptom-grid{
  display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:16px 0
}
.choice{
  background:#f5f5f7;color:#252529;border:1px solid #e0e0e4;padding:14px 10px;min-height:65px
}
.choice.selected{border:2px solid var(--orange);background:#fff4eb;color:#be4f00}
.upload-row{display:flex;gap:10px}
.upload-row > *{flex:1}
.case-strip{
  margin:0;background:#242428;color:#d8d8dc;padding:10px 18px;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis
}

#chat{display:flex;flex-direction:column;gap:12px}
.bubble{
  max-width:88%;padding:13px 15px;border-radius:18px;font-size:15px;line-height:1.4;white-space:pre-line
}
.bubble.bot{align-self:flex-start;background:white;border:1px solid #e4e4e8;border-bottom-left-radius:6px}
.bubble.user{align-self:flex-end;background:var(--orange);color:white;border-bottom-right-radius:6px}

.answer-area .choice-stack{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.answer-area button{min-height:48px}
.answer-area .help-link{width:100%;margin-top:8px;background:transparent;color:#666}
.result-card h1{font-size:28px;line-height:1.05;margin:10px 0}
.result-card .status-badge{display:inline-block;color:var(--orange);border-color:#ffd0ad;background:#fff4eb}
.evidence{background:#f7f7f9;border-radius:14px;padding:8px 13px;margin:18px 0}
.evidence div{padding:8px 0;border-bottom:1px solid #e7e7eb}
.evidence div:last-child{border-bottom:0}
.confidence{display:flex;justify-content:space-between;padding:12px 0 18px}
.confidence b{color:var(--green)}
.live-btn{
  width:100%;background:var(--black);color:white;padding:14px 18px;margin-top:10px;border:2px solid var(--orange)
}
.outcome p{color:var(--muted)}
.live-icon{font-size:56px;text-align:center}
.handoff{background:#f7f7f9;border-radius:14px;padding:15px;margin:18px 0;line-height:1.8}
@media (max-width:380px){
  .hero h1{font-size:33px}
  .symptom-grid{grid-template-columns:1fr}
}

.slot-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0}
.slot{
  background:#fff;border:1px solid #d9d9de;color:#222;padding:12px 8px;
  min-height:62px;display:flex;flex-direction:column;justify-content:center
}
.slot small{font-weight:600;color:#777;margin-top:3px}
.slot.selected{border:2px solid var(--orange);background:#fff3e9;color:#c24f00}
.prototype-note{font-size:12px;color:#777;line-height:1.4}
.checkmark{
  width:64px;height:64px;border-radius:50%;background:#e8f6ed;color:var(--green);
  display:grid;place-items:center;font-size:36px;font-weight:900;margin:5px auto 14px
}
.appointment-card{text-align:center}
.appointment-time{
  background:#f7f7f9;border-radius:14px;padding:16px;margin:16px 0;
  font-size:20px;font-weight:900
}
.help-visual{
  height:130px;border-radius:18px;background:#111;color:var(--orange);
  display:grid;place-items:center;font-size:64px;margin-bottom:18px
}
.safety-note{
  background:#fff4e8;border-left:4px solid var(--orange);padding:13px;
  border-radius:8px;margin:18px 0;font-size:13px;line-height:1.45
}

.shop-card{display:flex;flex-direction:column;gap:8px;border:1px solid #e0e0e4;border-radius:14px;padding:14px;margin-top:10px}
.shop-card span{color:#777;font-size:13px}


/* V0.7.1 diagnosis scrolling fix */
#diagnosis.active{
  display:flex;
  flex-direction:column;
  height:100vh;
  height:100dvh;
  min-height:0;
  overflow:hidden;
}

#diagnosis .screen-head,
#diagnosis .case-strip{
  flex:0 0 auto;
}

#diagnosis .chat-wrap{
  flex:1 1 auto;
  min-height:0;
  overflow-y:scroll;
  overflow-x:hidden;
  padding:18px 14px 24px;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
  -webkit-overflow-scrolling:touch;
}

#diagnosis #chat{
  min-height:min-content;
  padding-bottom:8px;
}

#diagnosis .answer-area{
  position:relative;
  left:auto;
  bottom:auto;
  transform:none;
  flex:0 0 auto;
  width:100%;
  max-width:none;
  max-height:48dvh;
  overflow-y:auto;
  overflow-x:hidden;
  background:rgba(250,250,251,.98);
  backdrop-filter:blur(10px);
  padding:12px 14px calc(18px + env(safe-area-inset-bottom));
  border-top:1px solid #dddde1;
  box-shadow:0 -8px 20px rgba(0,0,0,.04);
  scrollbar-gutter:stable;
  -webkit-overflow-scrolling:touch;
}

/* Keep the conversation scrollbar visibly available on desktop browsers. */
#diagnosis .chat-wrap::-webkit-scrollbar,
#diagnosis .answer-area::-webkit-scrollbar{
  width:10px;
}
#diagnosis .chat-wrap::-webkit-scrollbar-track,
#diagnosis .answer-area::-webkit-scrollbar-track{
  background:#ececef;
}
#diagnosis .chat-wrap::-webkit-scrollbar-thumb,
#diagnosis .answer-area::-webkit-scrollbar-thumb{
  background:#a9a9af;
  border-radius:999px;
  border:2px solid #ececef;
}

#diagnosis .chat-wrap,
#diagnosis .answer-area{
  scrollbar-width:auto;
  scrollbar-color:#a9a9af #ececef;
}

@media (max-height:700px){
  #diagnosis .answer-area{max-height:55dvh}
}

@media (max-width:380px){
  #diagnosis .answer-area .choice-stack{grid-template-columns:1fr}
}

/* V0.7.2 Universal Intake & Smart Triage */
.triage-checks{display:flex;flex-direction:column;gap:9px;margin:8px 0 16px}
.check-row{display:flex;align-items:flex-start;gap:9px;padding:10px 12px;border:1px solid #dddddf;border-radius:12px;background:#fff;font-size:14px;line-height:1.35}
.check-row input{width:auto;margin-top:2px}
.triage-summary-card{border-left:4px solid #f07b21}
.triage-route{display:inline-block;margin-top:8px;border-radius:999px;padding:6px 10px;font-size:11px;font-weight:900;letter-spacing:.5px;background:#fff3e9;color:#b85008;border:1px solid #ffd3b7}


/* V0.7.3 Beta Testing Shell */
body{padding-top:58px}
.beta-banner{
  position:fixed;
  top:0;left:0;right:0;
  z-index:9999;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
  min-height:46px;
  padding:8px 14px;
  background:#f27a1a;
  color:#111;
  border-bottom:1px solid rgba(0,0,0,.25);
  box-shadow:0 2px 10px rgba(0,0,0,.16);
  font-size:12px;
  line-height:1.25;
  text-align:center;
}
.beta-banner strong{
  font-size:12px;
  letter-spacing:.7px;
  font-weight:900;
}
.beta-banner span{font-weight:700}

.beta-feedback-fab{
  position:fixed;
  left:16px;
  right:auto;
  bottom:16px;
  z-index:9000;
  border:0;
  border-radius:999px;
  padding:12px 16px;
  background:#f27a1a;
  color:#111;
  font-weight:900;
  font-size:12px;
  letter-spacing:.4px;
  box-shadow:0 8px 24px rgba(0,0,0,.24);
  cursor:pointer;
}
.beta-feedback-fab:hover{filter:brightness(1.04)}

.beta-modal{
  display:none;
  position:fixed;
  inset:0;
  z-index:10000;
  background:rgba(0,0,0,.68);
  padding:18px;
  overflow-y:auto;
}
.beta-modal.open{
  display:flex;
  align-items:flex-start;
  justify-content:center;
}
.beta-modal-card{
  position:relative;
  width:min(620px,100%);
  margin:24px auto;
  border-radius:18px;
  background:#fff;
  padding:24px;
  box-shadow:0 24px 80px rgba(0,0,0,.35);
}
.beta-modal-card h2{margin:4px 0 8px}
.beta-modal-intro{margin-top:0;color:#555}
.beta-modal-close{
  position:absolute;
  right:14px;
  top:10px;
  border:0;
  background:transparent;
  font-size:30px;
  line-height:1;
  cursor:pointer;
  color:#555;
}
.beta-modal label{
  display:block;
  font-weight:800;
  margin:14px 0 6px;
}
.beta-modal select,
.beta-modal input[type="text"],
.beta-modal textarea{
  width:100%;
  box-sizing:border-box;
  border:1px solid #cfcfd4;
  border-radius:10px;
  padding:10px 11px;
  font:inherit;
  background:#fff;
}
.beta-modal textarea{resize:vertical}
.optional{font-weight:500;color:#777;font-size:12px}
.hidden-field{display:none}
.beta-submit{margin-top:18px;width:100%}
.beta-feedback-status{
  min-height:22px;
  margin-top:10px;
  font-size:13px;
  font-weight:800;
  text-align:center;
}
.beta-feedback-status.success{color:#19723a}
.beta-feedback-status.error{color:#a52d21}

/* Keep bottom content clear of feedback button */
.screen{padding-bottom:78px}

@media (max-width:600px){
  body{padding-top:74px}
  .beta-banner{min-height:62px;padding:7px 10px}
  .beta-banner span{font-size:11px}
  .beta-feedback-fab{left:10px;right:auto;bottom:10px;padding:11px 13px}
  .beta-modal{padding:8px}
  .beta-modal-card{margin:8px auto;padding:20px 16px 24px}
}

/* V0.7.3.1: Keep beta feedback clear of Netlify's bottom-right badge */
.beta-feedback-fab{
  max-width:calc(100vw - 32px);
}


/* V0.7.4 Beta Access Gate */
.beta-access-gate{
  position:fixed;
  inset:0;
  z-index:20000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:
    radial-gradient(circle at 50% 20%, rgba(242,122,26,.12), transparent 35%),
    #0d0e10;
}
.beta-access-gate.unlocked{display:none}

.beta-access-card{
  width:min(460px,100%);
  background:#151619;
  color:#fff;
  border:1px solid #34363b;
  border-radius:20px;
  padding:28px;
  box-shadow:0 24px 80px rgba(0,0,0,.5);
}
.beta-access-logo{
  font-size:28px;
  font-weight:950;
  letter-spacing:-1px;
  margin-bottom:24px;
}
.beta-access-logo span{color:#f27a1a}
.beta-access-card h1{
  margin:6px 0 10px;
  font-size:34px;
}
.beta-access-card p{
  color:#d3d3d6;
  line-height:1.5;
}
.beta-access-card label{
  display:block;
  margin:18px 0 7px;
  font-size:13px;
  font-weight:900;
  color:#fff;
}
.beta-access-card input{
  width:100%;
  box-sizing:border-box;
  border:1px solid #555962;
  border-radius:12px;
  padding:13px 14px;
  background:#0e0f12;
  color:#fff;
  font-size:16px;
  outline:none;
}
.beta-access-card input:focus{
  border-color:#f27a1a;
  box-shadow:0 0 0 3px rgba(242,122,26,.14);
}
.beta-access-submit{
  width:100%;
  margin-top:12px;
}
.beta-access-status{
  min-height:22px;
  margin-top:9px;
  text-align:center;
  font-size:13px;
  font-weight:900;
  color:#ffb385;
}
.beta-access-note{
  margin-top:18px !important;
  font-size:12px;
  color:#999da4 !important;
}

/* V0.7.5 */
.smart-id-help{margin:14px 0;padding:14px;border:1px solid #dedfe3;border-radius:14px;background:#fff8f2}.smart-id-title{font-size:12px;font-weight:950;color:#e96800;margin-bottom:6px}.smart-id-detail{display:none;margin-top:10px;padding:11px;border-radius:10px;background:#f5f5f6}.smart-id-detail.show{display:block}.text-button{border:0;background:transparent;color:#666;font-weight:800;padding:8px 0;text-decoration:underline}.mechanic-value-box,.mechanic-worth-box{margin:14px 0;padding:15px;border-radius:14px;background:#f5f5f7;line-height:1.45}.mechanic-value-box>div{margin-top:6px}.mechanic-worth-box p{margin:8px 0 12px}.outcome-grid{display:grid;gap:8px}.outcome-grid>div{background:#fff;border:1px solid #e1e2e5;border-radius:10px;padding:10px}.outcome-grid span{font-size:13px;color:#666}

/* V0.7.5 Final Beta live-mechanic visual */
.live-mechanic-preview{
  display:block;
  width:100%;
  max-height:260px;
  object-fit:cover;
  object-position:top;
  border-radius:14px;
  margin:0 0 16px;
  border:1px solid #dddfe3;
}
