:root {
  --primary: #0e7c86;
  --primary-dark: #075c64;
  --primary-soft: #e8f7f7;
  --staff: #405db7;
  --staff-dark: #2e438b;
  --ink: #17313c;
  --muted: #637984;
  --line: #d9e5ea;
  --bg: #f3f7fa;
  --card: #ffffff;
  --danger: #c43c4b;
  --warning: #a66b11;
  --success: #147a57;
  --shadow: 0 20px 55px rgba(26, 63, 77, .08);
  --shadow-strong: 0 24px 70px rgba(14, 92, 100, .16);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 15px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 5% 0%, rgba(14,124,134,.08), transparent 28rem),
    linear-gradient(180deg, #f8fbfd 0, var(--bg) 26rem);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.wrap { width: min(100% - 40px, 1320px); margin-inline: auto; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(217,229,234,.9);
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(160%) blur(16px);
}
.topbar-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.brand { min-width: 0; display: flex; align-items: center; gap: 13px; }
.brand-logo {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  letter-spacing: .06em;
  background: linear-gradient(135deg, var(--primary), #21adb5);
  box-shadow: 0 10px 25px rgba(14,124,134,.25);
}
.brand-logo.staff { background: linear-gradient(135deg, var(--staff), #748bdd); box-shadow: 0 10px 25px rgba(64,93,183,.25); }
.brand-copy { min-width: 0; display: block; }
.brand-copy strong, .brand-copy small { display: block; }
.brand-copy strong { font-size: 14px; letter-spacing: .045em; }
.brand-copy small { margin-top: 1px; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.top-link, .privacy-pill { padding: 9px 13px; border-radius: 999px; font-size: 12px; font-weight: 750; }
.top-link { color: #385875; background: #edf5fb; }
.top-link:hover { background: #e2eef8; }
.privacy-pill { color: var(--success); background: #eaf8f2; }
.privacy-pill span { font-size: 8px; vertical-align: 2px; }

.survey-layout { display: grid; grid-template-columns: 304px minmax(0, 1fr); gap: 26px; padding-block: 26px 60px; }
.side-panel { align-self: start; position: sticky; top: 102px; }
.side-card { margin-bottom: 16px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow); }
.side-card.muted { background: rgba(255,255,255,.72); box-shadow: none; }
.side-label { margin: 0 0 13px; color: #778b95; font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.side-empty, .side-note { margin: 0; color: var(--muted); font-size: 13px; }
.mode-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.mode-btn:hover { border-color: #9bc7cb; transform: translateY(-1px); }
.mode-btn.active { border-color: var(--primary); background: #fbffff; box-shadow: 0 0 0 4px rgba(14,124,134,.08); }
.staff-theme .mode-btn.active { border-color: var(--staff); background: #fcfcff; box-shadow: 0 0 0 4px rgba(64,93,183,.08); }
.mode-index { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); font-size: 13px; font-weight: 900; }
.staff-theme .mode-index { color: var(--staff); background: #eef1ff; }
.mode-copy { min-width: 0; }
.mode-copy strong { display: block; font-size: 12px; letter-spacing: .06em; }
.mode-copy small { display: -webkit-box; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.status-dot { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 11px; font-style: normal; font-weight: 800; }
.status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-open { color: var(--success) !important; }
.status-closed, .status-disabled, .status-expired { color: var(--danger) !important; }
.status-not-started, .status-draft { color: var(--warning) !important; }
.status-maintenance { color: #7250a5 !important; }
.progress-row { display: flex; align-items: baseline; gap: 8px; }
.progress-row strong { color: var(--primary); font-size: 30px; letter-spacing: -.04em; }
.staff-theme .progress-row strong { color: var(--staff); }
.progress-row span { color: var(--muted); font-size: 12px; }
.progress-track { height: 9px; margin: 8px 0 13px; overflow: hidden; border-radius: 999px; background: #e8eff2; }
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #28b8ba); transition: width .25s ease; }
.staff-theme .progress-track i { background: linear-gradient(90deg, var(--staff), #7e91dd); }
.mini-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.mini-list li + li { margin-top: 8px; }
.mini-list strong { color: var(--danger); }

.survey-stage { min-width: 0; }
.mobile-survey-switch { display: none; }
.headline-card {
  position: relative;
  margin-bottom: 20px;
  padding: 30px 32px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  color: #fff;
  background: linear-gradient(135deg, #0d6871 0%, var(--primary) 62%, #28aeb3 100%);
  box-shadow: var(--shadow-strong);
}
.headline-card::after { content: ""; position: absolute; width: 250px; height: 250px; right: -90px; top: -125px; border: 44px solid rgba(255,255,255,.08); border-radius: 50%; }
.headline-card.staff { background: linear-gradient(135deg, #304a9a 0%, var(--staff) 62%, #758bdd 100%); }
.headline-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.headline-kicker, .headline-status { display: inline-flex; padding: 7px 11px; border-radius: 999px; font-size: 11px; font-weight: 900; letter-spacing: .1em; }
.headline-kicker { background: rgba(255,255,255,.14); }
.headline-status { color: #fff !important; background: rgba(255,255,255,.16); letter-spacing: .03em; }
.headline-card h1 { position: relative; z-index: 1; max-width: 850px; margin: 17px 0 10px; font-size: clamp(29px, 4vw, 44px); line-height: 1.12; letter-spacing: -.035em; }
.headline-card p { position: relative; z-index: 1; max-width: 880px; margin: 0; color: rgba(255,255,255,.9); font-size: 15px; }

.state-card { display: flex; align-items: flex-start; gap: 16px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow); }
.state-icon { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; font-size: 22px; font-weight: 900; }
.state-card h2 { margin: 1px 0 5px; font-size: 21px; }
.state-card p { margin: 0; color: var(--muted); }
.maintenance-state .state-icon { color: #7250a5; background: #f2ecfb; }
.closed-state .state-icon { color: var(--danger); background: #fdeef0; }

.section-card { margin-bottom: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-xl); background: #fff; box-shadow: var(--shadow); scroll-margin-top: 105px; }
.section-head { display: flex; align-items: flex-start; gap: 15px; padding: 23px 26px; border-bottom: 1px solid #e6eef1; background: linear-gradient(180deg, #fcfeff, #f8fbfc); }
.section-number { flex: 0 0 auto; width: 43px; height: 43px; display: grid; place-items: center; border-radius: 14px; color: var(--primary); background: var(--primary-soft); font-size: 12px; font-weight: 900; }
.staff-theme .section-number { color: var(--staff); background: #eef1ff; }
.section-head p { margin: 0 0 2px; color: #81929a; font-size: 10px; font-weight: 900; letter-spacing: .13em; }
.section-head h2 { margin: 0; font-size: 21px; line-height: 1.3; letter-spacing: -.015em; }
.section-head span:not(.section-number) { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; }
.section-body { padding: 25px 26px 28px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field.full { grid-column: 1 / -1; }
.field { min-width: 0; padding: 16px; border: 1px solid #e2eaee; border-radius: 16px; background: #fcfeff; transition: border-color .18s, box-shadow .18s; }
.field:focus-within { border-color: #8bc5ca; box-shadow: 0 0 0 4px rgba(14,124,134,.07); }
.staff-theme .field:focus-within { border-color: #aab7e4; box-shadow: 0 0 0 4px rgba(64,93,183,.07); }
.field.invalid, tr.invalid .qtext { border-color: #e09aa2; background: #fffafb; }
.field-label { display: block; margin-bottom: 10px; color: #29434e; font-size: 14px; font-weight: 750; }
.required { margin-left: 3px; color: var(--danger); }
.field input[type="text"], .field input[type="tel"], .field input[type="number"], .field input[type="date"], .field select, .field textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid #cad9df;
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: #fff;
}
.field textarea { min-height: 118px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }
.staff-theme .field input:focus, .staff-theme .field select:focus, .staff-theme .field textarea:focus { border-color: var(--staff); }
.choice-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice-pill { position: relative; display: block; cursor: pointer; }
.choice-pill input { position: absolute; opacity: 0; pointer-events: none; }
.choice-pill span { min-height: 46px; display: flex; align-items: center; padding: 10px 13px 10px 40px; border: 1px solid #d5e1e6; border-radius: 13px; background: #fff; color: #425c66; font-size: 13px; transition: .16s ease; }
.choice-pill span::before { content: ""; position: absolute; left: 14px; width: 16px; height: 16px; border: 2px solid #adc0c8; border-radius: 50%; background: #fff; }
.choice-pill input[type="checkbox"] + span::before { border-radius: 5px; }
.choice-pill input:checked + span { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); font-weight: 750; }
.choice-pill input:checked + span::before { border: 5px solid var(--primary); }
.choice-pill input[type="checkbox"]:checked + span::before { border: 4px solid var(--primary); background: var(--primary); box-shadow: inset 0 0 0 2px #fff; }
.staff-theme .choice-pill input:checked + span { border-color: var(--staff); color: var(--staff-dark); background: #eef1ff; }
.staff-theme .choice-pill input:checked + span::before { border-color: var(--staff); }
.staff-theme .choice-pill input[type="checkbox"]:checked + span::before { background: var(--staff); }
.field-help { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.question-error { display: block; margin-top: 8px; color: var(--danger); font-size: 12px; font-weight: 700; }
.question-error[hidden] { display: none; }

.scale-legend { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 17px; }
.scale-legend.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.scale-legend span { min-height: 62px; display: flex; flex-direction: column; justify-content: center; padding: 8px; border-radius: 12px; color: var(--muted); background: #f2f7f9; text-align: center; font-size: 10px; line-height: 1.25; }
.scale-legend b { display: block; margin-bottom: 3px; color: var(--ink); font-size: 16px; }
.rating-scroll { overflow-x: auto; border: 1px solid #dfe9ed; border-radius: 15px; }
.rating-table { width: 100%; min-width: 730px; border-collapse: collapse; }
.rating-table th, .rating-table td { border-bottom: 1px solid #e5edef; }
.rating-table thead th { position: sticky; top: 0; z-index: 1; padding: 11px 8px; color: #627780; background: #f3f7f9; font-size: 11px; text-align: center; }
.rating-table thead th:first-child { min-width: 410px; padding-left: 15px; text-align: left; }
.rating-table tbody tr:last-child th, .rating-table tbody tr:last-child td { border-bottom: 0; }
.rating-table tbody tr:hover { background: #fbfefe; }
.rating-table .qtext { padding: 14px 15px; color: #344d57; font-size: 13px; font-weight: 650; text-align: left; }
.score-cell { width: 54px; padding: 8px 5px; text-align: center; }
.rating-radio { display: inline-grid; cursor: pointer; }
.rating-radio input { position: absolute; opacity: 0; pointer-events: none; }
.rating-radio span { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #cddce1; border-radius: 11px; color: #58707a; background: #fff; font-size: 13px; font-weight: 850; transition: .15s ease; }
.rating-radio:hover span { border-color: #8ebfc3; }
.rating-radio input:focus-visible + span { outline: 3px solid rgba(14,124,134,.18); }
.rating-radio input:checked + span { border-color: var(--primary); color: #fff; background: var(--primary); box-shadow: 0 7px 15px rgba(14,124,134,.2); }
.staff-theme .rating-radio input:checked + span { border-color: var(--staff); background: var(--staff); box-shadow: 0 7px 15px rgba(64,93,183,.2); }

.submit-panel { padding: 25px 27px; border: 1px solid var(--line); border-radius: var(--radius-xl); background: #fff; box-shadow: var(--shadow); }
.submit-panel h2 { margin: 0 0 3px; font-size: 20px; }
.submit-panel p { margin: 0; color: var(--muted); font-size: 13px; }
.action-row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.btn { min-height: 45px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 17px; border: 0; border-radius: 13px; cursor: pointer; font-size: 13px; font-weight: 850; transition: transform .17s, box-shadow .17s, background .17s; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { cursor: not-allowed; opacity: .68; transform: none; }
.btn-primary { color: #fff; background: var(--primary); box-shadow: 0 10px 22px rgba(14,124,134,.2); }
.btn-primary:hover { background: var(--primary-dark); }
.staff-theme .btn-primary { background: var(--staff); box-shadow: 0 10px 22px rgba(64,93,183,.2); }
.staff-theme .btn-primary:hover { background: var(--staff-dark); }
.btn-outline { border: 1px solid var(--line); color: var(--ink); background: #fff; }
.btn-soft { color: #536b75; background: #edf3f5; }
.button-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.is-loading .button-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.submit-note { margin-top: 16px !important; padding-top: 14px; border-top: 1px solid #e7eef1; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 26px; max-width: min(90vw, 560px); padding: 12px 17px; border-radius: 13px; color: #fff; background: #253f49; box-shadow: 0 15px 40px rgba(20,45,55,.22); font-size: 13px; font-weight: 700; opacity: 0; pointer-events: none; transform: translate(-50%, 16px); transition: .22s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #a73542; }
.toast.success { background: #126c51; }
.modal { position: fixed; inset: 0; z-index: 110; display: none; place-items: center; padding: 20px; }
.modal.open { display: grid; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10,32,40,.56); backdrop-filter: blur(5px); }
.modal-card { position: relative; width: min(100%, 470px); padding: 32px; border-radius: 26px; background: #fff; box-shadow: 0 30px 90px rgba(9,36,45,.28); text-align: center; animation: modalIn .2s ease both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal-icon { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto 15px; border-radius: 20px; color: #fff; background: var(--success); font-size: 31px; font-weight: 900; }
.modal-kicker { margin: 0 0 5px; color: var(--success); font-size: 10px; font-weight: 900; letter-spacing: .13em; }
.modal-card h2 { margin: 0 0 8px; font-size: 25px; }
.modal-card p { margin: 0; color: var(--muted); }
.modal-card code { display: block; margin: 15px 0 20px; padding: 10px; border-radius: 10px; color: #24424d; background: #eef5f7; font-size: 12px; overflow-wrap: anywhere; }

@media (max-width: 1000px) {
  .survey-layout { grid-template-columns: 1fr; }
  .side-panel { position: static; }
  .survey-selector, .progress-card { display: none; }
  .side-card.muted { display: none; }
  .mobile-survey-switch { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; padding: 7px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
  .mobile-survey-switch a { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 9px; border-radius: 11px; color: var(--muted); font-size: 12px; font-weight: 800; }
  .mobile-survey-switch a.active { color: var(--primary); background: var(--primary-soft); }
  .mobile-survey-switch small { font-size: 9px; }
}

@media (max-width: 720px) {
  .wrap { width: min(100% - 24px, 1320px); }
  .topbar-inner { min-height: 68px; }
  .brand-logo { width: 42px; height: 42px; border-radius: 13px; }
  .brand-copy strong { font-size: 11px; }
  .brand-copy small { font-size: 10px; }
  .top-link { display: none; }
  .privacy-pill { padding: 7px 9px; font-size: 10px; }
  .survey-layout { gap: 16px; padding-block: 14px 36px; }
  .headline-card { padding: 23px 20px; border-radius: 22px; }
  .headline-card h1 { margin-top: 13px; font-size: 26px; }
  .headline-card p { font-size: 13px; }
  .section-card { margin-bottom: 15px; border-radius: 21px; }
  .section-head { padding: 18px; }
  .section-head h2 { font-size: 18px; }
  .section-body { padding: 18px; }
  .field-grid { grid-template-columns: 1fr; gap: 13px; }
  .field.full { grid-column: auto; }
  .field { padding: 14px; }
  .choice-list { grid-template-columns: 1fr; }
  .scale-legend { display: none; }
  .rating-table { min-width: 650px; }
  .rating-table thead th:first-child { min-width: 330px; }
  .submit-panel { padding: 20px; border-radius: 21px; }
  .action-row { display: grid; grid-template-columns: 1fr 1fr; }
  .action-row .btn-primary { grid-column: 1 / -1; grid-row: 1; }
  .modal-card { padding: 26px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

