:root {
  --ink: #1d2025;
  --ink-soft: #687079;
  --muted: #8b9299;
  --line: rgba(37, 45, 53, 0.1);
  --line-strong: rgba(37, 45, 53, 0.16);
  --paper: #e8edf2;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-solid: rgba(255, 255, 255, 0.88);
  --input: rgba(244, 247, 249, 0.82);
  --blue: #3978d7;
  --blue-soft: rgba(57, 120, 215, 0.11);
  --green: #35a879;
  --red: #c84e55;
  --display: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SF Mono", "Cascadia Code", Consolas, monospace;
  --radius: 22px;
}

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

body {
  color: var(--ink);
  background: var(--paper);
  font-family: var(--body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }

.aero-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(650px 450px at 13% -5%, rgba(255, 255, 255, 0.98), transparent 70%),
    radial-gradient(540px 430px at 96% 15%, rgba(164, 211, 255, 0.52), transparent 70%),
    radial-gradient(600px 480px at 56% 110%, rgba(198, 227, 216, 0.62), transparent 70%),
    linear-gradient(135deg, #eef2f5 0%, #e1e8ed 52%, #edf1f3 100%);
}

.aero-bg::before,
.aero-bg::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
}

.aero-bg::before {
  width: 320px;
  height: 320px;
  left: -120px;
  bottom: 16%;
  background: rgba(183, 219, 255, 0.33);
}

.aero-bg::after {
  width: 420px;
  height: 420px;
  right: -190px;
  bottom: -180px;
  background: rgba(195, 234, 212, 0.36);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1060px, calc(100% - 42px));
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 27px 0 35px;
  animation: appear 0.55s ease both;
}

@keyframes appear { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }

.appbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 54px;
  padding: 0 17px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.44);
  box-shadow: 0 8px 25px rgba(72, 91, 106, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(25px) saturate(130%);
  -webkit-backdrop-filter: blur(25px) saturate(130%);
}

.window-controls { display: flex; gap: 7px; }
.window-controls i { width: 10px; height: 10px; border-radius: 50%; background: #d0d5d9; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.07); }
.window-controls i:first-child { background: #ff6058; }
.window-controls i:nth-child(2) { background: #ffbd2e; }
.window-controls i:nth-child(3) { background: #28c840; }

.appbar__title {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #3b424a;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.appbar__icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(145deg, #6f9ee6, #356fc9);
  box-shadow: 0 4px 9px rgba(57, 120, 215, 0.24);
}

.appbar__icon svg { width: 17px; height: 17px; }
.appbar__meta { display: flex; justify-content: flex-end; align-items: center; gap: 7px; color: #899198; font-family: var(--mono); font-size: 0.57rem; text-transform: uppercase; }
.appbar__meta b { padding-left: 8px; border-left: 1px solid var(--line); color: #a1a8ae; font-weight: 400; }
.online-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(53, 168, 121, 0.12); }

.banner-error { margin: 15px 0 0; padding: 11px 14px; border: 1px solid rgba(200, 78, 85, 0.25); border-radius: 11px; color: var(--red); background: rgba(255, 246, 246, 0.74); font-size: 0.85rem; font-weight: 600; }
.banner-error[hidden] { display: none; }

.decryptor-card,
.status {
  border: 1px solid rgba(255, 255, 255, 0.92);
  background: var(--glass);
  box-shadow: 0 24px 60px rgba(83, 100, 117, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(30px) saturate(125%);
  -webkit-backdrop-filter: blur(30px) saturate(125%);
}

.decryptor-card { margin-top: 21px; overflow: hidden; border-radius: var(--radius); }

.card-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 27px 31px 25px;
  border-bottom: 1px solid var(--line);
}

.card-header__icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 51px;
  height: 51px;
  border: 1px solid rgba(57, 120, 215, 0.2);
  border-radius: 15px;
  color: var(--blue);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(215, 231, 251, 0.7));
  box-shadow: 0 7px 18px rgba(57, 120, 215, 0.1), inset 0 1px 0 #fff;
}

.card-header__icon svg { width: 27px; height: 27px; }
.card-header__copy { min-width: 0; }
.card-kicker { margin: 0; color: #9aa2a9; font-family: var(--mono); font-size: 0.55rem; letter-spacing: 0.08em; text-transform: uppercase; }
.card-header h1 { margin: 4px 0 3px; color: var(--ink); font-family: var(--display); font-size: clamp(1.35rem, 2.5vw, 1.75rem); font-weight: 800; letter-spacing: -0.055em; line-height: 1.08; }
.card-header__copy > p:last-child { margin: 0; color: var(--ink-soft); font-size: 0.82rem; }
.card-header__status { display: grid; grid-template-columns: auto 1fr; gap: 0 7px; align-items: center; margin-left: auto; padding: 9px 13px; border: 1px solid rgba(53, 168, 121, 0.2); border-radius: 11px; background: rgba(237, 251, 245, 0.63); }
.card-header__status span { grid-row: span 2; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(53, 168, 121, 0.11); }
.card-header__status strong { color: #318e6c; font-size: 0.72rem; font-weight: 700; line-height: 1.1; }
.card-header__status small { color: #8aa69a; font-size: 0.56rem; }

.card-body { display: grid; grid-template-columns: 0.9fr 1.28fr; min-width: 0; }
.settings { display: grid; align-content: start; gap: 21px; padding: 25px 27px 28px; border-right: 1px solid var(--line); background: rgba(247, 249, 250, 0.29); }
.setting-group { display: grid; gap: 9px; }
.setting-label { display: flex; justify-content: space-between; color: var(--ink-soft); font-size: 0.68rem; font-weight: 700; }
.setting-label small { color: #adb4ba; font-family: var(--mono); font-size: 0.53rem; font-weight: 400; }

.segment { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; }
.segment__opt { position: relative; display: block; cursor: pointer; }
.segment__opt input { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segment__opt span { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-soft); background: rgba(255, 255, 255, 0.38); font-size: 0.76rem; transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; }
.segment__opt:hover span { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.65); }
.segment__opt input:checked + span { border-color: rgba(57, 120, 215, 0.43); color: #2d65b4; background: rgba(223, 235, 253, 0.76); box-shadow: inset 3px 0 var(--blue), 0 3px 10px rgba(57, 120, 215, 0.07); }
.segment__opt input:focus-visible + span { outline: 2px solid rgba(57, 120, 215, 0.45); outline-offset: 2px; }
.key-type { grid-template-columns: repeat(3, 1fr); gap: 5px; }
.key-type .segment__opt span { padding: 10px 5px; font-size: 0.65rem; text-align: center; }
.credential-fields { display: grid; gap: 12px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field > label { color: var(--ink-soft); font-size: 0.66rem; font-weight: 700; }
.field.is-hidden, [data-hide-for].is-hidden { display: none; }

.input-shell { display: flex; align-items: center; min-width: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--input); box-shadow: inset 0 1px 2px rgba(36, 47, 56, 0.025); transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.input-shell:focus-within { border-color: rgba(57, 120, 215, 0.55); box-shadow: 0 0 0 3px rgba(57, 120, 215, 0.1); }
.input-shell > span { flex: 0 0 auto; padding-left: 11px; color: var(--blue); font-family: var(--mono); font-size: 0.65rem; }
input[type="text"], input[type="url"], textarea { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 0.78rem; }
input[type="text"], input[type="url"] { padding: 11px; }
textarea { min-height: 94px; padding: 11px; border: 1px solid var(--line-strong); border-radius: 10px; resize: vertical; background: var(--input); font-family: var(--mono); font-size: 0.68rem; }
textarea:focus { border-color: rgba(57, 120, 215, 0.55); box-shadow: 0 0 0 3px rgba(57, 120, 215, 0.1); outline: 0; }
input::placeholder, textarea::placeholder { color: #aeb5ba; }
.file-chip { width: fit-content; color: var(--blue) !important; cursor: pointer; font-size: 0.64rem !important; font-weight: 600 !important; }
.file-chip input { display: none; }

.drop { position: relative; display: grid; place-items: center; align-content: center; gap: 6px; overflow: hidden; border: 1px dashed rgba(57, 120, 215, 0.34); border-radius: 14px; color: var(--ink-soft); background: linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(232, 241, 250, 0.6)); text-align: center; transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease; }
.drop::before { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(57, 120, 215, 0.08); border-radius: 9px; pointer-events: none; }
.drop--zip { min-height: 218px; padding: 24px; }
.drop--dump { min-height: 105px; padding: 16px; }
.drop.is-drag { border-color: var(--blue); background: rgba(211, 229, 255, 0.92); transform: scale(1.01); }
.drop input[type="file"] { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop__icon { display: grid; place-items: center; width: 43px; height: 43px; margin-bottom: 3px; border: 1px solid rgba(57, 120, 215, 0.18); border-radius: 12px; color: var(--blue); background: rgba(255, 255, 255, 0.65); box-shadow: 0 5px 12px rgba(57, 120, 215, 0.08); }
.drop--dump .drop__icon { width: 32px; height: 32px; border-radius: 9px; }
.drop__icon svg { width: 24px; height: 24px; }
.drop--dump .drop__icon svg { width: 18px; height: 18px; }
.drop__title, .drop__hint, .drop__file { position: relative; z-index: 1; margin: 0; }
.drop__title { color: var(--ink); font-family: var(--display); font-size: 0.86rem; font-weight: 700; }
.drop__hint { color: var(--muted); font-size: 0.69rem; }
.drop__file { color: var(--blue); font-family: var(--mono); font-size: 0.6rem; font-weight: 700; word-break: break-all; }

.source-panel { display: grid; align-content: start; gap: 17px; min-width: 0; padding: 25px 29px 28px; }
.source-panel__heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.source-panel h2 { margin: 4px 0 0; color: var(--ink); font-family: var(--display); font-size: 1.08rem; font-weight: 800; letter-spacing: -0.045em; }
.zip-badge { padding: 5px 8px; border: 1px solid rgba(57, 120, 215, 0.2); border-radius: 6px; color: var(--blue); background: rgba(223, 235, 253, 0.58); font-family: var(--mono); font-size: 0.55rem; font-weight: 700; }
.field--fill { grid-template-rows: auto 1fr; }
.url-row { display: grid; grid-template-columns: 25px 1fr; align-items: center; gap: 3px; }
.url-row > span { color: #a7afb5; font-size: 0.65rem; text-align: center; }
.input-shell--url > span { font-size: 0.9rem; }
.source-panel__footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 3px; }
.privacy-note { display: flex; align-items: center; gap: 7px; color: #9ca5aa; font-size: 0.61rem; }
.privacy-note > span:first-child { display: grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; color: var(--green); background: rgba(53, 168, 121, 0.13); font-size: 0.63rem; font-weight: 700; }
.cta { display: inline-flex; align-items: center; justify-content: center; gap: 13px; min-width: 166px; min-height: 43px; padding: 10px 13px 10px 16px; border: 0; border-radius: 10px; color: #fff; background: linear-gradient(180deg, #4f8ce0, #326fc9); box-shadow: 0 8px 17px rgba(57, 120, 215, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.27); font-size: 0.76rem; font-weight: 700; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease; }
.cta__arrow { margin-left: auto; font-size: 1.08rem; line-height: 1; }
.cta:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 11px 21px rgba(57, 120, 215, 0.27), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.cta:active:not(:disabled) { transform: none; }
.cta:disabled { opacity: 0.62; cursor: wait; box-shadow: none; }

.server-card { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center; margin-top: 2px; padding: 9px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255, 255, 255, 0.51); }
.server-card.is-loading { opacity: 0.82; }
.server-card__media { position: relative; width: 52px; height: 52px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #e2e7eb; }
.server-card__logo { display: block; width: 100%; height: 100%; object-fit: cover; }
.server-card__logo[hidden], .server-card__fallback[hidden] { display: none !important; }
.server-card__fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--blue); background: linear-gradient(145deg, #e5f0ff, #cbdff7); font-family: var(--display); font-size: 0.85rem; font-weight: 800; }
.server-card__name, .server-card__meta, .server-card__hint { margin: 0; }
.server-card__name { color: var(--ink); font-family: var(--display); font-size: 0.76rem; font-weight: 700; }
.server-card__meta, .server-card__hint { color: var(--muted); font-size: 0.6rem; line-height: 1.35; }
.server-card__hint { margin-top: 3px; color: var(--green); }

.status { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; margin-top: 15px; padding: 19px 23px; border-radius: 17px; }
.status__main { min-width: 0; }
.status__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 9px; }
.status__phase { margin: 3px 0 0; color: var(--ink); font-family: var(--display); font-size: 0.88rem; font-weight: 700; }
.status__pct { margin: 0; color: var(--blue); font-family: var(--mono); font-size: 0.75rem; font-weight: 700; }
.bar { position: relative; height: 7px; overflow: hidden; border-radius: 999px; background: rgba(52, 68, 82, 0.1); }
.bar__fill { width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #77a9f2, #3978d7); transition: width 0.25s ease; }
.bar.is-active .bar__fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.65) 50%, transparent 70%); background-size: 200% 100%; animation: shine 1.2s linear infinite; }
.bar.is-indeterminate .bar__fill { width: 35% !important; animation: indeterminate 1.4s ease-in-out infinite; }
@keyframes shine { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes indeterminate { 0% { transform: translateX(-120%); } 100% { transform: translateX(320%); } }
.status__meta { min-height: 1.1em; margin: 7px 0 0; overflow: hidden; color: var(--muted); font-family: var(--mono); font-size: 0.57rem; text-overflow: ellipsis; white-space: nowrap; }
.status__error { margin: 7px 0 0; color: var(--red); font-size: 0.76rem; font-weight: 600; }
.status__error[hidden], .status__dl[hidden], .banner-error[hidden] { display: none !important; }
.status__dl { display: inline-flex; align-items: center; gap: 12px; padding: 11px 13px 11px 15px; border: 1px solid rgba(57, 120, 215, 0.28); border-radius: 9px; color: var(--blue); background: rgba(223, 235, 253, 0.62); font-size: 0.72rem; font-weight: 700; text-decoration: none; white-space: nowrap; transition: background 0.2s ease, color 0.2s ease; }
.status__dl span { font-size: 1rem; }
.status__dl:hover { color: #fff; background: var(--blue); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

@media (max-width: 820px) {
  .shell { width: min(680px, calc(100% - 28px)); }
  .card-body { grid-template-columns: 1fr; }
  .settings { border-right: 0; border-bottom: 1px solid var(--line); }
  .segment:not(.key-type) { grid-template-columns: repeat(3, 1fr); }
  .segment:not(.key-type) .segment__opt span { text-align: center; }
}

@media (max-width: 560px) {
  .shell { width: calc(100% - 18px); padding-top: 12px; }
  .appbar { grid-template-columns: 1fr auto; padding: 0 13px; }
  .window-controls { display: none; }
  .appbar__title { grid-column: 1; grid-row: 1; }
  .appbar__meta { grid-column: 2; grid-row: 1; font-size: 0.49rem; }
  .appbar__meta b { display: none; }
  .appbar__account .sub-chip { display: none; }
  .card-header { align-items: flex-start; flex-wrap: wrap; padding: 21px 19px; }
  .card-header__status { margin-left: 66px; }
  .card-header__copy > p:last-child { font-size: 0.75rem; }
  .settings, .source-panel { padding: 20px 17px 22px; }
  .segment:not(.key-type) { grid-template-columns: 1fr; }
  .segment:not(.key-type) .segment__opt span { text-align: left; }
  .key-type { gap: 4px; }
  .key-type .segment__opt span { padding: 9px 3px; font-size: 0.6rem; }
  .drop--zip { min-height: 190px; }
  .source-panel__footer { align-items: stretch; flex-direction: column; }
  .cta { width: 100%; }
  .status { grid-template-columns: 1fr; padding: 17px; }
  .status__dl { justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Auth + account */
.appbar__account { gap: 10px; text-transform: none; letter-spacing: 0; font-family: var(--body); font-size: 0.72rem; }
.appbar__avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.appbar__link { color: var(--blue); text-decoration: none; font-weight: 600; }
.appbar__link:hover { text-decoration: underline; }
.sub-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(57, 120, 215, 0.08);
  border: 1px solid rgba(57, 120, 215, 0.14);
  color: var(--ink);
  font-family: var(--body);
  font-size: 0.72rem;
  text-transform: none;
  letter-spacing: 0;
}
.sub-chip small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sub-chip strong { font-weight: 700; font-size: 0.78rem; }
.sub-chip.is-warn { background: rgba(183, 121, 31, 0.12); border-color: rgba(183, 121, 31, 0.22); color: #8a5a12; }
.sub-chip.is-expired { background: rgba(200, 78, 85, 0.1); border-color: rgba(200, 78, 85, 0.22); color: var(--red); }
#daysBadge.is-warn, #daysBadge.is-expired { color: inherit; }

.sub-banner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--glass-solid);
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow: 0 10px 24px rgba(45, 58, 72, 0.05);
}
.sub-banner__item span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.sub-banner__item strong {
  font-family: var(--display);
  font-size: 1.02rem;
  font-weight: 700;
}

.banner-warn,
.banner-ok {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.84rem;
}
.banner-warn { background: rgba(183, 121, 31, 0.12); color: #8a5a12; border: 1px solid rgba(183, 121, 31, 0.22); }
.banner-ok { background: rgba(53, 168, 121, 0.12); color: #1f6b4a; border: 1px solid rgba(53, 168, 121, 0.22); }

.shell--auth { display: grid; place-items: center; }
.auth-card {
  width: min(420px, 100%);
  padding: 36px 32px;
  border-radius: var(--radius);
  background: var(--glass-solid);
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow: 0 18px 40px rgba(45, 58, 72, 0.08);
  text-align: center;
}
.auth-card--wide { width: min(440px, 100%); }
.auth-card__icon {
  width: 56px; height: 56px; margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 16px; color: var(--blue);
  background: var(--blue-soft);
}
.auth-card__icon svg { width: 28px; height: 28px; }
.auth-card h1 { margin: 0 0 8px; font-family: var(--display); font-size: 1.55rem; }
.auth-card__lead { margin: 0 0 22px; color: var(--ink-soft); font-size: 0.92rem; }
.auth-card__error { margin: 0 0 14px; color: var(--red); font-size: 0.85rem; }
.auth-form { display: grid; gap: 12px; text-align: left; margin-bottom: 14px; }
.auth-form .field { margin: 0; }
.auth-form .auth-name-field.is-hidden,
.auth-form .field[hidden] { display: none !important; }
.auth-form label { display: block; margin-bottom: 5px; font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); }
.auth-form input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--input);
}
.auth-form .cta { width: 100%; margin-top: 4px; }
.auth-switch { margin: 0 0 16px; }
.auth-switch__btn {
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line-strong);
}
.cta--discord {
  width: 100%;
  text-decoration: none;
  background: linear-gradient(180deg, #5b6eae, #4752c4);
  box-shadow: 0 8px 17px rgba(71, 82, 196, 0.25), inset 0 1px 0 rgba(255,255,255,0.2);
}
.cta--ghost {
  background: transparent;
  color: var(--blue);
  box-shadow: none;
  border: 1px solid rgba(57, 120, 215, 0.28);
  min-width: auto;
}
.cta--ghost:hover:not(:disabled) { background: var(--blue-soft); filter: none; transform: none; box-shadow: none; }

.shell--admin { width: min(1100px, calc(100% - 42px)); }
.admin-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 24px 0 40px;
  min-height: 100vh;
  min-height: 100dvh;
}
.admin-nav {
  position: sticky;
  top: 24px;
  align-self: start;
  padding: 20px 16px;
  border-radius: 20px;
  background: var(--glass-solid);
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow: 0 14px 34px rgba(45, 58, 72, 0.07);
}
.admin-nav__brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.admin-nav__mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: var(--blue);
  background: var(--blue-soft);
}
.admin-nav__mark svg { width: 20px; height: 20px; }
.admin-nav__brand strong {
  display: block;
  font-family: var(--display);
  font-size: 0.92rem;
  line-height: 1.15;
}
.admin-nav__brand small {
  color: var(--muted);
  font-size: 0.68rem;
}
.admin-nav__links { display: grid; gap: 4px; }
.admin-nav__link {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 11px 12px;
  border-radius: 11px;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.admin-nav__link:hover { background: rgba(57, 120, 215, 0.06); color: var(--ink); }
.admin-nav__link.is-active {
  background: var(--blue-soft);
  color: var(--blue);
}
.admin-nav__foot {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.admin-nav__foot a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 12px;
}
.admin-nav__foot a:hover { color: var(--blue); }
.admin-main { min-width: 0; }
.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}
.admin-top h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.7rem;
}
.admin-top__user {
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 600;
}
.admin-panel { display: none; }
.admin-panel.is-active { display: grid; gap: 18px; }
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.stat-card {
  padding: 18px 16px;
  border-radius: 16px;
  background: var(--glass-solid);
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow: 0 10px 24px rgba(45, 58, 72, 0.05);
}
.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.stat-card strong {
  font-family: var(--display);
  font-size: 1.55rem;
}
.admin-quick { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 24px 22px; }
.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  align-items: end;
}
.admin-form-grid .field { margin: 0; }
.admin-form-grid .field--wide { grid-column: 1 / -2; }
.admin-form-grid input,
.admin-form-grid select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--input);
}
.admin-form-grid--create {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}
.input-with-action {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}
.btn-mini {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--blue);
  white-space: nowrap;
}
.btn-mini:hover { border-color: var(--blue); background: var(--blue-soft); }
.cred-box {
  margin: 0;
  padding: 18px 24px 22px;
  border-top: 1px solid var(--line);
  background: rgba(57, 120, 215, 0.05);
}
.cred-box__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.cred-box__head strong {
  display: block;
  font-family: var(--display);
  font-size: 1.05rem;
}
.cred-box__text {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}
.pill--ok { background: rgba(53, 168, 121, 0.12); color: #1f6b4a; }
.pill--off { background: rgba(139, 146, 153, 0.16); color: #687079; }

.admin-card {
  margin-bottom: 0;
  border-radius: var(--radius);
  background: var(--glass-solid);
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow: 0 14px 34px rgba(45, 58, 72, 0.07);
  overflow: hidden;
}
.admin-card .card-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.admin-card h1, .admin-card h2 { margin: 0 0 6px; font-family: var(--display); font-size: 1.25rem; }
.admin-grant {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  align-items: end;
}
.admin-grant .field { margin: 0; }
.admin-grant input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--input);
}
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.admin-table th, .admin-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table th { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.admin-table code { font-family: var(--mono); font-size: 0.75rem; }
.admin-user { display: flex; align-items: center; gap: 8px; }
.admin-user img { border-radius: 50%; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-actions button {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 0.72rem;
  cursor: pointer;
  color: var(--ink);
}
.admin-actions button:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.admin-actions button:disabled { opacity: 0.45; cursor: not-allowed; }
.admin-key-reveal {
  margin: 0;
  padding: 12px 24px;
  background: rgba(57, 120, 215, 0.08);
  color: #24559e;
  font-family: var(--mono);
  font-size: 0.78rem;
  word-break: break-all;
}

@media (max-width: 980px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { position: static; }
  .admin-nav__links { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-form-grid { grid-template-columns: 1fr 1fr; }
  .admin-form-grid .field--wide { grid-column: 1 / -1; }
  .admin-form-grid .cta { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .admin-grant { grid-template-columns: 1fr 1fr; }
  .admin-grant .cta { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .admin-grant { grid-template-columns: 1fr; }
  .admin-nav__links { grid-template-columns: 1fr 1fr; }
  .admin-stats { grid-template-columns: 1fr; }
  .admin-form-grid { grid-template-columns: 1fr; }
  .appbar__account #userName { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sub-banner { grid-template-columns: 1fr; }
}
