:root {
  --bg: #f4f5f7; --card: #fff; --text: #1c2330; --muted: #677085; --line: #e3e6ec;
  --accent: #1f6feb; --ok: #1a7f37; --warn: #b26a00; --err: #c62828;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11151c; --card: #1a202a; --text: #e6e9ef; --muted: #8b93a5; --line: #2a313d; --accent: #4c8dff; --ok: #3fb950; --warn: #d29922; --err: #f85149; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
main { max-width: 460px; margin: 6vh auto; padding: 0 max(16px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(16px, env(safe-area-inset-left)); }
h1 { font-size: 18px; font-weight: 600; margin: 0 0 16px; display: flex; justify-content: space-between; align-items: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 14px; }
.row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; }
.label { color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; background: var(--muted); }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.err { background: var(--err); }
.ip { font: 600 30px/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .5px; margin: 6px 0 2px; }
.ip.none { color: var(--muted); font-size: 20px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
button { font: inherit; padding: 11px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
button.primary { grid-column: 1 / -1; background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button:disabled { opacity: .5; cursor: default; }
button.link { border: 0; background: none; color: var(--muted); padding: 0; font-size: 13px; }
.msg { min-height: 1.5em; color: var(--muted); font-size: 14px; margin-top: 12px; }
.msg.err { color: var(--err); }
button.full { width: 100%; }
.actions .span { grid-column: 1 / -1; }
.keys { list-style: none; margin: 8px 0 0; padding: 0; }
.keys li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.keys li:first-child { border-top: 0; }
input[type=password], input[type=text] { width: 100%; font: inherit; padding: 11px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); margin-bottom: 12px; }
small { color: var(--muted); }
h1 .tools { display: flex; gap: 14px; align-items: center; }
h1 form { margin: 0; }
.hint { display: flex; gap: 12px; justify-content: space-between; align-items: center; font-size: 14px; }
a.button { display: block; text-align: center; text-decoration: none; padding: 11px 12px; border-radius: 8px; }
a.button.primary { background: var(--accent); color: #fff; font-weight: 600; }
/* Installed app (standalone): no browser chrome, respect the notch, no rubber-band/tap flash. */
@media (display-mode: standalone) {
  main { margin-top: max(16px, env(safe-area-inset-top)); }
  body { overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
  button { -webkit-user-select: none; user-select: none; }
}
