/* theorem: 학교별 수학 내신 킬러 문항 해설 모바일 웹 시연. 칠판 녹색 바탕에 흰 풀이지 카드 */

.tm {
  --bg: #2F5D50;
  --surface: #FFFFFF;
  --text: #17231F;
  --muted: #5C6B66;
  --line: #D5DED9;
  --primary: #FFD45C;
  --accent: #1E4037;
  --ok: #1B7F4B;
  --warn: #A46200;
  --danger: #C7352B;
  --chalk: #CFE3DB;
  --deep: #24483E;
  --soft: #F4F7F5;
  --note: #FFF6D6;
  --serif: "STIX Two Text", "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 15% 0%, rgba(255, 255, 255, .07), transparent 70%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(0, 0, 0, .10), transparent 70%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.tm *, .tm *::before, .tm *::after { box-sizing: border-box; }
:where(.tm) :where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(.tm) button { cursor: pointer; }
:where(.tm) a { color: inherit; }
.tm code { font-family: var(--mono); font-size: .86em; }
.tm :focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.tm .tm-card :focus-visible, .tm dialog :focus-visible { outline-color: var(--accent); }
.tm [hidden] { display: none !important; }

/* 안내 띠 · 머리말 */
.tm-band {
  height: 28px; display: flex; align-items: center; justify-content: center; padding: 0 12px;
  background: var(--deep); color: var(--chalk); font-size: 12px; white-space: nowrap; overflow: hidden;
}
.tm-band span { overflow: hidden; text-overflow: ellipsis; }

.tm-head {
  max-width: 1240px; margin: 0 auto; padding: 8px 20px; display: flex; align-items: center; gap: 18px;
}
.tm-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: #fff; min-width: 0; }
.tm-logo__mark { width: 14px; height: 14px; background: var(--primary); flex: none; }
.tm-logo__name { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.tm-logo__tag { font-size: 13px; color: var(--chalk); white-space: nowrap; }
.tm-nav { display: flex; gap: 4px; margin-left: 8px; }
.tm-nav a {
  min-height: 36px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 999px;
  color: #fff; text-decoration: none; font-size: 15px; font-weight: 600;
}
.tm-nav a:hover { background: rgba(255, 255, 255, .1); }
.tm-nav a.is-on { background: var(--primary); color: var(--text); }
.tm-head__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tm-user { font-size: 13px; color: var(--chalk); white-space: nowrap; }
.tm-reset {
  min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(207, 227, 219, .6);
  background: transparent; color: #fff !important; font-size: 14px; white-space: nowrap;
}
.tm-reset:hover { background: rgba(255, 255, 255, .1); }
.tm-reset--map { border-color: var(--primary); color: var(--primary) !important; }

.tm-main { max-width: 1240px; margin: 0 auto; padding: 4px 20px 32px; }

/* 공통 부품 */
.tm-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.tm-label { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.tm-input {
  width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid #B9C7C1; border-radius: 8px; background: #fff; font-size: 16px;
}
.tm-input[readonly] { background: var(--soft); }
.tm-select { min-height: 38px; padding: 4px 8px; border: 1px solid #B9C7C1; border-radius: 8px; background: #fff; font-size: 14px; max-width: 100%; }
.tm-btn {
  min-height: 42px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--primary); color: var(--text) !important;
  font-weight: 700; font-size: 15px; white-space: nowrap;
}
.tm-btn:hover { background: #FFCB33; }
.tm-btn:disabled { background: #E7ECE9; color: var(--muted) !important; cursor: not-allowed; }
.tm-btn--line { background: #fff; border: 1.5px solid var(--accent); color: var(--accent) !important; }
.tm-btn--line:hover { background: var(--soft); }
.tm-btn--chalk { background: transparent; border: 1.5px solid var(--primary); color: var(--primary) !important; }
.tm-btn--chalk:hover { background: rgba(255, 212, 92, .12); }
.tm-link { border: 0; background: none; padding: 4px 2px; color: var(--accent); font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.tm-hint { margin: 0; font-size: 13px; color: var(--muted); }
.tm-eyebrow { margin: 0; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.tm-eyebrow--chalk { color: var(--chalk); }
.tm-h1 { margin: 2px 0 4px; font-size: 24px; line-height: 1.3; color: #fff; letter-spacing: -.02em; }
.tm-h2 { margin: 0; font-size: 17px; line-height: 1.35; letter-spacing: -.01em; }
.tm-sub { margin: 0; font-size: 14px; color: var(--chalk); }
.tm-empty { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

.tm-tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700;
  white-space: nowrap; border: 1px solid transparent; line-height: 1;
}
.tm-tag--on { background: var(--primary); color: var(--text); }
.tm-tag--off { background: #EEF1EF; color: var(--muted); font-weight: 600; }
.tm-tag--line { border-color: #A9B8B2; color: var(--muted); }
.tm-tag--warn { background: #FFF1DC; color: var(--warn); }
.tm-tag--ok { background: #E4F2EA; color: var(--ok); }
.tm-tag--mock { background: var(--note); color: #6B4E00; border: 1px dashed #D9B23F; }

.tm-mini { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tm-mini--ok { background: #E4F2EA; color: var(--ok); }
.tm-mini--ng { background: #FBE9E7; color: var(--danger); }

/* 화면 1. 학습 */
.tm-study { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.tm-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tm-step { margin: 0; display: flex; align-items: center; gap: 8px; color: #fff; font-size: 15px; font-weight: 700; min-height: 28px; }
.tm-step__no {
  width: 26px; height: 26px; border: 1.5px solid var(--primary); border-radius: 50%; display: grid; place-items: center;
  font-family: var(--serif); font-size: 16px; color: var(--primary); line-height: 1;
}

.tm-search { display: grid; gap: 8px; }
.tm-schools { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-school {
  min-height: 38px; padding: 0 12px; border-radius: 999px; border: 1px solid #B9C7C1; background: #fff; font-size: 14px; font-weight: 600;
}
.tm-school.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }

.tm-packs { display: grid; gap: 8px; }
.tm-pack {
  display: grid; gap: 3px; width: 100%; text-align: left; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); text-decoration: none;
}
.tm-pack:hover { border-color: #9FB3AB; }
.tm-pack.is-open { border: 2px solid var(--primary); padding: 8px 11px; box-shadow: inset 4px 0 0 var(--primary); }
.tm-pack__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tm-pack__exam { font-size: 13px; color: var(--muted); margin-left: 4px; }
.tm-pack__subject { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.tm-pack__meta { font-size: 13px; color: var(--muted); }
.tm-pack__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tm-pack__done { font-size: 13px; font-weight: 700; color: var(--accent); }
.tm-pack__done b { font-family: var(--serif); font-size: 17px; }
.tm-pack--wait { background: var(--soft); border-style: dashed; border-color: #A9B8B2; }
.tm-pack__go { font-size: 13px; font-weight: 700; color: var(--accent); white-space: nowrap; }

.tm-qlist { padding: 10px 12px 4px; }
.tm-qlist__head { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.tm-qlist__head b { color: var(--text); }
.tm-qlist ul { list-style: none; margin: 0; padding: 0; }
.tm-qrow {
  width: 100%; min-height: 42px; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 8px;
  border: 0; border-top: 1px solid var(--line); background: none; text-align: left; padding: 0 6px;
}
.tm-qrow.is-on { background: var(--note); box-shadow: inset 3px 0 0 var(--accent); }
.tm-qrow__no { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.tm-qrow__type { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.tm-qrow__done { font-size: 13px; color: var(--accent); font-weight: 700; }

.tm-paper { padding: 14px 16px; }
.tm-paper__head { display: flex; align-items: center; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.tm-paper__no { font-family: var(--serif); font-size: 34px; font-weight: 600; line-height: 1; color: var(--accent); }
.tm-paper__no small { font-family: "Pretendard Variable", Pretendard, sans-serif; font-size: 14px; font-weight: 700; margin-left: 2px; }
.tm-paper__src { display: grid; font-size: 13px; color: var(--muted); min-width: 0; }
.tm-paper__src code { font-size: 12px; color: var(--accent); }
.tm-paper__stem { margin: 8px 0 6px; font-size: 17px; line-height: 1.65; }

.tm-steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; border-top: 1px dashed var(--line); }
.tm-stepbox { border-bottom: 1px dashed var(--line); min-width: 0; }
.tm-stepbox summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: 14px; font-weight: 700; color: var(--accent);
}
.tm-stepbox summary::-webkit-details-marker { display: none; }
.tm-stepbox summary::after { content: "접기"; margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
.tm-stepbox:not([open]) summary::after { content: "펼치기"; }
.tm-stepbox__no { padding: 1px 7px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 12px; }
.tm-stepbox__body { padding: 0 0 6px; font-size: 15px; line-height: 1.6; }
.tm-stepbox__body p { margin: 0; }
.tm-disp { overflow-x: auto; overflow-y: hidden; margin: 4px 0; padding: 6px 8px; background: var(--soft); border-radius: 8px; -webkit-overflow-scrolling: touch; }
.tm-disp .katex-display { margin: 0; }
.tm-disp .katex-display > .katex { text-align: left; }
.tm-m:not([data-display]) { display: inline-block; }
.tm-nb { white-space: nowrap; }
.tm-m:not([data-ok]) { font-family: var(--mono); font-size: .85em; color: var(--muted); }
.tm .katex { font-size: 1.05em; }

.tm-answer { margin: 6px 0; display: flex; align-items: center; gap: 8px; }
.tm-answer span { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--primary); }
.tm-answer b { font-family: var(--serif); font-size: 22px; line-height: 1; }

.tm-video {
  position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; display: grid; place-items: center;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .04) 0 1px, transparent 1px 28px),
    linear-gradient(160deg, #26503F, var(--accent));
}
.tm-video__play { width: 52px; height: 52px; border-radius: 50%; background: var(--primary); position: relative; }
.tm-video__play::after {
  content: ""; position: absolute; left: 21px; top: 16px; border-style: solid; border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent var(--text);
}
.tm-video__title { position: absolute; left: 12px; bottom: 10px; color: #fff; font-size: 14px; font-weight: 700; }
.tm-video__note {
  position: absolute; right: 10px; top: 10px; font-size: 12px; color: var(--chalk); border: 1px dashed rgba(207, 227, 219, .7);
  border-radius: 999px; padding: 1px 8px;
}

.tm-a2hs {
  margin-top: 8px; width: 100%; min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--soft); font-size: 14px; text-align: left;
}
.tm-a2hs__icon { width: 24px; height: 24px; border-radius: 6px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 15px; flex: none; }
.tm-a2hs__go { margin-left: auto; font-weight: 700; color: var(--accent); white-space: nowrap; }

/* 변형 문제 */
.tm-v { padding: 11px 14px 12px; display: grid; gap: 8px; }
.tm-v__head { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.tm-v__label { font-weight: 800; font-size: 15px; white-space: nowrap; }
.tm-v__type { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tm-v__tools { margin-left: auto; display: inline-flex; gap: 8px; }
.tm-v__tools .tm-link { padding: 2px 0; font-size: 12.5px; white-space: nowrap; }
.tm-verdict {
  margin-left: auto; display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 6px; font-size: 13px; font-weight: 800;
  background: #EEF1EF; color: var(--muted); white-space: nowrap; transition: background-color .2s ease, color .2s ease, transform .2s ease;
}
.tm-v__tools:not([hidden]) + .tm-verdict { margin-left: 4px; }
.tm-v[data-state="ok"] .tm-verdict { background: var(--ok); color: #fff; }
.tm-v[data-state="ng"] .tm-verdict { background: var(--danger); color: #fff; }
.tm-v.is-just .tm-verdict { transform: scale(1.08); }
.tm-v__stem { margin: 0; font-size: 15px; line-height: 1.6; }
.tm-v__form { display: flex; gap: 8px; }
.tm-v__form .tm-input { flex: 1; min-width: 0; min-height: 40px; }
.tm-v[data-state="ok"] .tm-input { border-color: var(--ok); color: var(--ok); font-weight: 700; }
.tm-v[data-state="ng"] .tm-input { border-color: var(--danger); color: var(--danger); font-weight: 700; }
.tm-v__explain { font-size: 14px; line-height: 1.6; border-radius: 8px; background: var(--soft); padding: 7px 10px; }
.tm-v__explain p { margin: 0; }
.tm-v__note { font-size: 13px; font-weight: 700; color: var(--accent); }
.tm-v[data-state="ng"] .tm-v__explain { background: #FDF2F0; }
.tm-v[data-state="ng"] .tm-v__note { color: var(--danger); }

.tm-choices { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.tm-choice {
  min-height: 40px; border-radius: 8px; border: 1px solid #B9C7C1; background: #fff; display: flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 15px; transition: background-color .2s ease, border-color .2s ease;
}
.tm-choice:disabled { cursor: default; color: var(--text); }
.tm-choice__mark { font-size: 15px; }
.tm-choice__val { font-family: var(--serif); font-size: 17px; }
.tm-choice.is-picked { background: #FBE9E7; border: 2px solid var(--danger); color: var(--danger); }
.tm-choice.is-answer { border: 2px solid var(--ok); color: var(--ok); font-weight: 700; }
.tm-choice.is-picked.is-answer { background: #E4F2EA; }

.tm-logbox { padding: 9px 14px 6px; }
.tm-logbox__head { margin: 0 0 4px; font-size: 13px; font-weight: 700; display: flex; justify-content: space-between; }
.tm-logbox__head span { color: var(--muted); font-weight: 600; }
.tm-log { list-style: none; margin: 0; padding: 0; }
.tm-log li { display: grid; grid-template-columns: 48px 52px minmax(0, 1fr) auto; align-items: center; gap: 6px; min-height: 29px; border-top: 1px solid var(--line); font-size: 13px; }
.tm-log time { font-family: var(--serif); font-size: 15px; color: var(--muted); }
.tm-log__q { font-weight: 700; }
.tm-log__a { color: var(--muted); }

.tm-tabs { display: none; }

/* 화면 2. 요청판 */
.tm-reqpage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 500px); gap: 20px; align-items: start; }
.tm-board { min-width: 0; }
.tm-board__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.tm-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tm-filter {
  min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(207, 227, 219, .55); background: transparent; color: #fff; font-size: 14px;
}
.tm-filter b { font-family: var(--serif); font-weight: 600; margin-left: 2px; }
.tm-filter.is-on { background: var(--primary); border-color: var(--primary); color: var(--text); font-weight: 700; }
.tm-reqs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tm-req { padding: 10px 14px; display: grid; gap: 6px; scroll-margin: 80px; }
.tm-req.is-focus { animation: tm-focus 1.6s ease; }
@keyframes tm-focus { 0%, 60% { box-shadow: 0 0 0 4px var(--primary); } 100% { box-shadow: 0 0 0 0 transparent; } }
.tm-req--empty { color: var(--muted); font-size: 14px; }
.tm-req__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tm-req__title { font-size: 15px; font-weight: 600; }
.tm-req__title b { font-family: var(--serif); font-size: 17px; }
.tm-req__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tm-req__label { font-size: 13px; color: var(--muted); }
.tm-status { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.tm-status--new { border: 1px solid #A9B8B2; color: var(--muted); }
.tm-status--review { background: #FFF1DC; color: var(--warn); }
.tm-status--make { background: #E3ECE8; color: var(--accent); }
.tm-status--open { background: var(--ok); color: #fff; }
.tm-bar { height: 8px; border-radius: 999px; background: #E7ECE9; overflow: hidden; }
.tm-bar span { display: block; height: 100%; background: var(--primary); border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(164, 98, 0, .25); }
.tm-req[data-status="공개"] .tm-bar span { background: var(--ok); box-shadow: none; }
.tm-stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.tm-stages__seg {
  height: 20px; border-radius: 5px; background: #E7ECE9; color: var(--muted); font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.tm-stages__seg.is-done { background: var(--primary); color: var(--text); }
.tm-stages__seg.is-now { background: repeating-linear-gradient(135deg, var(--primary) 0 6px, #FFE7A3 6px 12px); color: var(--text); }
.tm-vote {
  min-height: 34px; padding: 0 12px; border-radius: 8px; border: 1.5px solid var(--accent); background: #fff; color: var(--accent);
  font-size: 14px; font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
}
.tm-vote b { font-family: var(--serif); font-size: 16px; }
.tm-vote.is-mine { background: var(--accent); color: #fff; }
.tm-vote--view { border-color: var(--ok); color: var(--ok); }
.tm-assume { margin: 10px 2px 0; font-size: 13px; color: var(--chalk); }

.tm-panel { padding: 16px; display: grid; gap: 10px; }
.tm-panel__sendhead { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.tm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tm-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 6px 8px; border-bottom: 1.5px solid var(--accent); white-space: nowrap; }
.tm-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tm-table .num { text-align: right; }
.tm-table td.num { font-family: var(--serif); font-size: 16px; }
.tm-table--reqs td:first-child { font-weight: 600; }
.tm-sends { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tm-send { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--soft); }
.tm-send__head { margin: 0 0 6px; font-size: 14px; }
.tm-send__head time { font-family: var(--serif); color: var(--muted); margin-right: 4px; }
.tm-send__nums { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tm-n { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 9px; border-radius: 6px; font-size: 13px; font-weight: 700; background: #fff; border: 1px solid var(--line); }
.tm-n b { font-family: var(--serif); font-size: 17px; }
.tm-n--ok { color: var(--ok); }
.tm-n--ng { color: var(--danger); }
.tm-n--warn { color: var(--warn); }
.tm-n__arrow { color: var(--muted); font-weight: 700; }
.tm-send__more { margin-top: 6px; font-size: 13px; }
.tm-send__more summary { cursor: pointer; color: var(--accent); font-weight: 700; min-height: 26px; display: flex; align-items: center; }
.tm-send__more ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); display: grid; gap: 4px; }

.tm-ask { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tm-ask .tm-select { display: block; width: 100%; margin-top: 4px; min-height: 44px; font-size: 15px; }
.tm-ask__msg { margin: 12px 0 0; font-size: 13px; color: var(--muted); padding: 8px 10px; border-radius: 8px; background: var(--soft); }
.tm-ask__msg.is-warn { background: var(--note); color: #6B4E00; font-weight: 700; }
.tm-ask__foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* 화면 3. 관리자 */
.tm-adm { display: grid; gap: 12px; }
.tm-adm__bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: #fff; }
.tm-2fa {
  margin: 0; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px;
  background: rgba(27, 127, 75, .35); border: 1px solid rgba(207, 227, 219, .5); font-size: 13px; font-weight: 700;
}
.tm-stats { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--chalk); }
.tm-stats b { font-family: var(--serif); font-size: 19px; color: #fff; font-weight: 600; margin-left: 2px; }
.tm-stats small { font-size: 13px; color: #fff; margin-left: 1px; }
.tm-adm__bar .tm-btn { margin-left: auto; min-height: 38px; }

.tm-adm__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.tm-json { display: grid; gap: 10px; }
.tm-json__head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.tm-json__file { font-family: var(--mono); font-size: 12px; color: var(--muted); padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; white-space: nowrap; }
.tm-json__input {
  width: 100%; height: 556px; resize: vertical; padding: 10px 12px; border: 1px solid #B9C7C1; border-radius: 8px; background: #FAFBFA;
  font-family: var(--mono) !important; font-size: 12.5px; line-height: 1.6; white-space: pre; overflow: auto; tab-size: 2;
}
.tm-json__input::selection { background: #FFE08A; }
.tm-json__foot { display: flex; align-items: center; gap: 10px; }

.tm-result { display: grid; gap: 10px; }
.tm-result__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tm-result__sum { margin: 0; font-size: 15px; font-weight: 700; color: var(--muted); }
.tm-sum { font-family: inherit; font-size: 17px; font-weight: 800; }
.tm-sum--ok { color: var(--ok); }
.tm-sum--ng { color: var(--danger); }
.tm-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tm-check {
  width: 100%; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; text-align: left; padding: 7px 10px;
  border-radius: 8px; border: 1px solid var(--line); background: #fff;
}
.tm-check.is-ok { box-shadow: inset 3px 0 0 var(--ok); }
.tm-check.is-ng { box-shadow: inset 3px 0 0 var(--danger); background: #FFF8F7; }
.tm-check.is-on { background: var(--note); border-color: #E9C75A; }
.tm-check__mark { font-weight: 800; font-size: 16px; line-height: 1.4; }
.tm-check.is-ok .tm-check__mark { color: var(--ok); }
.tm-check.is-ng .tm-check__mark { color: var(--danger); }
.tm-check__body { display: grid; gap: 2px; min-width: 0; }
.tm-check__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tm-check__top code { font-weight: 700; font-size: 13px; }
.tm-check__type, .tm-check__line { font-size: 12px; color: var(--muted); }
.tm-check__verdict { margin-left: auto; font-size: 12px; font-weight: 800; }
.tm-check.is-ok .tm-check__verdict { color: var(--ok); }
.tm-check.is-ng .tm-check__verdict { color: var(--danger); }
.tm-check__why { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.tm-check.is-ng .tm-check__why { color: #9A2A21; font-family: var(--mono); font-size: 12px; }

.tm-preview__label { margin: 0 0 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.tm-preview__card { border: 1px dashed #A9B8B2; border-radius: 8px; padding: 10px 12px; font-size: 14px; line-height: 1.6; }
.tm-preview__stem { margin: 0 0 6px; font-size: 15px; }
.tm-preview__choices { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.tm-preview__ans { margin: 0 0 4px; display: flex; align-items: center; gap: 6px; }
.tm-preview__ans span { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--primary); }
.tm-preview__ans b { font-family: var(--serif); font-size: 18px; }
.tm-preview__steps { margin: 0; padding-left: 20px; color: var(--text); }
.tm-preview__explain { margin: 0; }
.tm-preview__err { border: 1px solid #F0C8C2; background: #FFF8F7; border-radius: 8px; padding: 10px 12px; font-size: 13px; display: grid; gap: 4px; }
.tm-preview__err p { margin: 0; overflow-wrap: anywhere; }
.tm-preview__err b { color: var(--danger); margin-right: 4px; }
.tm-result__foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tm-result__msg { margin: 0; font-size: 13px; font-weight: 700; color: var(--ok); }

.tm-solves__head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.tm-table--solves td { font-size: 13.5px; }
.tm-table--solves td:first-child { font-family: var(--serif); font-size: 15px; white-space: nowrap; }
.tm-table--solves tr.is-local td:nth-child(2)::after { content: "이 브라우저"; margin-left: 6px; font-size: 11px; color: #6B4E00; background: var(--note); padding: 1px 6px; border-radius: 999px; }

/* 시트(dialog) */
.tm-modal { border: 0; padding: 0; border-radius: 14px; width: min(560px, calc(100% - 24px)); max-height: calc(100vh - 48px); color: var(--text); background: var(--surface); }
.tm-modal::backdrop { background: rgba(10, 28, 22, .6); }
.tm-modal--small { width: min(400px, calc(100% - 24px)); }
.tm-modal__in { padding: 18px 20px 20px; }
.tm-modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.tm-modal__title { margin: 2px 0 0; font-size: 19px; font-weight: 800; }
.tm-modal__body { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.tm-x { width: 44px; height: 44px; margin: -8px -10px 0 0; border: 0; background: none; border-radius: 8px; display: grid; place-items: center; flex: none; }
.tm-x:hover { background: var(--soft); }
.tm .tm-x:focus-visible { outline-width: 2px; outline-offset: -6px; }
.tm-modal--sheet { width: min(680px, calc(100% - 24px)); }
.tm-map { list-style: none; margin: 0; padding: 0; display: grid; }
.tm-map li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.tm-map__no { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-family: var(--serif); font-size: 13px; display: grid; place-items: center; }
.tm-map__need { margin: 0; font-size: 14px; font-weight: 700; }
.tm-map__show { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.tm-map__show a { color: var(--accent); font-weight: 600; text-underline-offset: 3px; }
.tm-map__foot { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--soft); font-size: 13px; color: var(--muted); }

.tm-how { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tm-how section { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.tm-how__art { display: block; width: 84px; height: 105px; margin: 0 auto 6px; }
.tm-how h3 { margin: 0 0 6px; font-size: 15px; }
.tm-how ol { margin: 0; padding-left: 18px; font-size: 14px; display: grid; gap: 4px; }
.tm-how__note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

/* 공고 대응표 단추 · 알림 · 하단 안내 */
.tm-fab {
  display: none; position: fixed; right: 16px; bottom: 16px; z-index: 30; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 0;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 700; align-items: center; gap: 6px;
  box-shadow: 0 0 0 2px rgba(255, 212, 92, .9);
}
.tm-toast {
  position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); z-index: 40; max-width: min(520px, calc(100% - 24px));
  padding: 10px 16px; border-radius: 10px; background: var(--text); color: #fff; font-size: 14px; text-align: center;
}
.demo-notice { padding: 14px 16px 80px; font-size: 12px; color: var(--chalk); text-align: center; }

/* 1080px 이하: 세 단을 조금 좁게 */
@media (max-width: 1080px) {
  .tm-logo__tag { display: none; }
  .tm-study { gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tm-reqpage { grid-template-columns: minmax(0, 1fr) minmax(0, 420px); }
}

/* 900px 이하: 휴대폰 화면. 세 단은 아래 탭으로 바꾸고 나머지 화면은 위아래로 쌓는다 */
@media (max-width: 900px) {
  .tm-head { flex-wrap: wrap; gap: 8px 12px; padding: 8px 12px; }
  .tm-nav { order: 3; width: 100%; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .tm-nav a { justify-content: center; min-height: 40px; }
  .tm-user, .tm-reset--map { display: none; }
  .tm-fab { display: inline-flex; }
  .tm-reset { min-height: 38px; font-size: 13px; padding: 0 12px; }
  .tm-main { padding: 4px 12px 24px; }

  .tm-study { display: block; padding-bottom: 72px; }
  .tm-study .tm-col { display: none; }
  .tm-study[data-tab="pack"] .tm-col[data-col="pack"],
  .tm-study[data-tab="explain"] .tm-col[data-col="explain"],
  .tm-study[data-tab="variant"] .tm-col[data-col="variant"] { display: flex; }
  .tm-step { display: none; }
  .tm-tabs {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    background: var(--surface); border-top: 1px solid var(--line); padding: 0 0 env(safe-area-inset-bottom);
  }
  .tm-tabs button {
    min-height: 58px; border: 0; background: none; font-size: 14px; font-weight: 700; color: var(--muted);
    display: flex; align-items: center; justify-content: center; gap: 6px; border-top: 3px solid transparent;
  }
  .tm-tabs button.is-on { color: var(--text); border-top-color: var(--primary); background: #FFFBEA; }
  .tm-tabs__no { font-family: var(--serif); font-size: 16px; }
  .tm-tabs__count { font-size: 12px; color: var(--accent); }
  .tm--home .tm-fab { bottom: 74px; }
  .tm--home .tm-toast { bottom: 132px; }

  .tm-reqpage { grid-template-columns: minmax(0, 1fr); }
  .tm-board__head { flex-direction: column; align-items: stretch; }
  .tm-board__head .tm-btn { min-height: 44px; }

  .tm-adm__grid { grid-template-columns: minmax(0, 1fr); }
  .tm-adm__grid .tm-result { order: -1; }
  .tm-adm__bar { gap: 8px 12px; }
  .tm-adm__bar .tm-btn { margin-left: 0; width: 100%; min-height: 44px; }
  .tm-json__input { height: 340px; }
}

@media (max-width: 600px) {
  .tm-paper { padding: 12px; }
  .tm-paper__stem { font-size: 17px; }
  .tm-card { padding: 12px; }
  .tm-school, .tm-filter, .tm-vote, .tm-select { min-height: 44px; }
  .tm-choice { min-height: 44px; }
  .tm-req__foot { flex-wrap: wrap; }
  .tm-ask { grid-template-columns: minmax(0, 1fr); }
  .tm-fab { right: 12px; padding: 0 14px; font-size: 13px; }
  .tm-how { grid-template-columns: minmax(0, 1fr); }
  .tm-json__head { flex-direction: column; }
  .tm-panel { padding: 12px; }

  /* 표는 카드 목록으로 */
  .tm-table--solves thead { display: none; }
  .tm-table--solves, .tm-table--solves tbody, .tm-table--solves tr, .tm-table--solves td { display: block; width: 100%; }
  .tm-table--solves tr {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--line);
    grid-template-areas: "at at who" "code code code" "school ans ok";
  }
  .tm-table--solves td { border: 0; padding: 0; }
  .tm-table--solves td[data-th="풀이 시각"] { grid-area: at; }
  .tm-table--solves td[data-th="학생"] { grid-area: who; }
  .tm-table--solves td[data-th="문항 코드"] { grid-area: code; }
  .tm-table--solves td[data-th="학교"] { grid-area: school; }
  .tm-table--solves td[data-th="답"] { grid-area: ans; }
  .tm-table--solves td[data-th="채점"] { grid-area: ok; }
  .tm-table--solves td::before { content: attr(data-th); display: block; font-family: "Pretendard Variable", Pretendard, sans-serif; font-size: 11px; color: var(--muted); }
}

@media (min-width: 901px) {
  /* 데스크톱에서 세 단이 한 화면 높이에 들어가게 영상 틀을 낮춘다 */
  .tm-video { aspect-ratio: 3 / 1; }
  .tm-video__play { width: 44px; height: 44px; }
  .tm-video__play::after { left: 18px; top: 13px; border-width: 9px 0 9px 14px; }
}

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