/* Gully Offerwall UI on the Gully Terminal design system (gully-ops design/terminal, data-product="chain"): kit v3
 * ground and accent, 1 px rules, 4 px radius on buttons/inputs/panels (status pills are the only round shapes),
 * JetBrains Mono for numbers and labels. Shared by the landing, the dashboard and the widget. */
@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@500;600;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --night: #05080d;
  --ink: #0d1015;   /* --t-surface: ground + 3% white */
  --ink-2: #14171c; /* --t-surface-2: ground + 6% white */
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .16);
  --cyan: #00b2fa;
  --blue: #2563ff;
  --green: #46fb04;
  --white: #eef1f4;
  --muted: #8d96a3;
  --danger: #ff6b6b;
  --warn: #f5b83d;
  --chain: linear-gradient(90deg, #00b2fa, #46fb04);
  --radius: 4px;
  --r-pill: 999px;
  --font: 'Exo 2', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--white);
  font: 500 15px/1.5 var(--font);
  overflow-x: hidden;
  min-width: 0;
}
img, svg { max-width: 100%; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
h1, h2, h3 { font-weight: 800; line-height: 1.15; margin: 0 0 .5em; letter-spacing: .2px; }
h1 { font-size: clamp(26px, 4vw, 44px); }
h2 { font-size: clamp(20px, 2.4vw, 26px); }
h3 { font-size: 17px; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.label {
  color: var(--muted);
  font: 700 11px/1.4 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.label::before { content: ''; display: inline-block; width: 12px; height: 1px; background: var(--cyan); vertical-align: middle; margin-right: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 24px; } }

/* ---------------------------------------------------------------- header (one line from 1024px) */
.hdr { position: sticky; top: 0; z-index: 20; background: rgba(5, 8, 13, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.hdr .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.hdr .brand { display: flex; align-items: center; gap: 10px; color: var(--white); font-weight: 800; white-space: nowrap; }
.hdr .brand img { height: 20px; width: auto; display: block; }
.hdr gc-switcher { flex: none; }
.hdr .prod { color: var(--muted); font: 700 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; border-left: 1px solid var(--line); padding-left: 12px; white-space: nowrap; }
.hdr .brand span { color: var(--muted); font-weight: 600; font-size: 14px; border-left: 1px solid var(--line); padding-left: 10px; }
.hdr nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.hdr nav a, .hdr nav button.navbtn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius);
  color: var(--muted); font: 600 14px var(--font); background: none; border: 0; cursor: pointer; white-space: nowrap;
}
.hdr nav a:hover, .hdr nav button.navbtn:hover { color: var(--white); text-decoration: none; background: var(--ink); }
.hdr nav a[aria-current='page'] { color: var(--cyan); background: var(--ink); }
.hdr .end { display: flex; align-items: center; gap: 8px; margin-left: auto; }
@media (min-width: 1024px) { .hdr .wrap { flex-wrap: nowrap; } .hdr nav { flex-wrap: nowrap; } }
@media (max-width: 1023px) { .hdr nav { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; } }

.ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- signature pill button */
.btn {
  --bg: var(--cyan); --fg: #000;
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: var(--radius); border: 1px solid transparent;
  background: var(--bg); color: var(--fg); font: 800 14px var(--font); letter-spacing: .3px;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .12s ease, filter .2s ease;
}
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn::after { /* cyan shine sweep */
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .6s ease;
}
.btn:hover::after { transform: translateX(120%); }
.btn .arrow { transition: transform .2s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.btn.secondary { --bg: transparent; --fg: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 45%, transparent); }
.btn.secondary::after { background: linear-gradient(110deg, transparent 30%, rgba(0, 178, 250, .25) 50%, transparent 70%); }
.btn.ghost { --bg: transparent; --fg: var(--white); border-color: var(--line); }
.btn.ghost::after { background: linear-gradient(110deg, transparent 30%, rgba(0, 178, 250, .25) 50%, transparent 70%); }
.btn.danger { --bg: transparent; --fg: var(--danger); border-color: rgba(255, 92, 122, .4); }
.btn.sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: .45; cursor: not-allowed; transform: none; }
.btn[disabled]::after { display: none; }

/* ---------------------------------------------------------------- cards, tiles, forms */
.card { background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.tile { background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.tile .v { font-family: var(--mono); font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .k { color: var(--muted); font: 500 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--r-pill); font: 700 11px/1.6 var(--mono); letter-spacing: .06em; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.live { color: var(--green); border-color: rgba(70, 251, 4, .35); }
.pill.warn { color: var(--warn); border-color: rgba(255, 176, 32, .35); }
.pill.bad { color: var(--danger); border-color: rgba(255, 92, 122, .35); }
.pill.info { color: var(--cyan); border-color: rgba(0, 178, 250, .35); }
.field { display: grid; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); }
input, select, textarea {
  width: 100%; min-width: 0; background: var(--night); color: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; font: 500 14px var(--font);
}
textarea { min-height: 80px; resize: vertical; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row > * { min-width: 0; }
.split { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .12em; }
td.num, .num { font-family: var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; max-width: 100%; }
code, .mono { font-family: var(--mono); font-size: 13px; word-break: break-all; }
pre { background: var(--night); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; overflow-x: auto; max-width: 100%; }

/* ---------------------------------------------------------------- stepper */
.stepper { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 18px; flex-wrap: wrap; counter-reset: s; }
.stepper li {
  counter-increment: s; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: var(--radius);
  border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 700;
}
.stepper li::before {
  content: counter(s); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 2px;
  background: var(--ink-2); color: var(--muted); font: 700 12px var(--mono);
}
.stepper li.active { color: var(--white); border-color: var(--cyan); }
.stepper li.active::before { background: var(--cyan); color: #000; }
.stepper li.done { color: var(--green); }
.stepper li.done::before { content: '✓'; background: rgba(70, 251, 4, .15); color: var(--green); }

/* ---------------------------------------------------------------- toasts (bottom-right) */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: grid; gap: 10px; width: min(360px, calc(100vw - 32px)); }
.toast {
  position: relative; overflow: hidden; display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px 16px;
  background: var(--night); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
  animation: toast-in .25s ease;
}
.toast .ico { color: var(--cyan); margin-top: 2px; }
.toast.ok .ico { color: var(--green); }
.toast.err .ico { color: var(--danger); }
.toast b { display: block; font-size: 14px; }
.toast span { color: var(--muted); font-size: 13px; }
.toast i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--cyan); animation: toast-bar linear forwards; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }
@keyframes toast-bar { from { width: 100%; } to { width: 0; } }

/* ---------------------------------------------------------------- charts */
.chart { position: relative; min-width: 0; }
.chart canvas { display: block; width: 100%; height: 150px; }
.chart .tip {
  position: absolute; pointer-events: none; background: var(--night); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 6px 10px; font: 500 12px var(--mono); white-space: nowrap; transform: translate(-50%, -110%); display: none;
}
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.chart-head .v { font-family: var(--mono); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
details.table-view summary { cursor: pointer; color: var(--muted); font-size: 12px; margin-top: 6px; }

/* ---------------------------------------------------------------- footer + badge */
.ftr { border-top: 1px solid var(--line); margin-top: 40px; }
.ftr .wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between; padding-top: 18px; padding-bottom: 18px; }
.ftr .links { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.ftr .links a { color: var(--muted); }
.ftr .bottom { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.badge-link { display: inline-flex; line-height: 0; }
.badge-link img { height: 30px; width: auto; }
@media (max-width: 720px) { .badge-link img { height: 26px; } }
.ext::after {
  content: ''; display: inline-block; width: 11px; height: 11px; margin-left: 4px; vertical-align: -1px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7h10v10'/%3E%3Cpath d='M7 17 17 7'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7h10v10'/%3E%3Cpath d='M7 17 17 7'/%3E%3C/svg%3E") center / contain no-repeat;
}
.badge-link.ext::after { display: none; }

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

/* ---------------------------------------------------------------- 404 */
.nf { padding: 72px 0 40px; max-width: 640px; }
.nf .code { font: 700 13px var(--mono); color: var(--cyan); letter-spacing: .12em; }
