:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  color: #eef1f3;
  background: #101316;
  --muted: #a9b5bf;
  --line: #364049;
  --surface: #171d22;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: grid; place-items: center; }
h1, h2, p, dl, dd { margin: 0; }
.shell { width: min(100%, 44rem); padding: clamp(1rem, 3vw, 2rem); }
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.15rem; }
.brand { font-size: .875rem; font-weight: 730; letter-spacing: .17em; text-transform: uppercase; color: var(--muted); }
h1 { font-size: clamp(1.65rem, 4vw, 2.4rem); margin-top: .25rem; }
.demo { border: 1px solid var(--line); border-radius: 2rem; padding: .35rem .8rem; color: var(--muted); }
.panel, dialog { border: 1px solid var(--line); border-radius: 1.2rem; background: var(--surface); }
.panel { padding: clamp(1rem, 4vw, 2rem); }
.login, .login label { display: grid; gap: .65rem; }
.login { gap: 1rem; }
.gate { --signal: #ff9399; text-align: center; display: grid; gap: .75rem; }
.gate[data-state="closed"] { --signal: #79dfac; }
.gate[data-state="open"] { --signal: #ffbc80; }
.gate[data-state="moving"] { --signal: #94c7ff; }
.signal { color: var(--signal); display: flex; justify-content: center; gap: .35rem; margin-bottom: .3rem; }
.signal i { display: block; width: .45rem; height: 1.65rem; border-radius: .14rem; background: currentColor; }
.gate[data-state="open"] .signal i:nth-child(n + 4),
.gate[data-state="unknown"] .signal i:nth-child(even) { opacity: .28; }
.gate[data-state="moving"] .signal i:nth-child(3),
.gate[data-state="moving"] .signal i:nth-child(4) { opacity: .4; }
#state { color: var(--signal); font-size: clamp(1.45rem, 5vw, 2.7rem); line-height: 1.12; text-transform: uppercase; }
#message { color: #ffb2b6; }
#message:empty, #reason:empty { display: none; }
#message:not(:empty) { margin-bottom: .8rem; }
#reason { color: var(--muted); }
.metadata { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; padding: .8rem .15rem; }
dt { color: var(--muted); font-size: .875rem; margin-bottom: .25rem; }
dd { overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.actions button { flex: 1; }
button, input {
  min-height: 3rem;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: #20282f;
  color: inherit;
  padding: .55rem .8rem;
}
button { cursor: pointer; font-weight: 700; }
button:enabled:hover { filter: brightness(1.18); }
button:disabled { color: #a9b5bf; background: #22292f; cursor: default; }
.primary:enabled { background: #ebf1f5; color: #14191e; border-color: #ebf1f5; }
.primary { min-height: 3.7rem; }
.gate .primary { text-transform: uppercase; }
.confirmation p { margin-bottom: .75rem; }
:focus-visible { outline: 3px solid #94c7ff; outline-offset: 3px; }
dialog { width: min(30rem, calc(100% - 2rem)); padding: 1.3rem; }
dialog::backdrop { background: #090b0cbb; }
dialog ol { padding-left: 1.4rem; overflow-wrap: anywhere; }
dialog li { margin: .5rem 0; }
dialog p { margin-top: .6rem; }
@media (max-height: 600px) and (min-width: 600px) {
  .shell { padding-block: .65rem; }
  .top { margin-bottom: .6rem; }
  .panel { padding-block: .8rem; }
  .gate { gap: .5rem; }
  .signal { margin-bottom: 0; }
  .metadata { padding-block: .55rem; }
}
