:root {
  color-scheme: light dark;
  --bg: #f5f6fa;
  --card: #fff;
  --text: #202137;
  --muted: #636579;
  --line: #e4e5ee;
  --accent: #6251d8;
  --accent-soft: #eeebff;
  --input: #fafafd;
  --danger: #b6324d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); }
main { max-width: 920px; margin: auto; padding: 36px 28px 24px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 18px; letter-spacing: -.4px; }
.brand b { font-weight: 450; color: var(--muted); }
.mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--accent); color: #fff; font-size: 26px; font-weight: 750; line-height: 1; }
.badge { margin-left: auto; border: 1px solid var(--line); padding: 4px 9px; border-radius: 6px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: 1.4px; }
.intro { margin: 50px 0 28px; text-align: center; }
h1 { margin: 0 0 10px; font-size: clamp(25px, 4vw, 34px); letter-spacing: -1.2px; line-height: 1.4; }
h2 { margin: 0; font-size: 19px; letter-spacing: -.5px; overflow-wrap: anywhere; }
p { margin: 0 0 18px; }
.muted, .hint, footer { color: var(--muted); }
.card { padding: 28px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; margin-bottom: 18px; box-shadow: 0 4px 20px #20213704; }
.auth-card { max-width: 440px; margin: 0 auto; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 6px; font-size: 20px; font-weight: 700; letter-spacing: -.5px; }
.muted { font-size: 13px; }
label { display: block; margin-top: 18px; font-size: 13px; font-weight: 600; }
input { display: block; width: 100%; min-height: 46px; margin-top: 7px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--input); color: var(--text); font: inherit; font-weight: 400; }
input::placeholder { color: var(--muted); opacity: .8; }
input:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.hint { margin: 8px 0 22px; font-size: 12px; }
button { min-height: 42px; border: 1px solid var(--line); border-radius: 9px; padding: 10px 16px; background: var(--card); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
button:hover { background: var(--accent-soft); }
button:disabled { opacity: .55; cursor: wait; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.primary:hover { filter: brightness(1.1); background: var(--accent); }
.danger { color: var(--danger); }
.actions { display: flex; gap: 10px; }
.actions button { flex: 1; }
#status { max-width: 600px; margin: 0 auto 18px; padding: 12px 16px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; text-align: center; overflow-wrap: anywhere; }
#status:empty { display: none; }
#status[data-state="error"] { color: var(--danger); border: 1px solid currentColor; background: var(--card); }
.account-heading, .section-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.account-heading button, .section-heading button, #devices button { flex-shrink: 0; }
.section-heading .muted { margin: 4px 0 0; }
.sync-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.sync-stats dt { color: var(--muted); font-size: 13px; }
.sync-stats dd { margin: 4px 0 0; font-size: clamp(22px, 4vw, 32px); font-weight: 650; overflow-wrap: anywhere; }
.sync-stats + p { margin: 0; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.settings-grid button { margin-top: 22px; }
.checkbox { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; }
.checkbox input { width: 17px; min-height: 17px; margin: 3px 0 0; accent-color: var(--accent); }
#devices { margin: 18px 0 0; padding: 0; list-style: none; }
#devices li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
#devices strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
#devices small { display: block; color: var(--muted); font-size: 12px; }
footer { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 28px; font-size: 11px; flex-wrap: wrap; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: #26866c; }
.divider { margin: 0 3px; }
@media (max-width: 600px) {
  main { padding: 22px 18px; }
  .intro { margin-top: 36px; }
  .card { padding: 22px; }
  .settings-grid { grid-template-columns: 1fr; gap: 0; }
  .account-heading, .section-heading { align-items: flex-start; flex-wrap: wrap; }
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14151c; --card: #1d1e29; --text: #eeedf7; --muted: #a8a7ba; --line: #343443; --accent: #8170ee; --accent-soft: #302a4c; --input: #191a24; --danger: #ff8da2; }
  .primary { color: #fff; }
  .dot { background: #6dcbaa; }
}
