/* Corda Arena design system. Tokens come from corda-arena.com itself (black pearl navy, ultra violet, electric purple, Bebas Neue).
   Neue Haas Grotesk is licensed to the venue site, Inter Tight is the free stand-in with the same tight grotesque rhythm.
   Rule of thumb: navy and off-white do the work, violet marks what is active, white pills are the primary action. */
@font-face { font-family: "Bebas Neue"; src: url(/core/fonts/bebas-neue.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Inter Tight"; src: url(/core/fonts/inter-tight-latin.woff2) format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter Tight"; src: url(/core/fonts/inter-tight-latin-ext.woff2) format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --navy: #030d2b;
  --navy-1: #081338;
  --navy-2: #0e1a47;
  --navy-3: #172357;
  --line: rgba(226, 216, 254, 0.14);
  --line-strong: rgba(226, 216, 254, 0.28);
  --text: #f7f6fc;
  --dim: #b6b8c8;
  --mute: #8d91a6;
  --violet: #6f3bfa;
  --violet-soft: rgba(111, 59, 250, 0.2);
  --lilac: #c5b1fd;
  --purple: #a628e8;
  --orange: #f6511d;
  --ok: #5fe0b0;
  --warn: #ffc26b;
  --bad: #ff8a7a;
  --r-s: 12px;
  --r-m: 16px;
  --r-l: 24px;
  --r-xl: 32px;
  --head: "Bebas Neue", "Arial Narrow", Impact, sans-serif;
  --body: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--navy); color: var(--text); }
body { font: 400 16px/1.5 var(--body); letter-spacing: 0.002em; min-height: 100dvh; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; border-radius: 6px; }

/* ---------- type ---------- */
.display { font: 400 clamp(64px, 13vw, 190px)/0.88 var(--head); letter-spacing: 0; }
.h1 { font: 400 clamp(40px, 6vw, 64px)/0.95 var(--head); letter-spacing: 0.005em; }
.h2 { font: 400 clamp(28px, 3.4vw, 38px)/1 var(--head); letter-spacing: 0.01em; }
.h3 { font: 600 18px/1.3 var(--body); letter-spacing: 0; }
.lead { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.45; color: var(--dim); max-width: 60ch; }
.small { font-size: 14px; line-height: 1.45; }
.dim { color: var(--dim); }
.mute { color: var(--mute); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px;
  border: 1px solid transparent; border-radius: 999px; background: none; font-weight: 500; font-size: 15px; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease), color .18s;
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: .45; cursor: default; transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: #fff; color: var(--navy); }
.btn-primary:hover { background: #e9e3ff; }
.btn-primary svg { color: var(--violet); }
.btn-ghost { border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--lilac); background: var(--violet-soft); }
.btn-quiet { color: var(--dim); padding-inline: 12px; }
.btn-quiet:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.btn-danger { border-color: rgba(255, 138, 122, .45); color: var(--bad); }
.btn-danger:hover { background: rgba(255, 138, 122, .12); }
.btn-ok { background: var(--ok); color: #03231a; }
.btn-ok:hover { filter: brightness(1.08); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--dim); }
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 14px; font-weight: 500; color: var(--dim); }
.hint { font-size: 13px; line-height: 1.4; color: var(--mute); }
.err { font-size: 14px; color: var(--bad); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 11px 14px; font-size: 16px; line-height: 1.35; color: var(--text); background: var(--navy-1);
  border: 1px solid var(--line-strong); border-radius: var(--r-s); transition: border-color .15s, background .15s; appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--mute); }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(226, 216, 254, .42); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--lilac); background: var(--navy-2); }
.textarea { min-height: 110px; resize: vertical; }
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23c5b1fd' stroke-width='1.6'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; line-height: 1.35; }
.check input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--violet); }

/* on/off */
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; min-height: 32px; }
.switch input { position: absolute; opacity: 0; width: 46px; height: 28px; margin: 0; cursor: pointer; }
.switch i { width: 46px; height: 28px; flex: none; border-radius: 999px; background: var(--navy-3); border: 1px solid var(--line-strong); position: relative; transition: background .2s, border-color .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--dim); transition: transform .22s var(--ease), background .2s; }
.switch input:checked + i { background: var(--violet); border-color: var(--violet); }
.switch input:checked + i::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + i { outline: 2px solid var(--lilac); outline-offset: 2px; }

/* choose one */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--navy-1); }
.seg button { min-height: 38px; padding: 6px 16px; border: 0; border-radius: 999px; background: none; color: var(--dim); font-size: 14px; font-weight: 500; cursor: pointer; transition: background .15s, color .15s; }
.seg button:hover { color: var(--text); }
.seg button.on, .seg button[aria-pressed="true"] { background: #fff; color: var(--navy); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { flex: none; padding: 12px 14px; min-height: 44px; border: 0; background: none; color: var(--dim); text-decoration: none; font-weight: 500; font-size: 15px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs .on { color: var(--text); border-bottom-color: var(--lilac); }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.count:empty { display: none; }

/* ---------- surfaces ---------- */
.panel { background: var(--navy-1); border: 1px solid var(--line); border-radius: var(--r-l); padding: clamp(16px, 2.4vw, 24px); }
.panel + .panel { margin-top: 16px; }
.panel-title { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 14px; }
.stack { display: grid; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--dim); white-space: nowrap; }
.tag-violet { background: var(--violet-soft); border-color: rgba(197, 177, 253, .4); color: var(--lilac); }
.tag-ok { border-color: rgba(95, 224, 176, .4); color: var(--ok); }
.tag-warn { border-color: rgba(255, 194, 107, .4); color: var(--warn); }
.tag-bad { border-color: rgba(255, 138, 122, .45); color: var(--bad); }
.tag-live { background: var(--orange); border-color: var(--orange); color: #fff; }
.items > * + * { border-top: 1px solid var(--line); }
.item { display: flex; align-items: center; gap: 14px; padding: 14px 0; min-width: 0; }
.empty { padding: 40px 16px; text-align: center; color: var(--dim); }
.empty .h2 { color: var(--text); margin-bottom: 6px; }
.skeleton { background: linear-gradient(100deg, var(--navy-1) 30%, var(--navy-2) 50%, var(--navy-1) 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--r-m); min-height: 80px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- dialog + toast ---------- */
dialog.sheet { border: 1px solid var(--line-strong); border-radius: var(--r-l); background: var(--navy-1); color: var(--text); padding: 24px; width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; }
dialog.sheet::backdrop { background: rgba(3, 13, 43, .72); backdrop-filter: blur(4px); }
#toasts { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 40; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: var(--r-m); background: #fff; color: var(--navy); font-weight: 500; font-size: 15px; animation: rise .3s var(--ease); }
.toast.bad { background: #ffd9d3; color: #5a0f03; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (min-width: 900px) { #toasts { bottom: 24px; } }

/* ---------- brand mark ---------- */
.mark { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.mark img { width: 36px; height: 36px; }
.mark span { font: 400 22px/1 var(--head); letter-spacing: 0.04em; padding-top: 2px; }

/* ---------- centered auth pages ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); background: var(--navy); }
.auth-photo { display: none; position: relative; overflow: hidden; }
.auth-photo img { width: 100%; height: 100%; object-fit: cover; }
.auth-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(3, 13, 43, .15), var(--navy)), linear-gradient(0deg, rgba(3, 13, 43, .7), rgba(3, 13, 43, .1) 50%); }
.auth-main { display: flex; flex-direction: column; padding: calc(20px + env(safe-area-inset-top)) var(--gutter) calc(24px + env(safe-area-inset-bottom)); min-height: 100dvh; }
.auth-body { flex: 1; display: flex; flex-direction: column; justify-content: center; width: min(420px, 100%); margin: 28px auto; }
.auth-body .h1 { margin-bottom: 8px; }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.langs { display: inline-flex; gap: 2px; }
.langs a, .langs button { display: inline-grid; place-items: center; min-width: 40px; min-height: 40px; border: 0; background: none; border-radius: 999px; color: var(--mute); font-size: 14px; font-weight: 500; letter-spacing: .03em; text-decoration: none; cursor: pointer; }
.langs a:hover, .langs button:hover { color: var(--text); }
.langs .on { color: var(--text); background: rgba(255, 255, 255, .09); }
@media (min-width: 960px) {
  .auth { grid-template-columns: minmax(0, 1.15fr) minmax(460px, 1fr); }
  .auth-photo { display: block; }
}

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