:root {
  color-scheme: dark;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #0a211c;
  color: #fff8e7;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

#login {
  position: fixed;
  inset: 0;
  display: grid;
  overflow: auto;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 20%, #164d3c, #0a211c 70%);
}

.login-card {
  width: min(100%, 374px);
  margin: auto;
  padding: 28px 22px;
  border: 1px solid #396456;
  border-radius: 18px;
  background: #153f35;
  text-align: center;
}

.login-card h1 {
  margin: 0 0 16px;
  color: #f1d28e;
  font-size: 32px;
}

.login-card p {
  margin: 10px 0;
  line-height: 1.6;
}

#login-qr {
  display: block;
  width: min(100%, 256px);
  height: auto;
  margin: 16px auto;
  border-radius: 8px;
}

#login-help {
  color: #c4d6cb;
  font-size: 14px;
}

#login-action {
  width: 100%;
  min-height: 44px;
  margin-top: 16px;
  border: 1px solid #f1d28e;
  border-radius: 9px;
  background: #f1d28e;
  color: #172e26;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

#table {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  display: block;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  touch-action: none;
}

#toast {
  position: fixed;
  z-index: 2;
  left: 50%;
  bottom: 56px;
  bottom: max(56px, env(safe-area-inset-bottom) + 44px);
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 36px);
  padding: 12px 18px;
  border-radius: 12px;
  background: #152e25;
  border: 1px solid #557467;
  text-align: center;
  pointer-events: none;
}

#overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 15, 12, 0.72);
}

#dialog {
  width: min(100%, 370px);
  padding: 23px;
  border: 1px solid #537b68;
  border-radius: 18px;
  background: #153f35;
}

#dialog h1 { margin: 0 0 14px; font-size: 21px; }
#dialog p { margin: 0 0 14px; color: #c4d6cb; line-height: 1.5; }

#dialog input {
  width: 100%;
  min-height: 45px;
  padding: 9px 12px;
  border: 1px solid #537b68;
  border-radius: 9px;
  background: #0a211c;
  color: inherit;
  font: inherit;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.dialog-actions button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #537b68;
  border-radius: 9px;
  background: #1c4b3e;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.dialog-actions button[type="submit"] {
  border-color: #f1d28e;
  background: #f1d28e;
  color: #172e26;
  font-weight: 700;
}
