:root {
  --navy-950: #062f50;
  --navy-900: #083d68;
  --navy-800: #0a4b79;
  --navy-700: #0a5a91;
  --navy-100: #eaf4fb;
  --navy-50: #f2f8fc;
  --ink-900: #172d3e;
  --ink-700: #3d5366;
  --ink-500: #718292;
  --ink-400: #8795a3;
  --line: #dde6ed;
  --surface: #fff;
  --canvas: #f3f6f9;
  --danger: #b64a42;
  --warning: #8b5b00;
  --success: #267451;
  --shadow-sm: 0 8px 26px rgba(18, 50, 74, .06);
  --shadow-lg: 0 26px 80px rgba(8, 36, 57, .2);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink-900);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { min-height: 100%; margin: 0; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 650;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button:active { transform: translateY(1px); }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button.primary { background: var(--navy-800); color: #fff; box-shadow: 0 8px 20px rgba(10, 75, 121, .18); }
.button.primary:hover { background: var(--navy-700); }
.button.secondary { border-color: #bfd0dc; background: #fff; color: #31536b; }
.button.light { background: #fff; color: var(--navy-900); }
.button.ghost { border-color: rgba(255,255,255,.26); background: rgba(255,255,255,.07); color: #fff; }
.button.full { width: 100%; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--navy-100);
  color: var(--navy-700);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
}
.brand-mark.inverse { background: rgba(255,255,255,.12); color: rgba(255,255,255,.8); }
.eyebrow { color: var(--navy-700); font-size: 12px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }

.landing-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 15%, rgba(37, 132, 191, .18), transparent 34%),
    linear-gradient(145deg, #082f50, #0a5689 58%, #0c6a9d);
}
.landing-card {
  width: min(520px, 100%);
  padding: 52px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 24px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow-lg);
}
.landing-card h1 { margin: 24px 0 12px; font-size: clamp(28px, 6vw, 40px); letter-spacing: -.03em; }
.landing-card p { margin: 0; color: var(--ink-500); font-size: 16px; line-height: 1.8; }
.landing-note { margin-top: 28px; padding: 16px 18px; border-radius: 12px; background: var(--navy-50); color: var(--ink-700); font-size: 13px; line-height: 1.6; }
.entry-form { margin-top: 28px; }
.entry-field { display: block; }
.entry-field span { display: block; margin-bottom: 8px; color: var(--ink-700); font-size: 13px; font-weight: 650; }
.entry-field input { width: 100%; height: 52px; padding: 0 15px; border: 1px solid #cfdae2; border-radius: 11px; outline: 0; background: #fbfcfd; color: var(--ink-900); font-size: 16px; transition: border .15s, box-shadow .15s, background .15s; }
.entry-field input:focus { border-color: var(--navy-700); background: #fff; box-shadow: 0 0 0 3px rgba(10,90,145,.08); }
.entry-field input[aria-invalid="true"] { border-color: var(--danger); background: #fffafa; }
.entry-error { min-height: 21px; margin: 8px 0 10px; color: var(--danger); font-size: 12px; line-height: 1.5; }
.entry-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 12px; color: var(--ink-400); font-size: 11px; }
.entry-divider::before, .entry-divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }
.leader-entry-link { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 15px; border: 1px solid #d7e2e9; border-radius: 12px; background: #fff; transition: border .15s, background .15s, transform .15s; }
.leader-entry-link:hover { border-color: #b9cdd9; background: var(--navy-50); }
.leader-entry-link:active { transform: translateY(1px); }
.leader-entry-link b { display: block; color: var(--navy-800); font-size: 14px; }
.leader-entry-link small { display: block; margin-top: 4px; color: var(--ink-400); font-size: 11px; }
.leader-entry-link i { color: var(--navy-700); font-size: 25px; font-style: normal; }

.center-state {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 32px;
  color: var(--ink-500);
  text-align: center;
}
.center-state h1 { margin: 16px 0 6px; color: var(--ink-900); font-size: 24px; }
.center-state p { margin: 8px 0; line-height: 1.65; }
.spinner { width: 34px; height: 34px; border: 3px solid #dce5eb; border-top-color: var(--navy-700); border-radius: 50%; animation: spin .75s linear infinite; }
.state-icon { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 50%; background: #fff1ef; color: var(--danger); font-size: 28px; font-weight: 800; }
@keyframes spin { to { transform: rotate(360deg); } }

.survey-body { background: #dfe7ec; }
.survey-shell { position: relative; width: min(100%, 720px); min-height: 100vh; margin: 0 auto; background: var(--canvas); box-shadow: 0 0 60px rgba(15, 44, 65, .12); }
.survey-hero { padding: 28px 28px 25px; background: linear-gradient(145deg, var(--navy-900), #0d6398); color: #fff; }
.hero-topline { display: flex; align-items: center; justify-content: space-between; color: rgba(255,255,255,.68); font-size: 12px; }
.save-state { min-height: 21px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.08); }
.save-state.saving { color: #fff; }
.save-state.saved { color: #c8f4dc; }
.save-state.failed { color: #ffd6d2; }
.survey-hero h1 { margin: 19px 0 6px; font-size: clamp(26px, 7vw, 34px); font-weight: 680; letter-spacing: -.02em; }
.survey-hero > p { margin: 0; color: rgba(255,255,255,.7); font-size: 13px; }
.progress-track { height: 4px; margin-top: 24px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.2); }
.progress-track span { display: block; width: 50%; height: 100%; border-radius: inherit; background: #fff; transition: width .25s ease; }
.progress-labels { display: flex; justify-content: space-between; margin-top: 9px; color: rgba(255,255,255,.48); font-size: 12px; }
.progress-labels strong, .progress-labels .active { color: #fff; font-weight: 650; }

.notice { margin: 14px 18px 0; padding: 13px 15px; border-radius: 10px; font-size: 13px; line-height: 1.55; }
.notice.warning { background: #fff6e4; color: var(--warning); }
.notice.neutral { background: #e9edf1; color: #526172; }
.identity-card { display: flex; align-items: center; justify-content: space-between; margin: 16px 18px; padding: 17px 18px; border-radius: 13px; background: #fff; box-shadow: var(--shadow-sm); }
.identity-card strong { display: block; font-size: 17px; font-weight: 680; }
.identity-card p { margin: 5px 0 0; color: var(--ink-500); font-size: 12px; }
.identity-tag { padding: 6px 10px; border-radius: 999px; background: var(--navy-100); color: var(--navy-700); font-size: 11px; }

.step-panel { padding: 0 18px; }
.field-card, .current-room-card { margin-bottom: 13px; padding: 19px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.field-card.invalid { border-color: rgba(182,74,66,.45); box-shadow: 0 0 0 3px rgba(182,74,66,.06); }
.field-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.field-heading h2 { margin: 0; color: #19364d; font-size: 16px; font-weight: 680; }
.required-label, .optional-label { flex: 0 0 auto; color: var(--danger); font-size: 11px; font-weight: 650; }
.optional-label { color: var(--ink-400); }
.field-hint { margin: 7px 0 0; color: var(--ink-400); font-size: 12px; line-height: 1.55; }
.field-error { display: none; margin: 9px 0 0; color: var(--danger); font-size: 12px; line-height: 1.45; }
.field-error:not(:empty) { display: block; }

.department-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 15px; }
.department-option { position: relative; display: flex; min-height: 48px; align-items: center; gap: 9px; padding: 8px 11px; border: 1px solid #d6e0e7; border-radius: 10px; background: #fff; color: var(--ink-700); font-size: 13px; text-align: left; }
.department-option:last-child { grid-column: span 2; }
.department-option .radio { display: grid; width: 18px; height: 18px; flex: 0 0 auto; place-items: center; border: 1.5px solid #c4d0d9; border-radius: 50%; color: #fff; font-size: 11px; }
.department-option.selected { border-color: var(--navy-700); background: #edf6fc; color: var(--navy-800); font-weight: 650; box-shadow: 0 0 0 2px rgba(10,90,145,.05); }
.department-option.selected .radio { border-color: var(--navy-700); background: var(--navy-700); }

.textarea-shell { position: relative; display: block; min-height: 142px; margin-top: 14px; padding: 13px 13px 31px; border: 1px solid #d8e2e9; border-radius: 10px; background: #fbfcfd; transition: border .15s, box-shadow .15s; }
.textarea-shell.compact { min-height: 112px; }
.textarea-shell:focus-within { border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(10,90,145,.08); background: #fff; }
.textarea-shell textarea { display: block; width: 100%; min-height: 95px; resize: vertical; border: 0; outline: 0; background: transparent; color: #263d50; font-size: 14px; line-height: 1.7; }
.textarea-shell.compact textarea { min-height: 65px; }
.textarea-shell textarea::placeholder { color: #a1adb7; }
.char-count { position: absolute; right: 12px; bottom: 9px; color: #9aa6b2; font-size: 10px; }
.char-count b { font-weight: 500; }

.current-room-card { background: linear-gradient(135deg, #eaf5fb, #f8fbfd); }
.current-room-card p, .current-room-card small { display: block; margin: 0; color: #748698; font-size: 12px; }
.current-room-card strong { display: block; margin: 7px 0; color: var(--navy-800); font-size: 21px; }
.selector-button { display: flex; width: 100%; min-height: 49px; align-items: center; justify-content: space-between; margin-top: 14px; padding: 0 13px; border: 1px solid #d8e2e9; border-radius: 10px; background: #fbfcfd; color: #233f55; text-align: left; }
.selector-button:hover { border-color: #b8cad7; }
.selector-button .placeholder { color: #9aa6b2; }
.selector-button i { color: #6b7f91; font-size: 24px; font-style: normal; }
.selected-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.person-chip { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; background: var(--navy-100); color: var(--navy-700); font-size: 12px; }

.action-spacer { height: 98px; }
.sticky-actions { position: fixed; right: max(0px, calc((100vw - 720px) / 2)); bottom: 0; left: max(0px, calc((100vw - 720px) / 2)); z-index: 30; display: flex; gap: 10px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid #e3e9ee; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.sticky-actions .button { flex: 1; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; padding: 0; background: rgba(6, 26, 40, .52); backdrop-filter: blur(2px); }
.bottom-sheet { display: flex; width: min(100%, 720px); max-height: 86vh; flex-direction: column; padding: 9px 18px calc(18px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; background: #fff; box-shadow: var(--shadow-lg); animation: slide-up .18s ease-out; }
@keyframes slide-up { from { transform: translateY(24px); opacity: .7; } }
.sheet-handle { width: 38px; height: 4px; margin: 0 auto 15px; border-radius: 999px; background: #d7e0e6; }
.sheet-header { display: flex; align-items: flex-start; justify-content: space-between; }
.sheet-header h2, .review-header h2 { margin: 0; font-size: 19px; }
.sheet-header p { margin: 6px 0 0; color: var(--ink-400); font-size: 12px; }
.icon-button { display: grid; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 50%; background: #f0f4f7; color: #637584; font-size: 25px; line-height: 1; }
.search-field, .compact-search { display: flex; align-items: center; gap: 8px; margin: 18px 0 9px; padding: 0 12px; border: 1px solid transparent; border-radius: 10px; background: #f0f4f7; color: #758899; }
.search-field:focus-within, .compact-search:focus-within { border-color: #b7cbd8; background: #fff; }
.search-field input, .compact-search input { width: 100%; height: 43px; border: 0; outline: 0; background: transparent; color: var(--ink-900); }
.candidate-list { min-height: 220px; overflow-y: auto; overscroll-behavior: contain; }
.candidate-row { display: flex; width: 100%; min-height: 65px; align-items: center; padding: 0; border: 0; border-bottom: 1px solid #edf1f4; background: transparent; color: inherit; text-align: left; }
.candidate-row:last-child { border-bottom: 0; }
.candidate-avatar { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; margin-right: 12px; border-radius: 50%; background: #e6f1f8; color: var(--navy-700); font-size: 12px; font-weight: 700; }
.candidate-info { flex: 1; min-width: 0; }
.candidate-info strong { display: block; font-size: 14px; }
.candidate-info small { display: block; margin-top: 4px; color: var(--ink-400); font-size: 11px; }
.candidate-check { display: grid; width: 22px; height: 22px; place-items: center; border: 1.5px solid #c5d1da; border-radius: 50%; color: transparent; font-size: 13px; }
.candidate-row.selected .candidate-check { border-color: var(--navy-700); background: var(--navy-700); color: #fff; }
.candidate-row.limit-disabled { opacity: .4; }
.empty-list { padding: 60px 0; color: var(--ink-400); text-align: center; }
.bottom-sheet > .button { margin-top: 10px; flex: 0 0 auto; }

.review-dialog { width: min(100% - 28px, 660px); max-height: calc(100vh - 42px); overflow: hidden; border-radius: 18px; background: #fff; box-shadow: var(--shadow-lg); animation: modal-in .18s ease-out; }
@keyframes modal-in { from { transform: translateY(8px) scale(.985); opacity: .6; } }
.review-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 21px 21px 16px; border-bottom: 1px solid #e8edf1; }
.review-header h2 { margin-top: 5px; }
.review-content { max-height: calc(100vh - 210px); overflow-y: auto; padding: 4px 21px; }
.review-group { padding: 15px 0; border-bottom: 1px solid #edf1f4; }
.review-group:last-child { border-bottom: 0; }
.review-group span { display: block; margin-bottom: 6px; color: var(--ink-400); font-size: 11px; }
.review-group strong, .review-group p { margin: 0; color: var(--ink-900); font-size: 14px; line-height: 1.65; white-space: pre-wrap; }
.review-group p.muted { color: #a0abb4; }
.review-actions { display: flex; gap: 10px; padding: 15px 21px calc(15px + env(safe-area-inset-bottom)); border-top: 1px solid #e8edf1; background: #fff; }
.review-actions .button { flex: 1; }
.success-dialog { width: min(100% - 40px, 390px); padding: 32px 28px 25px; border-radius: 20px; background: #fff; box-shadow: var(--shadow-lg); text-align: center; animation: modal-in .18s ease-out; }
.success-check { display: grid; width: 62px; height: 62px; margin: 0 auto 18px; place-items: center; border-radius: 50%; background: #e6f5ee; color: var(--success); font-size: 30px; font-weight: 800; }
.success-dialog h2 { margin: 0; font-size: 23px; }
.success-dialog p { margin: 10px 0 22px; color: var(--ink-500); font-size: 13px; line-height: 1.7; }
.toast { position: fixed; right: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); z-index: 200; max-width: calc(100vw - 40px); padding: 10px 16px; border-radius: 9px; background: rgba(15,34,48,.92); color: #fff; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.2); transform: translateX(50%); }

/* Leader dashboard */
.leader-body { min-width: 320px; background: #edf2f5; }
.login-shell { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 10%, rgba(42,133,190,.26), transparent 30%), linear-gradient(145deg, #062f50, #0b5c90); }
.login-card { width: min(430px, 100%); padding: 42px; border-radius: 22px; background: #fff; box-shadow: var(--shadow-lg); }
.login-card h1 { margin: 22px 0 8px; font-size: 30px; letter-spacing: -.03em; }
.login-card > p { margin: 0 0 27px; color: var(--ink-500); line-height: 1.6; }
.login-field span { display: block; margin-bottom: 8px; color: var(--ink-700); font-size: 13px; font-weight: 650; }
.login-field input { width: 100%; height: 50px; padding: 0 14px; border: 1px solid #cfdae2; border-radius: 10px; outline: 0; }
.login-field input:focus { border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(10,90,145,.08); }
.login-error { min-height: 20px; margin: 9px 0; color: var(--danger); font-size: 12px; }

.leader-shell { min-height: 100vh; }
.leader-topbar { display: flex; min-height: 184px; align-items: center; justify-content: space-between; gap: 24px; padding: 34px max(32px, calc((100vw - 1240px) / 2)); background: linear-gradient(140deg, var(--navy-950), #0a5688); color: #fff; }
.leader-topbar h1 { margin: 14px 0 4px; font-size: clamp(26px, 3vw, 37px); letter-spacing: -.03em; }
.leader-topbar p { margin: 0; color: rgba(255,255,255,.62); }
.topbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.leader-content { width: min(1240px, calc(100% - 48px)); margin: 28px auto 0; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; padding: 0 4px; }
.section-heading h2, .card-heading h2, .response-toolbar h2 { margin: 5px 0 0; font-size: 21px; }
.survey-state { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 12px; border: 1px solid #d8e3e9; border-radius: 999px; background: rgba(255,255,255,.9); font-size: 12px; }
.survey-state > span { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(38,116,81,.12); }
.survey-state.closed > span { background: var(--ink-400); box-shadow: 0 0 0 4px rgba(113,130,146,.12); }
.survey-state button { margin-left: 4px; padding: 4px 8px; border: 0; border-radius: 999px; background: var(--navy-100); color: var(--navy-700); font-size: 11px; }
.survey-state button.danger-action { background: #ffebe8; color: #b7352e; font-weight: 700; }
.survey-state button.danger-action:hover { background: #ffdcd7; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { position: relative; min-height: 145px; overflow: hidden; padding: 21px; border: 1px solid #dce5eb; border-radius: 15px; background: #fff; box-shadow: var(--shadow-sm); }
.metric-card::after { position: absolute; right: -25px; bottom: -44px; width: 100px; height: 100px; border-radius: 50%; background: var(--navy-50); content: ""; }
.metric-card.accent { border-color: transparent; background: linear-gradient(145deg, #0a4d7b, #0c689c); color: #fff; }
.metric-card.accent::after { background: rgba(255,255,255,.07); }
.metric-card > span { display: block; position: relative; z-index: 1; color: var(--ink-500); font-size: 12px; }
.metric-card.accent > span { color: rgba(255,255,255,.65); }
.metric-card strong { display: block; position: relative; z-index: 1; margin: 10px 0 7px; font-size: 38px; line-height: 1; }
.metric-card small { position: relative; z-index: 1; color: var(--ink-400); }
.metric-card.accent small { color: rgba(255,255,255,.67); }
.progress-card { margin-top: 14px; padding: 20px 22px; border: 1px solid #dce5eb; border-radius: 15px; background: #fff; box-shadow: var(--shadow-sm); }
.progress-card > div:first-child { display: flex; justify-content: space-between; font-size: 13px; }
.progress-card > div:first-child span { color: var(--ink-500); }
.leader-progress { height: 9px; margin-top: 13px; overflow: hidden; border-radius: 999px; background: #e7edf1; }
.leader-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--navy-700), #2f92c4); transition: width .35s ease; }
.pending-people { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.pending-chip { padding: 5px 9px; border-radius: 999px; background: #f1f4f6; color: var(--ink-500); font-size: 11px; }
.pending-chip.draft { background: #fff6e4; color: var(--warning); }
.all-complete { color: var(--success); font-size: 12px; }

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.dashboard-card { border: 1px solid #dce5eb; border-radius: 15px; background: #fff; box-shadow: var(--shadow-sm); }
.card-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 21px 22px 16px; border-bottom: 1px solid #edf1f4; }
.card-heading small { color: var(--ink-400); }
.bar-chart, .ranking-chart { min-height: 270px; padding: 20px 22px 23px; }
.bar-row { display: grid; grid-template-columns: 90px 1fr 32px; align-items: center; gap: 12px; margin-bottom: 16px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-row label { color: var(--ink-700); font-size: 12px; }
.bar-track { height: 11px; overflow: hidden; border-radius: 999px; background: #eef3f6; }
.bar-track span { display: block; min-width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--navy-700), #3b9bc8); }
.bar-row strong { color: var(--navy-800); font-size: 14px; text-align: right; }
.ranking-row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 11px; min-height: 51px; border-bottom: 1px solid #edf1f4; }
.ranking-row:last-child { border-bottom: 0; }
.rank-number { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 7px; background: #eef4f8; color: var(--ink-500); font-size: 11px; font-weight: 750; }
.ranking-row:nth-child(1) .rank-number { background: #e4f1f8; color: var(--navy-700); }
.rank-name strong { display: block; font-size: 13px; }
.rank-name small { color: var(--ink-400); font-size: 10px; }
.rank-votes { color: var(--navy-700); font-size: 13px; font-weight: 750; }
.no-data { display: grid; min-height: 220px; place-items: center; color: var(--ink-400); font-size: 13px; }

.matrix-section { margin-top: 14px; overflow: hidden; }
.matrix-heading { align-items: center; }
.matrix-help { color: var(--ink-400); font-size: 11px; white-space: nowrap; }
.diagonal-key { display: inline-block; width: 11px; height: 11px; margin-right: 5px; border: 2px solid #0a5486; border-radius: 3px; background: #e1f0f8; vertical-align: -2px; }
.matrix-summary { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 22px 0; }
.matrix-summary > span { padding: 6px 10px; border-radius: 999px; background: #f0f5f8; color: var(--ink-500); font-size: 11px; }
.matrix-summary strong { color: var(--navy-800); font-size: 13px; }
.matrix-scroller { overflow-x: auto; padding: 14px 22px 22px; overscroll-behavior-x: contain; }
.heat-matrix { width: 100%; min-width: 760px; border-spacing: 0; border-collapse: separate; font-size: 12px; }
.staff-matrix { min-width: 940px; }
.heat-matrix th, .heat-matrix td { min-width: 88px; height: 48px; padding: 8px 10px; border-right: 1px solid #e2e9ee; border-bottom: 1px solid #e2e9ee; text-align: center; }
.heat-matrix tr > :first-child { border-left: 1px solid #e2e9ee; }
.heat-matrix thead th { border-top: 1px solid #e2e9ee; background: #edf4f8; color: #33536a; font-size: 11px; font-weight: 700; }
.heat-matrix thead th:first-child { border-top-left-radius: 10px; }
.heat-matrix thead th:last-child { border-top-right-radius: 10px; }
.heat-matrix tbody tr:last-child > :first-child { border-bottom-left-radius: 10px; }
.heat-matrix tbody tr:last-child > :last-child { border-bottom-right-radius: 10px; }
.heat-matrix .row-heading { position: sticky; left: 0; z-index: 1; min-width: 112px; background: #f8fafb; color: var(--ink-700); text-align: left; white-space: nowrap; }
.heat-matrix .corner-cell { position: sticky; left: 0; z-index: 2; min-width: 150px; }
.heat-matrix .person-column { min-width: 100px; }
.heat-matrix .current-department-column { min-width: 112px; color: var(--ink-500); font-size: 11px; }
.heat-matrix .total-cell { min-width: 62px; background: #f4f7f9; color: var(--navy-800); font-weight: 750; }
.heat-cell { color: #436075; font-weight: 650; }
.heat-cell.heat-0 { background: #fff; color: #b6c0c8; }
.heat-cell.heat-1 { background: #e9f4fa; color: #1b638d; }
.heat-cell.heat-2 { background: #cce6f3; color: #125779; }
.heat-cell.heat-3 { background: #7fbddd; color: #073c59; }
.heat-cell.heat-4 { background: #176f9f; color: #fff; }
.heat-cell.diagonal { box-shadow: inset 0 0 0 2px #0a5486; }

.response-section { margin-top: 14px; }
.response-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 21px 22px 17px; border-bottom: 1px solid #edf1f4; }
.filter-row { display: flex; align-items: center; gap: 8px; }
.compact-search { width: 180px; margin: 0; }
.compact-search input { height: 38px; font-size: 12px; }
.filter-row select { height: 40px; padding: 0 29px 0 11px; border: 1px solid #d5e0e7; border-radius: 9px; outline: 0; background: #fff; color: var(--ink-700); font-size: 12px; }
.response-list { padding: 7px 22px 20px; }
.response-item { border-bottom: 1px solid #e8edf1; }
.response-item:last-child { border-bottom: 0; }
.response-summary { display: grid; grid-template-columns: minmax(180px, 1fr) 1fr auto; align-items: center; gap: 20px; width: 100%; min-height: 78px; padding: 10px 0; border: 0; background: transparent; color: inherit; text-align: left; }
.response-person { display: flex; align-items: center; gap: 11px; }
.response-person .candidate-avatar { margin: 0; }
.response-person strong { display: block; font-size: 14px; }
.response-person small { display: block; margin-top: 4px; color: var(--ink-400); font-size: 11px; }
.response-status { justify-self: start; padding: 5px 9px; border-radius: 999px; background: #eef1f3; color: var(--ink-500); font-size: 11px; }
.response-status.submitted { background: #e6f5ee; color: var(--success); }
.response-status.draft { background: #fff6e4; color: var(--warning); }
.response-summary .expand-icon { color: var(--ink-400); font-size: 22px; transition: transform .15s ease; }
.response-item.expanded .expand-icon { transform: rotate(90deg); }
.response-detail { display: none; padding: 0 0 20px 49px; }
.response-item.expanded .response-detail { display: block; }
.response-answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px; border-radius: 12px; background: #f6f9fb; }
.answer-block { padding: 5px; }
.answer-block.wide { grid-column: span 2; }
.answer-block span { display: block; margin-bottom: 6px; color: var(--ink-400); font-size: 10px; }
.answer-block strong, .answer-block p { margin: 0; color: #263d50; font-size: 13px; line-height: 1.65; white-space: pre-wrap; }
.answer-block p.empty { color: #a0abb4; }
.private-draft { padding: 14px 16px; border-radius: 10px; background: #f4f6f8; color: var(--ink-500); font-size: 12px; }
.leader-footer { display: flex; width: min(1240px, calc(100% - 48px)); justify-content: space-between; margin: 18px auto 0; padding: 0 4px 30px; color: var(--ink-400); font-size: 11px; }

@media (min-width: 721px) {
  .modal-backdrop { align-items: center; padding: 22px; }
  .bottom-sheet { width: min(580px, 100%); max-height: min(760px, calc(100vh - 44px)); padding: 13px 22px 22px; border-radius: 18px; }
  .candidate-list { min-height: 310px; }
}

@media (max-width: 860px) {
  .leader-topbar { align-items: flex-start; flex-direction: column; padding: 28px 24px 55px; }
  .topbar-actions { justify-content: flex-start; }
  .leader-content { width: min(100% - 28px, 720px); }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .response-toolbar { align-items: flex-start; flex-direction: column; }
  .filter-row { width: 100%; flex-wrap: wrap; }
  .compact-search { flex: 1 1 180px; }
}

@media (max-width: 560px) {
  .survey-hero { padding: 25px 18px 22px; }
  .identity-card, .notice { margin-right: 13px; margin-left: 13px; }
  .step-panel { padding: 0 13px; }
  .field-card, .current-room-card { padding: 18px 15px; }
  .sticky-actions { padding-right: 13px; padding-left: 13px; }
  .field-heading { align-items: flex-start; }
  .modal-backdrop:has(.review-dialog), .modal-backdrop:has(.success-dialog) { align-items: center; }
  .login-card { padding: 32px 24px; }
  .leader-topbar { min-height: 230px; }
  .topbar-actions { width: 100%; }
  .topbar-actions .button { flex: 1; min-width: 92px; padding: 0 10px; }
  .leader-content { width: calc(100% - 20px); margin-top: 18px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .metric-grid { gap: 9px; }
  .metric-card { min-height: 126px; padding: 17px; }
  .metric-card strong { font-size: 32px; }
  .progress-card, .bar-chart, .ranking-chart, .response-list { padding-right: 15px; padding-left: 15px; }
  .card-heading, .response-toolbar { padding-right: 15px; padding-left: 15px; }
  .matrix-heading { align-items: flex-start; flex-direction: column; }
  .matrix-help { white-space: normal; }
  .matrix-summary { padding-right: 15px; padding-left: 15px; }
  .matrix-scroller { padding-right: 15px; padding-left: 15px; }
  .bar-row { grid-template-columns: 78px 1fr 26px; gap: 8px; }
  .filter-row select { flex: 1; }
  .response-summary { grid-template-columns: 1fr auto; gap: 8px; }
  .response-status { grid-row: 2; margin-left: 49px; }
  .response-summary .expand-icon { grid-row: 1 / span 2; grid-column: 2; }
  .response-detail { padding-left: 0; }
  .response-answer-grid { grid-template-columns: 1fr; }
  .answer-block.wide { grid-column: auto; }
  .leader-footer { width: calc(100% - 20px); flex-direction: column; gap: 6px; }
}

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