/* ============ Survey Platform: shared styles ============ */
:root {
  --ink: #0b1b33;
  --ink2: #2a3d58;
  --muted: #5a6b82;
  --faint: #8794a8;
  --line: #e2e7ee;
  --line2: #cfd6e0;
  --bg: #f4f6f9;
  --card: #ffffff;
  --brand: #1d4e9e;
  --accent: #19a974;
  --danger: #c93434;
  --ok: #0e8f5f;
  --tint: color-mix(in srgb, var(--brand) 7%, #fff);
  --tint2: color-mix(in srgb, var(--brand) 14%, #fff);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11, 27, 51, .05), 0 6px 24px rgba(11, 27, 51, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --head: "Outfit", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--head); margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0 0 .7em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--brand); }
.ico { display: inline-flex; width: 1.15em; height: 1.15em; flex: none; vertical-align: -.18em; }
.ico svg { width: 100%; height: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.sp { justify-content: space-between; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid transparent; border-radius: 10px; padding: 9px 16px; font-weight: 600; font-size: 14px; background: var(--brand); color: #fff; min-height: 40px; text-decoration: none; transition: filter .15s, background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; filter: none; }
.btn.ghost { background: #fff; color: var(--ink2); border-color: var(--line2); }
.btn.ghost:hover { background: var(--bg); filter: none; }
.btn.subtle { background: transparent; color: var(--ink2); border-color: transparent; padding: 7px 10px; min-height: 34px; }
.btn.subtle:hover { background: rgba(11, 27, 51, .06); filter: none; }
.btn.danger { background: #fff; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, #fff); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 7%, #fff); filter: none; }
.btn.lg { min-height: 50px; padding: 12px 24px; font-size: 16px; border-radius: 12px; }
.btn.sm { min-height: 32px; padding: 5px 10px; font-size: 13px; border-radius: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, #fff); outline-offset: 2px; }

/* ---- form fields ---- */
.field { display: block; margin-bottom: 14px; }
.field > span, .label { display: block; font-size: 13px; font-weight: 600; color: var(--ink2); margin-bottom: 5px; }
.field small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.input, .field input[type=text], .field input[type=password], .field input[type=number], .field select, .field textarea {
  width: 100%; border: 1.5px solid var(--line2); border-radius: 10px; padding: 10px 12px; background: #fff; min-height: 42px; font-size: 15px;
}
.field textarea, textarea.input { resize: vertical; min-height: 80px; line-height: 1.45; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, #fff); }
.check { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 12px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.cols3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
@media (max-width: 640px) { .cols2, .cols3 { grid-template-columns: 1fr; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---- toast & tooltip & modal ---- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; font-weight: 500; opacity: 0; transition: all .25s; z-index: 200; max-width: calc(100vw - 32px); box-shadow: 0 8px 30px rgba(0, 0, 0, .25); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); }
.tip { position: fixed; z-index: 300; background: var(--ink); color: #fff; font-size: 12.5px; line-height: 1.4; padding: 7px 10px; border-radius: 8px; pointer-events: none; max-width: 260px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); white-space: pre-line; }
.modal-bg { position: fixed; inset: 0; background: rgba(11, 27, 51, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 560px; padding: 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); animation: pop .18s ease-out; }
.modal.wide { max-width: 760px; }
.modal h3 { font-size: 20px; margin-bottom: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* =====================================================
   RESPONDENT (HCP) SURVEY
   ===================================================== */
body.sv { background: linear-gradient(180deg, var(--tint) 0, var(--bg) 320px); min-height: 100vh; min-height: 100dvh; }
.sv-top { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.sv-top-in { max-width: 820px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.brandmark { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brandmark img { max-height: 34px; max-width: 150px; display: block; }
.brandmark .bm-name { font-family: var(--head); font-weight: 700; font-size: 21px; color: var(--brand); letter-spacing: -.02em; line-height: 1; }
.brandmark .bm-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; margin-left: -4px; align-self: flex-end; margin-bottom: 3px; }
.brandmark .bm-tag { font-size: 11.5px; color: var(--muted); border-left: 1px solid var(--line2); padding-left: 9px; line-height: 1.2; }
.orgmark { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); text-align: right; line-height: 1.2; min-width: 0; }
.orgmark img { max-height: 26px; max-width: 110px; }
.orgmark b { display: block; font-family: var(--head); color: var(--ink); font-size: 13.5px; font-weight: 600; letter-spacing: .01em; }
.sv-prog { height: 4px; background: var(--line); }
.sv-prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 55%, var(--accent))); border-radius: 0 4px 4px 0; transition: width .35s ease; }
.sv-main { max-width: 820px; margin: 0 auto; padding: 20px 16px 120px; }
.sv-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 26px 26px 22px; animation: rise .28s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) { .sv-card { padding: 20px 16px 18px; border-radius: 16px; } .brandmark .bm-tag { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.sv-hero { text-align: center; padding: 34px 26px 30px; }
.sv-hero .badge { display: inline-flex; align-items: center; gap: 7px; background: var(--tint); color: var(--brand); font-weight: 600; font-size: 12.5px; padding: 6px 12px; border-radius: 99px; margin-bottom: 16px; letter-spacing: .02em; }
.sv-hero h1 { font-size: clamp(26px, 5.4vw, 36px); margin-bottom: 14px; }
.sv-hero .desc { color: var(--ink2); font-size: 16px; max-width: 560px; margin: 0 auto 6px; text-align: left; }
.sv-hero .desc p:first-child { font-weight: 600; color: var(--ink); }
.chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 20px 0 24px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line2); border-radius: 99px; padding: 6px 12px; font-size: 13px; color: var(--ink2); background: #fff; }
.sv-hero .btn.lg { min-width: 220px; }
.sv-foot { text-align: center; color: var(--faint); font-size: 12px; margin-top: 18px; }

.q-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; font-size: 12.5px; }
.q-sec { color: var(--brand); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; font-size: 11.5px; }
.q-code { background: var(--tint2); color: var(--brand); font-weight: 700; border-radius: 6px; padding: 2px 8px; font-size: 12px; }
.q-count { margin-left: auto; color: var(--muted); font-weight: 500; }
.q-title { font-size: clamp(19px, 3.6vw, 23px); font-weight: 600; margin-bottom: 6px; }
.q-title .req { color: var(--accent); margin-left: 3px; }
.q-help { color: var(--muted); font-size: 14px; margin-bottom: 4px; }
.q-body { margin-top: 18px; }
.q-err { display: flex; gap: 8px; align-items: flex-start; background: color-mix(in srgb, var(--danger) 8%, #fff); color: #8f1f1f; border: 1px solid color-mix(in srgb, var(--danger) 30%, #fff); border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 500; margin-top: 14px; }
.q-tally { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--bg); border-radius: 99px; padding: 3px 10px; margin-top: 8px; }
.q-tally.full { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, #fff); }

/* choice options */
.opts { display: grid; gap: 9px; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #fff; border: 1.5px solid var(--line2); border-radius: 12px; padding: 12px 14px; min-height: 52px; font-size: 15.5px; font-weight: 500; transition: border-color .12s, background .12s, box-shadow .12s; }
.opt:hover { border-color: color-mix(in srgb, var(--brand) 55%, #fff); background: var(--tint); }
.opt.sel { border-color: var(--brand); background: var(--tint); box-shadow: 0 0 0 1px var(--brand) inset; }
.opt .mark { width: 22px; height: 22px; border: 2px solid var(--line2); border-radius: 50%; flex: none; display: grid; place-items: center; background: #fff; transition: all .12s; color: #fff; font-size: 12px; font-weight: 700; }
.opt .mark.sq { border-radius: 6px; }
.opt.sel .mark { background: var(--brand); border-color: var(--brand); }
.opt .mark .ico { width: 14px; height: 14px; opacity: 0; }
.opt.sel .mark .ico { opacity: 1; }
.opt.sel .mark.dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.opt .mark.rank { width: 28px; height: 28px; font-size: 14px; color: transparent; }
.opt.sel .mark.rank { color: #fff; }
.opt-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.other-in { margin-top: 2px; }
.rank-hint { font-size: 13px; color: var(--muted); margin-top: 10px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; }

/* number scales */
.nums { display: flex; gap: 6px; }
.num { flex: 1 1 0; min-width: 0; height: 46px; border: 1.5px solid var(--line2); background: #fff; border-radius: 10px; font-weight: 600; font-size: 15px; padding: 0; transition: all .12s; }
.num:hover { border-color: var(--brand); background: var(--tint); }
.num.sel { background: var(--brand); border-color: var(--brand); color: #fff; }
.nums.many { gap: 4px; }
.nums.many .num { height: 42px; font-size: 14px; border-radius: 8px; }
.scale-ends { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.scale-key { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink2); background: var(--bg); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; font-weight: 500; }

/* grid rows */
.mrow { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: #fff; transition: border-color .15s, background .15s; scroll-margin: 90px 0 120px; }
.mrow.done { border-color: color-mix(in srgb, var(--brand) 28%, #fff); background: color-mix(in srgb, var(--brand) 2.5%, #fff); }
.mrow.missing { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 4%, #fff); }
.mrow-label { font-weight: 600; font-size: 15px; margin-bottom: 9px; display: flex; align-items: center; gap: 8px; }
.mrow-label .n { color: var(--faint); font-weight: 600; font-size: 12.5px; min-width: 18px; }
.mrow-label .tick { margin-left: auto; color: var(--ok); opacity: 0; transition: opacity .15s; }
.mrow.done .mrow-label .tick { opacity: 1; }
.pills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.pills.fit { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.pills.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pills.free { display: flex; flex-wrap: wrap; }
.pill { border: 1.5px solid var(--line2); background: #fff; border-radius: 10px; min-height: 42px; padding: 6px 8px; font-size: 13.5px; font-weight: 500; line-height: 1.2; transition: all .12s; overflow-wrap: anywhere; }
.pills.free .pill { padding: 6px 13px; border-radius: 99px; }
.pill:hover { border-color: var(--brand); background: var(--tint); }
.pill.sel { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.gline { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 10px; margin-top: 7px; }
.gline > span { font-size: 13.5px; color: var(--ink2); font-weight: 500; overflow-wrap: anywhere; }
@media (min-width: 760px) {
  .mrow.inline { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: 16px; padding: 10px 14px; }
  .mrow.inline .mrow-label { margin-bottom: 0; }
  .mrow.inline .mrow-label .tick { display: none; }
  .gline { grid-template-columns: 130px minmax(0, 1fr); }
}

/* sticky nav */
.sv-nav { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-top: 1px solid var(--line); z-index: 20; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.sv-nav-in { max-width: 820px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sv-nav .btn { min-height: 48px; font-size: 15.5px; border-radius: 12px; }
.sv-nav .next { min-width: 150px; }
.sv-nav .hint { font-size: 12px; color: var(--faint); }
@media (max-width: 600px) { .sv-nav .hint { display: none; } .sv-nav .next { flex: 1; } }
.preview-bar { background: #fff7e0; color: #6b4e00; border-bottom: 1px solid #f0dca0; text-align: center; font-size: 13px; font-weight: 600; padding: 6px 12px; }

.done-ico { width: 76px; height: 76px; border-radius: 50%; background: color-mix(in srgb, var(--ok) 12%, #fff); color: var(--ok); display: grid; place-items: center; margin: 0 auto 18px; animation: pop .4s ease-out; }
.done-ico .ico { width: 38px; height: 38px; }
.done-ico.info { background: var(--tint2); color: var(--brand); }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; margin: 80px auto; }
.btn .spinner { width: 16px; height: 16px; border-width: 2px; margin: 0; border-color: rgba(255, 255, 255, .4); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================
   ADMIN
   ===================================================== */
body.ad { --brand: #1d4e9e; --accent: #19a974; }
.ad-top { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 30; }
.ad-top-in { max-width: 1280px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 18px; min-height: 58px; }
.ad-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; min-width: 0; }
.ad-logo img { max-height: 30px; max-width: 130px; background: #fff; border-radius: 6px; padding: 3px 6px; }
.ad-logo .mk { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #2a78d6, #19a974); display: grid; place-items: center; font-family: var(--head); font-weight: 700; font-size: 16px; flex: none; }
.ad-logo b { font-family: var(--head); font-size: 17px; font-weight: 600; letter-spacing: .02em; }
.ad-logo span { font-size: 12px; color: rgba(255, 255, 255, .6); border-left: 1px solid rgba(255, 255, 255, .25); padding-left: 10px; white-space: nowrap; }
.ad-nav { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.ad-nav a, .ad-nav button { color: rgba(255, 255, 255, .78); text-decoration: none; font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 8px; background: none; border: 0; display: inline-flex; align-items: center; gap: 6px; }
.ad-nav a:hover, .ad-nav button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.ad-nav a.on { background: rgba(255, 255, 255, .14); color: #fff; }
@media (max-width: 640px) { .ad-logo span { display: none; } .ad-top-in { padding: 0 12px; gap: 8px; } .ad-nav .lbl { display: none; } }
.ad-main { max-width: 1280px; margin: 0 auto; padding: 24px 20px 90px; }
@media (max-width: 640px) { .ad-main { padding: 16px 12px 90px; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 28px; }
.page-head p { color: var(--muted); margin: 4px 0 0; }
.crumb { font-size: 13px; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.crumb:hover { color: var(--brand); }

.auth { max-width: 400px; margin: 9vh auto 0; padding: 30px 28px; }
.auth .mk { width: 46px; height: 46px; border-radius: 12px; background: linear-gradient(135deg, #2a78d6, #19a974); display: grid; place-items: center; color: #fff; font-family: var(--head); font-weight: 700; font-size: 24px; margin-bottom: 16px; }
.auth h1 { font-size: 24px; margin-bottom: 6px; }
.auth .btn { width: 100%; margin-top: 4px; }
.form-err { color: var(--danger); font-size: 13.5px; font-weight: 500; margin: -4px 0 12px; min-height: 0; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; border-radius: 99px; padding: 3px 10px; text-transform: uppercase; letter-spacing: .05em; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.live { color: #0a7a50; background: #e2f6ee; }
.status.draft { color: #6b5a00; background: #fdf3cf; }
.status.closed { color: #5a6b82; background: #e9edf2; }

.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 16px; }
.scard { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.scard .bar { height: 5px; }
.scard-in { padding: 18px 18px 14px; flex: 1; display: flex; flex-direction: column; }
.scard h3 { font-size: 18px; margin: 10px 0 4px; }
.scard h3 a { color: inherit; text-decoration: none; }
.scard h3 a:hover { color: var(--brand); }
.scard .nums3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.scard .nums3 div { background: var(--bg); border-radius: 10px; padding: 9px 10px; }
.scard .nums3 b { display: block; font-family: var(--head); font-size: 20px; line-height: 1.1; }
.scard .nums3 span { font-size: 11.5px; color: var(--muted); }
.scard .acts { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; margin-top: auto; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; font-size: 19px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line2); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; font-weight: 600; font-size: 14.5px; color: var(--muted); text-decoration: none; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.tabs .cnt { background: var(--line); color: var(--ink2); font-size: 12px; border-radius: 99px; padding: 1px 8px; }

/* dashboard */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar select { border: 1.5px solid var(--line2); border-radius: 10px; padding: 8px 10px; background: #fff; min-height: 40px; font-size: 14px; max-width: 100%; }
.toolbar .lbl { font-size: 13px; font-weight: 600; color: var(--ink2); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { padding: 16px 18px; }
.kpi .k { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi .v { font-family: var(--head); font-size: 32px; font-weight: 600; line-height: 1.15; margin-top: 4px; }
.kpi .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid2 .span2 { grid-column: 1 / -1; }
@media (max-width: 960px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.qcard { padding: 18px 18px 16px; min-width: 0; }
.qcard-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.qcard-head .code { background: var(--tint2); color: var(--brand); font-weight: 700; font-size: 12px; border-radius: 6px; padding: 3px 8px; white-space: nowrap; margin-top: 1px; }
.qcard-head h3 { font-size: 15.5px; font-weight: 600; flex: 1; min-width: 0; font-family: var(--font); letter-spacing: 0; line-height: 1.4; }
.qcard-head .n { font-size: 12px; color: var(--muted); white-space: nowrap; background: var(--bg); border-radius: 99px; padding: 3px 9px; font-weight: 600; }
.qcard .type { font-size: 11.5px; color: var(--faint); margin-top: 3px; font-weight: 500; }
.nodata { color: var(--faint); font-size: 14px; padding: 18px 0; text-align: center; }
.sub { font-size: 12.5px; font-weight: 700; color: var(--ink2); text-transform: uppercase; letter-spacing: .05em; margin: 16px 0 8px; }
.note { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.insights { padding: 18px 20px; margin-bottom: 16px; border-left: 4px solid var(--accent); }
.insights h3 { font-size: 16px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.insights ul { margin: 0; padding-left: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 28px; }
.insights li { font-size: 14px; color: var(--ink2); }
.insights li b { color: var(--ink); }
@media (max-width: 860px) { .insights ul { grid-template-columns: 1fr; } }

/* charts */
.hb { display: grid; gap: 9px; }
.hb-row { display: grid; grid-template-columns: minmax(80px, 36%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13.5px; }
.hb-label { color: var(--ink2); overflow-wrap: anywhere; line-height: 1.3; display: flex; align-items: center; gap: 7px; }
.hb-track { height: 18px; background: #eef1f5; border-radius: 4px; overflow: hidden; }
.hb-fill { height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; transition: width .5s ease; }
.hb-val { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 74px; text-align: right; white-space: nowrap; }
.hb-val span { color: var(--muted); font-weight: 500; }
@media (max-width: 560px) { .hb-row { grid-template-columns: minmax(0, 1fr) auto; } .hb-label { grid-column: 1 / -1; } }
.sw { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink2); margin-bottom: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.st { display: grid; gap: 7px; }
.st-row { display: grid; grid-template-columns: minmax(90px, 30%) minmax(0, 1fr) minmax(64px, auto); gap: 10px; align-items: center; font-size: 13.5px; }
.st-label { color: var(--ink2); line-height: 1.3; overflow-wrap: anywhere; }
.st-bar { display: flex; gap: 2px; height: 24px; border-radius: 4px; overflow: hidden; background: #eef1f5; }
.st-seg { height: 100%; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; overflow: hidden; white-space: nowrap; min-width: 0; transition: flex-basis .5s ease; }
.st-seg:hover { filter: brightness(1.1); }
.st-note { font-size: 12.5px; color: var(--ink2); font-weight: 600; text-align: right; white-space: nowrap; }
@media (max-width: 560px) { .st-row { grid-template-columns: minmax(0, 1fr) auto; } .st-label { grid-column: 1 / -1; font-weight: 500; } }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.heat { border-collapse: separate; border-spacing: 2px; width: 100%; font-size: 13px; }
table.heat th { font-weight: 600; color: var(--ink2); padding: 6px 8px; text-align: center; font-size: 12.5px; vertical-align: bottom; line-height: 1.25; }
table.heat th small { display: block; color: var(--faint); font-weight: 500; }
table.heat th.rl, table.heat td.rl { text-align: left; font-weight: 500; color: var(--ink2); min-width: 130px; padding: 6px 8px 6px 0; background: none; }
table.heat td { text-align: center; padding: 7px 8px; border-radius: 4px; font-variant-numeric: tabular-nums; font-weight: 600; min-width: 52px; }
table.heat.tight td { min-width: 34px; padding: 7px 4px; }
table.heat.tight td.rl { min-width: 110px; }
table.heat td.best { box-shadow: inset 0 0 0 2px var(--ink); }
table.heat tr.total td, table.heat tr.total th { border-top: 0; font-weight: 700; }
table.heat tr.total td.rl { font-weight: 700; color: var(--ink); }
.cols-chart { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 18px; border-bottom: 1px solid var(--line2); }
.cols-chart .c { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; }
.cols-chart .c i { display: block; width: 100%; max-width: 46px; background: #2a78d6; border-radius: 4px 4px 0 0; min-height: 2px; transition: height .5s ease; }
.cols-chart .c b { font-size: 11.5px; font-weight: 600; color: var(--ink2); margin-bottom: 3px; }
.cols-x { display: flex; gap: 4px; margin-top: 5px; }
.cols-x span { flex: 1 1 0; min-width: 0; text-align: center; font-size: 11.5px; color: var(--muted); overflow: hidden; white-space: nowrap; }
.stats { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 12px; }
.stats div b { display: block; font-family: var(--head); font-size: 24px; font-weight: 600; line-height: 1.1; }
.stats div span { font-size: 12px; color: var(--muted); }
.textlist { max-height: 260px; overflow-y: auto; display: grid; gap: 6px; }
.textlist div { background: var(--bg); border-radius: 8px; padding: 8px 11px; font-size: 13.5px; overflow-wrap: anywhere; white-space: pre-wrap; }
details.tv { margin-top: 12px; }
details.tv summary { cursor: pointer; font-size: 12.5px; color: var(--brand); font-weight: 600; user-select: none; }
table.plain { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
table.plain th, table.plain td { padding: 7px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.plain th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
table.plain td.r, table.plain th.r { text-align: right; font-variant-numeric: tabular-nums; }
table.plain tbody tr.click { cursor: pointer; }
table.plain tbody tr.click:hover { background: var(--tint); }
.rk-bar { height: 14px; border-radius: 0 4px 4px 0; min-width: 2px; display: inline-block; vertical-align: middle; margin-right: 8px; }

/* answers in response detail */
.ans { border-bottom: 1px solid var(--line); padding: 11px 0; }
.ans:last-child { border-bottom: 0; }
.ans .aq { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.ans .aq b { color: var(--brand); margin-right: 6px; }
.ans .av { font-size: 14.5px; font-weight: 500; overflow-wrap: anywhere; white-space: pre-wrap; }
.ans table { font-size: 13.5px; border-collapse: collapse; }
.ans table td { padding: 2px 14px 2px 0; vertical-align: top; }
.ans table td:first-child { color: var(--ink2); }
.ans table td:last-child { font-weight: 600; }

/* builder */
.build { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; max-width: 900px; }
.bq { padding: 0; overflow: hidden; }
.bq-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; }
.bq-head:hover { background: var(--bg); }
.bq-head .qn { min-width: 28px; padding: 0 7px; white-space: nowrap; height: 28px; border-radius: 8px; background: var(--tint2); color: var(--brand); font-weight: 700; font-size: 13px; display: grid; place-items: center; flex: none; }
.bq-head .t { flex: 1; min-width: 0; }
.bq-head .t b { display: block; font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bq-head .t span { font-size: 12px; color: var(--muted); }
.bq-head .acts { display: flex; gap: 2px; flex: none; }
.bq-head .acts button { width: 32px; height: 32px; border: 0; background: none; border-radius: 8px; color: var(--muted); display: grid; place-items: center; padding: 0; }
.bq-head .acts button:hover { background: var(--line); color: var(--ink); }
.bq-head .acts button:disabled { opacity: .3; cursor: default; background: none; }
.bq-head .acts button.del:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, #fff); }
.bq-body { border-top: 1px solid var(--line); padding: 16px 16px 6px; background: #fcfdfe; }
.bq.open { border-color: color-mix(in srgb, var(--brand) 45%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 10%, #fff), var(--shadow); }
.logic { background: var(--bg); border: 1px dashed var(--line2); border-radius: 10px; padding: 12px 12px 2px; margin-bottom: 14px; }
.logic .label { margin-bottom: 8px; }
.logic-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1fr); gap: 8px; margin-bottom: 10px; }
.logic-row select, .logic-row input { border: 1.5px solid var(--line2); border-radius: 8px; padding: 7px 9px; min-height: 38px; background: #fff; width: 100%; font-size: 14px; }
@media (max-width: 640px) { .logic-row { grid-template-columns: 1fr; } }
.addq { border: 2px dashed var(--line2); border-radius: var(--radius); padding: 16px; text-align: center; background: transparent; width: 100%; color: var(--brand); font-weight: 600; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.addq:hover { border-color: var(--brand); background: var(--tint); }
.typegrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 560px) { .typegrid { grid-template-columns: 1fr; } }
.typegrid button { text-align: left; border: 1.5px solid var(--line2); background: #fff; border-radius: 10px; padding: 10px 12px; }
.typegrid button:hover { border-color: var(--brand); background: var(--tint); }
.typegrid button b { display: block; font-size: 14px; }
.typegrid button span { font-size: 12px; color: var(--muted); }
.typegrid h4 { grid-column: 1 / -1; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 6px; font-family: var(--font); }
.savebar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--ink); color: #fff; z-index: 40; padding: 10px 20px calc(10px + env(safe-area-inset-bottom)); transform: translateY(110%); transition: transform .22s ease; }
.savebar.show { transform: none; }
.savebar-in { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 500; }
.savebar .btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.savebar .btn.ghost:hover { background: rgba(255, 255, 255, .1); }
.savebar .btn.primary { background: var(--accent); }

.panel { padding: 20px; margin-bottom: 16px; max-width: 900px; }
.panel h3 { font-size: 17px; margin-bottom: 4px; }
.panel > p.muted { margin-bottom: 16px; font-size: 13.5px; }
.linkbox { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.linkbox input { flex: 1; min-width: 200px; border: 1.5px solid var(--line2); border-radius: 10px; padding: 10px 12px; font-size: 15px; background: var(--bg); font-weight: 500; }
.callout { background: #fff7e0; border: 1px solid #f0dca0; color: #5c4400; border-radius: 10px; padding: 10px 13px; font-size: 13.5px; margin-top: 12px; }
.callout.info { background: var(--tint); border-color: var(--tint2); color: var(--ink2); }
.logo-up { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo-prev { height: 54px; min-width: 110px; border: 1.5px dashed var(--line2); border-radius: 10px; display: grid; place-items: center; padding: 6px 10px; background: #fff; color: var(--faint); font-size: 12px; }
.logo-prev img { max-height: 40px; max-width: 160px; display: block; }
.color-in { display: flex; gap: 8px; align-items: center; }
.color-in input[type=color] { width: 46px; height: 42px; border: 1.5px solid var(--line2); border-radius: 10px; padding: 3px; background: #fff; cursor: pointer; }

@media print {
  .ad-top, .tabs, .toolbar, .savebar, .no-print, .crumb, .page-head .btn { display: none !important; }
  body { background: #fff; }
  .ad-main { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  .grid2 { gap: 10px; }
  details.tv { display: none; }
}
