:root {
  --ink: #172033;
  --muted: #677085;
  --line: #e3e7ef;
  --soft: #f4f6fa;
  --paper: #ffffff;
  --canvas: #f7f8fb;
  --blue: #4d63e5;
  --blue-dark: #3548bf;
  --blue-soft: #eef0ff;
  --green: #168461;
  --green-soft: #e9f8f2;
  --amber: #a96614;
  --amber-soft: #fff7e8;
  --red: #ba3f4b;
  --shadow: 0 1px 2px rgba(25, 34, 53, 0.04), 0 10px 30px rgba(25, 34, 53, 0.05);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  height: 66px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 760; letter-spacing: -0.02em; }
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, #6073ed, #3548bf);
  box-shadow: 0 6px 18px rgba(77, 99, 229, 0.24);
}
.brand-caption { color: #8a91a2; font-size: 12px; font-weight: 600; letter-spacing: 0.01em; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.text-link { color: #4f586d; font-weight: 650; font-size: 14px; }
.text-link:hover { color: var(--blue); }

.ghost-button,
.secondary-button,
.primary-button,
.finish-button,
.save-dock button {
  border: 0;
  cursor: pointer;
  border-radius: 10px;
  font-weight: 700;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.ghost-button { padding: 9px 13px; background: var(--soft); color: #50596d; }
.ghost-button:hover { background: #ebedf3; }
.primary-button,
.finish-button {
  padding: 12px 18px;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 7px 18px rgba(77, 99, 229, 0.18);
}
.primary-button:hover,
.finish-button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.primary-button.compact { padding: 10px 15px; display: inline-flex; align-items: center; justify-content: center; }
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 17px;
  background: #fff;
  border: 1px solid #d8dce6;
  color: #4d566b;
}
.secondary-button:hover { border-color: #b8c0d1; background: #fafbfc; }
button:disabled { opacity: 0.48; cursor: not-allowed; transform: none !important; }

.app-shell { min-height: 100vh; padding-bottom: 88px; }
.app-grid {
  width: min(1450px, 100%);
  margin: 0 auto;
  padding: 28px 28px 64px;
  display: grid;
  grid-template-columns: 306px minmax(0, 1fr);
  gap: 34px;
}
.sidebar {
  align-self: start;
  position: sticky;
  top: 94px;
  max-height: calc(100vh - 122px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.progress-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
}
.progress-ring {
  --progress: 0deg;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--blue) var(--progress), #e9ecf2 0);
  display: grid;
  place-items: center;
  position: relative;
}
.progress-ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #fff; }
.progress-ring span { position: relative; z-index: 1; font-size: 12px; font-weight: 800; }
.progress-panel strong { display: block; font-size: 15px; }
.progress-panel > div:last-child span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

.section-nav {
  overflow: auto;
  padding: 4px 4px 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  scrollbar-width: thin;
}
.section-nav button {
  width: 100%;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  color: #60697d;
}
.section-nav button:hover { background: #eff1f6; }
.section-nav button.is-active { color: var(--blue-dark); background: var(--blue-soft); }
.section-index {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #eaedf3;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
}
.is-active .section-index { color: #fff; background: var(--blue); }
.section-label { font-size: 12.5px; line-height: 1.2; font-weight: 640; }
.section-score { color: #989faf; font-size: 10px; font-weight: 750; }
.is-active .section-score { color: #6474d6; }

.form-column { min-width: 0; width: min(920px, 100%); }
.hero-card {
  background:
    radial-gradient(circle at 94% 12%, rgba(92, 112, 234, 0.12), transparent 31%),
    linear-gradient(135deg, #fff 0%, #f8f9ff 100%);
  border: 1px solid #dfe3f1;
  border-radius: 22px;
  padding: 34px 38px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero-card::after {
  content: "";
  width: 190px;
  height: 190px;
  border-radius: 44px;
  border: 38px solid rgba(77, 99, 229, 0.045);
  position: absolute;
  right: -92px;
  top: -104px;
  transform: rotate(24deg);
}
.eyebrow { color: var(--blue); font-size: 11px; line-height: 1.4; font-weight: 850; letter-spacing: 0.11em; text-transform: uppercase; }
.hero-card h1, .library-hero h1, .result-hero h1 {
  max-width: 680px;
  margin: 9px 0 12px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}
.hero-card > p { max-width: 680px; margin: 0; color: #626b80; font-size: 16px; }
.title-field { display: block; max-width: 610px; margin-top: 24px; position: relative; z-index: 1; }
.title-field span { display: block; color: #747d90; font-size: 11px; font-weight: 750; margin-bottom: 6px; }
.title-field input {
  width: 100%;
  border: 1px solid #dce0eb;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 11px 13px;
  color: var(--ink);
  font-weight: 650;
  outline: none;
}
.title-field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(77, 99, 229, 0.11); }
.public-note {
  margin-top: 18px;
  padding: 11px 13px;
  max-width: 720px;
  border: 1px solid #dfe3f1;
  border-radius: 10px;
  background: rgba(247, 248, 253, 0.9);
  color: #626b7f;
  font-size: 12px;
  display: flex;
  gap: 9px;
  align-items: flex-start;
}
.public-note > span {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 850;
  font-size: 11px;
}

.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}
.status-legend > span {
  padding: 7px 10px;
  border: 1px solid #dfe3eb;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.84);
  color: #5e677a;
  font-size: 12px;
  font-weight: 700;
}
.status-legend b { margin-right: 4px; }

.section-header { margin: 36px 0 16px; display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.section-header span { color: #9097a8; font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: 0.08em; }
.section-header h2 { margin: 5px 0 0; font-size: 25px; line-height: 1.15; letter-spacing: -0.025em; }
.section-description { max-width: 700px; margin: 9px 0 0; color: #6f788b; font-size: 13px; }
.section-meta { color: #8b93a5; background: #eceff4; padding: 6px 10px; border-radius: 8px; font-size: 11px; white-space: nowrap; }
.questions-stack { display: flex; flex-direction: column; gap: 13px; }
.question-group-heading {
  margin: 20px 0 1px;
  padding: 10px 13px;
  border-left: 4px solid var(--blue);
  border-radius: 0 9px 9px 0;
  background: #eef0f8;
  color: #45506a;
  font-size: 14px;
}
.question-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 1px 2px rgba(25, 34, 53, 0.025);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.question-card:focus-within { border-color: #c4cbf5; box-shadow: 0 0 0 3px rgba(77, 99, 229, 0.07); }
.question-card.is-filled { border-color: #d9e9e3; }
.question-heading { display: grid; grid-template-columns: 30px minmax(0, 1fr) 24px; gap: 12px; align-items: start; }
.decision-card { padding: 17px 19px; }
.decision-card .question-heading { grid-template-columns: 96px minmax(0, 1fr) 24px; align-items: center; }
.feature-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.feature-code {
  color: #3d4a62;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.035em;
}
.priority-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef0f4;
  color: #6f788b;
  font-size: 9px;
  line-height: 1.3;
  font-weight: 850;
}
.priority-p0 { background: #fff0f1; color: #b33442; }
.priority-p1 { background: #fff5df; color: #96620d; }
.priority-p2 { background: #edf2ff; color: #5160aa; }
.question-number { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; background: #f0f2f6; color: #778094; font-weight: 800; font-size: 11px; }
.question-card.is-filled .question-number { color: var(--green); background: var(--green-soft); }
.question-heading h3 { margin: 2px 0 0; font-size: 16px; line-height: 1.38; letter-spacing: -0.012em; }
.question-heading p { margin: 6px 0 0; color: #757e91; font-size: 13px; }
.required-star { color: var(--blue); margin-right: 5px; }
.question-state { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 900; }
.question-state:empty { background: transparent; }

.textarea-field { display: block; margin: 17px 0 0 42px; }
.textarea-field textarea,
.extra-answer textarea {
  width: 100%;
  resize: vertical;
  min-height: 96px;
  padding: 12px 13px;
  background: #fbfcfd;
  border: 1px solid #dfe3eb;
  border-radius: 10px;
  color: var(--ink);
  outline: none;
  line-height: 1.55;
}
.textarea-field textarea::placeholder, .extra-answer textarea::placeholder { color: #a4aaba; }
.textarea-field textarea:focus, .extra-answer textarea:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(77, 99, 229, 0.09); }
.hint-box { margin: 16px 0 0 42px; border-radius: 10px; padding: 12px 14px; background: var(--amber-soft); color: #6f5a3a; font-size: 12px; }
.hint-box > span { font-weight: 800; }
.hint-box ul { margin: 7px 0 0; padding-left: 18px; columns: 2; column-gap: 30px; }
.hint-box li { margin: 2px 0; break-inside: avoid; }

.options-grid { border: 0; padding: 0; margin: 17px 0 0 42px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.option-control {
  min-height: 44px;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid #e1e4eb;
  border-radius: 10px;
  background: #fbfcfd;
  color: #555e72;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.option-control:hover { border-color: #c8cfe3; background: #fff; }
.option-control.is-selected { border-color: #aeb9f4; background: var(--blue-soft); color: #2f3d8f; }
.option-control input { position: absolute; opacity: 0; pointer-events: none; }
.option-marker { width: 17px; height: 17px; flex: 0 0 auto; border: 1.5px solid #bbc2d0; border-radius: 5px; background: #fff; margin-top: 1px; position: relative; }
input[type="radio"] + .option-marker { border-radius: 50%; }
.is-selected .option-marker { border-color: var(--blue); background: var(--blue); }
.is-selected .option-marker::after { content: ""; position: absolute; width: 7px; height: 4px; border-left: 1.8px solid #fff; border-bottom: 1.8px solid #fff; transform: rotate(-45deg); left: 4px; top: 4px; }
input[type="radio"] + .option-marker::after { width: 5px; height: 5px; border: 0; border-radius: 50%; background: #fff; left: 4.5px; top: 4.5px; }

.decision-options {
  border: 0;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.decision-option {
  min-height: 40px;
  padding: 8px 11px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
  font-size: 12px;
  font-weight: 750;
}
.decision-icon { font-size: 15px; line-height: 1; filter: grayscale(0.35); }
.decision-option.is-selected { box-shadow: inset 0 0 0 1px currentColor; }
.decision-make.is-selected { border-color: #68ad91; background: #ecf8f3; color: #147254; }
.decision-skip.is-selected { border-color: #d68a91; background: #fff0f1; color: #a63843; }
.decision-discuss.is-selected { border-color: #d7ad62; background: #fff7e7; color: #8d5d0c; }
.decision-card .extra-answer { margin-left: 0; }

.priority-list { margin: 17px 0 0 42px; border: 1px solid #e1e5ed; border-radius: 11px; overflow: hidden; }
.priority-head, .priority-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px; align-items: center; gap: 16px; }
.priority-head { padding: 9px 13px; color: #7a8396; background: #f2f4f7; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; }
.priority-row { min-height: 48px; padding: 7px 12px; border-top: 1px solid #edf0f4; font-size: 13px; }
.priority-row select { width: 100%; border: 1px solid #d9deea; border-radius: 8px; background: #fff; padding: 7px 8px; color: #485166; outline: none; }
.priority-row select:focus { border-color: var(--blue); }

.counts-grid { margin: 17px 0 0 42px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.count-field { min-height: 58px; padding: 10px 12px; border: 1px solid #e1e4eb; border-radius: 10px; background: #fbfcfd; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #555e72; font-size: 13px; }
.count-field > div { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; color: #8b93a4; font-size: 11px; }
.count-field input { width: 72px; border: 1px solid #d6dbe7; border-radius: 8px; background: #fff; color: var(--ink); padding: 8px 9px; text-align: center; outline: none; font-weight: 750; }
.count-field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(77, 99, 229, 0.09); }

.extra-answer { margin: 13px 0 0 42px; }
.extra-answer summary { width: max-content; max-width: 100%; color: #6f7790; font-size: 12px; font-weight: 700; cursor: pointer; list-style: none; }
.extra-answer summary::before { content: "+"; color: var(--blue); margin-right: 6px; font-weight: 900; }
.extra-answer[open] summary::before { content: "−"; }
.extra-answer textarea { min-height: 76px; margin-top: 9px; }

.section-footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; margin: 20px 0 0; }
.section-footer > :first-child { justify-self: start; }
.section-footer > :last-child { justify-self: end; }
.section-footer > span { color: #979eae; font-size: 11px; font-weight: 750; }

.save-dock {
  position: fixed;
  z-index: 40;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(880px, calc(100% - 28px));
  min-height: 58px;
  padding: 9px 10px 9px 15px;
  border: 1px solid #dce0ea;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 45px rgba(24, 33, 53, 0.16);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.save-indicator { min-width: 210px; color: #6e7688; font-size: 12px; display: flex; align-items: center; gap: 8px; }
.save-indicator > span { width: 8px; height: 8px; border-radius: 50%; background: #a0a7b4; }
.state-saving > span { background: var(--blue); animation: pulse 1s infinite; }
.state-dirty > span { background: var(--amber); }
.state-saved > span { background: var(--green); }
.state-error { color: var(--red); }
.state-error > span { background: var(--red); }
.save-dock-actions { display: flex; align-items: center; gap: 8px; }
.autosave-caption { color: #9aa1b0; font-size: 10px; margin-right: 3px; }
.save-dock button { padding: 9px 12px; background: #f0f2f6; color: #576074; font-size: 12px; }
.save-dock .finish-button { background: var(--blue); color: #fff; }
.dock-error { position: absolute; left: 16px; bottom: calc(100% + 8px); padding: 8px 10px; border-radius: 8px; background: #fff1f2; border: 1px solid #facdd2; color: var(--red); font-size: 11px; }
@keyframes pulse { 50% { opacity: 0.35; } }

.public-page { min-height: 100vh; }
.public-topbar { position: relative; }
.library-hero { width: min(1060px, calc(100% - 40px)); margin: 0 auto; padding: 72px 0 42px; text-align: center; }
.library-hero h1 { max-width: 740px; margin-left: auto; margin-right: auto; }
.library-hero p { max-width: 660px; margin: 0 auto; color: var(--muted); font-size: 16px; }
.library-list { width: min(980px, calc(100% - 40px)); margin: 0 auto; padding-bottom: 70px; display: flex; flex-direction: column; gap: 12px; }
.library-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 16px; align-items: center; box-shadow: var(--shadow); }
.file-badge { width: 48px; height: 58px; border-radius: 10px; background: var(--blue-soft); color: var(--blue-dark); display: grid; place-items: center; font-weight: 900; font-size: 12px; position: relative; }
.file-badge::after { content: ""; position: absolute; right: 0; top: 0; border-style: solid; border-width: 0 0 10px 10px; border-color: transparent transparent #cbd2fb transparent; }
.library-card h2 { margin: 0; font-size: 17px; }
.library-card p { margin: 3px 0 8px; color: #858d9e; font-size: 11px; }
.mini-progress { width: min(320px, 100%); height: 4px; background: #edf0f4; border-radius: 8px; overflow: hidden; }
.mini-progress span { display: block; height: 100%; background: var(--green); }
.library-card small { color: #8a92a3; font-size: 10px; }
.library-card-actions { display: flex; gap: 8px; }
.empty-state { padding: 70px 24px; text-align: center; background: #fff; border: 1px dashed #d6dbe5; border-radius: 18px; }
.empty-state > span { color: var(--blue); text-transform: uppercase; font-size: 10px; letter-spacing: 0.12em; font-weight: 850; }
.empty-state h2 { margin: 8px 0; }
.empty-state p { margin: 0 0 20px; color: var(--muted); }

.result-page { background: #f7f8fb; }
.result-hero { width: min(1180px, calc(100% - 40px)); margin: 32px auto 20px; padding: 28px; background: #fff; border: 1px solid var(--line); border-radius: 18px; display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 18px; align-items: center; box-shadow: var(--shadow); }
.success-mark { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-size: 25px; font-weight: 900; }
.result-hero h1 { font-size: clamp(25px, 4vw, 36px); margin: 5px 0 7px; }
.result-hero p { color: var(--muted); margin: 0; }
.download-button { text-align: center; white-space: nowrap; }
.result-layout { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding-bottom: 80px; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; align-items: start; }
.result-summary { position: sticky; top: 20px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 15px; display: flex; flex-direction: column; gap: 2px; }
.result-summary > strong { margin: 0 8px 7px; font-size: 12px; }
.result-summary a { padding: 7px 8px; border-radius: 7px; display: flex; justify-content: space-between; gap: 8px; color: #656e81; font-size: 11px; line-height: 1.25; }
.result-summary a:hover { background: var(--blue-soft); color: var(--blue-dark); }
.result-summary small { color: #9ca3b1; }
.result-content { display: flex; flex-direction: column; gap: 14px; }
.result-section { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 26px; box-shadow: 0 1px 2px rgba(25, 34, 53, 0.025); scroll-margin-top: 18px; }
.result-section > h2 { margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); font-size: 21px; }
.result-answer { padding: 14px 0; border-bottom: 1px solid #eff1f5; }
.result-answer:last-child { border-bottom: 0; padding-bottom: 0; }
.result-answer h3 { margin: 0 0 8px; font-size: 14px; line-height: 1.4; }
.result-answer h3 span { display: inline-grid; place-items: center; width: 23px; height: 23px; margin-right: 8px; border-radius: 6px; background: #f0f2f6; color: #7b8496; font-size: 9px; }
.result-answer h3 .result-code { width: auto; min-width: 66px; padding: 0 7px; }
.result-priority { display: inline-block; margin-right: 8px; color: #8a92a3; font-size: 10px; }
.result-status { display: inline-block; margin-left: 0 !important; padding: 6px 9px; border-radius: 8px; background: #f2f4f7; font-weight: 750; }
.result-group-heading { margin: 24px 0 2px; padding: 8px 10px; border-radius: 8px; background: #eef0f8; color: #4a556d; font-size: 13px; }
.result-answer p { margin: 7px 0 0 31px; color: #4e586c; white-space: pre-wrap; }
.result-answer ul, .result-answer ol { margin: 7px 0 0 48px; padding-left: 16px; color: #4e586c; }
.answer-comment { padding: 9px 10px; background: #f7f8fb; border-radius: 8px; }
.result-answer .unanswered { color: #a0a7b4; font-style: italic; }

@media (max-width: 1040px) {
  .app-grid { grid-template-columns: 250px minmax(0, 1fr); gap: 22px; padding-left: 18px; padding-right: 18px; }
  .options-grid { grid-template-columns: 1fr; }
  .decision-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .autosave-caption { display: none; }
}

@media (max-width: 780px) {
  .topbar { height: 58px; padding: 0 15px; }
  .brand-caption, .topbar .ghost-button { display: none; }
  .topbar-actions { gap: 12px; }
  .app-grid { display: block; padding: 14px 12px 92px; }
  .sidebar { position: static; max-height: none; display: block; }
  .progress-panel { padding: 12px; margin-bottom: 10px; }
  .progress-ring { width: 46px; height: 46px; }
  .section-nav { flex-direction: row; overflow-x: auto; padding: 2px 0 11px; gap: 6px; }
  .section-nav button { width: auto; min-width: 48px; display: flex; padding: 7px; }
  .section-nav .section-label, .section-nav .section-score { display: none; }
  .form-column { width: 100%; }
  .hero-card { border-radius: 16px; padding: 24px 20px; }
  .hero-card h1 { font-size: 30px; }
  .hero-card > p { font-size: 14px; }
  .section-header { margin-top: 26px; }
  .section-header h2 { font-size: 21px; }
  .question-card { padding: 17px 14px; border-radius: 13px; }
  .question-heading { grid-template-columns: 28px minmax(0, 1fr) 20px; gap: 9px; }
  .decision-card .question-heading { grid-template-columns: 82px minmax(0, 1fr) 20px; }
  .feature-code { font-size: 10px; }
  .question-heading h3 { font-size: 15px; }
  .textarea-field, .options-grid, .priority-list, .counts-grid, .extra-answer, .hint-box { margin-left: 0; }
  .counts-grid { grid-template-columns: 1fr; }
  .decision-options { grid-template-columns: 1fr; gap: 6px; }
  .decision-option { justify-content: flex-start; min-height: 39px; }
  .hint-box ul { columns: 1; }
  .priority-head, .priority-row { grid-template-columns: minmax(0, 1fr) 92px; }
  .section-footer { grid-template-columns: 1fr 1fr; }
  .section-footer > span { display: none; }
  .save-dock { bottom: 8px; width: calc(100% - 16px); min-height: 55px; padding: 8px 8px 8px 11px; }
  .save-indicator { min-width: 0; font-size: 10px; }
  .save-dock-actions > button:first-of-type { display: none; }
  .save-dock .finish-button { padding: 9px 13px; }
  .library-hero { padding-top: 46px; }
  .library-card { grid-template-columns: 42px minmax(0, 1fr); align-items: start; }
  .file-badge { width: 40px; height: 48px; }
  .library-card-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .result-hero { grid-template-columns: 48px minmax(0, 1fr); padding: 20px; }
  .success-mark { width: 46px; height: 46px; }
  .result-hero .download-button { grid-column: 1 / -1; }
  .result-layout { display: block; }
  .result-summary { position: static; margin-bottom: 14px; max-height: 250px; overflow: auto; }
  .result-section { padding: 19px 16px; }
}

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

.loading-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 650;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 17% 10%, rgba(77, 99, 229, 0.13), transparent 28%),
    radial-gradient(circle at 88% 84%, rgba(22, 132, 97, 0.1), transparent 26%),
    var(--canvas);
}

.login-card {
  width: min(440px, 100%);
  padding: 36px;
  border: 1px solid #dfe3ed;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(25, 34, 53, 0.12);
  text-align: center;
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.login-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 24px;
  font-weight: 900;
}

.login-card h1 {
  margin: 8px 0 10px;
  font-size: 29px;
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.login-card > p {
  margin: 0 auto 23px;
  max-width: 340px;
  color: var(--muted);
}

.login-card form { text-align: left; }
.login-card label > span {
  display: block;
  margin-bottom: 6px;
  color: #697286;
  font-size: 12px;
  font-weight: 750;
}

.login-card input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #d9deea;
  border-radius: 11px;
  background: #fbfcfd;
  outline: none;
}

.login-card input:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(77, 99, 229, 0.1);
}

.login-card form .primary-button {
  width: 100%;
  margin-top: 13px;
}

.login-error {
  margin-top: 9px;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.login-card > small {
  display: block;
  margin-top: 18px;
  color: #9aa1b0;
  font-size: 10px;
}

.result-loading {
  width: min(720px, calc(100% - 40px));
  margin: 80px auto;
}

@media (max-width: 520px) {
  .login-card { padding: 28px 21px; border-radius: 18px; }
  .login-card h1 { font-size: 25px; }
}
