:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #20242c;
  background: #f7f8fa;
  font-size: 15px;
  line-height: 1.5;
  font-synthesis: none;
  --muted: #626b78;
  --line: #e5e7eb;
  --accent: #245bd7;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.app-header { min-height: 64px; padding: 12px 32px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #fff; }
.brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; font-size: 14px; font-weight: 650; }
.brand span:last-child { font-weight: 400; color: var(--muted); }
.brand-divider { color: #c2c6cf; font-weight: 400; }
main { max-width: 760px; margin: 0 auto; padding: 40px 24px 24px; }
.page-title { margin-bottom: 28px; }
h1 { font-size: 28px; font-weight: 650; line-height: 1.25; letter-spacing: -.035em; margin: 0 0 8px; }
h2 { font-size: 16px; font-weight: 650; margin: 0; line-height: 1.4; }
h3 { font-size: 14px; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
p { color: var(--muted); margin: 0; }
button, input, select { font: inherit; }
button { min-height: 40px; padding: 8px 14px; border: 1px solid #d6dae1; border-radius: 6px; background: #fff; color: #303742; font-size: 13px; font-weight: 550; cursor: pointer; white-space: nowrap; }
button:hover { background: #f1f3f6; }
button.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
button.primary:hover { background: #1c4cbb; }
button.quiet { border-color: transparent; background: transparent; color: var(--muted); }
button.quiet:hover { background: #f1f3f6; color: #20242c; }
button.text-button { padding: 6px 0; min-height: 36px; color: var(--accent); border: 0; background: transparent; font-weight: 500; }
button.text-button:hover { text-decoration: underline; }
button:disabled { opacity: .45; cursor: default; }
button[aria-busy="true"] { opacity: .7; cursor: progress; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid #a9c4ff; outline-offset: 3px; }
.buttons { display: flex; gap: 4px; align-items: center; }
.device-panel, .settings { border: 1px solid var(--line); background: #fff; border-radius: 10px; }
.device-panel { padding: 24px; margin-bottom: 20px; }
.device-heading, .device-name, .section-heading { display: flex; align-items: center; gap: 12px; }
.device-heading, .section-heading { justify-content: space-between; }
.device-name { gap: 10px; min-width: 0; }
.device-name h2 { overflow-wrap: anywhere; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #adb4c0; flex-shrink: 0; }
.status-dot.connected { background: #20845b; }
#connect-prompt p { font-size: 14px; margin: 8px 0 20px 18px; }
#connect-prompt .primary { margin-left: 18px; }
.identity { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.id-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.id-row code { color: #414a58; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }
.id-row .quiet { min-height: 32px; padding: 4px 8px; }
.unlock { margin-top: 18px; }
label { display: block; font-size: 13px; font-weight: 550; margin-bottom: 7px; }
input:not([type="checkbox"]), select { display: block; width: 100%; min-height: 42px; border: 1px solid #cbd1da; border-radius: 6px; padding: 9px 11px; background: #fff; color: #20242c; }
input::placeholder { color: #89919e; font-size: 14px; letter-spacing: normal; }
.unlock-controls { display: flex; gap: 10px; max-width: 300px; }
#pin { min-width: 0; width: 170px; font-family: ui-monospace, Consolas, monospace; letter-spacing: .22em; }
.hint { font-size: 12px; line-height: 1.55; color: var(--muted); }
.unlock .hint { margin-top: 10px; }
.notice { padding: 12px 14px; margin-bottom: 20px; background: #edf3ff; color: #24477f; border-radius: 6px; font-size: 13px; overflow-wrap: anywhere; }
.notice.error { background: #fff0ee; color: #a33529; }
.setting-section { padding: 24px; }
.setting-section + .setting-section { border-top: 1px solid var(--line); }
.current-value { font-size: 14px; margin-top: 5px; overflow-wrap: anywhere; }
#wifi-status { margin-top: 2px; }
#adapter-field { margin-top: 18px; }
.networks { margin-top: 18px; max-height: 280px; overflow: auto; }
.networks > .hint { padding: 4px 0; }
.networks button { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 62px; text-align: left; white-space: normal; padding: 11px 12px; border-radius: 0; border: 0; border-bottom: 1px solid #edf0f3; font-weight: 500; }
.networks button:first-child { border-top: 1px solid #edf0f3; }
.networks button.selected { background: #f0f5ff; color: #204da8; }
.network-name { display: block; overflow-wrap: anywhere; }
.networks small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; margin-top: 2px; }
.network-signal { flex-shrink: 0; color: #747e8c; font-size: 11px; font-weight: 400; }
#other-network { margin-top: 10px; }
.wifi-form { background: #f7f8fa; border-radius: 6px; padding: 18px; margin-top: 14px; }
.wifi-form .section-heading { margin: -4px -6px 12px 0; }
.wifi-form .section-heading button { min-height: 32px; }
.wifi-form label { margin-top: 14px; }
.password-field { display: flex; align-items: center; background: white; border: 1px solid #cbd1da; border-radius: 6px; }
.password-field input { min-width: 0; border: 0; }
.password-field button { min-height: 36px; margin-right: 3px; }
.wifi-form .hint { margin-top: 6px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.check input { accent-color: var(--accent); }
#wifi-connect { margin-top: 18px; }
#wifi-result:not(:empty) { margin-top: 14px; }
.coordinate-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
details { margin-top: 16px; }
summary { width: fit-content; cursor: pointer; color: var(--accent); font-size: 13px; padding: 3px 0; }
details[open] summary { margin-bottom: 14px; }
#gps-save { margin-top: 16px; }
#live-gps { display: block; margin-top: 8px; }
dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 16px; font-size: 13px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
#wifi-details:not(:empty) { margin-top: 12px; }
#last-refresh { margin-top: 14px; }
footer { text-align: center; padding: 4px 16px 16px; color: #737d8b; font-size: 12px; }
@media (max-width: 520px) {
  .app-header { min-height: 56px; padding: 10px 18px; }
  .brand { gap: 10px; }
  .brand span:last-child, .brand-divider { display: none; }
  main { padding: 28px 16px 16px; }
  h1 { font-size: 26px; }
  .page-title { margin-bottom: 24px; }
  .page-title p { max-width: 285px; font-size: 14px; }
  .device-panel, .setting-section { padding: 20px; }
  .device-heading { align-items: center; flex-wrap: wrap; gap: 8px; }
  .device-heading .buttons { margin-left: 10px; }
  #connect-prompt p, #connect-prompt .primary { margin-left: 0; }
  .id-row code { font-size: 11px; }
  .identity { margin-top: 14px; }
  .wifi-form { padding: 16px; }
  .coordinate-fields { gap: 10px; }
  .network-signal { font-size: 10px; }
}
@media (prefers-reduced-motion: no-preference) { button { transition: background-color .12s, border-color .12s; } }
