:root {
  --red: #DC182D;
  --metal: #26282B;
  --dark-gray: #4C4F56;
  --gray: #727780;
  --light-gray: #D1D3D4;
  --bg: #F5F5F6;
  --card: #FFFFFF;
  --text: #26282B;
  --green: #00803E;
  --green-light: #E0F0E7;
  --red-light: #FFE6E9;
  --yellow: #F5A623;
  --yellow-light: #FCECD2;
  --sans: 'Figtree', 'Avenir Next', 'Segoe UI', -apple-system, sans-serif;
  --display: 'Barlow Condensed', 'Figtree', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C0C0D;
    --card: #1A1B1E;
    --text: #F2F2F3;
    --gray: #A3A7AE;
    --light-gray: #3A3C41;
    --green-light: #0F2A1C;
    --red-light: #3A0F15;
    --yellow-light: #3A2A0E;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.bar {
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
}
.logo { height: 28px; }
.link {
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.85);
  font: 600 15px var(--sans);
  cursor: pointer;
}

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

h1, h2 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.03em;
  margin: 0 0 8px;
}
h1 { font-size: 30px; }
h2 { font-size: 20px; text-transform: uppercase; letter-spacing: 0.06em; }

.hello { font-size: 17px; color: var(--gray); margin: 0 0 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--light-gray);
  border-radius: 12px;
  padding: 20px;
}
.center { text-align: center; }

.primary {
  background: var(--red);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 14px 22px;
  font: 600 16px var(--sans);
  cursor: pointer;
  margin-top: 8px;
}

.doors { display: grid; gap: 14px; margin-bottom: 20px; }

.door {
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 100%;
  padding: 28px 16px;
  border-radius: 16px;
  border: 0;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  font-family: var(--sans);
  transition: transform 0.08s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.door svg { width: 56px; height: 56px; }
.door:active:not(:disabled) { transform: scale(0.98); }
.door:disabled { background: var(--light-gray); color: var(--gray); cursor: default; }
.door.busy { opacity: 0.8; }
.door.ok { background: var(--green); color: #fff; }
.door-name {
  font: 600 32px var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.door-sub { font-size: 15px; opacity: 0.9; }

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: 448px;
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: 10px;
  font-weight: 600;
  border-left: 4px solid;
  background: var(--card);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}
.toast.success { border-color: var(--green); background: var(--green-light); }
.toast.error { border-color: var(--red); background: var(--red-light); }

.history-head { display: flex; align-items: baseline; justify-content: space-between; }
.all { font-size: 14px; color: var(--gray); }
.history { list-style: none; margin: 8px 0 0; padding: 0; }
.history li {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--light-gray);
  font-size: 15px;
}
.history li:first-child { border-top: 0; }
.history .empty { display: block; color: var(--gray); }
.what { text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.when { color: var(--gray); font-size: 14px; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.ok { background: var(--green); }
.dot.ko { background: var(--red); }

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  border-left: 4px solid;
  margin: 0;
}
.alert.error { background: var(--red-light); border-color: var(--red); }
.alert.warning { background: var(--yellow-light); border-color: var(--yellow); }

.tip { margin-top: 20px; font-size: 15px; color: var(--gray); }
.tip p { margin: 0 0 8px; }
.tip ul { margin: 0; padding-left: 18px; }
.tip li { margin: 4px 0; }
.tip a { color: var(--red); font-weight: 600; }
