:root {
  color-scheme: dark;
  --ink: #071426;
  --ink-soft: #0d1e35;
  --panel: rgba(17, 39, 67, .82);
  --panel-strong: #112944;
  --line: rgba(190, 216, 238, .15);
  --text: #f8fbff;
  --muted: #9fb4ca;
  --cyan: #64d4ff;
  --mint: #65dda4;
  --coral: #ff7c78;
  --amber: #ffc66c;
  --shadow: 0 24px 70px rgba(0, 5, 14, .42);
}

* { box-sizing: border-box; }

html { background: var(--ink); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% -10%, rgba(36, 141, 195, .23), transparent 36%),
    radial-gradient(circle at 100% 48%, rgba(32, 149, 105, .15), transparent 31%),
    linear-gradient(155deg, #06101e 0%, #091a2e 54%, #071426 100%);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.ambient {
  position: fixed;
  z-index: 0;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(100, 212, 255, .12);
  border-radius: 50%;
  pointer-events: none;
}

.ambient::after {
  content: "";
  position: absolute;
  inset: 28px;
  border: 1px dashed rgba(101, 221, 164, .14);
  border-radius: inherit;
}

.ambient-one { top: -150px; right: -100px; }
.ambient-two { bottom: 6%; left: -230px; transform: scale(1.5); }

.shell {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 18px max(32px, env(safe-area-inset-bottom));
}

.brandbar {
  display: grid;
  grid-template-columns: 44px 1fr 42px;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
  animation: rise .55s ease-out both;
}

.brandmark {
  position: relative;
  width: 43px;
  height: 34px;
  border: 2px solid var(--cyan);
  border-radius: 8px;
  box-shadow: inset 0 0 18px rgba(100, 212, 255, .15), 0 0 24px rgba(100, 212, 255, .1);
}

.brandmark::before { content: ""; position: absolute; left: 14px; right: 14px; bottom: -7px; height: 2px; background: var(--cyan); }
.brandmark span { position: absolute; width: 8px; height: 8px; border: 2px solid var(--mint); border-radius: 50%; left: 15px; top: 10px; }

.eyebrow, .section-kicker {
  margin: 0 0 3px;
  color: var(--cyan);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.brandbar h1 { margin: 0; font-size: 21px; letter-spacing: .01em; }

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
  font-size: 25px;
}

.pair-card, .status-card, .meter-card, .actions-section, .settings-card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.pair-card {
  margin-top: 15vh;
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(19, 48, 82, .95), rgba(10, 28, 49, .95));
  animation: rise .6s .08s ease-out both;
}

.pair-card h2 { margin: 5px 0 12px; font-size: 28px; line-height: 1.2; }
.pair-copy { margin: 0 0 24px; color: var(--muted); line-height: 1.75; font-size: 15px; }
.pair-form label { display: block; margin-bottom: 9px; color: var(--muted); font-size: 13px; }

.pair-form input {
  width: 100%;
  height: 68px;
  padding: 0 16px;
  border: 1px solid rgba(100, 212, 255, .28);
  border-radius: 18px;
  outline: none;
  background: rgba(3, 13, 25, .5);
  color: var(--text);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 34px;
  letter-spacing: .27em;
  text-align: center;
}

.pair-form input:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(100, 212, 255, .1); }

.primary-button {
  width: 100%;
  min-height: 56px;
  margin-top: 15px;
  border: 0;
  border-radius: 17px;
  background: linear-gradient(115deg, var(--cyan), #80e5cc);
  color: #062039;
  font-weight: 800;
  box-shadow: 0 12px 35px rgba(63, 192, 219, .2);
}

.form-error { min-height: 20px; margin: 12px 0 0; color: var(--coral); font-size: 13px; }

.status-card {
  overflow: hidden;
  border-radius: 27px;
  background:
    linear-gradient(150deg, rgba(26, 65, 105, .93), rgba(10, 29, 50, .9)),
    repeating-linear-gradient(90deg, transparent, transparent 23px, rgba(255,255,255,.02) 24px);
  animation: rise .55s .05s ease-out both;
}

.status-topline { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 22px 22px 18px; }

.status-orb { position: relative; width: 44px; height: 44px; border: 1px solid rgba(159,180,202,.26); border-radius: 50%; }
.status-orb::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--muted); transition: .3s ease; }
.status-orb i { position: absolute; inset: 3px; border: 1px solid rgba(101,221,164,.2); border-radius: 50%; opacity: 0; }
.status-orb.online::before { background: var(--mint); box-shadow: 0 0 20px rgba(101,221,164,.75); }
.status-orb.online i { opacity: 1; animation: signal 2.2s ease-out infinite; }
.status-orb.online i:nth-child(2) { animation-delay: 1.1s; }

.status-label { margin: 0; font-size: 17px; font-weight: 800; }
.status-caption { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.lock-badge { padding: 7px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 11px; font-weight: 700; }
.lock-badge.locked { border-color: rgba(255,124,120,.35); background: rgba(255,124,120,.1); color: #ffaaa7; }

.now-playing { padding: 20px 22px 24px; border-top: 1px solid var(--line); background: rgba(1, 10, 19, .22); }
.now-playing p { margin: 0 0 5px; color: var(--muted); font-size: 12px; }
.now-playing h2 { margin: 0 0 6px; font-size: 27px; }
.now-playing code { color: rgba(159,180,202,.72); font-size: 11px; word-break: break-all; }

.meter-card { margin-top: 14px; padding: 20px; border-radius: 22px; background: rgba(11, 31, 53, .75); animation: rise .55s .11s ease-out both; }
.meter-copy { display: flex; justify-content: space-between; gap: 20px; align-items: end; }
.meter-copy strong { font-size: 25px; }
.remaining-copy { text-align: right; }
.remaining-copy span { display: block; color: var(--muted); font-size: 11px; }
.remaining-copy b { color: var(--mint); font-size: 18px; }
.meter-track { height: 8px; margin-top: 17px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.08); }
.meter-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--mint)); transition: width .55s ease; }
.sync-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; }

.actions-section { margin-top: 14px; padding: 22px; border-radius: 24px; background: rgba(11, 31, 53, .76); animation: rise .55s .17s ease-out both; }
.section-heading { display: flex; justify-content: space-between; gap: 15px; align-items: end; }
.section-heading h2 { margin: 0; font-size: 21px; }
.section-heading > span { color: var(--muted); font-size: 10px; }
.bonus-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.bonus-grid button { min-height: 78px; border: 1px solid rgba(100,212,255,.19); border-radius: 18px; background: linear-gradient(145deg, rgba(37,79,115,.75), rgba(17,44,72,.75)); color: var(--text); }
.bonus-grid strong { display: block; color: var(--cyan); font-size: 25px; }
.bonus-grid span { color: var(--muted); font-size: 11px; }
.bonus-grid button:active { transform: scale(.97); border-color: var(--cyan); }
.command-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.secondary-button { min-height: 48px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.035); color: var(--text); font-weight: 700; }
.danger-button { color: #ffaaa7; }
.command-status { min-height: 17px; margin: 10px 0 0; color: var(--mint); font-size: 12px; }

.settings-card { margin-top: 14px; border-radius: 24px; background: rgba(11, 31, 53, .72); animation: rise .55s .23s ease-out both; }
.settings-card summary { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px; cursor: pointer; list-style: none; }
.settings-card summary::-webkit-details-marker { display: none; }
.settings-card summary small { display: block; margin-bottom: 3px; color: var(--cyan); font-size: 10px; letter-spacing: .13em; }
.settings-card summary strong { font-size: 16px; }
.settings-card summary b { color: var(--muted); font-size: 23px; transition: transform .25s ease; }
.settings-card[open] summary b { transform: rotate(180deg); }
.policy-form { padding: 0 22px 22px; border-top: 1px solid var(--line); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.policy-form label { position: relative; color: var(--muted); font-size: 11px; }
.policy-form input, .policy-form textarea { width: 100%; margin-top: 7px; border: 1px solid var(--line); border-radius: 13px; outline: none; background: rgba(2,12,23,.46); color: var(--text); }
.policy-form input { height: 48px; padding: 0 12px; }
.policy-form textarea { padding: 12px; resize: vertical; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 11px; line-height: 1.6; }
.policy-form label > span { position: absolute; right: 10px; bottom: 16px; color: var(--muted); font-size: 10px; pointer-events: none; }
.package-field { display: block; margin-top: 16px; }

footer { display: flex; justify-content: space-between; gap: 15px; padding: 22px 4px 5px; color: rgba(159,180,202,.58); font-size: 10px; }
footer button { border: 0; background: transparent; color: inherit; text-decoration: underline; }

.toast { position: fixed; z-index: 20; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 36px); padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(7,20,38,.95); color: var(--text); box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, 18px); pointer-events: none; transition: .25s ease; font-size: 13px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
button:disabled { opacity: .5; pointer-events: none; }
[hidden] { display: none !important; }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes signal { 0% { opacity: .8; transform: scale(.65); } 100% { opacity: 0; transform: scale(1.35); } }

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

