html {
  -webkit-text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #0b0b10;
  --panel: #151722;
  --panel2: #10121a;
  --text: #f2f4f8;
  --muted: #9aa0b4;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #78a6ff;
  --danger: #ff6b6b;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(800px 500px at 15% 0%, #17213f 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.app-shell,
.login-shell {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.panel {
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, .28);
  margin-bottom: 14px;
}

.header-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: .2px;
}

p {
  margin: 4px 0 0;
  color: var(--muted);
}

.ghost-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

.status-panel {
  display: grid;
  gap: 9px;
}

.status-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.status-line strong {
  color: var(--text);
  text-align: right;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 14px;
}

.field span {
  display: flex;
  justify-content: space-between;
}

input,
select,
button {
  font: inherit;
}

input[type="color"] {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 3px;
  background: #07080c;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

input[type="text"],
input[type="password"],
input[name="username"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0f1119;
  color: var(--text);
  padding: 13px 14px;
  outline: none;
}

select,
button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #171a26;
  color: var(--text);
  padding: 13px 14px;
  min-height: 47px;
}

button {
  cursor: pointer;
}

button:active {
  transform: translateY(1px);
}

button.danger {
  color: var(--danger);
}

.preset-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.preset-row button {
  width: auto;
}

.presets {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.preset {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 8px;
}

.muted,
.tiny {
  color: var(--muted);
  font-size: 13px;
}

code {
  color: var(--text);
  word-break: break-all;
}

.error {
  border: 1px solid rgba(255, 107, 107, .3);
  background: rgba(255, 107, 107, .12);
  color: #ffd6d6;
  border-radius: 14px;
  padding: 10px 12px;
  margin: 12px 0;
}

.login-panel {
  width: 100%;
  max-width: 420px;
}

@media (max-width: 560px) {
  .grid.two {
    grid-template-columns: 1fr;
  }

  .header-panel {
    align-items: flex-start;
  }
}

.wifi-icon {
  display: inline-grid;
  grid-template-columns: repeat(4, 4px);
  align-items: end;
  gap: 2px;
  height: 13px;
  vertical-align: -1px;
}

.wifi-icon i {
  display: block;
  width: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.wifi-icon i:nth-child(1) {
  height: 4px;
}

.wifi-icon i:nth-child(2) {
  height: 7px;
}

.wifi-icon i:nth-child(3) {
  height: 10px;
}

.wifi-icon i:nth-child(4) {
  height: 13px;
}

.wifi-icon.wifi-1 i:nth-child(-n+1),
.wifi-icon.wifi-2 i:nth-child(-n+2),
.wifi-icon.wifi-3 i:nth-child(-n+3),
.wifi-icon.wifi-4 i:nth-child(-n+4) {
  background: var(--text);
}

.wifi-icon.wifi-0 i {
  background: rgba(255, 255, 255, 0.18);
}
