:root {
  --bg: #07070c;
  --bg-2: #11141b;
  --surface: #151923;
  --surface-2: #1b2030;
  --border: #252b3b;
  --text: #e8ebf3;
  --muted: #8b93a7;
  --faint: #5d657a;
  --accent: #1de9a0;
  --accent-2: #a78bfa;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 10% -10%, rgba(167, 139, 250, .08), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(29, 233, 160, .07), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text);
  font: 600 14px var(--sans); cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s, opacity .15s;
}
.btn:hover { background: #232a3d; border-color: #323a50; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #03140d; }
.btn.primary:hover { background: #4ff0b6; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .4); }
.btn.ghost { background: transparent; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 500; }
.input, textarea.input {
  width: 100%; padding: 10px 12px;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  font: 15px var(--sans); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { resize: vertical; min-height: 80px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29, 233, 160, .18); }

.msg { min-height: 22px; font-size: 14px; margin: 10px 0 0; }
.msg.error { color: var(--danger); }
.msg.ok { color: var(--ok); }
.msg.info { color: var(--muted); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.card h2 { font-size: 16px; margin-bottom: 4px; }
.card > p.muted { margin: 0 0 16px; font-size: 14px; }

.code-reveal {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; margin-top: 12px;
  background: var(--bg-2); border: 1px dashed rgba(29, 233, 160, .5); border-radius: 12px;
}
.code-reveal .code { font: 700 28px var(--mono); letter-spacing: .25em; color: var(--accent); }
.code-reveal + .hint { font-size: 13px; color: var(--warn); margin: 8px 0 0; }

/* ---------- login ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand-mark { width: 36px; height: 36px; object-fit: contain; display: block; }
.auth-logo { display: block; width: 240px; max-width: 70%; height: auto; margin: 0 auto 20px; }
.auth-card h1 { font-size: 22px; text-align: center; }
.auth-card .sub { text-align: center; color: var(--muted); margin: 6px 0 22px; font-size: 14px; }

.otp { display: flex; justify-content: center; gap: 8px; }
.otp input {
  width: 48px; height: 58px; text-align: center;
  font: 600 24px var(--mono); color: var(--text);
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  outline: none; caret-color: var(--accent);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.otp input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29, 233, 160, .2); }
.otp input.filled { border-color: #3a4260; }
.otp.shake { animation: shake .35s; }
.otp.busy input { opacity: .6; }
@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.auth-foot { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }

/* ---------- app shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 64px; padding: 0 24px;
  background: rgba(7, 7, 12, .75); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; gap: 4px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 10px;
  color: var(--muted); font-weight: 500; font-size: 14px; text-decoration: none;
}
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.active { color: var(--text); background: var(--surface-2); }
.nav svg { width: 18px; height: 18px; }
.nav .count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: #03140d; font: 700 11px/18px var(--sans); text-align: center;
}
.brand { color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }

/* profile button + dropdown */
.topbar-left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.profile { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 12px;
  border-radius: 999px; border: 1px solid transparent; background: transparent;
  color: var(--muted); font: 500 14px var(--sans); cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.user-chip:hover, .user-chip[aria-expanded="true"] { background: var(--surface); border-color: var(--border); color: var(--text); }
.user-chip .chev { width: 16px; height: 16px; transition: transform .2s; }
.user-chip[aria-expanded="true"] .chev { transform: rotate(180deg); }
.avatar { position: relative; }
.avatar .dot {
  position: absolute; top: -1px; right: -1px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--warn); border: 2px solid var(--bg);
}
.menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30;
  width: 240px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
  transform-origin: top right; animation: pop .14s ease-out;
}
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
.menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-sub { font-size: 12px; color: var(--muted); margin-top: 2px; text-transform: capitalize; }
.menu a, .menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border: 0; border-radius: 9px; background: transparent;
  color: var(--text); font: 500 14px var(--sans); text-align: left; text-decoration: none; cursor: pointer;
}
.menu a:hover, .menu button:hover { background: var(--surface-2); text-decoration: none; }
.menu a.active { background: var(--surface-2); color: var(--accent); }
.menu svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.menu a.active svg { color: var(--accent); }
.menu .count { margin-left: auto; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu .menu-danger { color: var(--danger); }
.menu .menu-danger svg { color: var(--danger); }
.menu .menu-danger:hover { background: rgba(248, 113, 113, .1); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: 13px;
}

main { padding: 32px 32px 48px; }
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 26px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* ---------- home tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tile {
  --c: var(--accent);
  position: relative; border-radius: 18px; padding: 1px; isolation: isolate;
  background: var(--border);
  animation: rise .6s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: var(--rise-delay, 0s);
}
.tile-inner {
  position: relative; overflow: hidden; height: 100%;
  border-radius: 17px; padding: 22px 22px 20px;
  background: linear-gradient(180deg, var(--surface) 0%, #12151e 100%);
}
.tile-inner::before {
  content: ""; position: absolute; inset: -40% -40% auto auto; width: 220px; height: 220px; z-index: -1;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 28%, transparent), transparent 70%);
  animation: glow 4s ease-in-out infinite alternate;
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes glow { from { opacity: .5; transform: scale(.9); } to { opacity: 1; transform: scale(1.1); } }

.stage { position: relative; height: 150px; display: grid; place-items: end center; margin-bottom: 14px; }

/* graveyard scene; while cooking, ghost skulls rise out of the RIP grave and the fog drifts */
.graveyard { width: 220px; height: auto; margin-bottom: 4px; overflow: visible; }
.gy-moon { fill: #e5e7eb; opacity: .85; filter: drop-shadow(0 0 6px rgba(229, 231, 235, .5)); animation: gy-moon 4s ease-in-out infinite alternate; }
@keyframes gy-moon { from { opacity: .6; } to { opacity: .95; } }
.gy-ground { fill: #10131b; }
.gy-stone { fill: #2a3142; stroke: #3b4459; stroke-width: 1.5; }
.gy-main { stroke: color-mix(in srgb, var(--c) 55%, #3b4459); transition: filter .3s; }
.gy-rip { font: 700 13px var(--mono); fill: #8b93a7; letter-spacing: 1px; }
.gy-crack { fill: none; stroke: #1b2030; stroke-width: 1.5; stroke-linecap: round; }
.gy-mound { fill: #191d28; }
.gy-fog { fill: rgba(255, 255, 255, .07); filter: blur(3px); animation: gy-fog 9s linear infinite; }
@keyframes gy-fog { from { transform: translateX(0); } to { transform: translateX(-100px); } }
.tile:not(.idle) .gy-main { filter: drop-shadow(0 0 6px var(--c)); }
.tile:not(.idle) .gy-rip { fill: var(--c); }

.steam { position: absolute; bottom: 70px; left: 50%; transform: translateX(-50%); width: 110px; height: 70px; }
.steam span {
  position: absolute; bottom: 0; width: 30px; height: 30px; opacity: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='white' fill-rule='evenodd' d='M32 4C18 4 8 14 8 28c0 8 4 14 10 17v7a4 4 0 0 0 4 4h20a4 4 0 0 0 4-4v-7c6-3 10-9 10-17C56 14 46 4 32 4ZM16 29a7 7 0 1 0 14 0a7 7 0 1 0-14 0ZM34 29a7 7 0 1 0 14 0a7 7 0 1 0-14 0ZM32 36l-3.5 6h7Z'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 45%);
          mask-image: linear-gradient(to top, transparent 0%, #000 45%);
  animation: ghost-skull 3s ease-out infinite;
}
.steam span:nth-child(1) { left: 6px; animation-delay: 0s; }
.steam span:nth-child(2) { left: 40px; animation-delay: 1s; }
.steam span:nth-child(3) { left: 74px; animation-delay: 2s; }
@keyframes ghost-skull {
  0%   { transform: translate(0, 10px) scale(.5) rotate(0); opacity: 0; filter: blur(2px); }
  20%  { opacity: .55; filter: blur(.5px); }
  45%  { transform: translate(-6px, -22px) scale(.95) rotate(-8deg); opacity: .7; filter: blur(0); }
  70%  { transform: translate(6px, -42px) scale(1.15) rotate(7deg); opacity: .45; filter: blur(1px); }
  100% { transform: translate(-2px, -64px) scale(1.4) rotate(-4deg); opacity: 0; filter: blur(3px); }
}

.tile h3 { font-size: 18px; display: flex; align-items: baseline; }
.dots::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.5s steps(4) infinite; }
@keyframes dots {
  0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75%, 100% { content: "..."; }
}
.tile p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.tile .tag {
  display: inline-block; margin-bottom: 10px; padding: 2px 9px; border-radius: 999px;
  font: 600 11px var(--mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent);
}

/* open-page button on each tile (desktop); on phones it stretches over the whole tile */
.tile-open {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  color: var(--muted); background: var(--surface-2); border: 1px solid var(--border);
  transition: color .15s, background .15s, border-color .15s, transform .15s;
}
.tile-open svg { width: 18px; height: 18px; }
.tile-open:hover {
  color: var(--c); border-color: color-mix(in srgb, var(--c) 50%, transparent);
  background: color-mix(in srgb, var(--c) 12%, var(--surface-2)); transform: translate(1px, -1px);
  text-decoration: none;
}
.tile-open:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }

/* settings button: bottom-right of each tile; stays above the phone tap-overlay */
.tile-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.tile-settings {
  position: relative; z-index: 3;
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  color: var(--muted); background: var(--surface-2); border: 1px solid var(--border);
  transition: color .15s, background .15s, border-color .15s, transform .15s;
}
.tile-settings svg { width: 18px; height: 18px; transition: transform .3s; }
.tile-settings:hover {
  color: var(--c); border-color: color-mix(in srgb, var(--c) 50%, transparent);
  background: color-mix(in srgb, var(--c) 12%, var(--surface-2)); text-decoration: none;
}
.tile-settings:hover svg { transform: rotate(45deg); }
.tile-settings:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.back { display: inline-block; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.back:hover { color: var(--text); text-decoration: none; }

/* ---------- settings ---------- */
.stack { display: grid; gap: 16px; max-width: 640px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.code-input { font: 600 20px var(--mono); letter-spacing: .3em; max-width: 200px; text-align: center; }

/* ---------- admin ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); font: 500 13px var(--sans); cursor: pointer;
}
.chip.active { background: var(--surface-2); color: var(--text); border-color: #3a4260; }
.chip .n { color: var(--faint); margin-left: 4px; font-family: var(--mono); }
.users { display: grid; gap: 10px; }
.user {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.user.pending { border-color: rgba(251, 191, 36, .35); }
.user .name { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.user .meta { font-size: 13px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.user .note { font-size: 13px; color: var(--text); opacity: .85; margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.user .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .04em;
  background: var(--surface-2); color: var(--muted);
}
.badge.pending { color: var(--warn); background: rgba(251, 191, 36, .12); }
.badge.approved { color: var(--ok); background: rgba(52, 211, 153, .12); }
.badge.rejected, .badge.disabled { color: var(--danger); background: rgba(248, 113, 113, .12); }
.badge.admin { color: var(--accent-2); background: rgba(167, 139, 250, .14); }
.empty { padding: 32px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 12px; }

/* ---------- toast / modal ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 50;
  padding: 10px 16px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(248, 113, 113, .5); color: var(--danger); }
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .6); }
.modal .card { width: 100%; max-width: 420px; }

/* ---------- desktop vs. mobile ----------
   Chosen by device type, not window width: a mouse/trackpad computer always gets the
   full-screen desktop layout (a narrow window scrolls sideways instead of collapsing);
   only touch devices up to 900px wide (phones, tablets in portrait) get the mobile layout. */
@media (hover: hover), (pointer: fine) {
  body { min-width: 960px; }
}
@media (hover: none) and (pointer: coarse) and (max-width: 900px) {
  .topbar { height: 56px; padding: 0 12px 0 16px; gap: 8px; }
  .brand .app-name { font-size: 16px; }
  .user-chip .who { display: none; }
  .user-chip { padding: 4px; }
  .nav a { padding: 8px 10px; }
  .menu { width: min(260px, calc(100vw - 24px)); }
  main { padding: 20px 16px 32px; }
  .page-head h1 { font-size: 22px; }
  .tiles { grid-template-columns: 1fr; gap: 14px; }
  .tile-open { inset: 0; width: auto; height: auto; border: 0; border-radius: 17px; background: transparent; }
  .tile-open svg { display: none; }
  .tile-open:hover { background: transparent; transform: none; }
  .tile-inner { transition: transform .1s; }
  .tile:active .tile-inner { transform: scale(.985); }
  .user { grid-template-columns: 1fr; }
  .user .actions { justify-content: flex-start; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
}
@media (hover: none) and (pointer: coarse) and (max-width: 380px) {
  .otp { gap: 6px; }
  .otp input { width: 42px; height: 52px; font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* a tile that has stopped cooking: graveyard at rest, nothing rising, fog still */
.tile.idle .steam, .tile.idle .dots { display: none; }
.tile.idle .gy-fog, .tile.idle .gy-moon, .tile.idle .tile-inner::before { animation: none; }

/* ---------- Quick Trade go-live settings ---------- */
.card .hint { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.golive-check { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.golive-check li { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); }
.golive-check li::before {
  content: "✕"; flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: var(--danger); background: rgba(248, 113, 113, .12);
}
.golive-check li.ok { color: var(--text); }
.golive-check li.ok::before { content: "✓"; color: var(--ok); background: rgba(52, 211, 153, .12); }
.golive-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; align-items: end; }
.golive-grid .field { margin-bottom: 12px; }
.golive-span { grid-column: 1 / -1; }
.golive-grid .hint { margin: 0 0 12px; }
@media (max-width: 560px) { .golive-grid { grid-template-columns: 1fr; } }
/* go-live cards side by side on wide screens */
.stack.golive-cols { max-width: 1100px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
@media (max-width: 900px) { .stack.golive-cols { grid-template-columns: 1fr; max-width: 640px; } }
.golive-note {
  margin: 0 0 16px; padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 600;
  color: var(--warn); background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .35);
}
.golive-note::before { content: "⚠ "; }
/* go-live checklist popup: blur everything behind it until Proceed */
#gl-modal { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.golive-info {
  margin: 0 0 16px; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.5;
  color: var(--text); background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.golive-info b, .golive-info .mono { color: var(--accent); }
.card .hint.golive-small { font-size: 11px; opacity: .8; }

/* go-live page: content centred on the page */
#page-quick-trade-settings > * { max-width: 1100px; margin-left: auto; margin-right: auto; }
#page-quick-trade-settings .stack.golive-cols { width: 100%; }

/* caution banner with animated skull */
.golive-caution {
  display: flex; gap: 18px; align-items: center; margin-bottom: 16px; padding: 18px 20px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(248, 113, 113, .14), rgba(251, 191, 36, .08));
  border: 1px solid rgba(248, 113, 113, .45);
}
.golive-caution h2 { font-size: 16px; color: var(--danger); margin-bottom: 6px; letter-spacing: .02em; }
.golive-caution p { margin: 0 0 4px; font-size: 14px; color: var(--text); }
.golive-caution .golive-caution-strong { font-weight: 700; color: var(--warn); }
.golive-caution .golive-caution-tags { margin: 0; font: 600 12px var(--mono); color: var(--muted); }
.skull { flex: none; width: 64px; height: 64px; animation: skull-float 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
.skull-head { fill: #e5e7eb; }
.skull-eye, .skull-nose { fill: #0b0d13; }
.skull-eye { animation: skull-eyes 2.4s ease-in-out infinite; }
.skull-teeth { stroke: #0b0d13; stroke-width: 2.2; stroke-linecap: round; }
@keyframes skull-float {
  0%, 100% { transform: translateY(0) rotate(0); }
  20% { transform: translateY(-4px) rotate(-6deg); }
  40% { transform: translateY(0) rotate(5deg); }
  60% { transform: translateY(-3px) rotate(-3deg); }
  80% { transform: translateY(0) rotate(0); }
}
@keyframes skull-eyes {
  0%, 100% { fill: #0b0d13; }
  50% { fill: var(--danger); filter: drop-shadow(0 0 4px var(--danger)); }
}
@media (max-width: 560px) { .golive-caution { flex-direction: column; text-align: center; } }

/* Quick Trade home tile: small stat boxes */
.tile-mini { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.tile-mini > div {
  min-width: 0; padding: 4px 6px; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.tile-mini small { display: block; font-size: 9px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-mini b { display: block; margin-top: 1px; font: 600 11px var(--mono); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-mini b.pos { color: var(--ok); }
.tile-mini b.neg { color: var(--danger); }

/* gear on tiles whose settings page isn't built yet: same look, no link */
.tile-settings[aria-disabled="true"] { cursor: default; }

/* login page brand: skull + app name */
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0 auto 20px; font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.auth-brand img { width: 88px; height: 88px; filter: drop-shadow(0 0 14px rgba(29, 233, 160, .35)); }

/* go-live wallet presets */
.golive-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.golive-presets .btn { min-width: 64px; font-family: var(--mono); }
.golive-presets .btn.active { background: color-mix(in srgb, var(--accent) 18%, var(--surface-2)); border-color: var(--accent); color: var(--accent); }

/* go-live page for non-admins: details blurred + locked with an "Admin only" tag */
.admin-lock { position: relative; }
.admin-tag { display: none; }
.golive-user .admin-lock-body { filter: blur(6px); opacity: .55; pointer-events: none; user-select: none; }
.golive-user .admin-tag {
  display: inline-flex; align-items: center; gap: 6px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  padding: 6px 14px; border-radius: 999px; font: 700 12px var(--mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--warn); background: rgba(11, 13, 19, .85); border: 1px solid rgba(251, 191, 36, .45);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .4); white-space: nowrap;
}

/* power on/off confirm modal */
.pw-modal { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: pw-fade .15s ease-out; }
.pw-card { max-width: 400px; text-align: center; padding: 28px 26px 22px; border-radius: 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); animation: pw-pop .2s cubic-bezier(.2, .9, .3, 1.2); }
.pw-card h2 { font-size: 19px; margin-bottom: 8px; }
.pw-card p.muted { margin: 0 0 22px; font-size: 14px; line-height: 1.5; }
.pw-icon { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; }
.pw-icon svg { width: 28px; height: 28px; }
.turn-off .pw-icon { color: var(--danger); background: rgba(248, 113, 113, .12); box-shadow: 0 0 0 6px rgba(248, 113, 113, .06); }
.turn-on  .pw-icon { color: var(--ok); background: rgba(52, 211, 153, .12); box-shadow: 0 0 0 6px rgba(52, 211, 153, .06); }
.pw-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.turn-off #qt-power-ok { background: var(--danger); border-color: var(--danger); color: #1a0505; font-weight: 600; }
.turn-off #qt-power-ok:hover { background: #fb8f8f; }
.turn-on  #qt-power-ok { background: var(--ok); border-color: var(--ok); color: #03140d; font-weight: 600; }
.turn-on  #qt-power-ok:hover { background: #4ff0b6; }
@keyframes pw-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pw-pop { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }

/* home page bottom: low-light graveyard with ghosts, under a dark overlay */
.home-graveyard { position: relative; margin-top: 44px; height: 230px; border-radius: 18px; overflow: hidden; pointer-events: none; }
.home-graveyard svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.home-graveyard::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--bg, #08090d) 0%, rgba(8, 9, 13, .05) 35%, rgba(8, 9, 13, .3) 100%),
              radial-gradient(120% 90% at 50% 120%, transparent 50%, rgba(0, 0, 0, .35) 100%);
}
.hg-moon { fill: #e3e8f4; opacity: .45; filter: blur(1px) drop-shadow(0 0 18px rgba(215, 220, 234, .5)); }
.hg-fence { fill: none; stroke: #1a1f2b; stroke-width: 2; }
.hg-hill-back { fill: #131824; }
.hg-hill-front { fill: #0d1119; }
.hg-tree { fill: none; stroke: #1a1f2c; stroke-width: 4; stroke-linecap: round; }
.hg-back { fill: #1b2130; }
.hg-front { fill: #161b27; stroke: #283044; stroke-width: 1; }
.hg-ghost { fill: rgba(226, 232, 240, .32); fill-rule: evenodd; filter: drop-shadow(0 0 10px rgba(226, 232, 240, .4));
  transform-box: fill-box; animation: hg-float 10s ease-in-out infinite alternate; }
@keyframes hg-float {
  0%   { transform: translate(0, 0) rotate(-3deg); opacity: .5; }
  50%  { transform: translate(40px, -14px) rotate(3deg); opacity: 1; }
  100% { transform: translate(80px, 4px) rotate(-2deg); opacity: .6; }
}
.hg-fog { fill: rgba(255, 255, 255, .07); filter: blur(6px); animation: hg-fog 30s linear infinite; }
@keyframes hg-fog { from { transform: translateX(0); } to { transform: translateX(-1000px); } }
.hg-wisp { fill: #8ff5cf; opacity: 0; filter: drop-shadow(0 0 4px #1de9a0); animation: hg-wisp 6s ease-in-out infinite; }
@keyframes hg-wisp { 0%, 100% { opacity: 0; transform: translateY(0); } 40% { opacity: .8; } 60% { opacity: .5; transform: translateY(-8px); } }

/* keep the graveyard at the very bottom of the page (fills the space under the tiles, sits on the window edge) */
#page-home:not([hidden]) { display: flex; flex-direction: column; min-height: calc(100vh - 64px - 32px - 48px); min-height: calc(100dvh - 64px - 32px - 48px); }
#page-home .home-graveyard { margin-top: auto; margin-bottom: -48px; padding-top: 0; border-radius: 18px 18px 0 0; flex: none; }
#page-home .tiles { margin-bottom: 44px; }
@media (hover: none) and (pointer: coarse) and (max-width: 900px) {
  #page-home:not([hidden]) { min-height: calc(100vh - 56px - 20px - 32px); min-height: calc(100dvh - 56px - 20px - 32px); }
  #page-home .home-graveyard { margin-bottom: -32px; }
}

/* home greeting: "The spirits are listening" in a ghostly, softly flickering style */
#greeting {
  font-weight: 800; font-size: 28px; letter-spacing: -.01em;
  background: linear-gradient(90deg, #e8edf7 0%, #b8c4d8 40%, #8ff5cf 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 10px rgba(143, 245, 207, .25));
  animation: spirit-flicker 6s ease-in-out infinite;
}
#greeting + p { font-style: italic; letter-spacing: .02em; }
@keyframes spirit-flicker {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 10px rgba(143, 245, 207, .25)); }
  45% { opacity: .92; filter: drop-shadow(0 0 16px rgba(143, 245, 207, .4)); }
  47% { opacity: .6; }
  49% { opacity: .95; }
  70% { opacity: .85; filter: drop-shadow(0 0 6px rgba(143, 245, 207, .15)); }
}
@media (hover: none) and (pointer: coarse) and (max-width: 900px) { #greeting { font-size: 24px; } }
