:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #14202e;
  --muted: #5b6b7d;
  --line: #d9e0e8;
  --brand: #1f3a5f;
  --accent: #f28c28;
  --accent-text: #1b1205;
  --danger-bg: #fdecec;
  --danger: #a32020;
  --ok: #1d7a45;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1722; --surface: #172233; --text: #e8eef5; --muted: #9aabbd;
    --line: #2a3a50; --brand: #9cc2ef; --danger-bg: #3a1a1a; --danger: #ff9a9a;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  font-size: 16px; line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--brand); }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; color: var(--text); }
.langs { display: flex; gap: 4px; }
.langs a {
  font-size: .8rem; font-weight: 600; text-decoration: none; color: var(--muted);
  padding: 6px 8px; border-radius: 8px; min-width: 36px; text-align: center;
}
.langs a.on { background: var(--brand); color: var(--surface); }

.wrap { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 24px 16px; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 16px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; max-width: 520px; margin: 0 auto;
}
.card.narrow { max-width: 440px; }
.center { text-align: center; }

.form { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .95rem; }
.form label.check { flex-direction: row; align-items: center; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input:not([type]), input[inputmode] {
  font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); width: 100%;
}
input:focus { outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); border-color: var(--accent); }
input.code {
  font-size: 2.2rem; letter-spacing: .4em; text-align: center; font-weight: 700;
  padding: 14px; margin: 16px 0;
}

.btn {
  display: inline-block; font: inherit; font-weight: 700; border: 0; cursor: pointer;
  background: var(--brand); color: var(--surface); padding: 12px 20px; border-radius: 10px; text-decoration: none;
}
.btn.big { width: 100%; padding: 18px; font-size: 1.2rem; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.mark {
  width: 100%; min-height: 34vh; font-size: 2rem; border-radius: 24px; margin: 24px 0 12px;
  background: var(--accent); color: var(--accent-text);
}

.alert { background: var(--danger-bg); color: var(--danger); padding: 12px 14px; border-radius: 10px; font-weight: 600; }
.code-show { font-size: 2.4rem; font-weight: 800; letter-spacing: .3em; text-align: center; color: var(--ok); }

.worker-home { text-align: center; max-width: 520px; margin: 0 auto; }
.worker-home .clock { font-size: 3.5rem; font-weight: 800; margin: 8px 0 0; font-variant-numeric: tabular-nums; }

.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.panel-head p { margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 6px; min-height: 110px;
}
.tile-title { font-weight: 700; }
.tile-count { font-size: 2rem; font-weight: 800; color: var(--brand); }
.tile-note { color: var(--muted); font-size: .85rem; margin-top: auto; }
.tile.soon { opacity: .75; }

@media (max-width: 480px) {
  .card { padding: 20px 16px; }
  .langs a { min-width: 32px; padding: 6px; }
}
