/* ============================================================
   TRACELINE — component library
   Every interactive component ships default / hover / active /
   focus-visible / disabled / loading. Forced states are exposed
   as .is-hover .is-active .is-disabled .is-loading for the
   component-library page and for redline review.
   ============================================================ */

/* .connect-btn is the hook for the third-party wallet SDK
   (app-8o3zes1c.min.js). It carries no styling on purpose: appearance comes
   from the .btn variants, behaviour from the SDK or the built-in fallback. */

/* ---------------------------------------------------------- BUTTONS */
.btn {
  --btn-h: 44px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--btn-h);
  padding: 0 var(--sp-5);
  border-radius: var(--r-3);
  border: 1px solid transparent;
  font-family: var(--ff-ui);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--dur-2) var(--ease-out),
              border-color var(--dur-2) var(--ease-out),
              color var(--dur-2) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out),
              transform var(--dur-2) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.btn[disabled], .btn.is-disabled { opacity: 0.38; cursor: not-allowed; pointer-events: none; box-shadow: none; }

.btn--sm { --btn-h: 36px; padding: 0 var(--sp-4); border-radius: var(--r-2); font-size: var(--fs-xs); }
.btn--lg { --btn-h: 52px; padding: 0 var(--sp-6); font-size: 15px; border-radius: var(--r-4); }
.btn--block { width: 100%; }
.btn--icon { padding: 0; width: var(--btn-h); }

/* PRIMARY — the loudest surface on the page */
.btn--primary {
  background: var(--grad-cta);
  background-size: 160% 100%;
  background-position: 0% 50%;
  color: #fff;
  box-shadow: var(--glow-cta);
  border-color: rgba(255, 255, 255, 0.1);
}
.btn--primary::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.22), transparent 58%);
  opacity: 0.7;
}
.btn--primary:hover, .btn--primary.is-hover {
  background-position: 55% 50%;
  box-shadow: var(--glow-cta-hover);
  transform: translateY(-1px);
}
.btn--primary:active, .btn--primary.is-active {
  background-position: 100% 50%;
  transform: translateY(0) scale(0.994);
  box-shadow: 0 8px 24px -12px rgba(110, 75, 255, 0.7);
}

/* XL — the hero "Check wallet" */
.btn--xl {
  --btn-h: 68px;
  width: 100%;
  font-family: var(--ff-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  border-radius: var(--r-4);
  padding: 0 var(--sp-6);
}
.btn--xl .btn__arrow {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.18);
  transition: transform var(--dur-2) var(--ease-out), background var(--dur-2);
  margin-left: var(--sp-1);
}
.btn--xl:hover .btn__arrow, .btn--xl.is-hover .btn__arrow { transform: translateX(3px); background: rgba(255,255,255,0.3); }

/* SECONDARY — glass */
.btn--secondary {
  background: var(--glass);
  border-color: var(--border-strong);
  color: var(--text);
  backdrop-filter: blur(14px);
  box-shadow: var(--inset-hair);
}
.btn--secondary:hover, .btn--secondary.is-hover { background: var(--surface-2); border-color: var(--border-luminous); }
.btn--secondary:active, .btn--secondary.is-active { background: var(--surface-3); transform: scale(0.99); }

/* GHOST — text + subtle hover */
.btn--ghost { background: transparent; color: var(--text-2); border-color: transparent; padding: 0 var(--sp-3); }
.btn--ghost:hover, .btn--ghost.is-hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.btn--ghost:active, .btn--ghost.is-active { background: rgba(255, 255, 255, 0.09); }

/* QUIET — bordered on surface */
.btn--outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn--outline:hover, .btn--outline.is-hover { border-color: var(--border-strong); background: rgba(255, 255, 255, 0.04); }
.btn--outline:active, .btn--outline.is-active { background: rgba(255, 255, 255, 0.08); }

/* DANGER */
.btn--danger { background: var(--risk-severe); color: #fff; }
.btn--danger:hover, .btn--danger.is-hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn--danger:active, .btn--danger.is-active { filter: brightness(0.94); transform: none; }

/* LOADING — label is kept for width, replaced visually by a spinner */
.btn.is-loading { color: transparent; pointer-events: none; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::before {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
  animation: spin 720ms linear infinite;
}
.btn--secondary.is-loading::before, .btn--outline.is-loading::before { border-color: var(--border-strong); border-top-color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }

/* link-with-arrow */
.link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text); font-size: var(--fs-sm); font-weight: 600;
  border-bottom: 1px solid transparent; transition: color var(--dur-2), border-color var(--dur-2);
  min-height: 32px;
}
.link:hover { color: var(--g-cyan); border-color: currentColor; }
.link svg { transition: transform var(--dur-2) var(--ease-out); }
.link:hover svg { transform: translateX(3px); }

/* ---------------------------------------------------------- CHAIN SELECTOR */
.chain-select {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2);
  padding: 5px; border-radius: var(--r-4);
  background: rgba(6, 8, 18, 0.5);
  border: 1px solid var(--border);
}
[data-theme="light"] .chain-select { background: var(--surface-2); }

.chain-pill {
  --accent: var(--chain-eth);
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 12px;
  border-radius: var(--r-3);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  font-size: 13.5px; font-weight: 600; letter-spacing: -0.005em;
  cursor: pointer; text-align: left;
  transition: background var(--dur-2) var(--ease-out), border-color var(--dur-2), color var(--dur-2), box-shadow var(--dur-2);
}
.chain-pill[data-chain="bnb"] { --accent: var(--chain-bnb); }
.chain-pill img { width: 20px; height: 20px; flex: none; }
.chain-pill .chain-pill__tick { margin-left: auto; opacity: 0; transform: scale(0.6); transition: all var(--dur-2) var(--ease-spring); }
.chain-pill:hover, .chain-pill.is-hover { background: rgba(255, 255, 255, 0.045); color: var(--text); border-color: var(--border); }
[data-theme="light"] .chain-pill:not([aria-checked="true"]) { border-color: rgba(11, 16, 32, 0.09); background: rgba(255, 255, 255, 0.6); }
[data-theme="light"] .chain-pill:not([aria-checked="true"]):hover { border-color: rgba(11, 16, 32, 0.2); }
.chain-pill:active, .chain-pill.is-active { transform: scale(0.985); }
.chain-pill:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.chain-pill[aria-checked="true"], .chain-pill.is-selected {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-color: color-mix(in srgb, var(--accent) 62%, transparent);
  color: var(--text);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 24%, transparent), 0 6px 18px -12px var(--accent);
}
.chain-pill[aria-checked="true"] .chain-pill__tick, .chain-pill.is-selected .chain-pill__tick { opacity: 1; transform: scale(1); color: var(--accent); }
.chain-pill[disabled], .chain-pill.is-disabled { opacity: 0.35; cursor: not-allowed; }
.chain-pill.is-loading { color: transparent; position: relative; }
.chain-pill.is-loading img { opacity: 0.2; }
.chain-pill.is-loading::after {
  content: ""; position: absolute; left: 18px; top: 50%; margin-top: -8px;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border-strong); border-top-color: var(--text);
  animation: spin 700ms linear infinite;
}

/* compact dropdown variant used in the results header */
.chain-menu { position: relative; }
.chain-menu__btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 600; color: var(--text); cursor: pointer;
  min-height: 44px;
}
.chain-menu__btn img { width: 16px; height: 16px; }
.chain-menu__btn:hover { border-color: var(--border-strong); }

/* ---------------------------------------------------------- BADGES / CHIPS */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px;
  border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.01em;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  white-space: nowrap;
}
.badge img { width: 13px; height: 13px; }

.badge--chain[data-chain="ethereum"] { background: var(--chain-eth-tint); border-color: rgba(98, 126, 234, 0.45); color: #C3CEFF; }
.badge--chain[data-chain="bsc"] { background: var(--chain-bnb-tint); border-color: rgba(240, 185, 11, 0.45); color: #FFE79B; }
[data-theme="light"] .badge--chain[data-chain="ethereum"] { color: #2C46A8; }
[data-theme="light"] .badge--chain[data-chain="bsc"] { color: #7A5C00; }

.badge--demo {
  background: rgba(255, 255, 255, 0.08); border-color: var(--border-strong);
  color: var(--text); font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.12em;
}

/* risk chip — colour + icon + word, never colour alone */
.chip {
  --c: var(--risk-low); --tint: var(--risk-low-tint); --edge: var(--risk-low-edge);
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 11px 0 9px;
  border-radius: var(--r-pill);
  background: var(--tint);
  border: 1px solid var(--edge);
  color: var(--c);
  font-size: 12px; font-weight: 700; letter-spacing: 0.01em;
  white-space: nowrap;
}
.chip svg { width: 13px; height: 13px; flex: none; }
.chip--sm { height: 22px; font-size: 10.5px; padding: 0 8px 0 7px; gap: 4px; }
.chip--sm svg { width: 11px; height: 11px; }
.chip--lg { height: 34px; font-size: 13px; padding: 0 14px 0 11px; }
.chip--lg svg { width: 15px; height: 15px; }

.chip[data-tier="low"] { --c: var(--risk-low); --tint: var(--risk-low-tint); --edge: var(--risk-low-edge); }
.chip[data-tier="moderate"] { --c: var(--risk-mod); --tint: var(--risk-mod-tint); --edge: var(--risk-mod-edge); }
.chip[data-tier="high"] { --c: var(--risk-high); --tint: var(--risk-high-tint); --edge: var(--risk-high-edge); }
.chip[data-tier="severe"] { --c: var(--risk-severe); --tint: var(--risk-severe-tint); --edge: var(--risk-severe-edge); }

/* severity dot + label used in tables */
.sev { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; }
.sev i { width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
.sev[data-tier="low"] { color: var(--risk-low); }
.sev[data-tier="moderate"] { color: var(--risk-mod); }
.sev[data-tier="high"] { color: var(--risk-high); }
.sev[data-tier="severe"] { color: var(--risk-severe); }

.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: var(--r-1); border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--ff-mono); font-size: 10.5px; color: var(--text-2); letter-spacing: 0.02em;
}

/* ---------------------------------------------------------- SURFACES */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  box-shadow: var(--inset-hair), var(--sh-2);
  backdrop-filter: blur(18px);
}
[data-theme="light"] .card {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--sh-2);
}
.card--pad { padding: var(--sp-6); }
.card--pad-lg { padding: var(--sp-8); }
.card--solid { background: var(--surface); }
.card--hover { transition: border-color var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out), box-shadow var(--dur-3); }
.card--hover:hover { border-color: var(--border-luminous); transform: translateY(-2px); box-shadow: var(--inset-hair), var(--sh-3); }

.card--gradient {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, rgba(110,75,255,0.85), rgba(45,226,230,0.5) 45%, rgba(198,242,78,0.55)) border-box;
}

/* the hero input card gets a stronger, coloured hairline */
.input-card {
  position: relative;
  padding: var(--sp-5);
  border-radius: var(--r-7);
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, rgba(20, 25, 46, 0.92), rgba(11, 14, 27, 0.94)) padding-box,
    linear-gradient(140deg, rgba(123, 92, 255, 0.7), rgba(45, 226, 230, 0.35) 48%, rgba(198, 242, 78, 0.45)) border-box;
  box-shadow: var(--sh-4), var(--inset-hair);
  backdrop-filter: blur(24px);
}
[data-theme="light"] .input-card {
  background:
    linear-gradient(180deg, #FFFFFF, #FBFBFE) padding-box,
    linear-gradient(140deg, rgba(91, 52, 242, 0.5), rgba(45, 226, 230, 0.35) 50%, rgba(198, 242, 78, 0.5)) border-box;
}

/* ---------------------------------------------------------- FIELDS */
.field { position: relative; display: flex; align-items: center; gap: var(--sp-2); }
.input {
  width: 100%; min-height: 52px;
  padding: 0 52px 0 46px;
  background: rgba(4, 6, 14, 0.72);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-3);
  color: var(--text);
  font-family: var(--ff-mono);
  font-size: 13.5px;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2), background var(--dur-2);
}
[data-theme="light"] .input { background: #fff; }
.input::placeholder { color: var(--text-3); font-family: var(--ff-mono); }
.input:hover { border-color: rgba(255, 255, 255, 0.26); }
[data-theme="light"] .input:hover { border-color: var(--border-strong); }
.input:focus, .input:focus-visible {
  outline: none;
  border-color: var(--g-cyan);
  box-shadow: 0 0 0 3px rgba(45, 226, 230, 0.16);
  background: rgba(4, 6, 14, 0.9);
}
[data-theme="light"] .input:focus { box-shadow: 0 0 0 3px rgba(45, 226, 230, 0.28); background: #fff; }
.input[disabled], .input.is-disabled { opacity: 0.42; cursor: not-allowed; background: rgba(255,255,255,0.03); }
.input[aria-invalid="true"], .input.is-invalid {
  border-color: var(--risk-severe);
  box-shadow: 0 0 0 3px rgba(255, 46, 107, 0.16);
}
.field__icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  pointer-events: none; opacity: 0.9;
}
.field__icon img { width: 20px; height: 20px; }
.field__action {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: var(--r-2); border: 1px solid transparent; background: transparent;
  color: var(--text-3); cursor: pointer;
  transition: all var(--dur-2);
}
.field__action:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); border-color: var(--border); }
.field__action:active { transform: translateY(-50%) scale(0.94); }
.field.is-loading .input { padding-right: 44px; }
.field.is-loading .field__action { color: transparent; }
.field.is-loading .field__action::after {
  content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--border-strong); border-top-color: var(--text);
  animation: spin 700ms linear infinite;
}
.field__hint { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: var(--fs-xs); color: var(--text-3); min-height: 18px; }
.field__hint[data-state="error"] { color: var(--risk-severe); }
.field__hint[data-state="ok"] { color: var(--risk-low); }

/* ---------------------------------------------------------- GAUGE */
.gauge { position: relative; display: grid; place-items: center; }
.gauge svg { width: 100%; height: auto; overflow: visible; }
.gauge__track { stroke: rgba(255, 255, 255, 0.08); }
[data-theme="light"] .gauge__track { stroke: rgba(11, 16, 32, 0.1); }
.gauge__value {
  stroke-linecap: round;
  transition: stroke-dashoffset var(--dur-5) var(--ease-out);
  filter: drop-shadow(0 0 10px currentColor);
}
.gauge__ticks line { stroke: rgba(255, 255, 255, 0.16); }
.gauge__readout { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 2px; }
.gauge__score {
  font-family: var(--ff-ui); font-weight: 800; font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em; line-height: 0.9;
}

/* ---------------------------------------------------------- FINDINGS ROWS */
.finding {
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  background: rgba(255, 255, 255, 0.022);
  overflow: hidden;
  transition: border-color var(--dur-2) var(--ease-out), background var(--dur-2);
}
[data-theme="light"] .finding { background: #fff; }
.finding:hover { border-color: var(--border-strong); }
.finding[open] { border-color: var(--border-luminous); background: rgba(255, 255, 255, 0.04); }
.finding > summary {
  list-style: none; cursor: pointer;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center; gap: var(--sp-3);
  padding: var(--sp-4);
  min-height: 68px;
}
.finding > summary::-webkit-details-marker { display: none; }
.finding__icon {
  width: 44px; height: 44px; border-radius: var(--r-3);
  display: grid; place-items: center;
  background: var(--tint, var(--surface-2)); color: var(--c, var(--text-2));
  border: 1px solid var(--edge, var(--border));
}
.finding[data-tier="low"] { --c: var(--risk-low); --tint: var(--risk-low-tint); --edge: var(--risk-low-edge); }
.finding[data-tier="moderate"] { --c: var(--risk-mod); --tint: var(--risk-mod-tint); --edge: var(--risk-mod-edge); }
.finding[data-tier="high"] { --c: var(--risk-high); --tint: var(--risk-high-tint); --edge: var(--risk-high-edge); }
.finding[data-tier="severe"] { --c: var(--risk-severe); --tint: var(--risk-severe-tint); --edge: var(--risk-severe-edge); }
.finding__title { font-size: 14.5px; font-weight: 600; color: var(--text); letter-spacing: -0.005em; }
.finding__meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.finding__chev { transition: transform var(--dur-3) var(--ease-out); color: var(--text-3); }
.finding[open] .finding__chev { transform: rotate(180deg); }
.finding__body {
  padding: 0 var(--sp-4) var(--sp-4) calc(44px + var(--sp-4) + var(--sp-3));
  display: grid; gap: var(--sp-3);
  animation: fadeUp var(--dur-4) var(--ease-out);
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.evidence {
  display: grid; gap: 8px;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-3);
  background: rgba(4, 6, 14, 0.5);
  border: 1px solid var(--border-soft);
  font-size: 12.5px;
}
[data-theme="light"] .evidence { background: var(--surface-2); }
.evidence__row { display: flex; justify-content: space-between; gap: var(--sp-4); align-items: baseline; }
.evidence__k { color: var(--text-3); }
.evidence__v { color: var(--text); font-family: var(--ff-mono); font-size: 12px; }

/* ---------------------------------------------------------- STEPS */
.step {
  position: relative; padding-top: var(--sp-6);
  border-top: 1px solid var(--border);
}
.step__num {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.14em;
  color: var(--g-cyan); text-transform: uppercase;
}

/* ---------------------------------------------------------- NUMBERED GRID ITEM */
.screen-item {
  position: relative;
  padding: var(--sp-5);
  border-radius: var(--r-5);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008));
  transition: border-color var(--dur-3), transform var(--dur-3) var(--ease-out), background var(--dur-3);
}
[data-theme="light"] .screen-item { background: #fff; }
.screen-item:hover { border-color: var(--border-luminous); transform: translateY(-2px); }
.screen-item__num {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 8px;
  font-family: var(--ff-mono); font-size: 11px; font-weight: 500;
  color: var(--text); background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border); margin-bottom: var(--sp-4);
}
.screen-item__icon { color: var(--g-cyan); }

/* ---------------------------------------------------------- TABLE */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-3); font-weight: 700; padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--base); backdrop-filter: blur(8px);
}
.table td { padding: 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.table tbody tr { transition: background var(--dur-1); }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.035); }
.table .num { font-variant-numeric: tabular-nums; text-align: right; }

/* ---------------------------------------------------------- FAQ */
.faq { border-top: 1px solid var(--border); }
.faq__item { border-bottom: 1px solid var(--border); }
.faq__item summary {
  list-style: none; cursor: pointer; min-height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-4) 0; font-size: 15.5px; font-weight: 600; color: var(--text);
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary:hover { color: var(--g-cyan); }
.faq__item .plus { position: relative; width: 16px; height: 16px; flex: none; }
.faq__item .plus::before, .faq__item .plus::after {
  content: ""; position: absolute; background: currentColor; border-radius: 2px; transition: transform var(--dur-3) var(--ease-out), opacity var(--dur-3);
}
.faq__item .plus::before { left: 0; top: 7px; width: 16px; height: 1.5px; }
.faq__item .plus::after { left: 7px; top: 0; width: 1.5px; height: 16px; }
.faq__item[open] .plus::after { transform: rotate(90deg); opacity: 0; }
.faq__item p { padding: 0 0 var(--sp-5); max-width: 720px; color: var(--text-2); font-size: 14.5px; line-height: 1.65; }

/* ---------------------------------------------------------- ALERTS / STATES */
.alert {
  display: grid; grid-template-columns: auto 1fr; gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-4);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13.5px;
}
.alert__icon { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; }
.alert--error { border-color: var(--risk-severe-edge); background: var(--risk-severe-tint); }
.alert--error .alert__icon { color: var(--risk-severe); }
.alert--warn { border-color: var(--risk-mod-edge); background: var(--risk-mod-tint); }
.alert--warn .alert__icon { color: var(--risk-mod); }
.alert--info { border-color: rgba(45, 226, 230, 0.35); background: rgba(45, 226, 230, 0.08); }
.alert--info .alert__icon { color: var(--g-cyan); }
.alert__title { font-weight: 650; color: var(--text); font-size: 13.5px; }
.alert__body { color: var(--text-2); margin-top: 2px; }

/* ---------------------------------------------------------- SKELETON */
.skeleton {
  position: relative; overflow: hidden;
  background: rgba(255, 255, 255, 0.085);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--r-2);
}
[data-theme="light"] .skeleton { background: rgba(11, 16, 32, 0.09); }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.4s var(--ease-in-out) infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-line { height: 12px; border-radius: 99px; }
.sk-circle { border-radius: 50%; }

/* ---------------------------------------------------------- PROGRESS / EXPOSURE BAR */
.bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; display: flex; }
[data-theme="light"] .bar { background: rgba(11, 16, 32, 0.08); }
.bar > i { display: block; height: 100%; }

/* ---------------------------------------------------------- TABS */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--border); }
.tab {
  min-height: 34px; padding: 0 14px; border: 0; border-radius: var(--r-pill);
  background: transparent; color: var(--text-2);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: all var(--dur-2);
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.tab[aria-selected="true"] { background: var(--surface-3); color: var(--text); box-shadow: var(--sh-1); }

/* ---------------------------------------------------------- TOGGLE (theme + lang) */
.seg {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: rgba(255, 255, 255, 0.04);
}
.seg button {
  min-height: 30px; padding: 0 9px; border: 0; border-radius: var(--r-pill);
  background: transparent; color: var(--text-3);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; cursor: pointer;
  transition: all var(--dur-2);
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
[data-theme="light"] .seg button[aria-pressed="true"] { background: var(--text); color: #fff; }

/* ---------------------------------------------------------- CODE BLOCK */
.code {
  border-radius: var(--r-4);
  border: 1px solid var(--border);
  background: rgba(4, 6, 14, 0.78);
  overflow: hidden;
}
[data-theme="light"] .code { background: #0B1020; }
.code__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--ff-mono); font-size: 11px; color: #8E97B4; letter-spacing: 0.04em;
}
.code pre { margin: 0; padding: var(--sp-4); overflow-x: auto; font-family: var(--ff-mono); font-size: 12.5px; line-height: 1.75; color: #D7DEF5; }
.code .t-key { color: #C6F24E; }
.code .t-str { color: #2DE2E6; }
.code .t-com { color: #6B7492; }
.code .t-fn { color: #A78BFF; }

/* ---------------------------------------------------------- TOAST */
.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: var(--z-toast);
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--r-3);
  background: var(--glass-strong); border: 1px solid var(--border-luminous);
  backdrop-filter: blur(20px); box-shadow: var(--sh-3);
  font-size: 13px; color: var(--text);
  animation: toastIn var(--dur-4) var(--ease-out);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------- STATE PREVIEW TOOLBAR */
.toolbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px;
  z-index: var(--z-toolbar);
  display: flex; align-items: center; gap: 6px;
  padding: 6px; border-radius: var(--r-pill);
  background: var(--glass-strong); border: 1px solid var(--border-strong);
  backdrop-filter: blur(20px); box-shadow: var(--sh-3);
  max-width: calc(100vw - 24px); overflow-x: auto;
  scrollbar-width: none;
}
.toolbar::-webkit-scrollbar { display: none; }
.toolbar__label { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); padding: 0 8px; font-weight: 700; white-space: nowrap; }
.toolbar button {
  min-height: 32px; padding: 0 11px; border: 1px solid transparent; border-radius: var(--r-pill);
  background: transparent; color: var(--text-2); font-size: 11.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: all var(--dur-2);
}
.toolbar button:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.toolbar button[aria-pressed="true"] { background: var(--text); color: var(--text-inverse); }

/* ---------------------------------------------------------- MISC */
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--risk-low); box-shadow: 0 0 0 3px rgba(43, 217, 164, 0.18); }
.dot-live--pulse { animation: pulse 2.4s var(--ease-in-out) infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 3px rgba(43,217,164,0.18); } 50% { box-shadow: 0 0 0 7px rgba(43,217,164,0.04); } }

.copy-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px;
  border-radius: var(--r-2); border: 1px solid transparent; background: transparent;
  color: var(--text-3); cursor: pointer; transition: all var(--dur-2);
}
.copy-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); border-color: var(--border); }
.copy-btn:active { transform: scale(0.93); }

.avatar-chain { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); }
.avatar-chain img { width: 18px; height: 18px; }

/* ---------------------------------------------------------- WALLET STATE
   The connect sheet lives in the wallet script, not here. These are the only
   two pieces the interface owns: the account chip and the requirement note. */
.account-chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 11px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text); font-family: var(--ff-mono); font-size: 11.5px;
  cursor: default;
}
.wallet-note {
  display: flex; align-items: center; gap: 7px;
  margin-top: 10px; font-size: 11.5px; color: var(--text-3);
}
.wallet-note svg { color: var(--text-3); flex: none; }
@media (max-width: 560px) { .account-chip__addr { display: none; } }
