:root {
  --bg: #070e19;
  --surface: #111d30;
  --lift: #15243b;
  --line: #263852;
  --ink: #eef4fc;
  --muted: #a7b6cb;
  --gold: #f6c453;
  --green: #5ee39b;
  --red: #ff8585;
  --blue: #8fd3ff;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 85% -10%, #1c3556 0, #070e19 58%),
    linear-gradient(180deg, #070e19, #08111f 45%, #070d17);
  font: 15.5px/1.6 "Segoe UI", system-ui, -apple-system, sans-serif;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.shell { width: min(920px, 100%); margin: 0 auto; padding: 28px 18px 56px; }

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 22px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(700px 260px at 100% 0, rgba(246, 196, 83, .14), transparent 65%),
    linear-gradient(135deg, #12213a, #0c1626 62%);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .32);
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.logo {
  width: 58px; height: 58px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 18px;
  color: #151004;
  font-weight: 900;
  letter-spacing: -.04em;
  background: linear-gradient(145deg, #ffe08a, #f6c453 55%, #c9921e);
  box-shadow: 0 0 0 3px rgba(246, 196, 83, .12), 0 12px 30px rgba(0, 0, 0, .35);
}
.eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
h1 { margin: 0; font-size: clamp(26px, 4vw, 36px); line-height: 1.05; letter-spacing: -.035em; }
h1 span { color: var(--gold); }
.sub { margin: 7px 0 0; color: var(--muted); font-size: 13.5px; }
.hero-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 34px; padding: 4px 11px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(6, 13, 24, .72);
  font-size: 12px; font-weight: 700;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.pill.ok { color: var(--green); border-color: rgba(94, 227, 155, .35); }
.pill.ok::before { background: var(--green); box-shadow: 0 0 10px rgba(94, 227, 155, .5); }

.panel, .accounts {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #111e32, #0d1727);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .16);
}
.panel { padding: 20px; }
h2 { margin: 0 0 4px; font-size: 19px; letter-spacing: -.02em; }
.muted { color: var(--muted); font-size: 13px; }
label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
textarea, input, select {
  width: 100%;
  border: 1px solid #3b5474;
  border-radius: 10px;
  background: #081221;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}
textarea { resize: vertical; font-family: "Consolas", ui-monospace, monospace; font-size: 12.5px; line-height: 1.5; }
input[type="file"] { padding: 8px; border-style: dashed; color: var(--muted); }
textarea:focus, input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(143, 211, 255, .12); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
button {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #3b5474;
  border-radius: 10px;
  color: var(--ink);
  background: #1a2a42;
  font-weight: 600;
}
button:hover { background: #223653; }
button.primary { background: var(--gold); border-color: var(--gold); color: #151004; font-weight: 800; }
button.primary:hover { background: #ffda6a; }
button.ghost { background: rgba(8, 18, 33, .6); }
button.danger { color: var(--red); border-color: rgba(255, 133, 133, .35); background: rgba(255, 133, 133, .06); }
button.danger:hover { background: rgba(255, 133, 133, .12); }
button:disabled { opacity: .55; cursor: not-allowed; }
.error { margin: 12px 0 0; padding: 9px 11px; border: 1px solid rgba(255, 133, 133, .35); border-radius: 10px; color: var(--red); background: rgba(255, 133, 133, .06); font-size: 13px; }
.security { margin-top: 16px; color: var(--muted); font-size: 12.5px; }
.security summary { cursor: pointer; color: var(--blue); font-weight: 700; }
.security p { margin: 6px 0; }
code { color: var(--gold); font-family: "Consolas", ui-monospace, monospace; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.accounts { display: grid; gap: 12px; padding: 14px; background: transparent; border: 0; box-shadow: none; }
.account {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(420px 120px at 100% 0, rgba(246, 196, 83, .09), transparent 70%),
    linear-gradient(180deg, #13233a, #0d1829);
}
.account-main { min-width: 0; }
.account-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account-label { font-weight: 800; letter-spacing: -.01em; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
}
.badge.plus { color: var(--gold); border-color: rgba(246, 196, 83, .35); }
.code {
  margin: 10px 0 9px;
  color: var(--gold);
  font: 800 46px/1 "Consolas", ui-monospace, monospace;
  letter-spacing: .16em;
  text-shadow: 0 0 24px rgba(246, 196, 83, .14);
}
.code.expired { color: var(--red); font-size: 30px; letter-spacing: .08em; }
.countdown { height: 6px; border-radius: 999px; background: #0b1220; overflow: hidden; }
.countdown > span { display: block; height: 100%; width: 100%; background: var(--green); transition: width .25s linear; }
.account-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; color: var(--muted); font-size: 11.5px; }
.account-actions { display: flex; flex-direction: column; gap: 8px; }
.account-actions button { min-width: 96px; }
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(12px);
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: #13233a; color: var(--ink); font-size: 13px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: .2s ease; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

dialog {
  width: min(560px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #0f1b2c;
  color: var(--ink);
  padding: 20px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55);
}
dialog::backdrop { background: rgba(2, 6, 12, .74); backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.icon-btn { width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 999px; font-size: 20px; line-height: 1; }
.test-result { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #081221; font-size: 13px; }
.test-result.ok { border-color: rgba(94, 227, 155, .35); }
.test-result.bad { border-color: rgba(255, 133, 133, .35); }
.test-result ul { margin: 6px 0 0; padding-left: 18px; }
.test-result li { margin: 3px 0; }

footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 22px; padding-top: 12px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 11.5px;
}

@media (max-width: 620px) {
  .shell { padding: 16px 12px 40px; }
  .hero { padding: 16px; border-radius: 20px; }
  .account { grid-template-columns: 1fr; }
  .account-actions { flex-direction: row; flex-wrap: wrap; }
  .code { font-size: 40px; }
}
