:root {
  --bg: #0f1217;
  --panel: #171b22;
  --panel-2: #202630;
  --text: #edf0f3;
  --muted: #98a2b3;
  --border: #2f3744;
  --accent: #c0c7d1;
  --accent-strong: #e8edf5;
  --ok: #183d2d;
  --ok-text: #83d0a7;
  --warn: #4d3416;
  --warn-text: #f4c37d;
  --error: #50232a;
  --error-text: #ffb6c1;
}
* { box-sizing: border-box; }
body { margin:0; font-family: Inter, Arial, sans-serif; color: var(--text); background: radial-gradient(circle at top, #1b2028 0, #0f1217 45%); }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
.shell { max-width: 1240px; margin: 0 auto; padding: 24px; }
.topbar { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom: 24px; }
.brand { font-size: 24px; font-weight: 700; text-decoration: none; }
.nav { display:flex; align-items:center; gap:14px; flex-wrap: wrap; }
.user-chip { background: rgba(255,255,255,0.05); border:1px solid var(--border); border-radius: 999px; padding: 8px 12px; }
.page { display:block; }
.stack { display:flex; flex-direction:column; }
.gap16 { gap:16px; }
.gap24 { gap:24px; }
.grid { display:grid; gap:20px; }
.cards-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card, .subcard { background: rgba(23,27,34,0.96); border: 1px solid var(--border); border-radius: 24px; padding: 22px; box-shadow: 0 12px 40px rgba(0,0,0,.22); }
.subcard { border-radius: 18px; background: var(--panel-2); }
.card-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.centered-card { max-width: 520px; margin: 10vh auto 0; }
h1,h2,h3,p { margin-top:0; }
.muted { color: var(--muted); }
.uppercase { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; }
.btn { border:1px solid var(--accent); background: linear-gradient(180deg, #eff2f6, #c7ced8); color:#111; padding: 12px 18px; border-radius: 16px; font-weight: 700; cursor:pointer; }
.btn.secondary, .btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost { border-style:dashed; }
.row-actions { display:flex; gap:12px; flex-wrap:wrap; margin-top: 16px; }
.meta-list { display:flex; flex-direction:column; gap:10px; color: var(--muted); }
.meta-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap:16px; }
.meta-box { background: #12161d; border:1px solid var(--border); border-radius: 18px; padding: 14px; display:flex; flex-direction:column; gap:8px; }
.meta-box span { color: var(--muted); font-size: 13px; }
.meta-box strong { font-size: 18px; }
.pill { border:1px solid var(--border); border-radius:999px; padding:8px 12px; background:#13171e; white-space: nowrap; }
.pill.ok { background: var(--ok); color: var(--ok-text); }
.pill.warn { background: var(--warn); color: var(--warn-text); }
.alert { padding: 14px 16px; border-radius: 18px; border:1px solid transparent; }
.alert.warn { background: var(--warn); color: var(--warn-text); }
.alert.error { background: var(--error); color: var(--error-text); }
.alert.compact { font-size: 14px; }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse: collapse; }
th, td { padding: 12px; border-bottom:1px solid var(--border); text-align:left; }
.tg-login-wrap { position: relative; min-height: 64px; }
.tg-login-fake-btn { width:100%; min-height:56px; border-radius:18px; border:1px solid var(--accent); background: linear-gradient(180deg, #eff2f6, #c7ced8); color:#111; font-size:16px; font-weight:700; cursor:pointer; }
.tg-login-wrap iframe { position:absolute; inset:0; width:100%; height:56px; opacity:0; }
.login-card { text-align:center; }
.attempt-layout { display:grid; grid-template-columns: 320px 1fr; gap: 20px; }
.attempt-sidebar { position: sticky; top: 12px; height: fit-content; }
.progress { width:100%; height:10px; background:#0e1218; border-radius:999px; overflow:hidden; border:1px solid var(--border); }
.progress span { display:block; height:100%; background: linear-gradient(90deg, #dfe6ee, #97a6ba); }
.timer-box { background: #12161d; border:1px solid var(--border); border-radius: 18px; padding: 14px; margin: 14px 0; }
.timer-label { color: var(--muted); font-size:13px; margin-bottom:8px; }
.timer-value { font-size: 28px; font-weight: 800; }
.options-stack { display:flex; flex-direction:column; gap:12px; margin: 22px 0; }
.option-card { display:flex; gap:14px; align-items:flex-start; padding: 16px; border-radius: 18px; border:1px solid var(--border); background: #131821; cursor:pointer; }
.option-card input { margin-top: 3px; }
.option-card.static { cursor:default; }
.option-card.correct { border-color: #315d47; }
.option-card.chosen { background: #1d2430; }
.compact-options .option-card { padding: 12px 14px; }
.small-note { color: var(--muted); font-size: 14px; }
.markdown-like { line-height: 1.55; }
.simple-list { margin:0; padding-left: 22px; }
.import-form { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
input[type='file'] { color: var(--text); }
@media (max-width: 900px) {
  .attempt-layout { grid-template-columns: 1fr; }
  .attempt-sidebar { position: static; }
}
.input, select, textarea {
  width: 100%;
  background: #11161d;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 8px;
}
textarea { min-height: 96px; resize: vertical; }
.textarea-large { min-height: 180px; }
.form-grid-2 { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:16px; }
.two-col-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:20px; }
.span-2 { grid-column: 1 / -1; }
.checkbox-row { display:flex; align-items:center; gap:10px; }
.option-edit-row { display:grid; grid-template-columns: 120px 1fr; gap:12px; align-items:center; }
.compact-list { margin-top: 8px; }
.btn.danger { background: #3f171c; color: #ffd4da; border-color: #70353c; }
code { white-space: pre-wrap; word-break: break-word; }
@media (max-width: 900px) {
  .form-grid-2, .two-col-grid, .option-edit-row { grid-template-columns: 1fr; }
}
