:root {
  color-scheme: light;
  --page: #F7F8FA;
  --card: #fff;
  --border: #D5DEEE;
  --text: #333F48;
  --muted: #6B7780;
  --accent: #0474E1;
  --accent-soft: #C5DDF8;
  --ok: #1B8A4A;
  --down: #C43C3C;
  --warn: #C48A12;
  --wait-bg: #FFF4D6;
  --wait-fg: #C48A12;
  --note: #D97706;
  --expert-bg: #EEF4FF;
  --pass-bg: #E7F6EE;
  --pass-fg: #1B8A4A;
  --fail-bg: #FDECEC;
  --fail-fg: #C43C3C;
  --file-bg: #F3F5F8;
  --green: #1AA887;
  --yellow: #C4B11A;
  --red: #E85D75;
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--page);
}
* { box-sizing: border-box; }
html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  touch-action: pan-y;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body { margin: 0; min-height: 100vh; max-width: 100%; overflow-x: hidden; background: var(--page); }
button, input, textarea { font: inherit; color: inherit; }
input, textarea, select { font-size: 16px; }
button { cursor: pointer; }
@media (prefers-reduced-motion: no-preference) {
  button {
    transition:
      transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
      box-shadow 0.7s cubic-bezier(0.16, 1, 0.3, 1),
      background-color 0.5s ease,
      color 0.5s ease,
      border-color 0.5s ease;
  }
  button:active:not(:disabled) {
    transform: scale(0.975);
    transition-duration: 0.16s;
  }
  .btn:active:not(:disabled) {
    box-shadow: 0 10px 28px rgba(4, 116, 225, 0.16);
  }
  .pane.from-right { animation: enter-forward 0.82s cubic-bezier(0.16, 1, 0.3, 1) both; }
  .pane.from-left { animation: enter-back 0.82s cubic-bezier(0.16, 1, 0.3, 1) both; }
  .pane.leave-forward { animation: leave-forward 0.68s cubic-bezier(0.4, 0, 0.2, 1) both; }
  .pane.leave-back { animation: leave-back 0.68s cubic-bezier(0.4, 0, 0.2, 1) both; }
  .grow { animation: tab-grow 0.82s cubic-bezier(0.16, 1, 0.3, 1) both; transition: none; }
}
.pane { min-width: 0; position: relative; z-index: 1; }
.clip { overflow: hidden; position: relative; }
.pane.ghost { position: absolute; left: 0; top: 0; width: 100%; z-index: 2; pointer-events: none; }
@keyframes enter-forward {
  0% { opacity: 0; transform: translate3d(32px, 8px, 0) scale(0.982); filter: blur(12px); }
  38% { opacity: 1; }
  100% { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes enter-back {
  0% { opacity: 0; transform: translate3d(-32px, 8px, 0) scale(0.982); filter: blur(12px); }
  38% { opacity: 1; }
  100% { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes leave-forward {
  to { opacity: 0; transform: translate3d(-22px, -6px, 0) scale(1.02); filter: blur(14px); }
}
@keyframes leave-back {
  to { opacity: 0; transform: translate3d(22px, -6px, 0) scale(1.02); filter: blur(14px); }
}
@keyframes tab-grow {
  0% { transform: scale(1); }
  18% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
a { color: var(--accent); text-decoration: none; }
h1, h2, p { margin: 0; }
pre { white-space: pre-wrap; font: inherit; margin: 0; }

.screen { min-height: 100vh; background: var(--page); }
.login-wrap, .review-wrap { display: flex; justify-content: center; padding: 24px 16px 40px; }
.review-wrap { padding-top: calc(env(safe-area-inset-top, 0px) + 21px); }
.login-card {
  width: min(460px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 48px; height: 48px; }
.brand h1 { font-size: 28px; font-weight: 700; }
.muted { color: var(--muted); }
.note { color: var(--note); }
.error { color: var(--down); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { color: var(--muted); font-size: 15px; }
.field input, textarea, .editor {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--page);
  border-radius: 8px;
  padding: 8px 10px;
  outline: none;
}
textarea, .editor { min-height: 160px; resize: vertical; background: var(--card); border-radius: 12px; padding: 14px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn {
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  padding: 10px 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}
.btn.block { width: 100%; }
.btn.plain { background: transparent; color: var(--accent); }
.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn.muted {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
}
.btn.warn { background: var(--warn); }
.btn.bad { background: var(--down); }
.btn.ok { background: var(--ok); }
.btn:disabled { opacity: 0.55; cursor: default; }
.capsule {
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  white-space: nowrap;
}
.capsule.on { background: var(--accent); color: #fff; border-color: var(--accent); }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal {
  width: min(380px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal h2 { font-size: 20px; }
.codes { display: flex; gap: 8px; pointer-events: none; }
.codes b {
  width: 42px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--page);
  border: 1px solid var(--border);
  font-size: 18px;
  font-weight: 600;
}
.codes b.on { border-color: var(--accent); }
.modal-actions { display: flex; justify-content: space-between; gap: 12px; }
.busy-row { display: flex; align-items: center; gap: 8px; color: var(--muted); }

.dash {
  padding: calc(env(safe-area-inset-top, 0px) + 21px) 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100vh;
}
.header {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-rows: 36px auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 6px;
}
.header img { width: 36px; height: 36px; grid-column: 1; grid-row: 1; }
.greet {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  height: 36px;
}
.header h1 { font-size: 22px; font-weight: 700; line-height: 1.15; }
.header .pill { grid-column: 1 / -1; grid-row: 2; width: 100%; max-width: none; }
.logout {
  border: 1px solid var(--down);
  background: var(--fail-bg);
  color: var(--down);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  flex: none;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  max-width: 280px;
}
.pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: block; }
.pill.checking { color: var(--muted); background: rgba(107, 119, 128, 0.12); }
.pill.online { color: var(--ok); background: rgba(27, 138, 74, 0.12); }
.pill.offline { color: var(--down); background: rgba(196, 60, 60, 0.12); }
.tabs { display: flex; gap: 8px; overflow: auto; padding: 6px 0; scrollbar-width: none; touch-action: pan-x; }
.tabs::-webkit-scrollbar { display: none; }
.tabs .capsule { flex: none; }
.stats { display: flex; flex-direction: column; gap: 16px; }
.stats-head, .queue-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stats-head .capsule { padding: 6px 14px; flex: none; align-self: center; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.metric {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.metric b { font-size: 17px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric span { color: var(--muted); font-size: 12px; }
.section-title { font-size: 17px; font-weight: 650; margin-top: 4px; }
.table {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: auto;
}
.table-row, .table-head { display: grid; grid-template-columns: repeat(4, minmax(90px, 1fr)); }
.table-head { background: var(--accent); color: #fff; }
.table-head button, .table-row span { padding: 10px 8px; text-align: center; background: transparent; color: inherit; border: 0; font-weight: 600; }
.table-row span { font-weight: 400; font-size: 15px; }
.table-row.alt { background: var(--page); }
.queue { display: flex; flex-direction: column; gap: 12px; }
.work {
  display: flex;
  gap: 16px;
  align-items: center;
  text-align: left;
  width: 100%;
  border-radius: 14px;
  padding: 16px;
  background: var(--card);
}
.work .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.work strong { font-size: 17px; }
.work .side { width: 150px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.work .wait { font-size: 12px; font-weight: 650; text-align: center; }
.tone-green { background: rgba(26, 168, 135, 0.08); border: 1px solid rgba(26, 168, 135, 0.45); }
.tone-yellow { background: rgba(196, 177, 26, 0.08); border: 1px solid rgba(196, 177, 26, 0.45); }
.tone-red { background: rgba(232, 93, 117, 0.08); border: 1px solid rgba(232, 93, 117, 0.45); }
.tone-green .wait { color: var(--green); }
.tone-yellow .wait { color: var(--yellow); }
.tone-red .wait { color: var(--red); }

.review { width: min(860px, 100%); display: flex; flex-direction: column; gap: 18px; align-items: stretch; }
.review-head { display: flex; flex-direction: column; gap: 18px; }
.back { align-self: flex-start; }
.title { font-size: 22px; font-weight: 700; }
.person { display: flex; align-items: center; gap: 12px; }
.person .who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none;
}
.avatar.sm { width: 32px; height: 32px; }
.wait-pill, .verdict {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.wait-pill { color: var(--wait-fg); background: var(--wait-bg); flex: none; }
.verdict.pass { color: var(--pass-fg); background: var(--pass-bg); }
.verdict.warn { color: var(--wait-fg); background: var(--wait-bg); }
.verdict.fail { color: var(--fail-fg); background: var(--fail-bg); }
.status-row, .msg-head, .solution-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg-head { gap: 8px; }
.msg-head span, .solution-head span { margin-left: auto; }
.bubble { background: var(--expert-bg); border-radius: 12px; padding: 14px; }
.solution h2 { font-size: 18px; font-weight: 650; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.file {
  display: block;
  background: var(--file-bg);
  border-radius: 10px;
  padding: 12px;
  color: var(--text);
}
.file small, .link-card small { color: var(--muted); display: block; }
.subtabs { display: flex; gap: 18px; overflow: auto; padding: 4px 0; scrollbar-width: none; touch-action: pan-x; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs button { background: none; border: 0; padding: 0 0 6px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; flex: none; }
.subtabs button.on { color: var(--accent); font-weight: 700; border-bottom-color: var(--accent); }
.history-row { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.history-row.right { align-items: flex-end; text-align: right; }
.history-row small { color: var(--muted); }
.link-list { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.link-card { background: var(--file-bg); border-radius: 10px; padding: 12px; color: var(--accent); width: 100%; }
.form { display: flex; flex-direction: column; gap: 12px; }
.tools, .split, .grades { display: flex; gap: 8px; flex-wrap: wrap; }
.split > .btn, .grades > .btn { flex: 1; min-width: 0; }
.caption { font-size: 12px; color: var(--muted); }
.notify { margin-top: 8px; }

@media (max-width: 800px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .pair { grid-template-columns: 1fr; }
  .work { flex-direction: column; align-items: stretch; }
  .work .side { width: auto; align-items: stretch; }
  .dash { padding: calc(env(safe-area-inset-top, 0px) + 21px) 12px 40px; }
}
