/* 코드드릴: 코딩테스트 연습 */
.dr {
  --bg: #EEF0F4;
  --panel: #FFFFFF;
  --ink: #151A23;
  --sub: #434C5C;
  --muted: #778195;
  --line: #E1E5EC;
  --line2: #CDD3DD;
  --accent: #2B59C3;
  --accent-hover: #234BA8;
  --accent-soft: #E8EEFB;
  --gold: #FFC857;
  --pass: #168A4B;
  --pass-soft: #E2F4EA;
  --fail: #CF3A3A;
  --fail-soft: #FBE8E8;
  --warn: #B36A00;
  --warn-soft: #FDF0DA;
  --compat: #6B46C9;
  --compat-soft: #EFE9FB;
  --bar: #12161D;
  --ed-bg: #171B22;
  --ed-panel: #1D222B;
  --ed-line: #2A303B;
  --ed-ink: #D7DBE3;
  --ed-muted: #6E7788;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.dr *, .dr *::before, .dr *::after { box-sizing: border-box; }
.dr [hidden] { display: none !important; }
.dr a { color: var(--accent); }
.dr code { font-family: var(--mono); font-size: .88em; background: #EEF1F6; border-radius: 4px; padding: 1px 5px; color: #2A3550; }
.dr h1, .dr h2, .dr h3, .dr h4, .dr p { margin: 0; }
.dr button { font: inherit; cursor: pointer; }

.dr .demo-notice {
  flex: none;
  padding: 6px 16px;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  background: var(--bg);
}

/* 공통 버튼 */
.dr-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.dr-btn:disabled { opacity: .55; cursor: default; }
.dr-btn--primary { background: var(--accent); color: #fff !important; }
.dr-btn--primary:hover:not(:disabled) { background: var(--accent-hover); }
.dr-btn--ghost { background: var(--panel); color: var(--ink) !important; border-color: var(--line2); }
.dr-btn--ghost:hover { border-color: var(--muted); }
.dr-link { background: none; border: 0; padding: 4px 2px; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.dr-link:hover { color: var(--ink); }
.dr-link--dark { color: var(--ed-muted); }
.dr-link--dark:hover { color: var(--ed-ink); }
.dr-check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.dr-check input { margin: 4px 0 0; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.dr-meter { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.dr-meter i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .2s; }
.dr-eyebrow { font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: .02em; }
.dr-h2 { font-size: 18px; font-weight: 700; margin-bottom: 14px; }
.dr-note { font-size: 13.5px; color: var(--sub); }

/* 로고 */
.dr-logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: inherit !important; }
.dr-mark { flex: none; display: block; }
.dr-logo__name { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.dr-logo__sub { font-size: 13px; color: var(--muted); padding-left: 9px; border-left: 1px solid var(--line2); }

/* ── 처음 화면·메모 ───────────────────────── */
.dr--home, .dr--notes { min-height: 100vh; display: flex; flex-direction: column; }
.dr-page { flex: 1; }
.dr-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px max(20px, calc((100% - 1120px) / 2)); background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.dr-top__nav { display: flex; gap: 4px; }
.dr-top__nav a { padding: 6px 12px; border-radius: 7px; color: var(--sub); text-decoration: none; font-size: 14px; font-weight: 500; }
.dr-top__nav a:hover { background: var(--bg); }
.dr-top__nav a.is-on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.dr-home, .dr-notes { max-width: 1120px; margin: 0 auto; padding: 36px 20px 48px; }
.dr-hero { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: stretch; margin-bottom: 40px; }
.dr-hero h1 { font-size: 34px; line-height: 1.3; letter-spacing: -.02em; margin: 8px 0 14px; }
.dr-hero__lead { color: var(--sub); max-width: 620px; font-size: 15.5px; }
.dr-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 22px 0 0; }
.dr-facts li { display: flex; align-items: baseline; gap: 6px; padding: 10px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.dr-facts b { font-size: 20px; font-family: var(--mono); font-weight: 500; color: var(--ink); }
.dr-facts span { font-size: 13px; color: var(--muted); }

.dr-engine-card { background: var(--bar); color: #E9ECF2; border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.dr-engine-card__label { font-size: 12.5px; color: #9AA3B5; }
.dr-engine-card__state { font-size: 18px; font-weight: 700; }
.dr-engine-card .dr-meter { background: #2A303B; }
.dr-engine-card[data-state="ready"] .dr-meter i { background: #3CC47C; }
.dr-engine-card[data-state="error"] .dr-engine-card__state { color: #FF8A8A; }
.dr-engine-card__note { font-size: 13px; color: #A9B1C1; line-height: 1.65; margin-top: auto; }

.dr-sets { margin-bottom: 40px; }
.dr-sets__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dr-set { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.dr-set__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dr-set__head h3 { font-size: 18px; }
.dr-set__badge { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--bg); color: var(--muted); }
.dr-set[data-state="running"] .dr-set__badge { background: var(--warn-soft); color: var(--warn); }
.dr-set[data-state="done"] .dr-set__badge { background: var(--pass-soft); color: var(--pass); }
.dr-set__summary { font-size: 13.5px; color: var(--sub); }
.dr-set__list { list-style: none; margin: 0; padding: 0; counter-reset: q; border-top: 1px solid var(--line); }
.dr-set__list li { counter-increment: q; display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.dr-set__list li::before { content: counter(q); width: 20px; height: 20px; flex: none; border-radius: 5px; background: var(--bg); color: var(--muted); font-size: 12px; font-family: var(--mono); display: grid; place-items: center; }
.dr-set__list span { flex: 1; min-width: 0; }
.dr-set__list em { font-style: normal; font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
.dr-set__status { font-size: 13px; color: var(--muted); }
.dr-set__actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }

.dr-how__list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dr-how__list li { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.dr-how__list b { font-size: 15px; }
.dr-how__list span { font-size: 14px; color: var(--sub); }

/* 메모 */
.dr-notes__head { margin-bottom: 24px; }
.dr-notes__head h1 { font-size: 30px; margin: 6px 0 10px; letter-spacing: -.02em; }
.dr-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin-bottom: 16px; }
.dr-table-wrap { overflow-x: auto; }
.dr-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dr-table th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line2); }
.dr-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.dr-table__ver { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
.dr-tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.dr-tags code { display: inline-block; padding: 4px 9px; background: var(--pass-soft); color: #145C36; }
.dr-idioms { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.dr-idioms div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.dr-idioms dt { font-size: 13.5px; color: var(--sub); }
.dr-idioms dd { margin: 0; }
.dr-idioms code { background: none; padding: 0; font-size: 13px; }
.dr-pitfalls { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14.5px; }

/* ── 시험 화면 ───────────────────────── */
.dr--exam { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.dr--exam .demo-notice { padding: 3px 16px; font-size: 11px; background: var(--bar); color: #6E7788; }
.dr-exam { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.dr-bar {
  flex: none; display: flex; align-items: center; gap: 14px; height: 54px; padding: 0 16px;
  background: var(--bar); color: #E9ECF2; border-bottom: 1px solid #222833;
}
.dr-logo--bar .dr-logo__name { color: #fff; font-size: 15px; }
.dr-bar__set { font-size: 14px; color: #A9B1C1; padding-left: 14px; border-left: 1px solid #2E3542; white-space: nowrap; }
.dr-qtabs { display: flex; gap: 6px; margin-left: 6px; }
.dr-qtab {
  position: relative; width: 36px; height: 34px; border-radius: 8px; border: 1px solid #2E3542;
  background: #1B2029; color: #C5CBD6; font-family: var(--mono); font-size: 14px; font-weight: 500;
}
.dr-qtab:hover { border-color: #4A5366; }
.dr-qtab.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.dr-qtab i { position: absolute; right: 3px; top: 3px; width: 7px; height: 7px; border-radius: 50%; background: transparent; }
.dr-qtab[data-sub="yes"] i { background: #8FA6D9; }
.dr-qtab[data-sub="part"] i { background: #F0A13A; }
.dr-qtab[data-sub="pass"] i { background: #3CC47C; }
.dr-bar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.dr-engine { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: #9AA3B5; white-space: nowrap; }
.dr-engine i { width: 8px; height: 8px; border-radius: 50%; background: #5A6375; flex: none; }
.dr-engine[data-state="loading"] i, .dr-engine[data-state="starting"] i { background: var(--gold); animation: dr-pulse 1s ease-in-out infinite; }
.dr-engine[data-state="ready"] i { background: #3CC47C; }
.dr-engine[data-state="error"] i { background: #FF6B6B; }
@keyframes dr-pulse { 50% { opacity: .35; } }
.dr-timer {
  font-family: var(--mono); font-size: 17px; font-weight: 500; min-width: 74px; text-align: center;
  padding: 4px 10px; border-radius: 8px; background: #1B2029; border: 1px solid #2E3542; color: #fff; font-variant-numeric: tabular-nums;
}
.dr-timer[data-state="warn"] { background: #3A1E1E; border-color: #7A2F2F; color: #FF9B9B; }
.dr-timer[data-state="idle"], .dr-timer[data-state="done"] { color: #8A93A5; }
.dr-btn--end { min-height: 34px; padding: 0 14px; background: transparent; border-color: #3A4252; color: #E9ECF2; font-size: 13.5px; }
.dr-btn--end:hover { border-color: #FF8A8A; color: #FFB3B3; }
.is-done .dr-btn--end, .is-done .dr-qtabs { display: none; }

.dr-seg { display: none; }

.dr-work { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(360px, 42%) minmax(0, 1fr); }

/* 문제 */
.dr-prob { overflow: auto; background: var(--panel); border-right: 1px solid var(--line); }
.is-locked .dr-prob { -webkit-user-select: none; user-select: none; }
.dr-q { padding: 26px 30px 40px; max-width: 760px; }
.dr-q__meta { display: flex; gap: 8px; font-size: 13px; font-weight: 600; color: var(--accent); }
.dr-q__meta span + span { color: var(--muted); font-weight: 500; }
.dr-q__title { font-size: 23px; letter-spacing: -.01em; margin: 4px 0 16px; }
.dr-q__body p, .dr-q > p { margin-bottom: 8px; color: #252C38; }
.dr-q h2 { font-size: 15px; font-weight: 700; margin: 22px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.dr-q__limits { margin: 0; padding-left: 20px; }
.dr-q__limits li { margin-bottom: 2px; }
.dr-ex { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.dr-ex h3 { font-size: 13px; font-weight: 600; color: var(--sub); margin-bottom: 6px; }
.dr-ex pre { margin: 0; padding: 12px 14px; background: #F5F7FA; border: 1px solid var(--line); border-radius: 8px; font: 13.5px/1.55 var(--mono); overflow-x: auto; min-height: 46px; }

/* 편집기 */
.dr-ide { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) minmax(220px, 40%); background: var(--ed-bg); color: var(--ed-ink); }
.dr-ide__bar { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 14px; background: var(--ed-panel); border-bottom: 1px solid var(--ed-line); font-size: 13px; }
.dr-lang { display: inline-flex; gap: 5px; align-items: baseline; padding: 2px 10px; border-radius: 6px; background: #262C37; color: #C5CBD6; font-family: var(--mono); font-size: 12.5px; }
.dr-lang b { color: #FF8B8B; font-weight: 500; }
.dr-substate { color: var(--ed-muted); font-size: 12.5px; }
.dr-substate[data-state="done"] { color: #6FD39C; }
.dr-substate[data-state="changed"] { color: #F0B35A; }
.dr-ide__bar .dr-link { margin-left: auto; }

.dr-editor { display: flex; min-height: 0; overflow: hidden; font: 14px/1.65 var(--mono); position: relative; }
.dr-gutter { flex: none; width: 48px; overflow: hidden; background: var(--ed-bg); border-right: 1px solid #222833; color: #4F5868; text-align: right; }
.dr-gutter div { padding: 12px 10px 40px 0; will-change: transform; }
.dr-gutter span { display: block; }
.dr-code { position: relative; flex: 1; min-width: 0; overflow: hidden; }
.dr-code__hl, .dr-code__ta {
  position: absolute; inset: 0; margin: 0; padding: 12px 16px 40px;
  font: inherit; line-height: inherit; letter-spacing: 0; tab-size: 2; -moz-tab-size: 2;
  white-space: pre; overflow-wrap: normal; word-break: normal; border: 0;
}
.dr-code__hl { pointer-events: none; color: var(--ed-ink); overflow: visible; will-change: transform; }
.dr-code__hl code { font: inherit; background: none; padding: 0; color: inherit; border-radius: 0; }
.dr-code__ta { width: 100%; height: 100%; background: transparent; color: transparent; caret-color: #FFFFFF; resize: none; outline: none; overflow: auto; }
.dr-code__ta::selection { background: rgba(110, 150, 255, .35); color: transparent; }
.tk-c { color: #6F7A8C; font-style: italic; }
.tk-s { color: #A6D189; }
.tk-y { color: #79C9D4; }
.tk-n { color: #EBA96E; }
.tk-k { color: #D497EA; }
.tk-b { color: #7AB5F5; }
.tk-t { color: #EACB7E; }
.tk-v { color: #E98C8C; }

/* 실행 결과 */
.dr-console { display: flex; flex-direction: column; min-height: 0; background: var(--ed-panel); border-top: 1px solid var(--ed-line); }
.dr-console__tabs { flex: none; display: flex; align-items: center; gap: 2px; padding: 0 10px; height: 38px; border-bottom: 1px solid var(--ed-line); }
.dr-console__tabs button { background: none; border: 0; color: var(--ed-muted); font-size: 13px; font-weight: 600; padding: 9px 10px; border-bottom: 2px solid transparent; }
.dr-console__tabs button.is-on { color: #fff; border-bottom-color: var(--accent); }
.dr-console__hint { margin-left: auto; font-size: 12px; color: #586174; }
.dr-console__body { flex: 1; min-height: 0; overflow: auto; padding: 12px 14px; font-size: 13.5px; }
.dr-console__custom { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px 14px; font-size: 13px; color: #C5CBD6; }
.dr-console__custom textarea {
  flex: 1; min-height: 60px; resize: none; background: var(--ed-bg); color: var(--ed-ink); border: 1px solid var(--ed-line);
  border-radius: 8px; padding: 10px 12px; font: 13.5px/1.55 var(--mono); outline: none;
}
.dr-console__custom textarea:focus { border-color: #4A5A80; }
.dr-console__actions { flex: none; display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--ed-line); }
.dr-console__actions .dr-btn { min-width: 92px; }
.dr-btn--run { background: #2A303B; color: #E9ECF2; border-color: #3A4252; }
.dr-btn--run:hover:not(:disabled) { background: #333A47; }

.dr-idle, .dr-wait { color: var(--ed-muted); }
.dr-wait::after { content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 8px; vertical-align: -1px; border: 2px solid #4A5366; border-top-color: #C5CBD6; border-radius: 50%; animation: dr-spin .8s linear infinite; }
@keyframes dr-spin { to { transform: rotate(360deg); } }
.dr-sum { font-weight: 600; margin-bottom: 10px; }
.dr-sum--pass { color: #6FD39C; }
.dr-sum--fail { color: #FF9B9B; }
.dr-sum--done { color: #9FB8F0; }
.dr-case { border: 1px solid var(--ed-line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: #1A1F27; }
.dr-case__head { display: flex; align-items: center; gap: 8px; }
.dr-case__head b { font-size: 13px; color: #C5CBD6; }
.dr-case h4 { font-size: 12px; color: var(--ed-muted); font-weight: 600; margin: 8px 0 4px; }
.dr-ms { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--ed-muted); }
.dr-v { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.dr-v--pass { background: #1C3B2A; color: #6FD39C; }
.dr-v--wrong { background: #432325; color: #FF9B9B; }
.dr-v--error, .dr-v--syntax { background: #43301F; color: #F2B36B; }
.dr-v--timeout { background: #3F3720; color: #E9C96B; }
.dr-v--compat { background: #2F2648; color: #C3A9FF; }
.dr-v--info { background: #22304D; color: #9FB8F0; }
.dr-cmp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dr-cmp--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dr-pre { margin: 0; padding: 8px 10px; background: var(--ed-bg); border-radius: 6px; font: 12.5px/1.5 var(--mono); color: var(--ed-ink); white-space: pre; overflow: auto; max-height: 220px; }
.dr-pre--err { margin-top: 8px; color: #FFB4A8; background: #241A1B; white-space: pre-wrap; }
.dr-empty { color: var(--ed-muted); font-style: italic; }
.dr-issues { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.dr-issues li { padding: 8px 10px; background: #231F33; border-radius: 6px; color: #DCCFFF; font-size: 13px; }
.dr-issues span { display: inline-block; margin-right: 8px; font-family: var(--mono); font-size: 12px; color: #B49BFF; }
.dr-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 10px; }
.dr-chip { width: 16px; height: 16px; border-radius: 4px; background: #3A4252; }
.dr-chip--pass { background: #2FA866; }
.dr-chip--wrong { background: #D64A4A; }
.dr-chip--error, .dr-chip--syntax { background: #D98A2B; }
.dr-chip--timeout { background: #C9A227; }
.dr-chip--compat { background: #7E5BD6; }
.dr-fail { border: 1px solid var(--ed-line); border-radius: 8px; padding: 10px 12px; background: #1A1F27; }
.dr-fail__title { font-weight: 600; font-size: 13px; color: #FF9B9B; }

/* 결과 */
.dr-result { flex: 1; min-height: 0; overflow: auto; background: var(--bg); }
.dr-res { max-width: 980px; margin: 0 auto; padding: 28px 20px 48px; }
.dr-res__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 16px; }
.dr-res__set { font-size: 14px; font-weight: 600; color: var(--accent); }
.dr-res__score { display: flex; align-items: baseline; gap: 6px; margin: 4px 0; }
.dr-res__score b { font-size: 48px; line-height: 1.1; font-family: var(--mono); font-weight: 500; letter-spacing: -.02em; }
.dr-res__score span { font-size: 16px; color: var(--muted); }
.dr-res__meta { font-size: 13.5px; color: var(--sub); }
.dr-res__actions { display: flex; gap: 8px; }
.dr-res__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.dr-rq { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--line2); border-radius: 12px; padding: 16px 18px; }
.dr-rq--pass { border-left-color: var(--pass); }
.dr-rq--part { border-left-color: #E39A2E; }
.dr-rq--fail { border-left-color: var(--fail); }
.dr-rq__top { display: flex; align-items: center; gap: 10px; }
.dr-rq__no { width: 26px; height: 26px; border-radius: 7px; background: var(--bg); display: grid; place-items: center; font-family: var(--mono); font-size: 13px; color: var(--sub); flex: none; }
.dr-rq__top h3 { font-size: 16.5px; flex: 1; min-width: 0; }
.dr-rq__score { font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.dr-rq__score b { font-size: 18px; color: var(--ink); font-family: var(--mono); font-weight: 500; }
.dr-rq__sum { font-size: 13.5px; color: var(--sub); margin: 6px 0 4px 36px; }
.dr-rq .dr-chips { margin-left: 36px; }
.dr-rq .dr-chip { background: var(--line); }
.dr-rq .dr-chip--pass { background: #2FA866; }
.dr-rq .dr-chip--wrong { background: #D64A4A; }
.dr-rq .dr-chip--error, .dr-rq .dr-chip--syntax { background: #D98A2B; }
.dr-rq .dr-chip--timeout { background: #C9A227; }
.dr-rq .dr-chip--compat { background: #7E5BD6; }
.dr-det { margin: 8px 0 0 36px; border-top: 1px solid var(--line); padding-top: 8px; }
.dr-det summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--sub); }
.dr-det[open] summary { margin-bottom: 8px; }
.dr-det .dr-fail { background: var(--ed-bg); color: var(--ed-ink); }
.dr-det .dr-fail h4 { font-size: 12px; color: var(--ed-muted); font-weight: 600; margin: 8px 0 4px; }
.dr-point { font-size: 14px; color: var(--sub); margin-bottom: 8px; }
.dr-code-view { margin: 0; padding: 12px 14px; border-radius: 8px; background: var(--ed-bg); color: var(--ed-ink); font: 13px/1.6 var(--mono); overflow: auto; white-space: pre; }

/* 모달·토스트 */
.dr-modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(10, 14, 20, .6); }
.dr-modal__card { width: 100%; max-width: 540px; max-height: calc(100dvh - 32px); overflow: auto; background: var(--panel); border-radius: 16px; padding: 26px; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
.dr-modal__card--sm { max-width: 440px; }
.dr-modal__card h2 { font-size: 21px; margin: 4px 0 14px; }
.dr-modal__text { color: var(--sub); margin-bottom: 16px; }
.dr-modal__card .dr-meter { margin-bottom: 8px; }
.dr-rules { margin: 0 0 18px; padding-left: 20px; display: grid; gap: 5px; font-size: 14.5px; color: #252C38; }
.dr-opts { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; display: grid; gap: 8px; font-size: 14px; }
.dr-opts legend { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.dr-start-engine { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.dr-start-engine[data-state="ready"] { color: var(--pass); }
.dr-start-engine[data-state="error"] { color: var(--fail); }
.dr-modal__actions { display: flex; justify-content: flex-end; gap: 8px; }
.dr-modal__actions--stack { flex-direction: column-reverse; }
.dr-modal__actions--stack .dr-btn { width: 100%; }
.dr-toast {
  position: fixed; left: 50%; bottom: 72px; transform: translateX(-50%); z-index: 60;
  padding: 10px 16px; border-radius: 10px; background: #0D1015; color: #fff; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); max-width: calc(100% - 32px);
}

/* ── 좁은 화면 ───────────────────────── */
@media (max-width: 1080px) {
  .dr-engine span { display: none; }
  .dr-bar__set { display: none; }
}

@media (max-width: 860px) {
  .dr-hero { grid-template-columns: 1fr; }
  .dr-hero h1 { font-size: 27px; }
  .dr-sets__grid { grid-template-columns: 1fr; }
  .dr-how__list, .dr-idioms { grid-template-columns: 1fr; }
  .dr-logo__sub { display: none; }
  .dr-home, .dr-notes { padding-top: 24px; }

  .dr-bar { flex-wrap: wrap; height: auto; gap: 8px 10px; padding: 8px 12px; }
  .dr-logo--bar .dr-logo__name { display: none; }
  .dr-qtabs { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .dr-qtab { flex: 1 0 40px; height: 34px; }
  .dr-bar__right { gap: 8px; }
  .dr-timer { font-size: 15px; min-width: 64px; }

  .dr-seg { flex: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 6px 12px; background: var(--bar); border-bottom: 1px solid #222833; }
  .dr-seg button { background: #1B2029; border: 1px solid #2E3542; color: #A9B1C1; border-radius: 8px; padding: 7px 0; font-size: 13.5px; font-weight: 600; }
  .dr-seg button.is-on { background: #E9ECF2; color: var(--bar); border-color: #E9ECF2; }
  .is-done .dr-seg { display: none; }

  .dr-work { display: flex; flex-direction: column; }
  .dr-prob { flex: 1; border-right: 0; }
  .dr-q { padding: 20px 16px 32px; }
  .dr-q__title { font-size: 20px; }
  .dr-ex { grid-template-columns: 1fr; gap: 8px; }
  .dr-ide { flex: 1; display: flex; flex-direction: column; }
  .dr-editor { flex: 1; font-size: 15px; }
  .dr-code__ta { font-size: 16px; }
  .dr-code__hl { font-size: 16px; }
  .dr-gutter { width: 40px; font-size: 13px; line-height: calc(16px * 1.65); }
  .dr-editor { line-height: 1.65; }
  .dr-console { flex: none; border-top: 1px solid var(--ed-line); }
  .dr-console__hint { display: none; }

  .dr-work[data-pane="problem"] .dr-ide { display: none; }
  .dr-work[data-pane="code"] .dr-prob, .dr-work[data-pane="console"] .dr-prob { display: none; }
  .dr-work[data-pane="code"] .dr-console__tabs,
  .dr-work[data-pane="code"] .dr-console__body,
  .dr-work[data-pane="code"] .dr-console__custom { display: none !important; }
  .dr-work[data-pane="console"] .dr-ide__bar, .dr-work[data-pane="console"] .dr-editor { display: none; }
  .dr-work[data-pane="console"] .dr-console { flex: 1; border-top: 0; }

  .dr-cmp, .dr-cmp--3 { grid-template-columns: 1fr; }
  .dr-res { padding: 16px 12px 32px; }
  .dr-res__head { padding: 18px; }
  .dr-res__actions { width: 100%; }
  .dr-res__actions .dr-btn { flex: 1; }
  .dr-rq__sum, .dr-rq .dr-chips, .dr-det { margin-left: 0; }
  .dr-modal__card { padding: 20px; }
  .dr-modal__actions--stack { flex-direction: column-reverse; }
  .dr-modal__actions--stack .dr-btn { width: 100%; }
  .dr-toast { bottom: 84px; }
}
