:root {
  color-scheme: dark;
  --bg: #071422;
  --panel: rgba(9, 22, 38, .58);
  --line: rgba(255, 255, 255, .16);
  --text: #edf3fa;
  --muted: #c3d1e3;
  --accent: #97d9ff;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, sans-serif;
  overflow-x: hidden;
}
/* Only the two background layers are fixed. All page content scrolls normally. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: #071422 url('/background.webp') center center / cover no-repeat;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(2, 9, 19, .22), rgba(2, 9, 19, .10) 55%, rgba(2, 9, 19, .28));
}
header {
  border-bottom: 1px solid var(--line);
  padding: 20px max(24px, calc((100vw - 1240px) / 2));
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(5, 16, 30, .48);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
header > div { display: flex; gap: 14px; align-items: center; }
.brand {
  background: rgba(0, 128, 215, .36);
  border: 1px solid rgba(151, 217, 255, .55);
  color: var(--text);
  width: 32px;
  height: 32px;
  text-align: center;
  border-radius: 9px;
  font-weight: 800;
  padding: 2px;
}
main { max-width: 1288px; margin: 30px auto; padding: 0 24px; }
h1 { font-size: clamp(24px, 3vw, 34px); line-height: 1.2; letter-spacing: -1px; }
h2 { font-size: 20px; margin: 0 0 8px; }
h3 { font-size: 17px; }
p { margin: 8px 0 18px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { font-size: 11px; letter-spacing: 2px; color: var(--accent); }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  -webkit-backdrop-filter: blur(16px) saturate(115%);
  backdrop-filter: blur(16px) saturate(115%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .16), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.narrow { max-width: 520px; margin: 60px auto; }
.heading, .section-head, .actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.heading { margin: 35px 0; text-shadow: 0 2px 8px rgba(0, 0, 0, .55); }
.status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.status-grid article { display: flex; flex-direction: column; gap: 12px; }
.status-grid strong { font-size: 18px; overflow-wrap: anywhere; }
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.columns > .card { min-width: 0; }
button, input, textarea, select {
  font: inherit;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(0, 0, 0, .30);
  color: var(--text);
  padding: 10px 13px;
}
button { cursor: pointer; font-weight: 600; background: rgba(255, 255, 255, .10); }
button:hover { border-color: var(--accent); background: rgba(255, 255, 255, .16); }
button:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary { background: rgba(0, 128, 215, .40); color: var(--text); border-color: rgba(80, 181, 255, .70); }
.primary:hover { background: rgba(0, 128, 215, .58); }
label { display: flex; flex-direction: column; gap: 6px; margin: 13px 0; min-width: 0; }
input, select, textarea { width: 100%; min-width: 0; }
input::placeholder, textarea::placeholder { color: #afbdd0; opacity: 1; }
input[readonly] { color: var(--muted); }
select option { color: var(--text); background: #10263d; }
textarea { resize: vertical; min-height: 80px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.inline { flex-direction: row; align-items: center; gap: 10px; }
.item { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 6px 18px; border-top: 1px solid var(--line); padding: 14px 0; }
.item .message { grid-column: 1 / -1; }
.item .actions { grid-column: 1 / -1; justify-content: flex-end; }
.separated { margin-top: 34px; border-top: 1px solid var(--line); padding-top: 20px; }
.error { color: #ffd0d0; }
.warning { color: #ffe0a8; }
#notice:not(:empty) {
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 18px;
  white-space: pre-wrap;
  background: rgba(5, 16, 30, .72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
#qr { display: block; margin: 20px auto; background: white; max-width: 100%; height: auto; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
#logs { list-style: none; padding: 0; max-height: 300px; overflow: auto; font-size: 13px; }
#logs li { border-bottom: 1px solid var(--line); padding: 9px 0; }
footer { text-align: center; padding: 30px; color: var(--muted); font-size: 12px; text-shadow: 0 2px 6px rgba(0, 0, 0, .7); }
[hidden] { display: none !important; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card { background: rgba(9, 22, 38, .88); }
}
@media (max-width: 850px) {
  .status-grid { grid-template-columns: 1fr 1fr; }
  .columns { grid-template-columns: 1fr; }
  .item { grid-template-columns: 1fr 1fr; }
  .item > label:nth-child(3) { grid-column: 1 / -1; }
  .card { padding: 18px; }
  header { padding: 16px 24px; }
}
@media (max-width: 450px) {
  .status-grid { grid-template-columns: 1fr; }
  .item { grid-template-columns: 1fr; }
  .item > label { grid-column: 1 / -1; }
}
