:root {
  --ink: #17211d;
  --muted: #66716c;
  --line: #dce2df;
  --surface: #ffffff;
  --soft: #f3f6f4;
  --page: #e9eeeb;
  --green: #176c4b;
  --green-hover: #10583d;
  --red: #b33a32;
  --yellow: #d7a92f;
  --blue: #2b5f91;
  --shadow: 0 18px 50px rgba(19, 36, 29, 0.12);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--page); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }
button:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: .55; }
a { color: var(--blue); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.auth-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 520px) minmax(320px, 430px);
  justify-content: center;
  align-items: center;
  gap: clamp(48px, 8vw, 140px);
  padding: 48px;
  background: #15241e;
  color: #f7faf8;
}

.auth-brand h1 { margin: 26px 0 6px; font-size: clamp(46px, 7vw, 86px); line-height: 1; }
.auth-brand p { margin: 0; color: #aebdb6; font-size: 20px; }
.auth-atlas-link { display: inline-block; margin-top: 24px; color: #83b59b; font-size: 13px; text-decoration: none; }
.auth-atlas-link:hover { color: #b0e3c7; text-decoration: underline; text-underline-offset: 4px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 74px;
  aspect-ratio: 1;
  border: 2px solid #62c394;
  color: #83ddb0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 27px;
  font-weight: 800;
}
.brand-mark.small { width: 38px; border-width: 1px; font-size: 14px; }

.auth-panel { width: 100%; padding: 32px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.auth-tab, .submission-tab { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 12px; color: var(--muted); font-weight: 700; }
.auth-tab.active, .submission-tab.active { color: var(--green); border-color: var(--green); }
.auth-form { display: grid; gap: 18px; }
.auth-form label { display: grid; gap: 7px; color: #47534e; font-size: 13px; font-weight: 700; }

input, select, textarea {
  width: 100%;
  border: 1px solid #cbd4cf;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
input, select { min-height: 42px; padding: 9px 11px; }
textarea { padding: 14px; resize: vertical; line-height: 1.65; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23, 108, 75, .13); }

button { min-height: 40px; border-radius: 4px; padding: 9px 15px; border: 1px solid transparent; font-weight: 750; }
.primary { background: var(--green); color: #fff; }
.primary:hover { background: var(--green-hover); }
.wide { width: 100%; }
.quiet { color: var(--muted); background: transparent; border-color: var(--line); }
.quiet:hover { color: var(--ink); background: var(--soft); }
.danger-quiet { color: var(--red); background: transparent; border-color: #e9c4c0; }
.danger-quiet:hover { background: #fff2f0; }

.app-view { min-height: 100vh; }
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.topbar-actions, .user-chip { display: flex; align-items: center; gap: 12px; }
.user-chip { font-weight: 700; }
.avatar { display: grid; place-items: center; width: 34px; aspect-ratio: 1; border-radius: 50%; background: #dfeee7; color: var(--green); }

.workspace {
  width: min(1520px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  min-height: calc(100vh - 64px);
}
.challenge-column { min-width: 0; padding: 34px clamp(22px, 4vw, 58px) 70px; background: var(--surface); }
.side-column { border-left: 1px solid var(--line); background: var(--soft); }
.challenge-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.challenge-heading { flex: 0 0 auto; }
.eyebrow { margin: 0 0 6px; color: var(--green); font: 700 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.challenge-toolbar h1, .section-heading h2 { margin: 0; font-size: 26px; line-height: 1.2; }
.training-mode-tabs { display: flex; align-items: center; width: max-content; max-width: 100%; overflow-x: auto; margin-top: 15px; border: 1px solid var(--line); border-radius: 4px; }
.training-mode-tab { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: 32px; padding: 6px 11px; border: 0; border-radius: 0; background: transparent; color: var(--muted); font-family: inherit; font-size: 12px; font-weight: 750; line-height: 1.5; letter-spacing: 0; text-decoration: none; white-space: nowrap; }
.training-mode-tab + .training-mode-tab { border-left: 1px solid var(--line); }
.training-mode-tab.active { background: var(--ink); color: #fff; }
.range-form { display: flex; align-items: flex-end; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.range-form label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.range-form select { width: 104px; }
.range-dash { min-height: 42px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.contest-form { display: flex; align-items: flex-end; gap: 9px; }
.contest-form label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.contest-form select { width: 110px; }
.contest-id-field { width: 190px; }
.training-settings-button { white-space: nowrap; }

.contest-board { margin: 22px 0 4px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.contest-board-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 24px; padding: 19px 0; }
.contest-title-block { min-width: 0; }
.contest-title-block h2 { margin: 0; overflow-wrap: anywhere; font-size: 18px; line-height: 1.35; }
.contest-clock-block { display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 7px; min-width: 170px; }
.contest-clock-block > span { grid-column: 1 / -1; color: var(--muted); font: 700 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.contest-clock-block strong { font: 800 23px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.contest-clock-block strong.overtime { color: var(--red); }
.contest-clock-block small { color: var(--muted); font: 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.contest-timing-legend, .contest-problem-row { display: grid; grid-template-columns: minmax(240px, 2fr) 130px 130px minmax(170px, 1fr); align-items: center; gap: 12px; }
.contest-timing-legend { padding: 8px 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--soft); color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.contest-problems { max-height: 320px; overflow-y: auto; }
.contest-problem-row { width: 100%; min-height: 66px; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--surface); color: var(--ink); text-align: left; }
.contest-problem-row:last-child { border-bottom: 0; }
.contest-problem-row:hover { background: #f1f7f4; }
.contest-problem-row.readonly { cursor: default; }
.contest-problem-row.readonly:hover { background: var(--surface); }
.contest-problem-row.readonly.current:hover { background: #eaf4ef; }
.contest-problem-row.current { box-shadow: inset 3px 0 0 var(--green); background: #eaf4ef; }
.contest-problem-row.code-ac { box-shadow: inset 3px 0 0 var(--blue); }
.contest-problem-row.current.code-ac { box-shadow: inset 3px 0 0 var(--blue), inset 7px 0 0 #eaf4ef; }
.contest-problem-name { min-width: 0; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.contest-problem-name > strong { font: 800 17px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.contest-problem-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contest-problem-name > small { color: var(--muted); font: 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.contest-time-cell { display: grid; gap: 3px; }
.contest-time-cell strong { font: 700 13px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.contest-time-cell small, .time-split { color: var(--muted); font-size: 11px; }
.contest-problem-row.oral-ac > .contest-time-cell:nth-child(2) strong { color: var(--green); }
.contest-problem-row.code-ac > .contest-time-cell:nth-child(3) strong { color: var(--blue); }

.empty-state { min-height: 540px; display: grid; place-content: center; text-align: center; }
.empty-index { margin: 0 auto 20px; color: #acb7b1; font: 800 62px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.empty-state h2 { margin: 0 0 8px; font-size: 22px; }
.empty-state p { margin: 0; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.problem-view { max-width: 900px; margin: 0 auto; padding-top: 22px; }
.problem-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; color: var(--muted); font-size: 13px; font-weight: 700; }
.problem-head > div { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.live-dot { display: inline-block; width: 8px; aspect-ratio: 1; margin-right: 6px; border-radius: 50%; background: var(--yellow); }
.challenge-mode { padding: 4px 7px; border: 1px solid #bed0c7; border-radius: 4px; color: var(--green); font-size: 11px; }
.problem-identity { color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.statement-section { color: #25302b; line-height: 1.75; overflow-wrap: anywhere; }
.statement-section + .statement-section { margin-top: 30px; }
.statement-section h2 { margin: 0 0 13px; padding-bottom: 9px; border-bottom: 1px solid var(--line); font-size: 18px; }
.statement-section p { margin: 9px 0; }
.statement-section pre { overflow: auto; padding: 14px; border: 1px solid var(--line); border-radius: 4px; background: var(--soft); font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.statement-section code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.statement-section img { display: block; max-width: 100%; height: auto; margin: 16px auto; }
.statement-section table { width: 100%; border-collapse: collapse; }
.statement-section td, .statement-section th { padding: 8px; border: 1px solid var(--line); }
.assistance-panel { margin-top: 34px; padding: 25px 0 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.assistance-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.assistance-head h2 { margin: 0; font-size: 18px; }
.challenge-clock { display: grid; justify-items: end; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.challenge-clock strong { color: var(--ink); font: 800 17px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.assistance-steps { display: grid; }
.assistance-step { display: grid; grid-template-columns: 126px minmax(0, 1fr); align-items: start; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.assistance-step button { min-height: 34px; padding: 7px 9px; border-color: #bed0c7; background: transparent; color: var(--green); font-size: 12px; font-weight: 800; }
.assistance-step button:not(:disabled):hover { background: #e8f3ed; }
.assistance-step button.early { border-style: dashed; border-color: #a7893f; color: #765e25; }
.assistance-step button.early:hover { background: #fff8e8; }
.assistance-step button.revealed { border-color: var(--ink); background: var(--ink); color: #fff; }
.assistance-content { min-height: 34px; display: flex; align-items: center; margin: 0; color: #34423b; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.assistance-content.locked { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.tag-list { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.tag-chip { padding: 4px 7px; border: 1px solid #c7d5df; border-radius: 3px; background: #edf4f8; color: var(--blue); font-size: 11px; font-weight: 700; }
.forced-giveup-status { margin: 8px 0 12px; padding: 10px 12px; border-left: 3px solid var(--red); background: #fff2f0; color: #7d312b; font-size: 12px; font-weight: 700; }
.sample-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sample-label { margin: 0 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; }

.submission-zone { margin-top: 50px; padding-top: 12px; border-top: 2px solid var(--ink); }
.submission-tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); }
.submission-form { padding-top: 20px; }
.submit-row { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 12px; }
.service-status { color: var(--muted); font-size: 12px; }
.service-status.unavailable { color: var(--red); }
.editor-toolbar { display: flex; justify-content: flex-end; margin-bottom: 9px; }
.editor-toolbar label { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; font-weight: 700; }
.editor-toolbar select { width: 130px; }
.code-editor { min-height: 360px; background: #17211d; color: #e6eee9; border-color: #17211d; tab-size: 4; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); background: var(--surface); }
.stat-strip > * { min-width: 0; padding: 25px 17px; border: 0; border-right: 1px solid var(--line); border-radius: 0; text-align: left; background: transparent; }
.stat-strip > *:last-child { border-right: 0; }
.stat-strip span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.stat-strip strong { display: block; overflow: hidden; font: 800 21px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; }
.stat-button:hover { background: #edf5f1; }
.stat-button:focus-visible { position: relative; outline: 2px solid var(--green); outline-offset: -2px; }
.leaderboard-section { padding: 30px 25px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.section-heading > span { color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 7px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 10px; text-transform: uppercase; }
td { font-size: 13px; }
td:nth-child(1), td:nth-child(3), td:nth-child(4) { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
tr.me td { background: #e4f1ea; }
.muted { color: var(--muted); }
.center { text-align: center; }

.toast { position: fixed; z-index: 50; top: 16px; left: 50%; transform: translate(-50%, -140%); max-width: min(520px, calc(100% - 32px)); padding: 11px 16px; border-radius: 4px; background: #17211d; color: #fff; box-shadow: var(--shadow); transition: transform .2s ease; }
.toast.show { transform: translate(-50%, 0); }
.toast.error { background: #822c27; }
.busy-layer { position: fixed; z-index: 40; inset: 0; display: grid; place-content: center; gap: 14px; text-align: center; background: rgba(244, 247, 245, .86); backdrop-filter: blur(2px); }
.spinner { width: 34px; aspect-ratio: 1; margin: 0 auto; border: 3px solid #bfcbc5; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.result-dialog { width: min(540px, calc(100% - 28px)); padding: 30px; border: 0; border-radius: 6px; box-shadow: var(--shadow); }
.result-dialog::backdrop { background: rgba(12, 21, 17, .66); }
.result-dialog h2 { margin: 4px 0 10px; font-size: 27px; }
.result-dialog > p:not(.eyebrow) { color: #4d5953; line-height: 1.65; }
.result-accent { width: 56px; height: 5px; margin-bottom: 23px; background: var(--green); }
.result-accent.rejected { background: var(--red); }
.reveal-list { display: grid; grid-template-columns: 90px 1fr; gap: 7px 14px; margin: 22px 0; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.reveal-list:empty { display: none; }
.reveal-list dt { color: var(--muted); font-size: 12px; }
.reveal-list dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.result-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.result-links a { padding: 8px 10px; border: 1px solid #bed0c7; border-radius: 4px; text-decoration: none; font-size: 12px; font-weight: 700; }

.specific-dialog {
  width: min(500px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  box-shadow: var(--shadow);
}
.specific-dialog::backdrop { background: rgba(12, 21, 17, .66); }
.dialog-fallback-open::before { content: ""; position: fixed; z-index: 40; inset: 0; background: rgba(12, 21, 17, .66); }
.specific-dialog.dialog-fallback { position: fixed; z-index: 41; inset: 50% auto auto 50%; display: block; margin: 0; transform: translate(-50%, -50%); }
.specific-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 27px 30px 18px; }
.specific-header h2 { margin: 0; font-size: 26px; line-height: 1.2; }
.specific-problem-form { display: grid; gap: 17px; padding: 0 30px 30px; }
.specific-problem-form label { display: grid; gap: 7px; color: #47534e; font-size: 13px; font-weight: 700; }
.settings-form { display: grid; gap: 22px; padding: 0 30px 30px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-grid label { display: grid; gap: 7px; color: #47534e; font-size: 13px; font-weight: 700; }
.settings-wide { grid-column: 1 / -1; }
.minute-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; min-height: 42px; border: 1px solid #cbd4cf; border-radius: 4px; background: var(--surface); }
.minute-input:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23, 108, 75, .1); }
.minute-input input { width: 100%; min-width: 0; height: 40px; padding: 0 4px 0 10px; border: 0; outline: 0; background: transparent; }
.minute-input small { min-width: 44px; padding-right: 10px; color: var(--muted); font-size: 10px; font-weight: 700; text-align: right; }
.practice-note { margin: 0; padding: 12px 14px; border-left: 3px solid var(--green); background: var(--soft); color: var(--muted); font-size: 12px; line-height: 1.6; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; }

.records-dialog {
  width: min(920px, calc(100% - 28px));
  max-width: 920px;
  max-height: min(820px, calc(100vh - 40px));
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  box-shadow: var(--shadow);
}
.records-dialog::backdrop { background: rgba(12, 21, 17, .66); }
.records-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 27px 30px 20px; }
.records-header h2 { margin: 0; font-size: 26px; line-height: 1.2; }
.dialog-close { width: 40px; min-height: 40px; padding: 0; border-color: var(--line); background: transparent; color: var(--muted); font-size: 27px; line-height: 1; }
.dialog-close:hover { color: var(--ink); background: var(--soft); }
.records-summary { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--soft); }
.records-summary div { padding: 17px 30px; border-right: 1px solid var(--line); }
.records-summary div:last-child { border-right: 0; }
.records-summary span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.records-summary strong { font: 800 20px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.records-tabs { display: flex; gap: 22px; padding: 0 30px; border-bottom: 1px solid var(--line); }
.records-tab { padding: 15px 2px 12px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); }
.records-tab.active { border-color: var(--green); color: var(--green); }
.records-loading { min-height: 330px; display: grid; place-content: center; gap: 13px; color: var(--muted); text-align: center; font-size: 13px; }
.records-panel { min-height: 330px; max-height: 52vh; overflow-y: auto; padding: 18px 30px 28px; }
.records-table th { position: sticky; z-index: 1; top: 0; background: var(--surface); }
.records-table td { height: 48px; }
.records-table td:nth-child(2), .records-table td:nth-child(3) { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.records-table meter { width: min(180px, 70%); height: 8px; margin-right: 10px; vertical-align: middle; accent-color: var(--green); }
.records-table meter::-webkit-meter-bar { border: 0; border-radius: 2px; background: #e2e9e5; }
.records-table meter::-webkit-meter-optimum-value { border-radius: 2px; background: var(--green); }
.records-table meter + span { color: var(--muted); font-size: 11px; }
.history-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.history-toolbar input { max-width: 380px; }
.history-toolbar span { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.history-table th:nth-child(1) { min-width: 250px; }
.history-table th:nth-child(4) { min-width: 145px; }
.history-problem { display: block; max-width: 330px; overflow-wrap: anywhere; white-space: normal; font-weight: 700; text-decoration: none; }
.history-problem:hover { text-decoration: underline; }
.method-badge { display: inline-block; margin: 0; padding: 4px 7px; border: 1px solid #bed0c7; border-radius: 4px; color: var(--green); font-size: 11px; white-space: nowrap; }
.history-links { display: flex; gap: 9px; }
.history-links a { font-size: 12px; font-weight: 700; text-decoration: none; }
.history-links a:hover { text-decoration: underline; }

@media (max-width: 1050px) {
  .workspace { grid-template-columns: 1fr; }
  .side-column { grid-row: 1; border-left: 0; border-bottom: 1px solid var(--line); }
  .leaderboard-section { display: none; }
  .stat-strip { max-width: none; }
}

@media (max-width: 720px) {
  .auth-view { grid-template-columns: 1fr; align-content: center; gap: 34px; padding: 28px 18px; }
  .auth-brand h1 { font-size: 45px; }
  .auth-brand p { font-size: 16px; }
  .auth-panel { padding: 23px; }
  .topbar { height: 58px; padding: 0 14px; }
  .workspace { min-height: calc(100vh - 58px); }
  .challenge-column { padding: 23px 16px 50px; }
  .challenge-toolbar { display: block; }
  .range-form { display: grid; grid-template-columns: 1fr auto 1fr; margin-top: 19px; }
  .range-form select { width: 100%; }
  .range-form button { grid-column: 1 / -1; }
  .contest-form { display: grid; grid-template-columns: 1fr 1.5fr; margin-top: 19px; }
  .contest-form select { width: 100%; }
  .contest-id-field { width: auto; }
  .contest-form button { grid-column: 1 / -1; }
  .contest-board { margin-top: 17px; }
  .contest-board-head { grid-template-columns: minmax(0, 1fr) auto; gap: 14px; }
  .contest-board-head #endContestBtn { grid-column: 1 / -1; }
  .contest-clock-block { min-width: 145px; }
  .contest-clock-block strong { font-size: 19px; }
  .contest-timing-legend { display: none; }
  .contest-problem-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; padding: 12px; }
  .contest-problem-name { grid-column: 1 / -1; grid-template-columns: 28px minmax(0, 1fr) auto; }
  .contest-problem-name > span { white-space: normal; }
  .contest-time-cell strong { font-size: 12px; }
  .time-split { text-align: right; }
  .empty-state { min-height: 360px; }
  .sample-grid { grid-template-columns: 1fr; }
  .submit-row { align-items: stretch; flex-direction: column; }
  .submit-row .primary { width: 100%; }
  .problem-head { margin-bottom: 20px; }
  .problem-view { padding-top: 16px; }
  .statement-section { font-size: 15px; }
  .assistance-step { grid-template-columns: 112px minmax(0, 1fr); gap: 11px; }
  .user-chip #displayName { display: none; }
  .result-dialog { padding: 24px 20px; }
  .specific-header { padding: 21px 20px 16px; }
  .specific-header h2 { font-size: 22px; }
  .specific-problem-form { padding: 0 20px 22px; }
  .settings-form { padding: 0 20px 22px; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-wide { grid-column: auto; }
  .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .records-dialog { width: calc(100% - 20px); max-height: calc(100vh - 20px); }
  .records-header { padding: 21px 18px 16px; }
  .records-header h2 { font-size: 22px; }
  .records-summary div { padding: 14px 12px; }
  .records-tabs { padding: 0 18px; }
  .records-panel { min-height: 300px; max-height: 58vh; padding: 14px 18px 22px; }
  .history-toolbar { align-items: stretch; flex-direction: column; gap: 7px; }
  .history-toolbar input { max-width: none; }
  .history-toolbar span { text-align: right; }
}

.assistance-content:not(.locked) { white-space: pre-line; }
