:root {
  --bg: #000;
  --text: #f6f0e9;
  --muted: #bdb6ae;
  --ink: #201b17;
  --apricot: #ffc898;
  --mint: #bde6cd;
  --sky: #bbdfff;
  --lavender: #d6c8f3;
  --stone: #d8d4d0;
  --card: #1b1b1d;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.4 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.screen {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 16px 96px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.top { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 4px; }
h1 { margin: 0; font-size: 1.5rem; font-weight: 600; text-align: center; }
h2 { margin: 0 0 6px; font-size: 1rem; font-weight: 600; color: var(--muted); }
p { margin: 0; }
.help { color: var(--muted); text-align: center; }
.help.small { font-size: .85rem; }
.notice { background: var(--card); border-radius: 16px; padding: 12px 16px; text-align: center; }
.error { color: #ffb4a8; text-align: center; }
.sync { font-size: .8rem; color: var(--muted); }
.sync.offline { color: #ffd9a8; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 0 8px; }
.brand .icon { width: 56px; height: 56px; color: var(--apricot); }

.action {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 12px 20px;
  border: 0;
  border-radius: 32px;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.action:active { transform: scale(.985); filter: brightness(.95); }
.action:disabled { opacity: .5; cursor: default; }
.action:focus-visible, .lang:focus-visible, .small-button:focus-visible, .toast button:focus-visible, .code:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.c-apricot { background: var(--apricot); }
.c-mint { background: var(--mint); }
.c-sky { background: var(--sky); }
.c-lavender { background: var(--lavender); }
.c-stone { background: var(--stone); }
.action-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.action-label { font-size: 1.1rem; font-weight: 600; }
.action-label.center { text-align: center; width: 100%; }
.action-sub { font-size: .9rem; opacity: .78; font-variant-numeric: tabular-nums; }
.icon { width: 28px; height: 28px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.action .icon { color: var(--ink); }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row .action { min-height: 56px; border-radius: 28px; }
.card { background: var(--card); border-radius: 24px; padding: 14px 18px; display: flex; flex-direction: column; gap: 4px; }
.card p { font-variant-numeric: tabular-nums; }
.timer { font-size: 3rem; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; color: var(--mint); padding: 8px 0; }
.codebox { display: block; }
.code {
  width: 100%;
  background: #303033;
  color: #fff;
  border: 0;
  border-radius: 20px;
  padding: 14px;
  font: inherit;
  font-size: 2rem;
  letter-spacing: .35em;
  text-align: center;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chips .lang { padding: 0 16px; }
.fieldbox { display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.field {
  width: 100%;
  min-height: 52px;
  background: #303033;
  color: #fff;
  border: 0;
  border-radius: 20px;
  padding: 10px 16px;
  font: inherit;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}
.field:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.langbar { display: flex; gap: 8px; justify-content: center; }
.lang { min-width: 56px; min-height: 40px; border-radius: 20px; border: 2px solid var(--stone); background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.lang.on { background: var(--apricot); border-color: var(--apricot); color: var(--ink); font-weight: 600; }
.device { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.small-button { min-height: 40px; padding: 0 16px; border-radius: 20px; border: 0; background: var(--stone); color: var(--ink); font: inherit; cursor: pointer; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 12px 10px 20px;
  background: var(--mint);
  color: var(--ink);
  border-radius: 28px;
  font-weight: 600;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .6);
}
.toast button { min-height: 40px; padding: 0 18px; border: 0; border-radius: 20px; background: var(--ink); color: var(--text); font: inherit; cursor: pointer; }
