/* OMR 답안지에서 가져온 시각 언어: 자홍색 인쇄 선, 칠한 타원, 가장자리 눈금, 채점 표시. */
:root {
  --paper: #eef1f2;
  --sheet: #ffffff;
  --ink: #17191e;
  --muted: #5b626c;
  --form: #b3134f;
  --form-tint: #fbe6ee;
  --form-line: #eeb9cd;
  --rule: #d9dee2;
  --s1: #1f55c4;
  --s2: #c2570c;
  --caution-bg: #fff4d6;
  --caution-ink: #6b4a00;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.65 "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  font-variant-numeric: tabular-nums; word-break: keep-all; overflow-wrap: anywhere;
}
a { color: var(--form); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--s1); outline-offset: 2px; }

/* 답안지 한 장. 왼쪽 자홍색 눈금은 OMR 의 타이밍 마크. */
.sheet {
  position: relative; max-width: 920px; margin: 28px auto; padding: 36px 44px 28px 60px;
  background: var(--sheet); border: 1.5px solid var(--form-line);
}
.sheet::before {
  content: ""; position: absolute; top: 18px; bottom: 18px; left: 18px; width: 16px;
  background: repeating-linear-gradient(to bottom, var(--form) 0 6px, transparent 6px 26px);
}
.sheet.narrow { max-width: 620px; margin-top: 12vh; }

h1 { font-size: 34px; line-height: 1.25; font-weight: 700; margin: 0 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 18px; line-height: 1.4; font-weight: 700; margin: 0 0 14px; color: var(--form); }
section { margin-top: 38px; padding-top: 20px; border-top: 1.5px solid var(--form-line); }
.lead { margin: 0 0 24px; max-width: 34em; }
.back { margin-bottom: 18px; font-size: 14px; }

/* 입력 */
.field-row label { display: block; font-weight: 500; margin-bottom: 6px; color: var(--form); }
.field { display: flex; gap: 10px; flex-wrap: wrap; }
.field input {
  flex: 1 1 240px; min-width: 0; height: 50px; padding: 0 14px; font: inherit; font-size: 18px; color: var(--ink);
  background: #fff; border: 2px solid var(--form); border-radius: 0;
}
.field input::placeholder { color: #8b929b; }
/* 칠한 타원 버튼 */
button.mark {
  height: 50px; padding: 0 28px; font: inherit; font-weight: 700; color: #fff; background: var(--ink);
  border: 0; border-radius: 25px; cursor: pointer;
}
button.mark:hover { background: var(--form); }
button.mark:disabled { background: var(--muted); cursor: progress; }
button.link { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--muted); text-decoration: underline; cursor: pointer; }
.error { color: var(--form); font-weight: 500; margin: 12px 0 0; }
.status { margin: 12px 0 0; color: var(--ink); }

.rules { margin: 30px 0 0; }
.rules div { display: grid; grid-template-columns: 7em 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--rule); }
.rules dt { font-weight: 500; }
.rules dd { margin: 0; color: var(--muted); }
.logout { margin-top: 22px; }

/* 종목 머리 */
.stock-id { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; color: var(--muted); }

/* Hit Ratio 눈금자: 이 페이지의 주인공 */
.ruler { --label: 148px; }
.ruler-row { display: grid; grid-template-columns: var(--label) 1fr; align-items: center; min-height: 46px; }
.ruler-label { font-weight: 500; padding-right: 12px; line-height: 1.3; }
.ruler-label label { display: block; }
.ruler-head { min-height: 34px; align-items: end; }
.track { position: relative; height: 100%; min-height: 46px; }
.ruler-head .track { min-height: 34px; border-bottom: 2px solid var(--ink); }
.tick { position: absolute; bottom: 0; width: 1px; height: 6px; background: var(--ink); margin-left: -0.5px; }
.tick.major { height: 12px; width: 2px; margin-left: -1px; }
.tick-v { position: absolute; bottom: 13px; transform: translateX(-50%); font-weight: 500; font-size: 13px; white-space: nowrap; }
.ruler-body { position: relative; }
.band-layer { position: absolute; inset: 0; display: grid; grid-template-columns: var(--label) 1fr; pointer-events: none; }
.band-track { grid-column: 2; position: relative; }
.band { position: absolute; top: 0; bottom: 0; background: var(--form-tint); }
.fifty { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--form); }
.ruler-body .ruler-row { position: relative; border-bottom: 1px solid var(--rule); }

/* OMR 타원 표시. 번호가 곧 과제 번호다. */
.bubble { position: absolute; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 8px; margin-left: -10px; white-space: nowrap; }
.bubble em {
  width: 20px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-style: normal; font-weight: 700; font-size: 13px; color: #fff; box-shadow: 0 0 0 2px #fff;
}
.bubble strong { font-weight: 700; font-size: 17px; background: rgba(255, 255, 255, .78); padding: 0 3px; }
.bubble.flip { flex-direction: row-reverse; margin-left: 0; transform: translate(calc(-100% + 10px), -50%); }
.bubble.s1 em { background: var(--s1); }
.bubble.s2 em { background: var(--s2); }
.bubble.s3 em { background: var(--ink); }
.bubble.ghost::before {
  content: ""; width: 12px; height: 12px; margin: 0 4px; background: #fff; border: 2px solid var(--muted); transform: rotate(45deg);
}
.bubble.ghost strong { font-weight: 500; font-size: 15px; color: var(--muted); }
.ruler-row.ref .ruler-label { font-weight: 400; color: var(--muted); font-size: 14px; }
.mine-field { display: inline-flex; align-items: center; gap: 3px; margin-top: 2px; }
.mine-field input {
  width: 5.2em; height: 28px; padding: 0 6px; font: inherit; font-size: 15px; border: 1.5px solid var(--form); border-radius: 0; background: #fff;
}
.mine-field input[aria-invalid="true"] { border-width: 3px; }
.ruler-row:has(.mine-field) { min-height: 66px; }
.ruler-key { display: flex; gap: 8px; align-items: center; margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.ruler-key i { flex: none; width: 18px; height: 12px; background: var(--form-tint); border: 1px solid var(--form-line); }

.reading { margin-top: 16px; }
.reading p { margin: 0 0 6px; }
.caution { background: var(--caution-bg); color: var(--caution-ink); padding: 8px 12px; margin-top: 10px !important; }
.caution span { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 6px; border-radius: 50%; background: var(--caution-ink); color: #fff; font-weight: 700; font-size: 12px; }

/* 표 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--rule); white-space: nowrap; }
thead th { font-weight: 500; font-size: 13px; color: var(--muted); border-bottom: 2px solid var(--ink); white-space: normal; vertical-align: bottom; }
tbody th { font-weight: 500; }
.num { text-align: right; }
.strong { font-weight: 700; font-size: 17px; }
tr.ref th, tr.ref td { color: var(--muted); font-weight: 400; }
tr.ref .strong { font-size: 15px; }
.note { margin: 12px 0 0; font-size: 14px; color: var(--muted); max-width: 46em; }
.note.first { margin: 0 0 12px; }

/* 추이 차트 */
.chart { position: relative; width: 100%; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: auto; }
.grid { stroke: var(--rule); stroke-width: 1; }
.grid-fifty { stroke: var(--form); stroke-width: 1.5; }
.axis { font-size: 12px; fill: var(--muted); }
.axis-strong { font-size: 12px; font-weight: 700; fill: var(--form); }
.end-label { font-size: 13px; font-weight: 700; fill: var(--ink); }
.line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.line.s1 { stroke: var(--s1); }
.line.s2 { stroke: var(--s2); }
.dot { stroke: #fff; stroke-width: 2; }
.dot.s1 { fill: var(--s1); }
.dot.s2 { fill: var(--s2); }
.cross { stroke: var(--muted); stroke-width: 1; }
.tip { position: absolute; background: #fff; border: 1.5px solid var(--ink); padding: 6px 10px; font-size: 13px; line-height: 1.5; pointer-events: none; white-space: nowrap; }
.tip-date { font-weight: 500; }
.tip i, .legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.tip i.s1, .legend i.s1 { background: var(--s1); }
.tip i.s2, .legend i.s2 { background: var(--s2); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 8px; font-size: 14px; }

/* 답안지 */
.grade { display: inline-block; width: 1.4em; font-weight: 700; color: var(--form); }
.grade.miss { color: var(--muted); }
.blank { background: repeating-linear-gradient(90deg, transparent 0 8px, var(--form-tint) 8px 9px); min-width: 72px; }

/* 10년 눈금: 한 달에 하나 */
.timing { display: flex; gap: 2px; height: 22px; margin-top: 4px; }
.timing i { flex: 1 1 0; min-width: 0; background: var(--ink); }
.timing .z-warm { background: var(--rule); }
.timing .z-train { background: #9aa2ab; }
.timing .z-val { background: #4d545d; }
.timing .z-hold { background: var(--form); }
.split { display: grid; grid-template-columns: 4fr 3fr 3fr; gap: 12px; margin: 10px 0 0; }
.split dt { font-weight: 700; }
.split dd { margin: 0; font-size: 14px; color: var(--muted); }
.split .z-hold dt { color: var(--form); }
.files { list-style: none; padding: 0; margin: 20px 0 0; }
.files li { padding: 8px 0; border-top: 1px solid var(--rule); font-size: 15px; color: var(--muted); }
.files a { font-weight: 700; margin-right: 8px; display: inline-block; }

.how { margin: 0; }
.how div { display: grid; grid-template-columns: 8em 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--rule); }
.how dt { font-weight: 500; }
.how dd { margin: 0; color: var(--muted); font-size: 15px; max-width: 42em; }
.foot { margin-top: 30px; font-size: 13px; color: var(--muted); }

@media (max-width: 640px) {
  .sheet, .sheet.narrow { margin: 0; padding: 22px 16px 22px 30px; border-width: 0; }
  .sheet::before { left: 8px; width: 10px; top: 12px; bottom: 12px; }
  h1 { font-size: 27px; }
  .ruler { --label: 92px; }
  .ruler-label { font-size: 14px; padding-right: 6px; }
  .bubble strong { font-size: 15px; }
  .bubble.ghost strong { font-size: 13px; }
  .split { grid-template-columns: 1fr; gap: 8px; }
  .rules div, .how div { grid-template-columns: 1fr; gap: 2px; }
  .field input { flex-basis: 100%; }
  button.mark { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }
@media print {
  body { background: #fff; }
  .sheet { border: 0; margin: 0; max-width: none; }
  .back, .logout { display: none; }
}
