:root {
  --bg: #f4f6f8;
  --elev: #ffffff;
  --ink: #152033;
  --muted: #5d6b7e;
  --line: #e3e8ef;
  --accent: #1d4e89;
  --accent-ink: #ffffff;
  --side: #101820;
  --side-ink: #e8eef5;
  --side-muted: #9aabbd;
  --bad: #9f2d2d;
  --bad-bg: #fdecea;
  --ok: #0f6b45;
  --ok-bg: #e7f6ee;
  --warn: #8a5a12;
  --warn-bg: #fff4df;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  color-scheme: light;
}
html.dark {
  --bg: #0e141b;
  --elev: #17202a;
  --ink: #e8eef5;
  --muted: #a9b6c6;
  --line: #2a3848;
  --accent: #8eb7e8;
  --accent-ink: #0e1824;
  --side: #0b1118;
  --side-ink: #e8eef5;
  --side-muted: #9aabbd;
  --bad: #ffb4b4;
  --bad-bg: #3a2224;
  --ok: #8fd9b8;
  --ok-bg: #163128;
  --warn: #f0d7a2;
  --warn-bg: #3a2e1c;
  --shadow: none;
  color-scheme: dark;
}
html.dark body {
  background-color: #0e141b;
  background-image:
    linear-gradient(rgba(14, 20, 27, 0.72), rgba(14, 20, 27, 0.72)),
    url("/static/bultixsync-logo.jpg");
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: #e7edf3;
  background-image:
    linear-gradient(rgba(244, 246, 248, 0.62), rgba(244, 246, 248, 0.62)),
    url("/static/bultixsync-logo.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  background-attachment: fixed;
  color: var(--ink);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--accent); }
h1, h2 { font-family: inherit; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 1.55rem; line-height: 1.2; }
h2 { font-size: 1.12rem; }
.frame { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--side);
  color: var(--side-ink);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.1rem 0.85rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: block;
  padding: 0 0.15rem 0.45rem;
  text-decoration: none;
}
.logo {
  display: block;
  width: 100%;
  height: 168px;
  object-fit: cover;
  object-position: center 46%;
  border-radius: 12px;
}
.auth-aside .logo {
  height: 320px;
}
.mark {
  width: 1.85rem;
  height: 1.85rem;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #2f6fed;
  color: #fff;
  font-weight: 600;
}
.side-nav { display: grid; gap: 0.2rem; }
.side-nav a {
  color: var(--side-ink);
  text-decoration: none;
  font-weight: 550;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
}
.side-nav a:hover, .side-nav a.active { background: rgba(255, 255, 255, 0.08); }
.side-label { margin: 0.85rem 0.7rem 0.15rem; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--side-muted); font-weight: 600; }
.side-nav a.market { display: flex; align-items: center; gap: 0.55rem; font-weight: 500; }
.mlogo { width: 1.35rem; height: 1.35rem; flex: none; display: block; }
.side-foot { margin-top: auto; display: grid; gap: 0.45rem; border-top: 1px solid #2a3a4c; padding-top: 0.85rem; }
.side .who { color: #d5dee8; font-size: 0.82rem; overflow-wrap: anywhere; }
.side .btn { width: 100%; color: var(--side-ink); border-color: #3a4d63; background: #1a2733; }
.side .btn:hover { color: #fff; border-color: #8eb7e8; }
.side .pill { justify-self: start; color: #d6e6fa; background: rgba(47, 111, 237, 0.22); border-color: transparent; }
.main { min-width: 0; }
.wrap { width: min(1120px, calc(100% - 3rem)); margin: 1.4rem auto 2.5rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-top { display: flex; align-items: center; gap: 0.75rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.7rem; color: var(--muted); margin: 0 0 0.3rem; font-weight: 600; }
.lead, .meta, .fine { color: var(--muted); }
.fine a { font-weight: 600; text-decoration: none; }
.card, .auth-card {
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 1.15rem 1.2rem;
}
.auth-card { width: min(420px, 100%); }
.auth-card.wide { width: min(560px, 100%); }
.wrap > .auth-card { margin-inline: auto; }
.detail { margin-top: 1rem; }
.store-grid { display: grid; gap: 0.8rem; }
@media (min-width: 800px) { .store-grid { grid-template-columns: 1fr 1fr; } }
.store-grid .card:hover { border-color: #c5d0de; }
.stack { display: grid; gap: 0.8rem; margin-top: 1rem; }
label { display: grid; gap: 0.35rem; font-weight: 550; }
.check { grid-template-columns: auto 1fr; align-items: center; font-weight: 400; }
input[type="email"], input[type="password"], input[type="text"], input:not([type]), select, textarea {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 0.62rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--elev);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-color: var(--accent);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn.solid { background: var(--accent); color: var(--accent-ink); }
.btn.solid:hover { filter: brightness(1.08); }
.btn.send-go { min-height: 52px; padding: 0.9rem 1.6rem; font-size: 1.08rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.tally { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.85rem 0; }
.tally a { display: grid; gap: 0.1rem; min-width: 5.5rem; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 0.4rem 0.65rem; background: var(--bg); font-size: 0.75rem; }
.tally a b { font-size: 1.05rem; }
.tally a.on { border-color: var(--accent); color: var(--accent); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: 0.6; }
.banner { border-radius: 8px; padding: 0.7rem 0.8rem; margin: 0.75rem 0; background: color-mix(in srgb, var(--bg) 80%, var(--elev)); border: 1px solid var(--line); }
.banner.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.banner.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.pill { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 0.12rem 0.55rem; font-size: 0.75rem; font-weight: 600; color: var(--muted); background: var(--bg); }
.pill.live { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.pill.stage { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.card h2 a { color: var(--ink); text-decoration: none; }
.card h2 a:hover { color: var(--accent); }
.card form { margin-top: 0.8rem; }
.nav-links { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 1rem 0; }
.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--elev);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}
.nav-links a:hover { border-color: var(--accent); color: var(--accent); }
.rule-row { display: grid; gap: 0.75rem; }
@media (min-width: 800px) { .rule-row { grid-template-columns: repeat(3, 1fr); } }
.rule-list { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.45rem; }
.rule-list li { display: flex; justify-content: space-between; gap: 0.75rem; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.75rem; background: var(--elev); }
.rule-list form { margin: 0; }
.rule-list li > span:last-child { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }
.sheet-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--elev); }
.sheet { width: 100%; border-collapse: collapse; }
.sheet th, .sheet td { text-align: left; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.sheet th { font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); background: var(--bg); }
.sheet tr:last-child td { border-bottom: 0; }
.steps { margin: 0.6rem 0 0; padding-left: 1.2rem; color: var(--ink); }
.steps li { margin: 0.35rem 0; }
.empty h2 { margin-bottom: 0.35rem; }
body.gate .frame { display: block; }
body.gate .wrap { width: 100%; margin: 0; }
.theme-float { position: fixed; top: 1rem; right: 1rem; z-index: 6; background: var(--elev); }
.auth-layout { display: grid; min-height: 100vh; }
.auth-aside {
  background: var(--side);
  color: var(--side-ink);
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-aside .brand { padding-left: 0; margin-bottom: 1.5rem; font-size: 1.2rem; }
.auth-aside h1 { font-size: 2rem; color: #fff; }
.auth-aside .lead { color: var(--side-muted); max-width: 28rem; }
.auth-aside .eyebrow { color: #9ec1ef; }
body.gate .auth-card { width: auto; max-width: none; border: 0; box-shadow: none; border-radius: 0; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 3rem 2.5rem; }
@media (min-width: 900px) {
  .auth-layout { grid-template-columns: 1.05fr 0.95fr; }
}
@media (max-width: 899px) {
  .frame { grid-template-columns: 1fr; }
  .side { position: sticky; height: auto; z-index: 4; }
  .side-nav { grid-template-columns: 1fr 1fr; }
  .side-foot { margin-top: 0.5rem; }
  .auth-aside, body.gate .auth-card { min-height: auto; padding: 1.5rem 1.1rem 2rem; }
  .wrap { width: min(1120px, calc(100% - 1.5rem)); }
}
