:root {
  --ink: #111827;
  --muted: #667085;
  --line: #dde2ea;
  --paper: #f6f7f9;
  --panel: #ffffff;
  --accent: #ff5b35;
  --accent-dark: #d83d1b;
  --lime: #d9ff73;
  --blue: #4169e1;
  --shadow: 0 16px 45px rgba(17, 24, 39, .08);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
button { border: 0; border-radius: 12px; background: var(--ink); color: white; padding: 12px 18px; font-weight: 750; cursor: pointer; transition: transform .15s, background .15s; }
button:hover { transform: translateY(-1px); background: #293244; }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
button.secondary { background: white; color: var(--ink); border: 1px solid var(--line); }
.topbar { height: 68px; background: var(--ink); color: white; display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100vw - 1180px) / 2)); }
.brand { color: white; text-decoration: none; font-size: 20px; font-weight: 850; letter-spacing: -.03em; }
.brand span { color: var(--lime); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-left: 8px; }
.shell { max-width: 1180px; margin: 0 auto; padding: 48px 24px 80px; }
.hidden { display: none !important; }
.login-wrap { min-height: calc(100vh - 180px); display: grid; grid-template-columns: 1.4fr .8fr; gap: 72px; align-items: center; }
.compact-login { min-height: 70vh; }
.login-copy h1, .hero-row h1 { font-size: clamp(42px, 6vw, 78px); line-height: .98; letter-spacing: -.06em; margin: 12px 0 24px; }
.login-copy p:last-child { color: var(--muted); font-size: 20px; max-width: 560px; line-height: 1.55; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); }
.panel h2 { margin: 4px 0 24px; font-size: 28px; letter-spacing: -.03em; }
label { display: block; font-weight: 700; margin: 16px 0 8px; }
input { width: 100%; border: 1px solid #cbd2dc; border-radius: 12px; padding: 13px 14px; background: white; color: var(--ink); outline: none; }
input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(65, 105, 225, .12); }
.login-card button, .panel form button, #attempt-form > button { width: 100%; margin-top: 18px; }
.eyebrow { margin: 0; color: var(--accent-dark); text-transform: uppercase; letter-spacing: .12em; font-weight: 850; font-size: 12px; }
.hint, .muted { color: var(--muted); line-height: 1.5; }
.hint { font-size: 13px; margin: 8px 0 0; }
.form-error { color: #b42318; min-height: 20px; font-size: 14px; margin-bottom: 0; }
.hero-row { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 52px; }
.hero-row h1 { font-size: clamp(40px, 5vw, 64px); margin-bottom: 12px; }
.quota-card { min-width: 210px; background: var(--lime); border: 1px solid #bade57; border-radius: 20px; padding: 20px 24px; }
.quota-card span, .quota-card small { display: block; color: #45521d; }
.quota-card strong { display: block; font-size: 52px; line-height: 1; margin: 6px 0; }
.notice { border-radius: 12px; padding: 13px 15px; margin: 14px 0; line-height: 1.4; }
.notice.warning { background: #fff1c9; color: #754c00; }
.notice.success { background: #e4f8df; color: #22631b; overflow-wrap: anywhere; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 38px 0 20px; }
.section-heading.compact { margin-top: 0; }
.section-heading h2 { margin: 5px 0 0; font-size: 30px; letter-spacing: -.04em; }
.section-heading > p { color: var(--muted); max-width: 480px; text-align: right; }
.task-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.task-card { min-height: 245px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; align-items: flex-start; box-shadow: 0 8px 30px rgba(17,24,39,.04); }
.task-card .number { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: white; font-weight: 800; }
.task-card h3 { font-size: 24px; letter-spacing: -.03em; margin: 22px 0 8px; }
.task-card p { color: var(--muted); line-height: 1.45; margin: 0 0 24px; }
.task-card button { margin-top: auto; background: var(--accent); }
.two-column { display: grid; grid-template-columns: .9fr 1.4fr; gap: 30px; margin-top: 64px; align-items: start; }
.attempt-list { display: grid; gap: 12px; }
.attempt { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.attempt-top { display: flex; justify-content: space-between; gap: 10px; }
.attempt h3 { font-size: 16px; margin: 0 0 5px; }
.attempt time { color: var(--muted); font-size: 12px; }
.score { font-size: 24px; font-weight: 850; }
.status { display: inline-flex; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 750; background: #eef1f5; color: #475467; }
.status.running { background: #e4edff; color: #214db6; }
.status.done { background: #e4f8df; color: #22631b; }
.status.failed { background: #fee4e2; color: #b42318; }
.attempt details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.attempt summary { cursor: pointer; font-weight: 700; }
.checks { display: grid; gap: 6px; margin-top: 12px; }
.check { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); border: 1px dashed #cbd2dc; border-radius: 14px; padding: 28px; text-align: center; }
.table-wrap { overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: 16px; }
table { border-collapse: collapse; width: 100%; min-width: 650px; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
tbody tr:last-child td { border-bottom: 0; }
.total-score { font-weight: 850; }
dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; border: 0; border-radius: 22px; padding: 30px; box-shadow: 0 30px 90px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(17,24,39,.72); backdrop-filter: blur(4px); }
.dialog-close { float: right; background: transparent; color: var(--muted); padding: 0; font-size: 32px; line-height: 1; }
.statement { white-space: pre-wrap; font: 14px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; background: #f5f6f8; padding: 16px; border-radius: 12px; max-height: 280px; overflow: auto; }
.dropzone { border: 2px dashed #b9c1cc; padding: 20px; border-radius: 14px; cursor: pointer; text-align: center; }
.dropzone strong, .dropzone span { display: block; }
.dropzone span { margin-top: 6px; color: var(--muted); font-weight: 400; }
.dropzone input { position: absolute; opacity: 0; pointer-events: none; width: 1px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 48px; }
.stat-panel h2 { font-size: 42px; margin-bottom: 8px; }
td button { padding: 7px 10px; border-radius: 8px; font-size: 12px; }

@media (max-width: 850px) {
  .shell { padding: 32px 16px 60px; }
  .login-wrap, .two-column, .admin-grid { grid-template-columns: 1fr; gap: 28px; }
  .login-wrap { align-content: center; }
  .task-grid { grid-template-columns: 1fr; }
  .hero-row { align-items: stretch; flex-direction: column; }
  .quota-card { min-width: 0; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .section-heading > p { text-align: left; margin-top: 0; }
  .login-copy h1 { font-size: 44px; }
}
