:root {
  --navy: #05334A;
  --navy-dark: #02131B;
  --light: #C1CCD2;
  --muted: #839AA5;
  --bg: #F4F7F9;
  --accent: #4A0510;
  --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'DM Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background-color: var(--bg);
  font-family: var(--font-sans);
  color: var(--navy-dark);
}

#tabs {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 14px 0 0;
}

.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  background-color: transparent;
  color: var(--muted);
}

.tab.active {
  background-color: var(--navy);
  color: white;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.container.narrow { max-width: 480px; }
.container.wide { max-width: 960px; }

.band {
  background-color: var(--navy);
  color: white;
  padding: 18px 22px;
  border-radius: 4px;
  margin-bottom: 4px;
}
.band .brand { font-family: var(--font-mono); font-weight: 700; letter-spacing: 1px; }
.band .sub { font-family: var(--font-mono); color: var(--light); margin-left: 10px; font-size: 13px; }

.accent-rule { height: 3px; background-color: var(--accent); margin-bottom: 28px; }

h1.title { color: var(--navy); font-size: 28px; font-weight: 700; margin: 0 0 6px; }
p.subtitle { color: var(--muted); font-style: italic; margin-bottom: 24px; }

label.field-label { display: block; color: var(--navy); font-weight: 700; margin-bottom: 6px; }

input[type=text], input[type=password], input[type=number], textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--light);
  border-radius: 4px;
  font-size: 15px;
  font-family: var(--font-sans);
  margin-bottom: 20px;
  box-sizing: border-box;
}

textarea { resize: vertical; }

button.primary {
  background-color: var(--navy);
  color: white;
  border: none;
  padding: 12px 22px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
button.primary:disabled { opacity: .7; cursor: default; }

button.ghost {
  background: none;
  border: 1px solid var(--light);
  color: var(--navy);
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-sans);
}

.error-text { color: var(--accent); margin-top: 12px; }

.sticky-progress {
  position: sticky;
  top: 0;
  background-color: var(--bg);
  padding-bottom: 12px;
  margin-bottom: 12px;
  z-index: 10;
}
.progress-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.progress-label { font-family: var(--font-mono); color: var(--navy); font-weight: 700; font-size: 13px; }
.progress-count { font-family: var(--font-mono); color: var(--muted); font-size: 13px; }
.progress-track { height: 4px; background-color: var(--light); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background-color: var(--accent); transition: width .2s; }

.block-section { margin-bottom: 32px; }
.block-title { color: var(--navy); font-size: 18px; font-weight: 700; border-bottom: 2px solid var(--accent); padding-bottom: 6px; margin-bottom: 16px; }

.question { margin-bottom: 22px; }
.question p.qtext { color: var(--navy-dark); font-weight: 600; margin-bottom: 10px; line-height: 1.5; }

.option-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 4px;
}
.option-row.selected { background-color: #E8EEF1; }
.option-row .marker { flex-shrink: 0; margin-top: 2px; font-size: 15px; }
.option-row .otext { color: var(--navy-dark); font-size: 14.5px; line-height: 1.4; }

.thanks-box { text-align: center; padding: 20px; }
.thanks-box .check { font-size: 44px; color: var(--navy); margin-bottom: 16px; }
.thanks-box h2 { color: var(--navy); font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.thanks-box p { color: var(--muted); }

.gate-box { text-align: center; padding: 20px; }
.gate-box .lock { font-size: 32px; color: var(--navy); margin-bottom: 12px; }
.gate-box h2 { color: var(--navy); font-size: 18px; font-weight: 700; margin-bottom: 12px; }

.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.panel-header h1 { color: var(--navy); font-size: 24px; font-weight: 700; margin: 0; }
.panel-header p { color: var(--muted); margin: 4px 0 0; }

.entry-card { border: 1px solid var(--light); border-radius: 6px; padding: 20px; margin-bottom: 16px; background-color: white; }
.entry-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.entry-name { color: var(--navy); font-size: 17px; font-weight: 700; margin: 0; }
.entry-date { color: var(--muted); font-size: 12.5px; margin: 2px 0 0; font-family: var(--font-mono); }
.entry-score { text-align: right; }
.entry-score .pct { font-family: var(--font-mono); font-size: 22px; font-weight: 700; }
.entry-score .label { font-size: 12.5px; font-weight: 600; }

.blocks-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.block-chip { background-color: var(--bg); border-radius: 4px; padding: 10px 12px; }
.block-chip .chip-label { font-size: 11.5px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.block-chip .chip-pct { font-family: var(--font-mono); font-size: 17px; font-weight: 700; color: var(--navy); }
.block-chip .chip-cls { font-size: 11px; }

.notice-box {
  background-color: #FDECEC;
  border-left: 3px solid var(--accent);
  color: var(--navy-dark);
  font-size: 13.5px;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 3px;
  margin-bottom: 20px;
}

.no-copy { user-select: none; -webkit-user-select: none; }

.tab-warning {
  display: none;
  background-color: #FDECEC;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
}

.paste-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: -14px;
  margin-bottom: 20px;
}
.paste-hint.flash { color: var(--accent); font-weight: 700; }

.tab-flag {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  margin: 4px 0 0;
}

.delete-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  margin-bottom: 14px;
  text-decoration: underline;
}
.delete-btn:hover { color: var(--accent); }

.suggest-box { background-color: #F7F5EC; border-left: 3px solid #B8860B; border-radius: 3px; padding: 10px 14px; margin-bottom: 12px; }
.suggest-title { font-size: 13px; font-weight: 700; color: var(--navy); margin: 0 0 6px; }
.criteria-list { display: flex; flex-direction: column; gap: 3px; margin-bottom: 6px; }
.criteria-item { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; }
.criteria-text { color: var(--navy-dark); }
.suggest-note { font-size: 11.5px; color: var(--muted); font-style: italic; margin: 4px 0 0; }

.detail-toggle { margin-top: 14px; font-size: 13px; }
.detail-wrap { margin-top: 12px; }
.detail-missing { color: var(--muted); font-size: 13px; font-style: italic; }
.detail-row { border-top: 1px solid var(--light); padding: 10px 0; }
.detail-row:first-child { border-top: none; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.detail-qtext { color: var(--navy-dark); font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.detail-status { font-size: 12px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.detail-answer { color: var(--navy-dark); font-size: 13px; margin-top: 4px; }
.detail-correct { color: #1E7A46; font-size: 13px; margin-top: 2px; }

.analysis-text {
  font-size: 13.5px;
  color: var(--navy-dark);
  line-height: 1.5;
  background-color: #EEF3F5;
  border-left: 3px solid var(--navy);
  padding: 10px 14px;
  border-radius: 3px;
  margin: 0 0 16px;
}

.open-section { border-top: 1px solid var(--light); padding-top: 14px; }
.open-section .oa-label { font-size: 12.5px; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.open-section .oa-text { font-size: 14px; color: var(--navy-dark); line-height: 1.5; background-color: var(--bg); padding: 12px; border-radius: 4px; margin-bottom: 10px; white-space: pre-wrap; }
.score-row { display: flex; align-items: center; gap: 10px; }
.score-row label { font-size: 13px; color: var(--navy); font-weight: 600; }
.score-row input { width: 70px; padding: 6px 8px; border: 1px solid var(--light); border-radius: 4px; font-family: var(--font-mono); margin-bottom: 0; }
.score-row button { background-color: var(--navy); color: white; border: none; padding: 7px 14px; border-radius: 4px; cursor: pointer; font-size: 13px; font-family: var(--font-sans); }
