/* kascov — /kascov trade page. Only what this page adds on top of the shared
   palette in /style.css; every colour is a shared token so the two surfaces
   can never drift, and light/dark follow the site's `color-scheme: dark`. */

.trade-market {
  --kc-lime: #d8ff57;
  --kc-cyan: #58f5d2;
  --kc-violet: #9d8cff;
  --kc-ink: #070b0a;
  --kc-panel: rgba(13, 21, 19, .84);
  --kc-shadow: 0 24px 80px rgba(0, 0, 0, .3);
  min-height: 100vh;
  overflow-x: clip;
  background-color: #080d0c;
  background-image:
    radial-gradient(900px 560px at 78% -8%, rgba(88, 245, 210, .12), transparent 66%),
    radial-gradient(800px 500px at 3% 26%, rgba(157, 140, 255, .065), transparent 68%);
  background-attachment: fixed;
}
.trade-market::before {
  position: absolute; inset: 0 0 auto; z-index: 0; height: 560px; content: ""; pointer-events: none;
  opacity: .3;
  background-image:
    linear-gradient(rgba(112, 199, 186, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112, 199, 186, .05) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 78%);
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}
.kc-brand-watermark {
  --kc-mark-x: 0px;
  --kc-mark-y: 0px;
  position: fixed; top: clamp(8rem, 18vh, 13rem); right: clamp(-17rem, -13vw, -8rem);
  z-index: 0; width: clamp(31rem, 46vw, 50rem); aspect-ratio: 1;
  display: grid; place-items: center; color: var(--accent); opacity: .035;
  pointer-events: none;
  transform: translate3d(var(--kc-mark-x), var(--kc-mark-y), 0);
  will-change: transform;
}
.kc-brand-watermark svg {
  width: 100%; height: 100%;
  filter: blur(16px) drop-shadow(0 0 58px rgba(112,199,186,.18));
}
.trade-doc { position: relative; z-index: 1; max-width: 1000px; margin: 0 auto; padding: 1.2rem 1.25rem 5rem; }
.kc-brandbar {
  min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.5rem; border-bottom: 1px solid var(--border);
}
.kc-brand,
.kc-brandlinks { display: inline-flex; align-items: center; gap: .7rem; }
.kc-brand {
  color: var(--text); text-decoration: none; font-family: var(--mono); font-size: .76rem;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.kc-brand .wordmark-eye { color: var(--accent); flex: none; filter: drop-shadow(0 0 10px rgba(73,234,203,.24)); }
.kc-brandlinks a,
.kc-network {
  min-height: 32px; display: inline-flex; align-items: center; padding: .3rem .65rem;
  border: 1px solid var(--border); border-radius: 999px; color: var(--faint);
  font-family: var(--mono); font-size: .66rem; letter-spacing: .04em; text-decoration: none;
}
.kc-brandlinks a:hover { color: var(--text); border-color: var(--border-strong); text-decoration: none; }
.kc-network { color: var(--accent); background: rgba(73,234,203,.055); }

/* ------------------------------------------------------------------ hero */

.kc-hero { position: relative; min-height: 300px; margin: 0 0 1.4rem; padding: clamp(2.2rem, 4.8vw, 4rem) 0 1.5rem; }
.kc-hero > *:not(.dag-canvas) { position: relative; z-index: 1; }
.kc-market-kicker {
  display: flex; align-items: center; gap: .65rem; margin: 0 0 1.05rem;
  color: var(--kc-cyan); font: 700 .7rem/1 var(--mono);
  letter-spacing: .12em; text-transform: uppercase;
}
.kc-live-dot {
  width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--kc-cyan);
  box-shadow: 0 0 0 5px rgba(88,245,210,.09), 0 0 22px var(--kc-cyan);
  animation: kc-market-pulse 2.4s ease-in-out infinite;
}
@keyframes kc-market-pulse { 50% { opacity: .55; transform: scale(.86); } }
.kc-hero-top { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; }
.kc-hero h1 {
  font-family: var(--display); font-size: clamp(2.8rem, 6.4vw, 5.6rem); font-weight: 780;
  margin: 0; line-height: .9; letter-spacing: -.06em;
  text-shadow: 0 0 36px rgba(216,255,87,.05);
}
.kc-ticker {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--border-strong);
  border-radius: 999px; padding: .28rem .7rem; align-self: center;
}
.kc-build {
  align-self: center; padding: .28rem .68rem; border: 1px solid rgba(216, 255, 87, .26);
  border-radius: 999px; background: rgba(216, 255, 87, .075); color: var(--kc-lime);
  font: 700 .72rem/1.25 var(--mono); letter-spacing: .055em; white-space: nowrap;
  box-shadow: inset 0 1px rgba(216, 255, 87, .055);
}
.kc-build[data-kind="curve"] {
  color: var(--kc-cyan); border-color: rgba(88, 245, 210, .26);
  background: rgba(88, 245, 210, .075); box-shadow: inset 0 1px rgba(88, 245, 210, .055);
}
.kc-priceline { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin: 1rem 0 .5rem; }
.kc-price { font-family: var(--mono); font-size: clamp(1.65rem, 4vw, 2.4rem); font-weight: 600; color: var(--text); }
.kc-price small { font-size: .5em; color: var(--faint); font-weight: 400; margin-left: .3rem; }
.kc-phase {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .05em;
  color: var(--born); background: var(--born-soft); border-radius: 999px; padding: .25rem .7rem;
}
.kc-bond { display: flex; align-items: center; gap: .8rem; margin: .2rem 0 .6rem; max-width: 680px; flex-wrap: nowrap; }
.kc-bond-bar {
  flex: 1 1 120px; height: 8px; border-radius: 999px; background: var(--bg-soft);
  border: 1px solid var(--border); overflow: hidden;
}
.kc-bond-fill { height: 100%; width: 0; background: var(--accent); transition: width .6s ease; }
/* the progress detail is a long mono string; let it shrink and wrap so a
   narrow phone never gets a horizontal scrollbar off this one label */
.kc-bond-label { font-family: var(--mono); font-size: .74rem; color: var(--faint); flex: 0 0 auto; white-space: nowrap; line-height: 1.4; }
@media (max-width: 600px) {
  .kc-bond { flex-wrap: wrap; }
  .kc-bond-label { flex: 0 1 auto; white-space: normal; min-width: 0; }
}
.kc-creed {
  color: var(--muted); line-height: 1.6; font-size: .96rem; max-width: 70ch;
  border-left: 2px solid var(--kc-cyan); padding-left: .9rem; margin: 1rem 0 0;
  text-shadow: 0 2px 26px rgba(5,16,14,.9);
}

/* ------------------------------------------------------------- verified stats */

.kc-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 1.6rem 0 1.2rem;
  overflow: hidden; border: 1px solid var(--border); border-radius: 18px;
  background: var(--border); box-shadow: var(--kc-shadow);
}
@media (max-width: 720px) { .kc-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 380px) { .kc-stats { grid-template-columns: 1fr; } }
.kc-stat {
  position: relative; min-height: 112px; padding: 1rem 1.05rem;
  background: rgba(12, 19, 17, .96); border: 0; border-radius: 0;
}
.kc-stat::before {
  position: absolute; inset: 0 auto auto 0; width: 100%; height: 2px; content: "";
  background: linear-gradient(90deg, var(--kc-cyan), transparent 78%); opacity: .32;
}
.kc-stat:nth-child(3)::before { background: linear-gradient(90deg, var(--kc-lime), transparent 78%); opacity: .65; }
.kc-stat:nth-child(4)::before { background: linear-gradient(90deg, var(--kc-violet), transparent 78%); opacity: .48; }
.kc-stat-label {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .07em; text-transform: uppercase;
  color: var(--faint); display: block;
}
.kc-stat-n { font-family: var(--mono); font-size: 1.12rem; font-weight: 600; color: var(--text); margin-top: .35rem; word-break: break-word; }
.kc-stat-n.soft { color: var(--faint); font-size: .9rem; font-weight: 400; }
.kc-stat-prove { display: block; margin-top: .35rem; font-family: var(--mono); font-size: .66rem; color: var(--faint); }
a.kc-stat { text-decoration: none; color: inherit; display: block; }
a.kc-stat:hover { background: #101a17; }
a.kc-stat:hover .kc-stat-prove { color: var(--accent); }

/* ---------------------------------------------------------------- sections */

.kc-section { margin: 2.2rem 0 0; }
.kc-section > h2, .kc-section-head > h2 {
  font-family: var(--mono); font-size: .78rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--faint); margin: 0 0 1rem;
  display: flex; align-items: center; gap: .7rem;
}
.kc-section > h2::before, .kc-section-head > h2::before { content: "▮"; color: var(--accent); font-size: .6rem; }
.kc-section > h2::after, .kc-section-head > h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }
.kc-section-head { display: flex; align-items: flex-start; gap: .8rem; }
.kc-section-head > h2 { flex: 1; min-width: 0; }
.kc-history-btn {
  appearance: none; flex: none; margin: -.35rem 0 .65rem; padding: .42rem .68rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--bg-soft);
  color: var(--accent); font: 600 .68rem/1.2 var(--mono); letter-spacing: .04em;
  cursor: pointer; transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.kc-history-btn:hover, .kc-history-btn:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.kc-history-btn:disabled { color: var(--faint); cursor: wait; opacity: .8; }

/* ---- production chart switcher ---------------------------------------- */
.kc-chart-section-head { align-items: center; }
.kc-chart-section-head > h2 { margin-bottom: .65rem; }
.kc-chart-window {
  position: relative; overflow: hidden; isolation: isolate;
  border: 1px solid rgba(88,245,210,.18); border-radius: 18px;
  background: linear-gradient(150deg, rgba(14,24,21,.82), rgba(6,11,10,.88));
  box-shadow: var(--kc-shadow), inset 0 1px rgba(255,255,255,.035);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.kc-chart-heading {
  display: flex; align-items: center; justify-content: space-between; gap: .7rem; flex-wrap: wrap;
  padding: .75rem .9rem; border-bottom: 1px solid var(--border);
  background: var(--bg-soft); color: var(--accent);
  font: 650 .7rem/1.4 var(--sans); letter-spacing: .035em;
}
.kc-chart-feed-label { color: var(--faint); font: 500 .62rem/1.4 var(--mono); }
.kc-chart-content { position: relative; min-height: 500px; background: var(--bg); }
.kc-chart-panel { min-height: 500px; }
.kc-chart-panel[hidden] { display: none !important; }
.trade-market .candles-host { height: 540px; min-height: 430px; }
.trade-market .candles-note { margin: .65rem 0 0; font-size: .75rem; line-height: 1.6; }
.trade-market .candles-status { margin: .5rem 0 0; color: var(--burn); font-size: .75rem; }
@media (max-width: 680px) {
  .kc-chart-content, .kc-chart-panel { min-height: 450px; }
  .trade-market .candles-host { height: 480px; min-height: 430px; }
}

.kc-chart-empty {
  min-height: 430px; display: grid; place-content: center;
  padding: 1.4rem; color: var(--faint); font-size: .9rem; text-align: center;
}
.price-view {
  position: relative; overflow: hidden; padding: 1rem;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
.kc-chart-toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: .7rem; flex-wrap: wrap;
  margin: 0; padding: .55rem .75rem;
  border: 0; border-bottom: 1px solid rgba(88,245,210,.13); border-radius: 0;
  background: rgba(6,14,12,.64);
}
.kc-chart-toolbar[hidden] { display: none !important; }
.kc-market-controls {
  display: flex; align-items: center; justify-content: flex-start; gap: .55rem;
  margin: 0; min-width: 0; flex-wrap: wrap;
}
.kc-market-controls .chart-pills { margin: 0; }
.kc-phase-pills { margin-left: 0; }
.kc-phase-pills[hidden], .kc-lifetime-btn[hidden] { display: none !important; }
.kc-phase-pills::before {
  content: "market"; align-self: center; margin-right: .15rem;
  color: var(--faint); font: 600 .62rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
}
.kc-phase-pills .chart-pill[disabled] { opacity: .4; cursor: not-allowed; }
.kc-lifetime-btn { margin: 0; white-space: nowrap; }
.kc-candles-shell { position: relative; }
@media (max-width: 560px) {
  .kc-market-controls { width: 100%; justify-content: flex-start; margin-left: 0; }
  .kc-phase-pills { width: auto; margin-left: 0; }
}

/* --------------------------------------------------------------- trade panel */

.kc-panel {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, rgba(17, 29, 26, .93), rgba(7, 11, 10, .94));
  border: 1px solid rgba(88,245,210,.2); border-radius: 18px;
  padding: 1.2rem 1.2rem 1.4rem;
  box-shadow: var(--kc-shadow), inset 0 1px rgba(255,255,255,.04);
}
.kc-panel::before {
  position: absolute; inset: 0 auto auto 0; width: 100%; height: 2px; content: "";
  background: linear-gradient(90deg, var(--kc-lime), var(--kc-cyan) 46%, transparent 88%);
  opacity: .58; pointer-events: none;
}
.trade-market .btn-accent { color: var(--kc-ink); background: var(--kc-lime); border-color: var(--kc-lime); }
.trade-market .btn-accent:hover { background: #e4ff87; border-color: #e4ff87; }
.kc-connect-wrap { text-align: center; padding: 1.4rem .5rem; }
.kc-connect-wrap p { color: var(--muted); margin: .8rem auto 0; max-width: 46ch; font-size: .92rem; }
.kc-connect-wrap .kc-install { font-family: var(--mono); font-size: .82rem; }
.kc-connect-wrap > .btn-cta { margin-top: .8rem; }

.kc-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin: 0 0 1rem; }
.kc-toggle button {
  appearance: none; font: inherit; font-weight: 600; cursor: pointer;
  padding: .6rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--muted);
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.kc-toggle button:hover { border-color: var(--border-strong); }
.kc-toggle button[aria-pressed="true"][data-side="buy"] { color: #06211d; background: var(--born); border-color: var(--born); }
.kc-toggle button[aria-pressed="true"][data-side="sell"] { color: #241206; background: var(--burn); border-color: var(--burn); }
/* the third surface: providing liquidity is neither a buy nor a sell, so it
   takes the page's own cyan accent — and the odd button out spans the row
   instead of sitting as a half-width orphan */
.kc-toggle button[data-side="liquidity"] { grid-column: 1 / -1; }
.kc-toggle button[aria-pressed="true"][data-side="liquidity"] { color: #062019; background: var(--kc-cyan); border-color: var(--kc-cyan); }

/* the liquidity tab's own deposit | withdraw split, one visual step quieter
   than the side toggle above it, plus the jump to the cross-pool overview */
.kc-liq-mode { display: grid; grid-template-columns: 1fr 1fr auto; gap: .4rem; align-items: center; margin: -.4rem 0 .9rem; }
/* display:grid would beat the UA [hidden] rule — the bar exists only on the liquidity tab */
.kc-liq-mode[hidden] { display: none !important; }
.kc-liq-mode button {
  appearance: none; font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer;
  padding: .42rem .6rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: transparent; color: var(--faint);
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.kc-liq-mode button:hover { border-color: var(--border-strong); color: var(--muted); }
.kc-liq-mode button[aria-pressed="true"] { color: #062019; background: var(--kc-cyan); border-color: var(--kc-cyan); }
.kc-liq-overview { font-family: var(--mono); font-size: .72rem; color: var(--accent); text-decoration: none; padding: 0 .2rem; white-space: nowrap; }
.kc-liq-overview:hover { text-decoration: underline; }

/* the position card: chain-derived numbers only, quote-row styling reused */
.kc-lp-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-soft); padding: .5rem .75rem; margin: 0 0 .9rem;
}
.kc-lp-card .kc-quote-row { font-size: .84rem; padding: .22rem 0; }
.kc-liq-ev { color: var(--kc-cyan); text-decoration: none; font-family: var(--mono); font-size: .8rem; }
.kc-liq-ev:hover { text-decoration: underline; }
.kc-liq-mode button[disabled] { opacity: .45; cursor: not-allowed; }

.kc-field { margin: 0 0 .9rem; }
.kc-field label { display: block; font-family: var(--mono); font-size: .72rem; letter-spacing: .05em; color: var(--faint); margin: 0 0 .35rem; }
.kc-input-row { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft); overflow: hidden; }
.kc-input-row:focus-within { border-color: var(--accent); }
.kc-input-row input {
  flex: 1; min-width: 0; appearance: none; border: 0; background: transparent; color: var(--text);
  font-family: var(--mono); font-size: 1.1rem; padding: .7rem .85rem;
}
.kc-input-row input:focus { outline: none; }
.kc-input-unit { display: flex; align-items: center; padding: 0 .9rem; font-family: var(--mono); font-size: .84rem; color: var(--faint); border-left: 1px solid var(--border); }
.kc-help { font-family: var(--mono); font-size: .72rem; color: var(--faint); margin: .4rem 0 0; }
.kc-help.bad { color: var(--burn); }
.kc-max { background: none; border: 0; color: var(--accent); font-family: var(--mono); font-size: .72rem; cursor: pointer; padding: 0; }
.kc-max:hover { text-decoration: underline; }

/* the live quote */
.kc-quote { border-top: 1px solid var(--border); margin: .3rem 0 0; padding: .9rem 0 0; }
.kc-quote-row { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; padding: .28rem 0; }
.kc-quote-row .k { color: var(--faint); font-family: var(--mono); font-size: .8rem; }
.kc-quote-row .v { color: var(--text); font-family: var(--mono); text-align: right; }
.kc-quote-row.total .k, .kc-quote-row.total .v { color: var(--text); font-weight: 600; }
.kc-quote-row .v.out { color: var(--born); }
.kc-quote-row .v.impact { color: var(--burn); }
.kc-fee-detail { padding-left: 1rem; }
.kc-fee-detail .k { font-size: .74rem; }

.kc-cta { width: 100%; margin: 1.1rem 0 0; }

/* ----------------------------------------------------------------- review */

.kc-review { border-top: 1px solid var(--border); margin: 1rem 0 0; padding: 1rem 0 0; }
.kc-review h3 { font-size: .95rem; margin: 0 0 .3rem; color: var(--text); }
.kc-review .kc-selfverify {
  border: 1px solid var(--border-strong); background: var(--accent-soft);
  border-radius: var(--radius-sm); padding: .7rem .85rem; margin: .7rem 0; font-size: .86rem; color: var(--muted);
}
.kc-review .kc-selfverify.ok::before { content: "✓ "; color: var(--born); font-weight: 700; }
.kc-review .kc-selfverify.bad { border-color: var(--burn); background: var(--burn-soft); }
.kc-review .kc-selfverify.bad::before { content: "✕ "; color: var(--burn); font-weight: 700; }
.kc-checks { list-style: none; margin: .5rem 0 0; padding: 0; font-family: var(--mono); font-size: .78rem; }
.kc-checks li { display: flex; gap: .5rem; padding: .18rem 0; color: var(--muted); }
.kc-checks li::before { content: "✓"; color: var(--born); flex: none; }
.kc-checks li.bad { color: var(--burn); }
.kc-checks li.bad::before { content: "✕"; color: var(--burn); }

.kc-outs { width: 100%; border-collapse: collapse; margin: .6rem 0 0; font-family: var(--mono); font-size: .8rem; }
.kc-outs th, .kc-outs td { text-align: left; padding: .35rem .5rem; border-bottom: 1px solid var(--border); }
.kc-outs th { color: var(--faint); font-weight: 500; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.kc-outs td.num { text-align: right; color: var(--text); }
.kc-outs td .kc-out-note { color: var(--faint); font-size: .72rem; display: block; }
.kc-review-actions { display: flex; gap: .6rem; margin: 1rem 0 0; flex-wrap: wrap; }
.kc-review-actions .btn { flex: 1 1 auto; text-align: center; }

/* status / result */
.kc-status { font-family: var(--mono); font-size: .84rem; margin: 1rem 0 0; padding: .7rem .85rem; border-radius: var(--radius-sm); }
.kc-status.info { color: var(--muted); background: var(--bg-soft); border: 1px solid var(--border); }
.kc-status.err { color: var(--burn); background: var(--burn-soft); border: 1px solid var(--burn); }
.kc-status.ok { color: var(--born); background: var(--born-soft); border: 1px solid var(--born); }
.kc-status a { color: inherit; text-decoration: underline; }
.kc-spin { display: inline-block; width: .8em; height: .8em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: kc-spin .7s linear infinite; vertical-align: -1px; margin-right: .5rem; }
@keyframes kc-spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------- skeletons */

.skel {
  display: inline-block; min-width: 3.5ch; height: 1em; border-radius: 4px; vertical-align: middle;
  background: linear-gradient(90deg, var(--bg-soft) 25%, var(--card-hover) 37%, var(--bg-soft) 63%);
  background-size: 400% 100%; animation: kc-shimmer 1.4s ease infinite;
}
@keyframes kc-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .skel, .kc-spin, .kc-live-dot, .kc-dot-wait { animation: none; }
  .kc-brand-watermark { transform: none; will-change: auto; }
}

/* ------------------------------------------------------------------ footer */

.kc-foot {
  margin: 2.6rem 0 0; padding: 1rem 1.1rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--card); color: var(--muted); font-size: .9rem; line-height: 1.6;
}
.kc-foot code { font-family: var(--mono); font-size: .82em; color: var(--text); word-break: break-all; }
.kc-foot a { color: var(--accent); }
.kc-disclaim { color: var(--faint); font-size: .82rem; margin: 1rem 0 0; line-height: 1.55; }

/* ---- sell: pick one cell, spent whole ---- */
#cell-list { display: flex; flex-direction: column; gap: .4rem; }
.kc-cell {
  display: flex; align-items: baseline; gap: .6rem; width: 100%;
  padding: .55rem .7rem; border-radius: 10px; cursor: pointer; text-align: left;
  border: 1px solid var(--border); background: transparent; color: var(--text);
  font: inherit;
}
.kc-cell:hover { border-color: var(--accent); }
.kc-cell.on { border-color: var(--accent); background: rgba(73, 234, 203, 0.08); }
.kc-cell-amt { font-weight: 600; }
.kc-cell-yield { color: var(--born, #5be49b); font-family: var(--mono); font-size: .85rem; }
.kc-cell-op { margin-left: auto; color: var(--faint); font-size: .75rem; }
.kc-cell-note { margin: .45rem 0 0; font-size: .82rem; color: var(--faint); }
.kc-cell-note.bad { color: var(--burn, #ffb067); }

/* ---- latest trades (read-only list, same data the chart replays) ---- */
.kc-trades { max-height: 21rem; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft); }
.kc-trades-empty { padding: .8rem .9rem; color: var(--muted); font-family: var(--mono); font-size: .84rem; }
.kc-trade-row { display: grid; grid-template-columns: 3.2rem 7.5rem 1fr 1fr 3.6rem; gap: .6rem; align-items: baseline; padding: .42rem .9rem; font-family: var(--mono); font-size: .82rem; color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--border); }
.kc-trade-row:last-child { border-bottom: 0; }
.kc-trade-row:hover, .kc-trade-row:focus-visible { background: var(--bg); outline: none; }
.kc-trade-side { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.kc-trade-row[data-side="buy"] .kc-trade-side { color: var(--born); }
.kc-trade-row[data-side="sell"] .kc-trade-side { color: var(--burn); }
.kc-trade-kas, .kc-trade-tok { text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-trade-age { text-align: right; color: var(--muted); }
.kc-trade-price { color: var(--muted); }
.kc-trade-pending { grid-template-columns: minmax(13rem, 1.6fr) minmax(7.5rem, 1fr) minmax(6.5rem, .8fr) 3.6rem; align-items: center; color: var(--faint); background: rgba(73, 234, 203, .035); }
.kc-trade-pending-state { display: flex; align-items: baseline; gap: .7rem; min-width: 0; }
.kc-trade-pending .kc-trade-side { flex: none; color: var(--accent); font-size: .7rem; }
.kc-trade-pending-note { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-trade-pending-status, .kc-trade-tx { text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-trade-pending-status { color: var(--muted); }
@media (max-width: 560px) {
  .kc-section-head { align-items: center; flex-wrap: wrap; }
  .kc-section-head > h2 { flex-basis: 100%; margin-bottom: .25rem; }
  .kc-history-btn { margin: 0 0 .65rem; }
  .kc-trade-row { grid-template-columns: 2.8rem 6.2rem 1fr 3.2rem; }
  .kc-trade-tok { display: none; }
  .kc-trade-pending { grid-template-columns: minmax(0, 1fr) auto; row-gap: .12rem; }
  .kc-trade-pending-state { grid-column: 1; grid-row: 1; }
  .kc-trade-pending-status { grid-column: 1; grid-row: 2; text-align: left; font-size: .74rem; }
  .kc-trade-tx { grid-column: 2; grid-row: 1; }
  .kc-trade-pending .kc-trade-age { grid-column: 2; grid-row: 2; }
}

/* ---- the live-status strip: facts this page verified, collapsed ---- */
details.kc-status-details { margin: 1.2rem 0 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft); font-family: var(--mono); font-size: .84rem; }
details.kc-status-details summary { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .65rem .9rem; cursor: pointer; list-style: none; color: var(--muted); }
details.kc-status-details summary::-webkit-details-marker { display: none; }
.kc-status-line { display: inline-flex; align-items: center; gap: .55rem; min-width: 0; }
.kc-status-line > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-status-more { flex: none; text-decoration: underline; }
.kc-dot { flex: none; width: .55rem; height: .55rem; border-radius: 50%; }
.kc-dot-wait { background: var(--warn, #d9a02c); animation: kc-pulse 1.2s ease-in-out infinite; }
.kc-dot-ok { background: var(--born); }
.kc-dot-err { background: var(--burn); }
@keyframes kc-pulse { 50% { opacity: .35; } }
.kc-status-body { border-top: 1px solid var(--border); padding: .5rem .9rem .7rem; }
.kc-srow { display: grid; grid-template-columns: 11rem 1fr; gap: .8rem; padding: .28rem 0; }
.kc-srow .k { color: var(--muted); }
.kc-srow .v { min-width: 0; overflow-wrap: anywhere; }
.kc-srow .v a { color: inherit; }
@media (max-width: 560px) { .kc-srow { grid-template-columns: 1fr; gap: .1rem; } }

/* ---- review: verdict + buttons first, proof one click away ---- */
.kc-review-details { margin-top: .9rem; border-top: 1px solid var(--border); padding-top: .6rem; }
.kc-review-details summary { cursor: pointer; color: var(--muted); font-family: var(--mono); font-size: .84rem; text-decoration: underline; list-style: none; }
.kc-review-details summary::-webkit-details-marker { display: none; }
.kc-review-details[open] summary { margin-bottom: .5rem; }
@media (max-width: 680px) {
  .trade-doc { padding-top: .6rem; }
  /* iOS SCROLL PAINT: a blurred, permanently promoted fixed layer under the
     content ghosts text coming back from a momentum scroll, and its parallax
     is fine-pointer only — so on a phone it costs a compositing layer and
     returns nothing. */
  .kc-brand-watermark { display: none; }
  .kc-brandbar { align-items: flex-start; padding: .7rem 0; }
  .kc-brandlinks { justify-content: flex-end; flex-wrap: wrap; gap: .35rem; }
  .kc-network { display: none; }
  .kc-hero { min-height: 330px; }
}

/* ---- DEX layout: chart dominant left, trade panel sticky right ---- */
@media (min-width: 1020px) {
  .trade-doc { max-width: 1240px; }
  .dex-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 1.5rem; align-items: start; }
  .dex-side { position: sticky; top: 1rem; }
  .dex-side .kc-section { margin-top: 0; }
  .dex-main .kc-section:first-child { margin-top: 0; }
  .candles-host { height: 430px; }
  .kc-trades { max-height: 16rem; }
  /* the hero tightens into a pair-header: identity and price on one line,
     stat cards in one compact row beneath */
  .kc-hero { margin-bottom: 1rem; }
  .kc-creed { font-size: .86rem; max-width: 72ch; }
}
@media (max-width: 1019px) {
  /* stacked: the trade panel keeps its place above the chart, as before */
  .dex-grid { display: flex; flex-direction: column; }
  .dex-side { order: -1; }
}

/* ---- quick amounts under the inputs ---- */
.kc-quick { display: flex; gap: .45rem; margin-top: .5rem; flex-wrap: wrap; }
.kc-quick button { font-family: var(--mono); font-size: .8rem; padding: .3rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft); color: var(--muted); cursor: pointer; }
.kc-quick button:hover { color: var(--fg); border-color: var(--accent, var(--born)); }

/* ---- expanded verification must wrap inside the narrow panel: hashes and
        script bytes break anywhere, nothing escapes to the right ---- */
.kc-checks li { overflow-wrap: anywhere; min-width: 0; }
.kc-outs { table-layout: fixed; }
.kc-outs th:first-child, .kc-outs td:first-child { width: 1.6rem; }
.kc-outs td.num { width: 7.5rem; }
.kc-outs td { overflow-wrap: anywhere; }

/* the row of the trade that just landed announces itself briefly */
@keyframes kc-landed { 0% { background: var(--born-soft); } 100% { background: transparent; } }
.kc-trade-new { animation: kc-landed 3s ease-out 1; }

/* ---- the full-width proof zone under the grid ---- */
.kc-review-wide { margin-top: 1.2rem; border: 1px solid var(--born); border-radius: var(--radius-sm); background: var(--bg-soft); padding: .9rem 1.1rem 1rem; }
.kc-wide-title { margin: 0 0 .4rem; font-size: .95rem; color: var(--fg); }
.kc-review-details .kc-wide-title { display: none; } /* only shown once broken out */
.kc-review-wide .kc-checks { columns: 2; column-gap: 2rem; }
.kc-review-wide .kc-checks li { break-inside: avoid; }
@media (max-width: 1019px) { .kc-review-wide { display: none !important; } }

/* ---- percent sliders ---- */
.kc-slider-row { display: flex; align-items: center; gap: .7rem; margin-top: .55rem; }
.kc-slider-row input[type="range"] { flex: 1; accent-color: var(--born); height: 1.1rem; cursor: pointer; }
.kc-slider-val { font-family: var(--mono); font-size: .8rem; color: var(--muted); min-width: 3ch; text-align: right; }

/* ---- 24h move beside the price ---- */
.kc-change { font-family: var(--mono); font-size: 1rem; font-weight: 600; align-self: baseline; }
.kc-change.up { color: var(--born); }
.kc-change.down { color: var(--burn); }
.kc-quick button.kc-quick-over { opacity: .45; }
.kc-disconnect { background: none; border: 1px solid var(--border); color: var(--dim, #9ab); border-radius: 6px; padding: .1rem .5rem; margin-left: .5rem; font: inherit; font-size: .78em; cursor: pointer; }
.kc-disconnect:hover { color: var(--warn, #f5a97f); border-color: currentColor; }
.kc-referral-note { margin-top: .9rem; font-size: .82rem; line-height: 1.5; color: var(--dim, #8fa6a0); text-align: left; }
