/* ============================================================================
   trade.ai — /settings/api-keys
   Presentation layer only. No backend contract lives here.
   Palette lives in :root — change 4 variables to reskin the whole page.
   ========================================================================== */

/* ------------------------------------------------------------------ fonts -- */
@font-face {
  font-family: "InterVar";
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/inter:vf@latest/latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetMono";
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/jetbrains-mono@latest/latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetMono";
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/jetbrains-mono@latest/latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --bg: #05070a;
  --ink: #eef4f8;
  --ink-dim: #a7b6c2;
  --mute: #7d8c98;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);

  --accent: 120, 180, 255;      /* blue  */
  --mint: 92, 232, 168;
  --amber: 255, 194, 102;
  --red: 255, 107, 107;

  --glass: rgba(255, 255, 255, 0.05);
  --glass-2: rgba(255, 255, 255, 0.035);
  --radius: 22px;
  --radius-sm: 14px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sans: "InterVar", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetMono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  font-variation-settings: "wght" 400;
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 44px 20px;
  overflow-x: hidden;
  position: relative;
}

/* ============================================================ 1. AURORA ==== */
.aurora {
  position: fixed;
  inset: -18vmax;
  z-index: 0;
  pointer-events: none;
  filter: blur(90px) saturate(135%);
  /* parallax offset written by JS */
  transform: translate3d(calc(var(--px, 0) * 1px), calc(var(--py, 0) * 1px), 0);
  transition: transform 260ms linear;
  opacity: 0.85;
}
.orb {
  position: absolute;
  border-radius: 47% 53% 58% 42% / 52% 45% 55% 48%;
  mix-blend-mode: screen;
  will-change: transform, border-radius;
  animation: morph 64s var(--ease) infinite alternate, hue 48s linear infinite;
}
.orb.o1 {
  width: 62vmax; height: 62vmax;
  top: -14vmax; left: -10vmax;
  background: conic-gradient(from 20deg, #0d3b6b, #1f7fb8, #0a4f5c, #0d3b6b);
  animation-duration: 72s, 54s;
  opacity: 0.75;
}
.orb.o2 {
  width: 54vmax; height: 54vmax;
  bottom: -18vmax; right: -8vmax;
  background: conic-gradient(from 140deg, #123a2c, #2f9c74, #0b3f4a, #123a2c);
  animation-duration: 88s, 61s;
  animation-delay: -12s, -8s;
  opacity: 0.62;
}
.orb.o3 {
  width: 40vmax; height: 40vmax;
  top: 32%; left: 44%;
  background: conic-gradient(from 260deg, #2b2350, #5a49a8, #173a4a, #2b2350);
  animation-duration: 79s, 43s;
  animation-delay: -24s, -16s;
  opacity: 0.5;
}
.orb.o4 {
  width: 30vmax; height: 30vmax;
  top: 6%; right: 18%;
  background: conic-gradient(from 320deg, #123b52, #3f7f9c, #12332e, #123b52);
  animation-duration: 96s, 68s;
  animation-delay: -40s, -22s;
  opacity: 0.45;
}
@keyframes morph {
  0%   { border-radius: 47% 53% 58% 42% / 52% 45% 55% 48%; transform: translate3d(0,0,0) scale(1) rotate(0deg); }
  50%  { border-radius: 62% 38% 41% 59% / 43% 61% 39% 57%; transform: translate3d(3vmax,-2vmax,0) scale(1.08) rotate(28deg); }
  100% { border-radius: 38% 62% 66% 34% / 60% 38% 62% 40%; transform: translate3d(-2vmax,3vmax,0) scale(0.96) rotate(-18deg); }
}
@keyframes hue { to { filter: hue-rotate(28deg); } }

/* grain overlay (SVG turbulence, inline data URI — no extra request) */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 6s steps(6) infinite;
}
@keyframes grainShift {
  0%, 100% { transform: translate3d(0,0,0); }
  20% { transform: translate3d(-2%,1%,0); }
  40% { transform: translate3d(1%,-2%,0); }
  60% { transform: translate3d(-1%,-1%,0); }
  80% { transform: translate3d(2%,2%,0); }
}

/* ======================================================== 2. CHROME GLASS == */
.shell { position: relative; z-index: 2; width: 100%; max-width: 560px; margin-block: auto; }

::selection { background: rgba(var(--accent), .28); color: #ffffff; }

.glass {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.028));
  backdrop-filter: blur(34px) saturate(140%);
  -webkit-backdrop-filter: blur(34px) saturate(140%);
  border-radius: var(--radius);
  box-shadow:
    0 1px 0 rgba(255,255,255,.08) inset,
    0 30px 80px -40px rgba(0,0,0,.85),
    0 2px 10px rgba(0,0,0,.4);
}
/* chrome edge: gradient border via masked pseudo element */
.glass::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg,
    rgba(255,255,255,.42) 0%,
    rgba(255,255,255,.08) 26%,
    rgba(255,255,255,.02) 52%,
    rgba(255,255,255,.1) 78%,
    rgba(255,255,255,.3) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}
/* top specular line */
.glass::after {
  content: "";
  position: absolute; top: 0; left: 12%; right: 12%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  opacity: .8;
  pointer-events: none;
}

.panel { padding: 28px 26px 26px; }

/* ====================================================== 3. CHOREOGRAPHY === */
.panel {
  opacity: 0;
  transform: translateY(40px) scale(.985);
  filter: blur(12px);
  transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease);
}
.panel.settled { opacity: 1; transform: none; filter: blur(0); }

.stage { display: none; }
.stage.active { display: block; }

.stagger {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.panel.settled .stagger { opacity: 1; transform: none; }

/* ========================================================== 4. BUTTONS ==== */
.pill {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06);
  color: var(--ink);
  font-family: var(--sans); font-weight: 500; font-size: 13px;
  letter-spacing: .02em;
  padding: 12px 22px;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform .22s var(--ease), border-color .22s, background .22s,
              box-shadow .28s, color .22s;
  -webkit-tap-highlight-color: transparent;
}
.pill::after { /* sheen */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,.18), transparent 60%);
  opacity: 0; transition: opacity .3s;
}
.pill:hover:not(:disabled) {
  transform: scale(1.04);
  border-color: rgba(255,255,255,.3);
  box-shadow: 0 0 24px rgba(var(--accent), .25), 0 8px 26px -14px rgba(0,0,0,.9);
}
.pill:hover:not(:disabled)::after { opacity: 1; }
.pill:active:not(:disabled) { transform: scale(.98); background: rgba(255,255,255,.12); }
.pill:focus-visible {
  outline: 2px solid rgba(var(--accent), .9);
  outline-offset: 3px;
}
.pill:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.pill.primary {
  background: linear-gradient(180deg, rgba(var(--accent), .95), rgba(74, 138, 224, .92));
  border-color: rgba(var(--accent), .55);
  color: #05121f;
  font-weight: 600;
  box-shadow: 0 10px 30px -14px rgba(var(--accent), .75), 0 0 0 1px rgba(255,255,255,.06) inset;
}
.pill.primary:hover:not(:disabled) {
  box-shadow: 0 16px 40px -14px rgba(var(--accent), .85), 0 0 26px rgba(var(--accent), .35);
}
.pill.primary::after { background: radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,.42), transparent 62%); }
.pill.ghost { background: transparent; border-color: rgba(255,255,255,.12); color: var(--ink-dim); }
.pill.danger { color: rgb(var(--red)); border-color: rgba(var(--red), .3); }
.pill.danger:hover:not(:disabled) {
  box-shadow: 0 0 22px rgba(var(--red), .22);
  border-color: rgba(var(--red), .5);
}
.pill.glowpulse { animation: glowOnce 1.4s var(--ease) 1; }
@keyframes glowOnce {
  0% { box-shadow: 0 0 0 0 rgba(var(--accent), 0); }
  35% { box-shadow: 0 0 34px 6px rgba(var(--accent), .45); }
  100% { box-shadow: 0 10px 30px -14px rgba(var(--accent), .75); }
}

/* button states */
.btn-label { display: inline-flex; align-items: center; gap: 8px; }
.spin-svg { width: 14px; height: 14px; animation: spin .9s linear infinite; display: none; }
.pill.loading .spin-svg { display: inline-block; }
.pill.loading { animation: breathe 1.2s ease-in-out infinite; pointer-events: none; }
@keyframes breathe { 0%,100% { box-shadow: 0 0 0 0 rgba(var(--accent), .15); } 50% { box-shadow: 0 0 22px 2px rgba(var(--accent), .3); } }
@keyframes spin { to { transform: rotate(360deg); } }

.check-svg { width: 14px; height: 14px; display: none; }
.check-svg path {
  stroke-dasharray: 24; stroke-dashoffset: 24;
  animation: draw .45s var(--ease) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.pill.success {
  background: linear-gradient(180deg, rgba(var(--mint), .95), rgba(38, 178, 124, .95));
  border-color: rgba(var(--mint), .6); color: #04170f;
  box-shadow: 0 0 28px rgba(var(--mint), .35);
}
.pill.success .check-svg { display: inline-block; }
.pill.error { border-color: rgba(var(--red), .7); color: rgb(var(--red)); animation: shake .42s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.pill.flash-error { animation: flashRed 1.6s ease; }
@keyframes flashRed {
  0% { box-shadow: inset 0 0 0 999px rgba(var(--red), .22); }
  100% { box-shadow: inset 0 0 0 999px rgba(var(--red), 0); }
}

/* ============================================================ 5. FIELDS === */
.brandline {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 22px;
}
.brand {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  color: rgba(var(--accent), .95);
}
.brand span { color: var(--mute); }
.backlink {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  color: var(--mute); text-decoration: none;
  padding: 6px 12px; border-radius: 999px; border: 1px solid transparent;
  transition: color .2s, border-color .2s, transform .2s var(--ease), background .2s;
}
.backlink:hover {
  color: var(--ink); border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.05); transform: translateX(-2px);
}
.backlink:focus-visible { outline: 2px solid rgba(var(--accent), .9); outline-offset: 2px; }

h1 {
  font-size: 28px; line-height: 1.15; font-weight: 600;
  letter-spacing: -.02em; margin: 0 0 8px;
  background: linear-gradient(180deg, #ffffff, #b9c9d6);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sub { color: var(--mute); font-size: 13.5px; margin: 0 0 24px; max-width: 46ch; }

.field { margin-bottom: 16px; }
.field > label, .fieldlabel {
  display: block;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim);
  margin-bottom: 9px;
}
.inputwrap {
  position: relative; display: flex; align-items: center;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-sm);
  transition: border-color .2s, box-shadow .2s, background .2s, transform .2s var(--ease);
}
.inputwrap:hover { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.045); }
.inputwrap:focus-within {
  border-color: rgba(var(--accent), .6);
  box-shadow: 0 0 0 4px rgba(var(--accent), .15);
  background: rgba(255,255,255,.05);
}
.inputwrap.invalid {
  border-color: rgba(var(--red), .65);
  box-shadow: 0 0 0 4px rgba(var(--red), .12);
  animation: shake .42s ease;
}
.inputwrap .ico {
  width: 42px; height: 42px; display: grid; place-items: center;
  color: var(--mute); flex: 0 0 auto;
  transition: color .2s, transform .2s var(--ease);
}
.inputwrap:focus-within .ico { color: rgba(var(--accent), 1); transform: scale(1.08); }
.inputwrap .ico svg { width: 15px; height: 15px; }

input[type=text], input[type=password] {
  flex: 1 1 auto; min-width: 0;
  background: transparent; border: 0; outline: 0;
  padding: 13px 4px 13px 0;
  color: var(--ink); font-family: var(--mono); font-size: 13px; letter-spacing: .03em;
}
input::placeholder { color: #55636e; font-style: italic; font-family: var(--sans); letter-spacing: 0; }
input:autofill { -webkit-text-fill-color: var(--ink); }

.peek {
  width: 38px; height: 38px; margin-right: 6px; flex: 0 0 auto;
  border: 0; border-radius: 50%; background: transparent;
  color: var(--mute); cursor: pointer; display: grid; place-items: center;
  transition: color .2s, background .2s, transform .2s var(--ease);
}
.peek:hover { color: rgba(var(--accent), 1); background: rgba(255,255,255,.07); transform: scale(1.1); }
.peek:active { transform: scale(.94); }
.peek:focus-visible { outline: 2px solid rgba(var(--accent), .9); outline-offset: 2px; }
.peek svg { width: 16px; height: 16px; }
.peek .eye-off { display: none; }
.peek.revealed .eye-on { display: none; }
.peek.revealed .eye-off { display: block; }

.hint {
  font-size: 12px; color: var(--mute); margin-top: 7px;
  opacity: 0; max-height: 0; overflow: hidden;
  transition: opacity .25s, max-height .25s;
}
.field:focus-within .hint, .field.show-hint .hint { opacity: 1; max-height: 40px; }
.hint.bad { color: rgb(var(--red)); }

/* ============================================================ 6. SWITCH === */
.envrow { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.envmeta { display: flex; flex-direction: column; gap: 3px; }
.envmeta .cap { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); }
.envmeta .desc { font-size: 12px; color: var(--mute); }

.switch {
  position: relative; display: inline-flex; align-items: center;
  width: 132px; height: 40px; padding: 4px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px; cursor: pointer;
  transition: border-color .3s, box-shadow .3s, background .3s;
  overflow: hidden;
}
.switch:hover { border-color: rgba(255,255,255,.24); }
.switch:focus-visible { outline: 2px solid rgba(var(--accent), .9); outline-offset: 3px; }
.knob {
  position: absolute; top: 4px; left: 4px;
  width: 62px; height: 30px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(var(--accent), .95), rgba(64,124,204,.95));
  box-shadow: 0 6px 18px -8px rgba(var(--accent), .9);
  transition: transform .42s var(--ease), background .35s, box-shadow .35s;
}
.switch[data-env="live"] .knob {
  transform: translateX(62px);
  background: linear-gradient(180deg, rgba(var(--amber), .95), rgba(214,124,32,.95));
  box-shadow: 0 6px 22px -8px rgba(var(--amber), .85);
  animation: livePulse 2.4s ease-in-out infinite;
}
@keyframes livePulse {
  0%,100% { box-shadow: 0 6px 22px -8px rgba(var(--amber), .8); }
  50% { box-shadow: 0 6px 30px -6px rgba(var(--amber), 1), 0 0 0 4px rgba(var(--amber), .1); }
}
.switch .opt {
  position: relative; z-index: 2; flex: 1 1 0; text-align: center;
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--mute);
  transition: color .3s; user-select: none;
}
.switch[data-env="testnet"] .opt.testnet,
.switch[data-env="live"] .opt.live { color: #05121f; }
.switch[data-env="live"] .opt.live { color: #241503; }

.confirm {
  overflow: hidden; max-height: 0; opacity: 0;
  transition: max-height .46s var(--ease), opacity .32s, margin .32s;
  margin-bottom: 0;
}
.confirm.open { max-height: 130px; opacity: 1; margin-bottom: 16px; }

/* ====================================================== 7. SAVED CARD ===== */
.saved {
  display: none;
  margin-bottom: 20px;
  padding: 15px 16px 15px 18px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.1);
  border-left: 3px solid rgba(var(--accent), .9);
  background: rgba(255,255,255,.045);
  backdrop-filter: blur(20px);
  transform: translateX(24px); opacity: 0;
  transition: transform .5s var(--ease), opacity .5s;
}
.saved.show { display: block; }
.saved.in { transform: none; opacity: 1; }
.saved .row1 { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.saved .cap { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.badge {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em;
  padding: 4px 10px; border-radius: 999px; border: 1px solid transparent;
}
.badge.testnet { color: rgb(var(--accent)); border-color: rgba(var(--accent), .4); background: rgba(var(--accent), .1); }
.badge.live { color: rgb(var(--amber)); border-color: rgba(var(--amber), .45); background: rgba(var(--amber), .1); }
.saved .keyval {
  font-family: var(--mono); font-size: 13px; color: var(--ink);
  letter-spacing: .04em; margin-bottom: 12px; word-break: break-all;
}
.saved .acts { display: flex; gap: 8px; }
.saved .mini {
  border-radius: 999px; padding: 7px 14px; font-size: 11.5px; font-weight: 500;
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06);
  color: var(--ink-dim); cursor: pointer; transition: all .2s var(--ease);
}
.saved .mini:hover { transform: scale(1.05); color: var(--ink); border-color: rgba(255,255,255,.3); }
.saved .mini:focus-visible { outline: 2px solid rgba(var(--accent), .9); outline-offset: 2px; }

/* meta table */
.meta { margin-top: 20px; display: grid; gap: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--mute); }
.meta div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed rgba(255,255,255,.06); padding-bottom: 7px; }
.meta b { color: var(--ink-dim); font-weight: 500; }
.meta b.on { color: rgb(var(--mint)); }

.fineprint { margin-top: 18px; font-size: 11.5px; line-height: 1.65; color: #5d6b76; }
.fineprint code { font-family: var(--mono); color: rgba(var(--accent), 1); font-size: 11px; }

/* ============================================================ 8. TOAST ==== */
.toasts {
  position: fixed; top: 20px; right: 20px; z-index: 50;
  display: flex; flex-direction: column; gap: 10px; width: min(320px, calc(100vw - 40px));
  pointer-events: none;
}
/* keep toasts clear of the centred panel on narrower viewports */
@media (max-width: 1120px) {
  .toasts {
    top: auto; bottom: 20px; right: 20px;
    width: min(420px, calc(100vw - 40px));
  }
  .toast { transform: translateY(16px); }
  .toast.in { transform: none; }
  .toast.out { transform: translateY(16px); }
}
.toast {
  position: relative; overflow: hidden;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 16px;
  background: rgba(14, 20, 26, .72);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 18px 50px -24px rgba(0,0,0,.95);
  transform: translateX(28px); opacity: 0;
  transition: transform .42s var(--ease), opacity .42s;
  pointer-events: auto;
}
.toast.in { transform: none; opacity: 1; }
.toast.out { transform: translateX(28px); opacity: 0; }
.toast .ic { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.toast .body { flex: 1 1 auto; font-size: 13px; line-height: 1.45; color: var(--ink); }
.toast .body small { display: block; color: var(--mute); font-size: 11.5px; margin-top: 2px; }
.toast.success { border-color: rgba(var(--mint), .38); }
.toast.success .ic { color: rgb(var(--mint)); }
.toast.error { border-color: rgba(var(--red), .4); }
.toast.error .ic { color: rgb(var(--red)); }
.toast.info { border-color: rgba(var(--accent), .4); }
.toast.info .ic { color: rgb(var(--accent)); }
.toast .bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; transform-origin: left; }
.toast.success .bar { background: rgb(var(--mint)); }
.toast.error .bar { background: rgb(var(--red)); }
.toast.info .bar { background: rgb(var(--accent)); }
.toast .bar.run { animation: drain 3.5s linear forwards; }
@keyframes drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* =========================================================== 10. LOGIN ==== */
.login .orb { animation-duration: 52s, 40s; opacity: .9; }
.logincard { text-align: left; }
.loginbtn { width: 100%; padding: 15px 22px; font-size: 14px; }
.pwring { position: relative; }
.pwring::after {
  content: ""; position: absolute; inset: -6px; border-radius: 20px;
  border: 1px solid rgba(var(--accent), .0);
  transition: inset .3s var(--ease), border-color .3s;
  pointer-events: none;
}
.pwring:focus-within::after { inset: -8px; border-color: rgba(var(--accent), .28); }

/* ============================================== 11. A11Y / REDUCED MOTION */
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
:focus-visible { outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .aurora { animation: none; filter: blur(90px); transform: none; }
  .orb { animation: none; }
  .grain { animation: none; }
  .panel, .stagger { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
  .pill, .peek, .switch, .knob, .saved, .toast, .confirm { animation: none !important; transition-duration: .01ms !important; }
  .pill.loading { animation: none; }
  .toast .bar.run { animation: none; }
}

@media (max-width: 520px) {
  body { padding: 22px 14px; }
  .panel { padding: 22px 18px; }
  h1 { font-size: 24px; }
  .envrow { flex-direction: column; align-items: flex-start; }
  .actions { flex-direction: column; }
  .pill { width: 100%; }
}