/* ============ Survey Platform v2: refreshed look + multi-question pages ============
   Loaded after app.css and theme.css. */
:root {
  --ink: #101828;
  --ink2: #344054;
  --muted: #475467;
  --faint: #8a94a6;
  --line: #eaecf0;
  --line2: #d0d5dd;
  --bg: #f4f6fa;
  --brand: #175cd3;
  --accent: #107569;
  --danger: #d92d20;
  --danger-bg: #fef3f2;
  --ok: #067647;
  --ok-bg: #ecfdf3;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --head: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 16px;
  --grad: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, var(--accent)));
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .05);
  --lift: 0 1px 3px rgba(16, 24, 40, .06), 0 12px 32px rgba(16, 24, 40, .08);
}
body { font-size: 15.5px; color: var(--ink); font-feature-settings: "cv11", "ss01"; }
h1, h2, h3, h4 { font-family: var(--head); letter-spacing: -.02em; }
.btn { font-family: var(--head); font-weight: 700; letter-spacing: -.005em; border-radius: 12px; }
.btn:not(.ghost):not(.subtle):not(.danger) { background: var(--grad); }
.btn.lg { border-radius: 14px; }
.input, .field input[type=text], .field input[type=password], .field input[type=number], .field input[type=email], .field select, .field textarea {
  border-radius: 12px; border-color: var(--line2); font-size: 15.5px;
}
.field input[type=email] { width: 100%; border: 1.5px solid var(--line2); padding: 10px 12px; background: #fff; min-height: 42px; }
.field input[type=email]:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, #fff); }
.toast { font-family: var(--head); font-weight: 600; border-radius: 12px; }

/* =====================================================
   HCP SURVEY
   ===================================================== */
body.sv { background: var(--bg); }
body.sv::before {
  height: 300px;
  background:
    radial-gradient(700px 300px at 85% -40px, color-mix(in srgb, var(--accent) 45%, transparent), transparent 70%),
    radial-gradient(500px 260px at 0% 110%, rgba(255, 255, 255, .12), transparent 70%),
    linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #0b1430));
  border-radius: 0 0 50% 50% / 0 0 40px 40px;
}
.sv-top { background: rgba(255, 255, 255, .96); box-shadow: 0 1px 0 var(--line), 0 6px 20px rgba(16, 24, 40, .06); }
.sv-top-in { max-width: 860px; min-height: 58px; }
.brandmark .bm-name { font-family: var(--head); font-size: 19px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.brandmark img { max-height: 32px; }
.sv-step { font-family: var(--head); font-size: 13px; font-weight: 700; color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, #fff); border-radius: 99px; padding: 5px 12px; white-space: nowrap; }
.sv-step:empty { display: none; }
.sv-prog { height: 5px; background: #e9edf3; }
.sv-prog i { background: var(--grad); box-shadow: none; }
.sv-main { max-width: 860px; padding: 26px 16px 130px; }
.sv-card { border-radius: 24px; box-shadow: var(--lift); }
.sv-foot { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--faint); font-size: 12.5px; margin-top: 22px; }
.sv-foot .ico { width: 14px; height: 14px; }

/* welcome / thank-you */
.sv-hero h1 { font-weight: 800; color: var(--ink); background: none; -webkit-background-clip: border-box; background-clip: border-box; }
.sv-hero .badge { background: color-mix(in srgb, var(--brand) 9%, #fff); color: var(--brand); font-family: var(--head); font-weight: 700; }
.sv-hero .desc { background: #f8fafc; border: 1px solid var(--line); font-size: 16px; line-height: 1.6; }
.sv-hero .desc.center { text-align: center; background: none; border: 0; padding: 0; }
.hero-ico { background: var(--grad); border-radius: 22px; }
.chip { font-family: var(--head); font-weight: 600; font-size: 13px; }
.done-ico { background: linear-gradient(135deg, #17b26a, #067647); }

/* page heading */
.pg-head { color: #fff; padding: 6px 4px 18px; }
.pg-kicker { display: inline-block; font-family: var(--head); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; opacity: .78; margin-bottom: 4px; }
.pg-head h1 { font-size: clamp(22px, 4.6vw, 30px); font-weight: 800; line-height: 1.2; }
.sec-head { font-size: 18px; font-weight: 800; color: var(--ink); margin: 26px 4px 12px; display: flex; align-items: center; gap: 10px; }
.sec-head::before { content: ""; width: 6px; height: 22px; border-radius: 3px; background: var(--grad); flex: none; }

/* question blocks */
.qlist { display: grid; gap: 16px; }
.qslot:not(.shown) { display: none; }
.qb { background: #fff; border: 1.5px solid #e6e9ef; border-radius: 22px; box-shadow: var(--shadow); padding: 22px 24px 20px; scroll-margin: 96px 0 140px; transition: border-color .2s, box-shadow .2s, background .2s; animation: rise .28s ease-out; position: relative; }
@media (max-width: 600px) { .qb { padding: 18px 16px 16px; border-radius: 18px; } }
.qb-head { display: flex; gap: 12px; align-items: flex-start; }
.qb-num { flex: none; min-width: 34px; height: 34px; padding: 0 9px; border-radius: 11px; display: grid; place-items: center; font-family: var(--head); font-weight: 800; font-size: 14px; color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, #fff); transition: background .2s, color .2s; white-space: nowrap; }
.qb-titles { flex: 1; min-width: 0; }
.qb .q-title { font-size: clamp(17px, 3.2vw, 19.5px); font-weight: 700; line-height: 1.4; margin: 4px 0 0; letter-spacing: -.01em; }
.q-title .req { color: var(--danger); margin-left: 4px; font-weight: 800; }
.qb .q-help { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin-top: 4px; }
.opt-tag { font-family: var(--head); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: #f2f4f7; border-radius: 6px; padding: 2px 7px; }
.qb-ok { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: #17b26a; opacity: 0; transform: scale(.6); transition: opacity .2s, transform .2s; margin-top: 3px; }
.qb-ok .ico { width: 16px; height: 16px; }
.qb.answered .qb-ok { opacity: 1; transform: none; }
.qb.answered .qb-num { background: var(--ok-bg); color: var(--ok); }
.qb .q-body { margin-top: 16px; }
.qb .q-tally { margin: 10px 0 0 46px; }
@media (max-width: 600px) { .qb .q-tally { margin-left: 0; } }

/* unanswered required question: the whole card turns red */
.qb.missing { border-color: var(--danger); background: var(--danger-bg); box-shadow: 0 0 0 4px rgba(217, 45, 32, .12), var(--shadow); }
.qb.missing .qb-num { background: var(--danger); color: #fff; }
.qb.missing .q-title { color: #912018; }
.qb.missing .opt, .qb.missing .num, .qb.missing .pill, .qb.missing .input, .qb.missing .vs { border-color: #fda29b; }
.qb.missing .mrow:not(.missing) { border-color: #fecdca; }
.qb.shake { animation: shake .45s ease-in-out; }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.q-err { background: #fff; color: #b42318; border: 1.5px solid #fda29b; border-radius: 12px; font-weight: 600; }
.q-err .ico { color: var(--danger); margin-top: 1px; }
.mrow.missing { border-color: var(--danger); background: #fff; box-shadow: inset 5px 0 0 var(--danger), 0 0 0 3px rgba(217, 45, 32, .10); }
.mrow.missing .mrow-label { color: #b42318; }
.mrow.missing .mrow-label .n { background: var(--danger); color: #fff; }
.pg-alert { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; background: var(--danger); color: #fff; border-radius: 14px; padding: 13px 16px; font-weight: 600; font-size: 14.5px; box-shadow: 0 8px 20px rgba(217, 45, 32, .25); }
.pg-alert .ico { margin-top: 2px; }

/* information block */
.qb-info { display: flex; gap: 14px; align-items: flex-start; background: color-mix(in srgb, var(--brand) 5%, #fff); border-color: color-mix(in srgb, var(--brand) 18%, #fff); }
.qb-info-ico { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: var(--grad); }
.qb-info .q-title { margin-top: 5px; }

/* choices: radio dot / tick box */
.opts { gap: 9px; }
.opts.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .opts.cols { grid-template-columns: minmax(0, 1fr); } }
.opt { border-radius: 14px; border: 1.5px solid #e3e7ee; min-height: 54px; padding: 12px 15px; font-size: 15.5px; font-weight: 500; gap: 12px; box-shadow: none; }
.opt:hover { transform: none; box-shadow: 0 2px 8px rgba(16, 24, 40, .06); border-color: color-mix(in srgb, var(--brand) 45%, #fff); background: #fff; }
.opt.sel { background: color-mix(in srgb, var(--brand) 7%, #fff); border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; font-weight: 600; }
.opt .mark.dot, .opt .mark.box { width: 22px; height: 22px; border: 2px solid #c3cad5; background: #fff; }
.opt .mark.box { border-radius: 7px; }
.opt .mark.dot .ico { display: none; }
.opt.sel .mark.dot { border-color: var(--brand); background: #fff; }
.opt.sel .mark.dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.opt.sel .mark.box { background: var(--brand); border-color: var(--brand); }
.opt.sel .mark.box .ico { opacity: 1; width: 14px; height: 14px; }
.opts.tiles .opt .mark.box { align-self: flex-start; }
.opts.tiles .opt.sel { background: var(--grad); color: #fff; }
.opts.tiles .opt.sel .mark.box { background: #fff; border-color: #fff; color: var(--brand); }
.opt .mark.rank { border: 2px solid #c3cad5; background: #fff; border-radius: 10px; }
.other-in { margin-top: 9px; }
.keyhint { margin-top: 10px; font-size: 12.5px; }
@media (hover: none) { .keyhint { display: block; } }

/* scales, grids, pills */
.num { border-radius: 12px; border-color: #e3e7ee; font-family: var(--head); font-weight: 700; }
.num.sel { background: var(--grad); transform: translateY(-1px); }
.scale-key { background: #f6f8fb; border: 1px solid var(--line); font-size: 13px; }
.mrow { border-radius: 14px; border: 1.5px solid #e9ecf2; background: #fcfdfe; }
.mrow.done { background: #fff; box-shadow: inset 4px 0 0 #17b26a; border-color: #d1fadf; }
.mrow-label .tick { color: #17b26a; }
.mrow.done .mrow-label .n { background: #17b26a; color: #fff; }
.pill { border-radius: 11px; border-color: #e3e7ee; font-weight: 500; }
.pill.sel { background: var(--grad); }
.vs .pill.vs-2.sel { background: linear-gradient(135deg, #f38744, #c4320a); }

/* bottom navigation */
.sv-nav { background: rgba(255, 255, 255, .97); box-shadow: 0 -1px 0 var(--line), 0 -8px 24px rgba(16, 24, 40, .06); }
.sv-nav-in { max-width: 860px; }
.sv-nav .hint { font-family: var(--head); font-size: 13px; font-weight: 700; color: var(--muted); background: #f2f4f7; border-radius: 99px; padding: 6px 12px; }
.sv-nav .hint:empty { visibility: hidden; }
.sv-nav .hint.all { color: var(--ok); background: var(--ok-bg); }
.sv-nav .next { min-width: 170px; }
@media (max-width: 600px) {
  .sv-nav .hint { display: inline-block; font-size: 12px; padding: 5px 9px; }
  .sv-nav .btn.ghost { padding: 9px 12px; }
  .sv-nav .btn.ghost .lbl { display: none; }
  .sv-nav .next { flex: 0 1 auto; min-width: 128px; }
}

/* =====================================================
   ADMIN
   ===================================================== */
body.ad { --brand: #175cd3; --accent: #107569; background: radial-gradient(1200px 420px at 90% -80px, rgba(23, 92, 211, .09), transparent 70%) no-repeat, var(--bg); background-attachment: scroll; }
.ad-top { background: #0c1527; box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 8px 24px rgba(12, 21, 39, .18); }
.ad-logo .mk, .auth .mk { background: linear-gradient(135deg, #2e90fa, #107569); border-radius: 10px; }
.ad-logo b { font-family: var(--head); font-weight: 800; }
.ad-nav a, .ad-nav button { font-family: var(--head); font-weight: 600; border-radius: 10px; }
.ad-nav a.on { background: rgba(255, 255, 255, .12); }
.card { border-color: #e7eaf0; border-radius: 18px; box-shadow: var(--shadow); }
.page-head h1 { font-weight: 800; }
.hero-head { border-radius: 24px; }
.tabs a { font-family: var(--head); font-weight: 700; }
.tabs a.on { background: var(--grad); }
.status { font-family: var(--head); }
.status.live { color: #067647; background: #dcfae6; }
.status.draft { color: #93370d; background: #fef0c7; }
.auth { border-radius: 24px; padding: 34px 30px; box-shadow: var(--lift); }
.auth h1 { font-weight: 800; }
.kpi .v, .scard .nums3 b, .stats div b, .donut-hole b { font-family: var(--head); font-weight: 800; }

/* survey list toolbar */
.listbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.search { position: relative; flex: 1 1 260px; max-width: 420px; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 18px; height: 18px; }
.search input { width: 100%; border: 1.5px solid var(--line2); border-radius: 12px; padding: 10px 12px 10px 40px; min-height: 42px; background: #fff; font-size: 15px; }
.search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, #fff); }

/* segmented control */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: #eef1f6; border-radius: 13px; padding: 4px; }
.seg button { border: 0; background: transparent; border-radius: 10px; padding: 8px 14px; font-family: var(--head); font-weight: 700; font-size: 13.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; min-height: 36px; }
.seg button:hover { color: var(--ink); background: rgba(255, 255, 255, .6); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.seg button .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.seg.status-seg button.on.live { color: #067647; }
.seg.status-seg button.on.draft { color: #93370d; }
.seg.status-seg button.on.closed { color: var(--ink2); }

/* new-survey templates */
.tpl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 6px; }
@media (max-width: 640px) { .tpl-grid { grid-template-columns: 1fr; } }
.tpl { text-align: left; border: 1.5px solid var(--line2); background: #fff; border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, box-shadow .15s; }
.tpl:hover { border-color: var(--brand); }
.tpl.sel { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset, 0 6px 16px color-mix(in srgb, var(--brand) 14%, transparent); background: color-mix(in srgb, var(--brand) 4%, #fff); }
.tpl .tpl-ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: var(--grad); }
.tpl b { font-family: var(--head); font-size: 14.5px; }
.tpl > span:not(.tpl-ico) { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.tpl .tpl-ico .ico { width: 19px; height: 19px; color: #fff; }

/* builder */
.build { max-width: 940px; gap: 0; }
.build > .card.bq { margin: 0; }
.bpanel { padding: 18px 20px; margin-bottom: 16px; }
.bpanel h3 { font-size: 16px; margin-bottom: 2px; }
.bpanel .muted { font-size: 13.5px; margin-bottom: 12px; }
.bsum { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bsum span { font-family: var(--head); font-size: 12.5px; font-weight: 700; background: #f2f4f7; color: var(--ink2); border-radius: 99px; padding: 4px 11px; }
.btools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 4px 0 10px; }
.pg-div { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; font-family: var(--head); font-size: 12.5px; font-weight: 800; color: var(--brand); text-transform: uppercase; letter-spacing: .08em; }
.pg-div:first-child { margin-top: 4px; }
.pg-div::after { content: ""; flex: 1; min-width: 24px; height: 2px; border-radius: 2px; background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--brand) 35%, #fff) 0 8px, transparent 8px 14px); }
.pg-div .why { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--muted); font-size: 12.5px; }
.pg-div .btn { text-transform: none; letter-spacing: 0; order: 3; white-space: nowrap; }
.pg-div { flex-wrap: wrap; }
.pg-div .why { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46%; }
/* "add here" controls sit in the gap between two cards and never push the cards apart */
.ins { position: relative; height: 16px; }
.ins::before { content: "+"; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #e4e8ef; color: #8a94a6; font: 700 13px/16px var(--head); text-align: center; transition: opacity .12s; }
.ins-in { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); display: flex; justify-content: center; gap: 6px; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 3; }
.ins:hover .ins-in, .ins:focus-within .ins-in { opacity: 1; pointer-events: auto; }
.ins:hover::before, .ins:focus-within::before { opacity: 0; }
.ins.end { margin-bottom: -6px; }
@media (hover: none) {
  .ins { height: 40px; }
  .ins::before { display: none; }
  .ins-in { opacity: 1; pointer-events: auto; }
}
.ins button { border: 1.5px dashed var(--line2); background: #fff; box-shadow: 0 2px 8px rgba(16, 24, 40, .10); white-space: nowrap; border-radius: 99px; padding: 4px 12px; font-family: var(--head); font-size: 12.5px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.ins button:hover { border-color: var(--brand); color: var(--brand); border-style: solid; }
.ins .ico { width: 14px; height: 14px; }
.bq { border-radius: 16px; }
.bq-head { gap: 10px; padding: 12px 12px 12px 8px; }
.bq-head .drag { cursor: grab; color: #b0b8c6; width: 22px; height: 30px; display: grid; place-items: center; flex: none; border-radius: 6px; }
.bq-head .drag:hover { color: var(--ink2); background: #f2f4f7; }
.bq-head .drag:active { cursor: grabbing; }
.bq.dragging { opacity: .45; }
.bq.drop-before { box-shadow: 0 -4px 0 var(--brand), var(--shadow); }
.bq.drop-after { box-shadow: 0 4px 0 var(--brand), var(--shadow); }
.bq-head .t span.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 3px; }
.tchip { font-size: 11.5px; font-weight: 600; color: var(--muted); background: #f2f4f7; border-radius: 6px; padding: 1px 7px; }
.tchip.warn { color: #93370d; background: #fef0c7; }
.tchip.cond { color: #5925dc; background: #f4f3ff; }
.reqsw { flex: none; display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; font-family: var(--head); font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 6px; border-radius: 8px; }
.reqsw:hover { background: #f2f4f7; }
.reqsw i { width: 32px; height: 18px; border-radius: 99px; background: #d0d5dd; position: relative; transition: background .15s; flex: none; }
.reqsw i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .2); transition: transform .15s; }
.reqsw.on { color: var(--danger); }
.reqsw.on i { background: var(--danger); }
.reqsw.on i::after { transform: translateX(14px); }
@media (max-width: 640px) { .reqsw span { display: none; } .bq-head .acts button.mv { display: none; } }
.bq-body { background: #fbfcfe; padding: 18px 18px 8px; }
.bq-body .callout { margin: 0 0 14px; }
.quickadd { margin-top: 18px; padding: 16px; border: 2px dashed var(--line2); border-radius: 18px; background: #fff; }
.quickadd .lbl { font-family: var(--head); font-weight: 800; font-size: 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.quickadd .qa { display: flex; flex-wrap: wrap; gap: 8px; }
.quickadd .qa button { border: 1.5px solid var(--line2); background: #fff; border-radius: 11px; padding: 8px 12px; font-family: var(--head); font-weight: 700; font-size: 13.5px; color: var(--ink2); display: inline-flex; align-items: center; gap: 6px; }
.quickadd .qa button:hover { border-color: var(--brand); color: var(--brand); background: color-mix(in srgb, var(--brand) 5%, #fff); }
.quickadd .qa button.more { border-style: dashed; }

/* settings: share + colours */
.share-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btn.wa { background: #25d366 !important; box-shadow: 0 4px 12px rgba(37, 211, 102, .3) !important; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.swatch { border: 1.5px solid var(--line2); background: #fff; border-radius: 12px; padding: 7px 10px 7px 7px; display: inline-flex; align-items: center; gap: 8px; font-family: var(--head); font-size: 12.5px; font-weight: 700; color: var(--ink2); }
.swatch i { width: 30px; height: 22px; border-radius: 7px; display: block; }
.swatch:hover { border-color: var(--ink2); }
.swatch.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }
.preview-strip { height: 46px; border-radius: 12px; margin-bottom: 14px; display: flex; align-items: center; padding: 0 16px; color: #fff; font-family: var(--head); font-weight: 700; font-size: 14px; }
.chips-in { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips-in span { font-size: 12.5px; font-weight: 600; background: var(--danger-bg); color: #b42318; border-radius: 8px; padding: 3px 9px; }

@media print { .ins, .quickadd, .pg-div .btn { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .qb, .qb.shake { animation: none !important; } }

/* ---- response details (admin) ---- */
.metabox { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 4px 0 10px; }
.metabox > div { background: #f6f8fb; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; min-width: 0; }
.metabox span { display: block; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.metabox b { font-size: 14px; overflow-wrap: anywhere; }
@media (max-width: 560px) { .metabox { grid-template-columns: 1fr; } }
.privacy { font-size: 12px; color: var(--faint); margin: 16px auto 0; max-width: 420px; line-height: 1.5; }

/* =====================================================
   PHONES: compact, thumb-friendly survey (most doctors open the link on a phone)
   ===================================================== */
@media (max-width: 600px) {
  body.sv { font-size: 14.5px; }
  body.sv::before { height: 210px; border-radius: 0 0 28px 28px; }
  .sv-top-in { min-height: 48px; padding: 6px 12px; }
  .brandmark .bm-name { font-size: 16px; }
  .brandmark img { max-height: 26px; }
  .sv-step { font-size: 11.5px; padding: 4px 9px; }
  .sv-prog { height: 4px; }
  .sv-main { padding: 12px 10px 104px; }

  /* welcome / thank-you */
  .sv-card { border-radius: 18px; }
  .sv-hero { padding: 22px 16px 20px; }
  .hero-ico { width: 56px; height: 56px; border-radius: 17px; margin-bottom: 12px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 10%, #fff); }
  .hero-ico .ico { width: 28px; height: 28px; }
  .sv-hero .badge { font-size: 11.5px; padding: 4px 10px; margin-bottom: 10px; }
  .sv-hero h1 { font-size: 22px; margin-bottom: 10px; }
  .sv-hero .desc { font-size: 14.5px; padding: 12px 13px 4px; border-radius: 12px; line-height: 1.5; }
  .chips { margin: 14px 0 16px; gap: 6px; }
  .chip { font-size: 12px; padding: 5px 10px; }
  .sv-hero .btn.lg { min-height: 48px; font-size: 16px; min-width: 0; width: 100%; }
  .done-ico { width: 64px; height: 64px; margin-bottom: 12px; }
  .done-ico .ico { width: 30px; height: 30px; }

  /* page + question cards */
  .pg-head { padding: 2px 4px 10px; }
  .pg-kicker { font-size: 10.5px; margin-bottom: 2px; }
  .pg-head h1 { font-size: 19px; }
  .sec-head { font-size: 16px; margin: 16px 2px 8px; }
  .qlist { gap: 10px; }
  .qb { padding: 13px 12px 12px; border-radius: 16px; border-width: 1.5px; scroll-margin: 70px 0 110px; }
  .qb-head { gap: 9px; }
  .qb-num { min-width: 26px; height: 26px; padding: 0 6px; border-radius: 8px; font-size: 12px; }
  .qb .q-title { font-size: 15.5px; line-height: 1.38; margin-top: 2px; }
  .qb .q-help { font-size: 12.5px; margin-top: 2px; }
  .qb-ok { width: 22px; height: 22px; margin-top: 2px; }
  .qb-ok .ico { width: 13px; height: 13px; }
  .qb .q-body { margin-top: 11px; }
  .qb .q-tally { font-size: 11.5px; padding: 2px 8px; margin-top: 6px; }
  .q-err { font-size: 12.5px; padding: 8px 10px; margin-top: 10px; border-radius: 10px; }
  .pg-alert { font-size: 13px; padding: 10px 12px; margin-top: 12px; border-radius: 12px; }

  /* choices */
  .opts { gap: 7px; }
  .opt { min-height: 44px; padding: 9px 11px; font-size: 14.5px; gap: 10px; border-radius: 12px; }
  .opt .mark.dot, .opt .mark.box { width: 19px; height: 19px; }
  .opt.sel .mark.dot::after { width: 9px; height: 9px; }
  .opt .mark.rank { width: 26px; height: 26px; font-size: 13px; border-radius: 8px; }
  .opts.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opts.tiles .opt { min-height: 86px; padding: 10px; font-size: 13px; gap: 8px; }
  .input, .field input[type=text], .field textarea { font-size: 16px; min-height: 42px; padding: 9px 11px; }   /* 16px stops iPhone zooming in */
  textarea.input { min-height: 84px; }
  .rank-hint { font-size: 12px; margin-top: 8px; }
  .keyhint { font-size: 11.5px; }

  /* scales and grids */
  .nums { gap: 4px; }
  .num { height: 40px; font-size: 14px; border-radius: 9px; }
  .nums.many { gap: 3px; }
  .nums.many .num { height: 36px; font-size: 13px; border-radius: 8px; }
  .scale-ends { font-size: 11.5px; margin-top: 4px; }
  .scale-key { font-size: 11.5px; padding: 6px 9px; margin-bottom: 8px; border-radius: 9px; }
  .mrow { padding: 9px 10px; margin-bottom: 7px; border-radius: 12px; }
  .mrow-label { font-size: 13.5px; margin-bottom: 7px; gap: 7px; }
  .mrow-label .n { width: 19px; height: 19px; font-size: 10.5px; border-radius: 6px; }
  .pills { gap: 5px; }
  .pill { min-height: 36px; font-size: 12.5px; padding: 5px 6px; border-radius: 9px; }
  .pills.free .pill { padding: 5px 10px; }
  .pills.fit .pill { padding: 5px 3px; font-size: 12px; overflow-wrap: normal; word-break: normal; }
  .vs { border-radius: 11px; padding: 3px; }
  .vs .pill { min-height: 36px; font-size: 12.5px; }
  .gline { grid-template-columns: 78px minmax(0, 1fr); gap: 7px; margin-top: 5px; }
  .gline > span { font-size: 12.5px; }
  .sl-line { grid-template-columns: minmax(0, 1fr) 58px; gap: 10px; }
  .sl-val { font-size: 16px; padding: 6px 2px; border-radius: 9px; }
  .sl-val:not(.set) { font-size: 11px; padding: 8px 2px; }
  .sl-ends { font-size: 10.5px; }

  /* bottom bar */
  .sv-nav { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
  .sv-nav-in { gap: 8px; }
  .sv-nav .btn { min-height: 44px; font-size: 15px; border-radius: 11px; }
  .sv-nav .btn.ghost { padding: 8px 12px; }
  .sv-nav .next { min-width: 118px; padding: 8px 16px; }
  .sv-nav .hint { font-size: 11.5px; padding: 4px 8px; }
  .sv-foot { font-size: 11.5px; margin-top: 14px; }
}
@media (max-width: 360px) {
  .nums.many .num { height: 34px; font-size: 12px; }
  .opt { font-size: 14px; }
  .sv-nav .hint { display: none; }
}

/* =====================================================
   Logo, Home button, landing page, popups
   ===================================================== */
.mc-logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: inherit; min-width: 0; border-radius: 10px; }
.mc-logo:hover .mc-word { color: var(--brand); }
.mc-mark { height: 30px; width: auto; display: block; }
.mc-custom { max-height: 32px; max-width: 160px; display: block; }
.mc-word { font-family: var(--head); font-weight: 800; font-size: 17px; letter-spacing: .1em; color: #1d4e9e; transition: color .15s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-top-r { display: flex; align-items: center; gap: 8px; flex: none; }
.home-btn { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line2); background: #fff; border-radius: 99px; padding: 5px 12px 5px 9px; font-family: var(--head); font-weight: 700; font-size: 13px; color: var(--ink2); min-height: 34px; }
.home-btn:hover { border-color: var(--brand); color: var(--brand); }
.home-btn .ico { width: 17px; height: 17px; }
.sv-foot a { color: inherit; font-weight: 700; text-decoration: none; border-bottom: 1px dotted currentColor; }
.sv-foot a:hover { color: var(--brand); }

/* landing */
.wl { padding: 0; overflow: hidden; text-align: left; }
.wl-band { position: relative; color: #fff; padding: 30px 30px 34px; overflow: hidden;
  background:
    radial-gradient(420px 220px at 100% 0%, color-mix(in srgb, var(--accent) 70%, transparent), transparent 70%),
    radial-gradient(300px 200px at 0% 100%, rgba(255, 255, 255, .14), transparent 70%),
    linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 62%, #0b1430)); }
.wl-band::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 220px; height: 220px; border-radius: 50%; border: 28px solid rgba(255, 255, 255, .07); }
.wl-ecg { position: absolute; left: 0; right: 0; top: 50%; height: 80px; transform: translateY(-50%); color: rgba(255, 255, 255, .16); pointer-events: none; }
.wl-ecg svg { width: 100%; height: 100%; display: block; }
.wl-ecg path { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: ecgdraw 3.2s ease-out .2s forwards; }
@keyframes ecgdraw { to { stroke-dashoffset: 0; } }
.wl-band .badge { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 7px; background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .25); font-family: var(--head); font-weight: 700; font-size: 12.5px; padding: 6px 12px; border-radius: 99px; margin-bottom: 14px; backdrop-filter: blur(4px); }
.wl-band h1 { position: relative; z-index: 1; font-size: clamp(24px, 4.6vw, 34px); font-weight: 800; line-height: 1.18; color: #fff; text-wrap: balance; }
.wl-body { padding: 24px 30px 26px; }
.wl .desc { color: var(--ink2); font-size: 15.5px; line-height: 1.65; text-align: justify; text-justify: inter-word; hyphens: auto; -webkit-hyphens: auto; margin: 0; background: none; border: 0; padding: 0; }
.wl .desc p { margin: 0 0 .7em; }
.wl .desc p:first-child { font-family: var(--head); font-weight: 700; color: var(--ink); font-size: 17px; text-align: left; }
.wl-note { display: flex; align-items: flex-start; gap: 9px; background: color-mix(in srgb, var(--brand) 8%, #fff); color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 20%, #fff); border-radius: 12px; padding: 10px 13px; font-weight: 600; font-size: 14px; margin-bottom: 16px; }
.wl-note .ico { margin-top: 2px; }
.wl-note.ok { background: var(--ok-bg); color: var(--ok); border-color: #abefc6; }
.wl-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 20px 0 22px; }
.wl-fact { background: #f6f8fb; border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wl-fi { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--grad); margin-bottom: 6px; }
.wl-fi .ico { width: 17px; height: 17px; }
.wl-fact b { font-family: var(--head); font-weight: 800; font-size: 15px; color: var(--ink); }
.wl-fact > span:last-child { font-size: 12.5px; color: var(--muted); }
.wl-go { width: 100%; min-height: 54px; font-size: 17px; }
.wl-over { display: flex; margin: 10px auto 0; }
.wl .privacy { text-align: center; }

/* popup */
.modal { border-radius: 22px; }
.modal h3 { font-family: var(--head); font-weight: 800; }
.pop { text-align: center; padding: 4px 6px 0; }
.pop .done-ico { width: 64px; height: 64px; margin-bottom: 14px; }
.pop .done-ico .ico { width: 30px; height: 30px; }
.pop p { font-size: 15px; }
.pop p.muted { font-size: 14px; }
.modal-foot .btn { min-height: 44px; }
.modal-foot .pop-ok { min-width: 120px; }

@media (max-width: 600px) {
  .mc-mark { height: 24px; }
  .mc-word { font-size: 14px; letter-spacing: .08em; }
  .home-btn { padding: 4px 10px 4px 7px; font-size: 12px; min-height: 30px; }
  .home-btn .ico { width: 15px; height: 15px; }
  .sv-top-r { gap: 6px; }
  .wl-band { padding: 20px 16px 22px; }
  .wl-band .badge { font-size: 11px; padding: 4px 10px; margin-bottom: 10px; }
  .wl-band h1 { font-size: 22px; }
  .wl-body { padding: 16px 16px 18px; }
  .wl .desc { font-size: 14.5px; line-height: 1.6; }
  .wl .desc p:first-child { font-size: 15.5px; }
  .wl-facts { gap: 6px; margin: 14px 0 16px; }
  .wl-fact { padding: 9px 8px; border-radius: 12px; }
  .wl-fi { width: 26px; height: 26px; border-radius: 8px; margin-bottom: 4px; }
  .wl-fi .ico { width: 14px; height: 14px; }
  .wl-fact b { font-size: 12.5px; }
  .wl-fact > span:last-child { font-size: 11px; line-height: 1.3; }
  .wl-go { min-height: 48px; font-size: 16px; }
  .wl-note { font-size: 13px; padding: 9px 11px; margin-bottom: 12px; }
  .modal { padding: 18px 16px; }
  .modal-bg { align-items: center; }
}
@media (max-width: 360px) { .home-btn span { display: none; } .home-btn { padding: 5px; } }
@media (prefers-reduced-motion: reduce) { .wl-ecg path { animation: none; stroke-dashoffset: 0; } }
.ad-logo img.ad-mark { background: #fff; border-radius: 8px; padding: 3px 5px; max-height: 32px; }

/* backups */
.bk-status { border-radius: 12px; padding: 10px 13px; font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.bk-status.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #abefc6; }
.bk-status.warn { background: #fffaeb; color: #93370d; border: 1px solid #fedf89; }
.bk-list table { margin-top: 0; }

/* smoother admin on slower computers: no costly effects while moving the mouse over the question list */
.bq { transition: none; }
.bq:hover { box-shadow: var(--shadow); border-color: #cfd6e2; }

.bq-save { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); margin: 6px -18px 0; padding: 12px 18px; background: #fff; border-radius: 0 0 16px 16px; }
.bq-save .muted { margin-right: auto; }
