:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f5f7fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #172033;
  --muted: #667085;
  --line: #dbe1ea;
  --panel: #ffffff;
  --soft: #f3f6fa;
  --accent: #274c77;
  --accent-soft: #e9f0f7;
  --warning: #9a6700;
  --warning-soft: #fff7db;
  --success-soft: #edf7f1;
  --shadow: 0 12px 34px rgba(28, 39, 60, .08);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #f5f7fb; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at top, #ffffff 0, #f5f7fb 34rem); }
button, input, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(219, 225, 234, .86);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
}
.brand {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 850;
  letter-spacing: .14em;
  cursor: pointer;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-note { color: var(--muted); font-size: 13px; }

.page { width: min(1040px, calc(100% - 32px)); margin: 0 auto; padding: 44px 0 96px; }
.hero { padding: clamp(28px, 5vw, 58px); }
.panel {
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: #5d6b82;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
h1 { max-width: 840px; margin: 0 0 16px; font-size: clamp(32px, 5vw, 54px); line-height: 1.04; letter-spacing: -.035em; }
h2 { margin: 0 0 12px; font-size: clamp(22px, 3vw, 31px); line-height: 1.2; letter-spacing: -.02em; }
h3 { margin: 0 0 9px; font-size: 18px; line-height: 1.35; }
p { margin: 0 0 16px; line-height: 1.65; }
.lead { max-width: 760px; color: #445066; font-size: clamp(17px, 2vw, 20px); line-height: 1.65; }
.muted { color: var(--muted); }
.result-lead { margin-bottom: 30px; }

.notice { margin: 22px 0; padding: 15px 17px; border: 1px solid #dae3ee; border-radius: 14px; background: var(--soft); color: #445066; line-height: 1.5; }
.warning-panel { border-color: #ecd58e; background: linear-gradient(135deg, #fffdf6, var(--warning-soft)); }
.center-panel { display: flex; min-height: 390px; flex-direction: column; align-items: flex-start; justify-content: center; }
.spinner { width: 34px; height: 34px; margin-bottom: 24px; border: 3px solid #dbe3ed; border-top-color: var(--accent); border-radius: 50%; animation: spin .95s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.button { min-height: 44px; padding: 11px 16px; border: 1px solid transparent; border-radius: 12px; font-weight: 760; cursor: pointer; transition: transform .14s ease, box-shadow .14s ease, background .14s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--accent); color: white; box-shadow: 0 8px 18px rgba(39, 76, 119, .2); }
.button.secondary { border-color: var(--line); background: white; color: var(--ink); }
.button.ghost { border-color: transparent; background: transparent; color: #536076; }
.button.small { min-height: 36px; padding: 7px 10px; font-size: 12px; }
.text-back { margin: 0 0 28px; padding: 0; border: 0; background: transparent; color: var(--accent); font-weight: 760; cursor: pointer; }

.progress { display: flex; gap: 7px; width: min(440px, 100%); margin-bottom: 34px; }
.progress span { height: 5px; flex: 1; border-radius: 999px; background: #dce2e9; }
.progress span.on { background: var(--accent); }
.question-wrap { max-width: 820px; }
.question-hint { max-width: 700px; margin-bottom: 22px; }
.choices { display: grid; gap: 10px; margin: 26px 0 10px; }
.choice { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: white; cursor: pointer; transition: border-color .14s ease, background .14s ease, transform .14s ease; }
.choice:hover { transform: translateY(-1px); border-color: #b4bfce; }
.choice.selected { border-color: #7e9bb8; background: var(--accent-soft); }
.choice input { width: 18px; height: 18px; accent-color: var(--accent); }
.nav-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.textarea { width: 100%; min-height: 160px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 14px; outline: none; resize: vertical; background: white; color: var(--ink); line-height: 1.6; }
.textarea:focus { border-color: #7e9bb8; box-shadow: 0 0 0 4px rgba(83, 126, 168, .12); }
.error { margin: 14px 0; color: #a33a34; font-weight: 700; }

.priority-stack { display: grid; gap: 18px; }
.finding-card { padding: 26px; }
.finding-card.rank-1 { border-top: 5px solid #2f6b4f; }
.finding-card.rank-2 { border-top: 5px solid #b78017; }
.finding-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }
.status-chip { display: inline-flex; margin-bottom: 12px; padding: 6px 10px; border-radius: 999px; background: var(--soft); color: #536076; font-size: 12px; font-weight: 800; }
.rank-number { min-width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--soft); color: var(--muted); font-size: 20px; font-weight: 850; }
.card-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.section-block { margin-top: 42px; }
.section-heading { margin-bottom: 16px; }
.protected-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.protected-card { padding: 20px; box-shadow: 0 8px 22px rgba(28, 39, 60, .05); }
.info-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px; }
.info-panel h2 { max-width: 690px; font-size: 24px; }

.detail-panel, .plan-panel { max-width: 850px; padding: 26px; }
.detail-section { padding: 20px 0; border-top: 1px solid var(--line); }
.detail-section:first-child { padding-top: 0; border-top: 0; }
.detail-copy { color: #435067; line-height: 1.7; }
.detail-copy ul { margin: 0; padding-left: 20px; }
.detail-copy li { margin: 8px 0; }

.moderator-panel { position: fixed; right: 16px; bottom: 16px; z-index: 30; width: min(360px, calc(100vw - 32px)); max-height: 310px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.96); box-shadow: 0 18px 60px rgba(28,39,60,.2); backdrop-filter: blur(14px); }
.moderator-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.icon-button { border: 0; border-radius: 8px; background: var(--soft); padding: 6px 9px; cursor: pointer; color: #4e5a70; font-size: 12px; font-weight: 700; }
.event-list { max-height: 250px; overflow: auto; padding: 10px 14px 14px; }
.event-item { display: grid; grid-template-columns: 104px 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px solid #eef1f5; font-size: 12px; }
.event-item span { color: var(--muted); overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .topbar { padding: 12px 15px; }
  .topbar-note { display: none; }
  .page { width: min(100% - 24px, 1040px); padding-top: 28px; }
  .hero { padding: 24px; }
  h1 { font-size: clamp(30px, 10vw, 42px); }
  .finding-head { gap: 10px; }
  .rank-number { display: none; }
  .protected-grid { grid-template-columns: 1fr; }
  .info-panel { align-items: flex-start; flex-direction: column; }
  .card-actions .button { flex: 1 1 100%; }
  .nav-row .button { flex: 1; }
  .moderator-panel { right: 10px; bottom: 10px; width: calc(100vw - 20px); }
}

.privacy-note{margin-top:14px;font-size:.85rem;max-width:62ch}
.remote-log-state{margin-top:4px;font-size:.72rem;color:var(--muted)}
