/* ---------- base (mobile-first) ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #1d2733;
  background: #eef2f6;
}
.wrap { max-width: 640px; margin: 0 auto; padding: 16px 12px 48px; }
.wrap.wide { max-width: 860px; }
.center-page { min-height: 90vh; display: flex; align-items: center; justify-content: center; }

.card {
  background: #fff;
  border-radius: 12px;
  padding: 18px 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(20, 40, 60, .08);
}

h1 { font-size: 1.25rem; margin: 8px 0 10px; line-height: 1.35; }
h2 { font-size: 1.05rem; margin: 0 0 10px; }
h3 { font-size: 1rem; margin: 0 0 4px; }
p { margin: 6px 0; }
code { background: #f0f3f7; padding: 1px 6px; border-radius: 6px; font-size: .85em; }

/* ---------- public form ---------- */
.brand-bar { height: 6px; border-radius: 6px; background: linear-gradient(90deg, #0b7a4b, #12a563); margin: -4px -2px 10px; }
.intro-p { color: #38434f; font-size: .95rem; }
.req { color: #d3382c; }
.req-note { color: #6a7684; font-size: .85rem; margin-top: 12px; }

.qlabel { display: block; font-weight: 600; margin-bottom: 4px; }
.help { color: #6a7684; font-size: .875rem; margin: 2px 0 8px; }

.opts { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.opt {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid #d7dee6; border-radius: 10px;
  padding: 12px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.opt:active { background: #f2f8f5; }
.opt:has(input:checked) { border-color: #0b7a4b; background: #f0faf5; }
.opt input[type=radio], .opt input[type=checkbox] {
  width: 20px; height: 20px; flex-shrink: 0; accent-color: #0b7a4b; margin: 0;
}
.opt span { flex-shrink: 0; }
.opt-other { flex-wrap: wrap; }
.other-text {
  flex: 1; min-width: 120px;
  border: none; border-bottom: 1.5px solid #d7dee6;
  font-size: 16px; padding: 4px 2px; outline: none; background: transparent;
}
.other-text:focus { border-bottom-color: #0b7a4b; }

.input {
  width: 100%; font-size: 16px; font-family: inherit;
  border: 1.5px solid #d7dee6; border-radius: 10px;
  padding: 11px 12px; margin-top: 6px;
  background: #fff; color: inherit;
}
.input:focus { outline: none; border-color: #0b7a4b; box-shadow: 0 0 0 3px rgba(11, 122, 75, .12); }
textarea.input { resize: vertical; }

.q-error { border: 2px solid #d3382c; }
.err-msg { color: #d3382c; font-size: .875rem; font-weight: 600; margin: 2px 0 6px; }
.alert {
  background: #fdecea; color: #a02318;
  border: 1px solid #f2b8b2; border-radius: 10px;
  padding: 12px 14px; margin-bottom: 14px; font-size: .95rem;
}

.btn-submit {
  display: block; width: 100%;
  background: #0b7a4b; color: #fff;
  font-size: 1.05rem; font-weight: 700; font-family: inherit;
  border: none; border-radius: 12px;
  padding: 15px; margin-top: 6px; cursor: pointer;
  text-align: center; text-decoration: none;
}
.btn-submit:active { background: #096a41; }
.btn-link { margin-top: 16px; }
.foot-note { text-align: center; color: #6a7684; font-size: .85rem; margin-top: 12px; }

.hp { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; }

.privacy-box {
  background: #fff; border: 1px solid #d7dee6; border-radius: 10px;
  padding: 12px 14px; margin: 4px 0 10px;
  font-size: .85rem; color: #38434f;
}
.privacy-box summary { cursor: pointer; font-weight: 600; color: #14293e; }
.privacy-box p { margin: 8px 0 0; }
.consent-note { color: #6a7684; font-size: .8rem; margin: 0 4px 10px; }

.done { text-align: center; padding: 32px 20px; max-width: 480px; }
.tick {
  width: 64px; height: 64px; margin: 0 auto 10px;
  border-radius: 50%; background: #0b7a4b; color: #fff;
  font-size: 34px; line-height: 64px;
}
.tick.muted { background: #97a3b0; }

/* ---------- admin ---------- */
.topbar {
  background: #14293e; color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; position: sticky; top: 0; z-index: 10;
}
.topbar-title { color: #fff; font-weight: 700; text-decoration: none; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.topbar form { margin: 0; }

.btn {
  display: inline-block;
  background: #fff; color: #1d2733;
  border: 1.5px solid #cfd7e0; border-radius: 9px;
  font-size: .9rem; font-weight: 600; font-family: inherit;
  padding: 8px 13px; cursor: pointer; text-decoration: none;
  line-height: 1.3;
}
.btn:hover { border-color: #9aa8b6; }
.btn-primary { background: #0b7a4b; border-color: #0b7a4b; color: #fff; }
.btn-primary:hover { background: #096a41; border-color: #096a41; }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,.4); color: #fff; }
.btn-danger { color: #a02318; border-color: #e3a49e; }
.btn-danger:hover { background: #fdecea; }
.btn-small { padding: 4px 10px; font-size: .85rem; }
.btn-block { display: block; width: 100%; margin-bottom: 14px; }

.page-title { margin-top: 0; }
.section-title { margin: 22px 4px 10px; }
.muted-text { color: #6a7684; font-size: .9rem; }

.login-card { width: 100%; max-width: 360px; }
.field { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 160px; }
.check-field { display: flex; align-items: center; gap: 8px; font-size: .95rem; margin: 6px 0; cursor: pointer; }
.check-field input { width: 18px; height: 18px; accent-color: #0b7a4b; }
.checks { display: flex; flex-direction: column; justify-content: flex-end; }

.survey-list { display: flex; flex-direction: column; }
.survey-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  color: inherit; text-decoration: none;
}
.survey-row:hover { box-shadow: 0 2px 8px rgba(20, 40, 60, .14); }
.survey-title { font-weight: 700; }
.survey-meta { color: #6a7684; font-size: .85rem; margin-top: 2px; }
.survey-row-side { text-align: right; flex-shrink: 0; }
.count { display: block; font-size: .85rem; color: #38434f; margin-top: 4px; }
.badge {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .4px;
  border-radius: 20px; padding: 3px 10px;
}
.badge-open { background: #e0f5ea; color: #0b7a4b; }
.badge-closed { background: #f0f3f7; color: #6a7684; }
.empty-state { text-align: center; padding: 40px 16px; }

.results-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.toolbar form { margin: 0; }

.share-grid { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.share-grid > div:first-child { flex: 1; min-width: 220px; }
.qr-box { text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.qr-box img { border: 1px solid #e2e8ef; border-radius: 8px; }

.bars { margin-top: 8px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bar-label { flex: 0 0 42%; font-size: .9rem; }
.bar-track { flex: 1; background: #f0f3f7; border-radius: 6px; height: 20px; overflow: hidden; }
.bar-fill { background: linear-gradient(90deg, #0b7a4b, #12a563); height: 100%; border-radius: 6px; min-width: 2px; }
.bar-count { flex: 0 0 34px; text-align: right; font-weight: 700; font-size: .9rem; }
.others-detail { margin: 6px 0 10px; font-size: .92rem; }
.others-detail summary { cursor: pointer; color: #0b7a4b; font-weight: 600; }
.others-detail ul { margin: 8px 0; padding-left: 20px; }
.others-detail li { margin-bottom: 4px; }

.q-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.q-num { font-weight: 700; color: #14293e; }
.q-card-btns { display: flex; gap: 6px; }
.q-title { margin-bottom: 2px; }

@media (max-width: 480px) {
  .bar-label { flex-basis: 100%; }
  .bar-row { flex-wrap: wrap; row-gap: 2px; }
  .survey-row { flex-direction: column; align-items: flex-start; }
  .survey-row-side { text-align: left; }
}
