
:root {
    --bg: #09111d;
    --surface: #121d2d;
    --surface-2: #172437;
    --border: rgba(255,255,255,.08);
    --text: #eef4ff;
    --muted: #9eb1cc;
    --accent: #5fb3ff;
    --accent-2: #79f2c0;
    --danger: #ff6b6b;
    --warning: #ffcc66;
    --shadow: 0 20px 60px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: Inter, ui-sans-serif, system-ui, sans-serif; background: radial-gradient(circle at top left, #13213a, var(--bg)); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
code, pre, textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 48px; }
.container.narrow { width: min(860px, calc(100% - 32px)); }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 28px; }
.topbar-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-grid, .panel-grid, .stats-grid { display: grid; gap: 20px; }
.hero-grid { grid-template-columns: 1.1fr .9fr; }
.panel-grid { grid-template-columns: 1fr 1fr; margin-top: 20px; }
.stats-grid { grid-template-columns: repeat(4, 1fr); margin-bottom: 20px; }
.hero-card, .panel-card, .stat-card, .log-card { background: rgba(18,29,45,.88); backdrop-filter: blur(10px); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); }
.hero-card, .panel-card { padding: 26px; }
.hero-card.alt { background: rgba(23,36,55,.92); }
.stat-card { padding: 18px 22px; display: flex; flex-direction: column; gap: 8px; }
.stat-card strong { font-size: 2rem; }
.badge { display: inline-flex; width: fit-content; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: rgba(95,179,255,.15); color: var(--accent); border: 1px solid rgba(95,179,255,.25); font-size: .88rem; margin-bottom: 14px; }
.badge.danger { color: #fff; background: rgba(255,107,107,.2); border-color: rgba(255,107,107,.35); }
h1, h2, h3 { margin: 0 0 12px; }
p { color: var(--muted); line-height: 1.55; }
.stack, .stack-sm { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { gap: 10px; }
label { display: flex; flex-direction: column; gap: 8px; color: var(--text); }
input, textarea, button, select { font: inherit; }
input, textarea { width: 100%; border: 1px solid rgba(255,255,255,.1); border-radius: 16px; background: rgba(255,255,255,.03); color: var(--text); padding: 14px 16px; }
textarea { min-height: 130px; resize: vertical; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 14px; padding: 12px 18px; cursor: pointer; border: 1px solid transparent; transition: transform .15s ease, opacity .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #07101a; font-weight: 700; }
.btn-secondary { background: rgba(255,255,255,.05); color: var(--text); border-color: rgba(255,255,255,.1); }
.full-width { width: 100%; }
.alert { border-radius: 16px; padding: 14px 16px; border: 1px solid transparent; }
.alert-warning { background: rgba(255,204,102,.08); border-color: rgba(255,204,102,.24); color: #ffe4a3; }
.alert-error { background: rgba(255,107,107,.08); border-color: rgba(255,107,107,.24); color: #ffc6c6; }
.alert-success { background: rgba(121,242,192,.08); border-color: rgba(121,242,192,.24); color: #baf9df; }
.muted { color: var(--muted); }
.plain-list { padding-left: 18px; color: var(--muted); }
.exercise-list { display: flex; flex-direction: column; gap: 12px; }
.exercise-item { padding: 14px 16px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06); border-radius: 16px; display: flex; flex-direction: column; gap: 6px; }
.exercise-list.compact .exercise-item { padding: 12px 14px; }
.actions-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 10px; border-bottom: 1px solid rgba(255,255,255,.07); text-align: left; color: var(--muted); vertical-align: top; }
th { color: var(--text); font-size: .95rem; }
.exam-body { min-height: 100vh; }
.exam-shell { display: grid; grid-template-columns: 360px 1fr; min-height: 100vh; }
.exam-sidebar { padding: 26px; border-right: 1px solid var(--border); background: rgba(10,17,29,.92); display: flex; flex-direction: column; gap: 16px; }
.exam-main { padding: 26px; }
.info-card, .info-grid { display: grid; gap: 12px; }
.info-card > div, .info-grid > div { padding: 12px 14px; background: rgba(255,255,255,.03); border-radius: 14px; border: 1px solid rgba(255,255,255,.06); display: flex; flex-direction: column; gap: 6px; }
.info-grid.two { grid-template-columns: 1fr 1fr; }
.editor-wrapper { background: rgba(18,29,45,.92); border: 1px solid var(--border); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); }
.editor-header { padding: 14px 18px; background: rgba(255,255,255,.04); border-bottom: 1px solid var(--border); color: var(--muted); }
#code-editor { min-height: calc(100vh - 130px); border: 0; border-radius: 0; background: transparent; padding: 18px; font-size: .95rem; line-height: 1.5; }
.drag-list { display: flex; flex-direction: column; gap: 12px; padding: 18px; min-height: 420px; }
.drag-item { padding: 14px 16px; border-radius: 16px; border: 1px solid rgba(95,179,255,.22); background: rgba(95,179,255,.08); cursor: grab; user-select: none; }
.drag-item.dragging { opacity: .55; }
.overlay { position: fixed; inset: 0; background: rgba(6,10,16,.8); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 30; }
.overlay-card { width: min(560px, 100%); background: rgba(18,29,45,.98); border: 1px solid var(--border); border-radius: 24px; padding: 28px; text-align: center; box-shadow: var(--shadow); }
.code-block { background: #08111c; border: 1px solid rgba(255,255,255,.08); border-radius: 18px; padding: 16px; white-space: pre-wrap; word-break: break-word; color: #d6e6ff; overflow-x: auto; }
.log-card { padding: 16px; }
.log-card pre { color: var(--muted); white-space: pre-wrap; word-break: break-word; }
.app-body { min-height: 100vh; }
@media (max-width: 1024px) {
    .hero-grid, .panel-grid, .exam-shell, .stats-grid { grid-template-columns: 1fr; }
    #code-editor { min-height: 55vh; }
}
