:root {
  color-scheme: dark;
  font: 16px/1.5 system-ui, sans-serif;
  color: #f2f5fc;
  background: #0d1018;
  --muted: #a6aec3;
  --panel: #171c29;
  --border: #30384d;
  --accent: #a4b4ff;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); letter-spacing: -.045em; }
h2 { font-size: 1.13rem; }
p, small { color: var(--muted); }
button, input { font: inherit; }
button, a, input { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--accent); }
button {
  border: 1px solid transparent; border-radius: .6rem; padding: .6rem 1rem;
  min-height: 44px; background: var(--accent); color: #131a31; font-weight: 650;
  cursor: pointer;
}
button:disabled { opacity: .6; cursor: wait; }
.secondary { background: transparent; color: #eef1fb; border-color: var(--border); }
label { display: grid; gap: .35rem; font-weight: 550; }
input {
  width: 100%; min-height: 46px; padding: .65rem .75rem;
  background: #101522; border: 1px solid var(--border); border-radius: .55rem;
  color: inherit;
}
form { display: grid; gap: .95rem; }
form button { justify-self: start; }
.card {
  display: grid; gap: 1rem; background: var(--panel); border: 1px solid var(--border);
  border-radius: 1rem; padding: clamp(1rem, 4vw, 1.7rem); min-width: 0;
}
.auth {
  min-height: 100svh; display: grid; place-items: center; padding: 1rem;
  background: radial-gradient(ellipse at top, #202844, transparent 62%);
}
.auth .card { width: min(100%, 25rem); }
.auth button { justify-self: stretch; }
.brand { font-size: 1.2rem; font-weight: 750; letter-spacing: -.045em; color: #e0e6ff; }
.shell { display: grid; grid-template-columns: 14rem minmax(0, 1fr); min-height: 100svh; }
aside { display: flex; flex-direction: column; gap: 1.5rem; padding: 1.3rem; background: #111522; border-right: 1px solid var(--border); }
nav { display: grid; gap: .5rem; }
nav a {
  min-height: 44px; display: flex; align-items: center; border-radius: .55rem;
  padding: .5rem .75rem; background: #242e4a; color: #e6ebff; text-decoration: none;
}
#logout { margin-top: auto; }
.content { padding: clamp(1rem, 5vw, 3rem); display: grid; gap: 1.25rem; align-content: start; }
.settings { display: grid; gap: 1rem; max-width: 40rem; }
.message:empty, .error:empty { display: none; }
.error { color: #ffb6bf; }
.message { color: #a9edc7; }
.notice { color: #f2d69a; }
code { overflow-wrap: anywhere; font-size: 1rem; color: #eef1ff; user-select: all; }
.loading { padding: 1rem; }
@media (max-width: 640px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  aside { gap: .65rem; border-right: 0; border-bottom: 1px solid var(--border); padding: 1rem; }
  #logout { align-self: start; }
  .content { padding: 1rem; }
  .content form button { width: 100%; }
}

nav a { background: transparent; }
nav a[aria-current="page"] { background: #242e4a; }
.settings, .account-layout { margin-top: 1rem; }
.account-layout {
  display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
  gap: 1rem; align-items: start; max-width: 72rem;
}
select {
  width: 100%; min-height: 46px; padding: .65rem .75rem;
  font: inherit; color: inherit; background: #101522;
  border: 1px solid var(--border); border-radius: .55rem;
}
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.accounts { margin: 0; padding: 0; list-style: none; }
.accounts li {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
  justify-content: space-between; padding: .75rem 0; border-top: 1px solid var(--border);
}
.accounts li div { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 960px) {
  .account-layout { grid-template-columns: minmax(0, 1fr); }
}
