/* The City Exchange: the market pages (exchange.html). Loaded after gov.css, so it uses the civic theme's colours. */
.ex-up { color: var(--good); } .ex-down { color: var(--bad); } .ex-flat { color: var(--t2); }
.ex-demo { display: flex; align-items: center; justify-content: center; gap: 10px 16px; flex-wrap: wrap; padding: 9px 20px; font-family: var(--head); font-weight: 700; font-size: .92rem;
  color: var(--acc-top); background: repeating-linear-gradient(-45deg, #ffd23f 0 18px, rgba(3,5,9,1.00) 18px 36px); border-bottom: 2px solid var(--acc); text-align: center; }
.ex-demo b { background: var(--gl3); color: var(--acc-top); padding: 2px 10px; border-radius: 3px; letter-spacing: .12em; }
.ex-tape { background: var(--gl3); color: #e7ecf4; overflow: hidden; white-space: nowrap; border-bottom: 3px solid var(--acc); font-family: var(--head); font-size: .95rem; position: relative; }
.ex-tape .run { display: inline-flex; animation: ex-tape 60s linear infinite; padding: 9px 0; }
.ex-tape:hover .run { animation-play-state: paused; }
.ex-tape a { color: #fff; text-decoration: none; display: inline-flex; gap: 8px; align-items: baseline; padding: 0 22px; border-right: 1px solid rgba(255,255,255,.14); }
.ex-tape a b { letter-spacing: .04em; } .ex-tape .ex-up { color: var(--good); } .ex-tape .ex-down { color: #ff8a80; }
@keyframes ex-tape { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ex-tape .run { animation: none; } .ex-tape { overflow-x: auto; } }

.ex-head { display: grid; grid-template-columns: 1fr auto; gap: 18px 30px; align-items: end; padding: 30px 0 22px; }
.ex-head h1 { margin: 6px 0 8px; font-size: clamp(2rem, 4vw, 2.9rem); }
.ex-head .lead { margin: 0; }
.ex-status { display: inline-flex; align-items: center; gap: 8px; font-family: var(--head); font-weight: 700; color: var(--acc-top); background: var(--gl); border: 1px solid var(--edge); border-radius: 999px; padding: 6px 14px; font-size: .9rem;backdrop-filter:var(--bf);-webkit-backdrop-filter:var(--bf);}
.ex-status i { width: 10px; height: 10px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 3px rgba(242,183,5,.25);color:#15171c !important;}
.ex-soon { margin: 0 0 24px; padding: 14px 18px; border: 1px solid var(--edge); border-left: 5px solid #2f9a60; background: rgba(95,208,138,.13); border-radius: 4px; color: var(--t1); }
.ex-soon b { color: var(--good); }

.ex-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--edge); border-top: 4px solid var(--edge2); border-radius: 4px; margin: 0 0 28px; background: var(--gl);backdrop-filter:var(--bf);-webkit-backdrop-filter:var(--bf);}
.ex-stats > div { padding: 14px 18px; border-right: 1px solid var(--edge); }
.ex-stats > div:last-child { border-right: 0; }
.ex-stats span { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--t2); font-weight: 600; }
.ex-stats b { font-family: var(--head); font-size: 1.45rem; color: var(--acc-top); font-variant-numeric: tabular-nums; }

.ex-sec { border-top: 0; padding: 0 0 34px; }
.ex-sec > h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin: 0 0 12px; font-size: 1.5rem; }
.ex-sec > h2 small { font-family: var(--body); font-weight: 400; font-size: .92rem; color: var(--t2); }
.ex-card { background: var(--gl); border: 1px solid var(--edge); border-top: 4px solid var(--edge2); border-radius: 4px;backdrop-filter:var(--bf);-webkit-backdrop-filter:var(--bf);}
.ex-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ex-table th, .ex-table td { padding: 11px 14px; border-bottom: 1px solid var(--edge); text-align: right; white-space: nowrap; }
.ex-table th { font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: var(--t2); background: rgba(120,170,255,.12); font-weight: 700; }
.ex-table th:first-child, .ex-table td:first-child { text-align: left; }
.ex-table tbody tr { cursor: pointer; } .ex-table tbody tr:hover { background: rgba(120,170,255,.12); }
.ex-table tr:last-child td { border-bottom: 0; }
.ex-sym { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--t1); }
.ex-sym .code { font-family: var(--head); font-weight: 800; color: #fff; background: var(--gl3); border-radius: 3px; padding: 3px 8px; font-size: .86rem; min-width: 64px; text-align: center; letter-spacing: .04em; }
.ex-sym small { display: block; color: var(--t2); font-size: .82rem; }
.ex-pill { display: inline-block; font-family: var(--head); font-weight: 700; font-size: .78rem; padding: 2px 8px; border-radius: 3px; }
.ex-pill.up { background: rgba(95,208,138,.13); color: var(--good); } .ex-pill.down { background: rgba(255,122,102,.14); color: var(--bad); } .ex-pill.flat { background: var(--gl); color: var(--t2); }
.ex-pill.halt { background: #3a2b00; color: var(--acc-top); } .ex-pill.pin { background: rgba(120,170,255,.12); color: var(--acc-top); }
.ex-spark { width: 110px; height: 30px; display: block; margin-left: auto; }
.ex-table .num-strong { font-weight: 700; color: var(--acc-top); font-family: var(--head); }

.ex-grid2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.ex-tk { display: grid; grid-template-columns: 1fr auto; gap: 10px 24px; align-items: end; padding: 26px 0 18px; }
.ex-tk .crumb { font-family: var(--head); font-weight: 700; font-size: .9rem; } .ex-tk .crumb a { text-decoration: none; }
.ex-tk h1 { margin: 4px 0 0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.ex-tk h1 .code { font-size: .55em; background: var(--gl3); color: #fff; padding: 4px 10px; border-radius: 4px; letter-spacing: .05em; }
.ex-px { text-align: right; font-family: var(--head); }
.ex-px b { display: block; font-size: clamp(2rem, 5vw, 3rem); color: var(--acc-top); line-height: 1; font-variant-numeric: tabular-nums; }
.ex-px span { font-weight: 700; font-size: 1.1rem; }
.ex-px small { display: block; color: var(--t2); font-family: var(--body); font-size: .85rem; margin-top: 4px; }
.ex-kv { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--edge); border-radius: 4px; margin-bottom: 22px; background: var(--gl); }
.ex-kv div { padding: 10px 14px; border-right: 1px solid var(--edge); } .ex-kv div:last-child { border-right: 0; }
.ex-kv span { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--t2); font-weight: 600; }
.ex-kv b { font-family: var(--head); color: var(--acc-top); font-variant-numeric: tabular-nums; }

.ex-chart { padding: 14px 16px 10px; }
.ex-chart .bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.ex-chart h3 { margin: 0; font-size: 1.05rem; }
.ex-range { display: inline-flex; border: 1px solid var(--edge); border-radius: 4px; overflow: hidden; }
.ex-range button { font-family: var(--head); font-weight: 700; font-size: .85rem; border: 0; background: var(--gl); color: var(--t2); padding: 6px 12px; cursor: pointer; border-right: 1px solid var(--edge); }
.ex-range button:last-child { border-right: 0; } .ex-range button.on { background: var(--gl3); color: #fff; }
.ex-plot { position: relative; } .ex-plot svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.ex-plot .grid { stroke: #e3e8ee; stroke-width: 1; } .ex-plot .axis { fill: var(--t2); font-size: 11px; font-family: var(--body); }
.ex-plot .line { fill: none; stroke-width: 2; stroke-linejoin: round; } .ex-plot .vol { fill: #c9d3e3; }
.ex-plot .cross { stroke: var(--t2); stroke-dasharray: 3 3; } .ex-plot .dot { stroke: #fff; stroke-width: 2; }
.ex-tip { position: absolute; transform: translate(-50%, -120%); background: var(--gl3); color: #fff; font-size: .8rem; padding: 6px 9px; border-radius: 4px; pointer-events: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ex-tip b { display: block; font-family: var(--head); }

.ex-book { padding: 0; }
.ex-book h3, .ex-trades h3, .ex-order h3 { margin: 0; padding: 12px 16px; font-size: 1.05rem; border-bottom: 1px solid var(--edge); display: flex; justify-content: space-between; align-items: baseline; }
.ex-book h3 small, .ex-trades h3 small { font-family: var(--body); font-weight: 400; color: var(--t2); font-size: .82rem; }
.ex-book table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .92rem; }
.ex-book th { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--t2); padding: 6px 14px; text-align: right; background: rgba(120,170,255,.12); }
.ex-book td { padding: 4px 14px; text-align: right; position: relative; }
.ex-book th:first-child, .ex-book td:first-child { text-align: left; }
.ex-book td.depth { position: absolute; inset: 0; padding: 0; z-index: 0; }
.ex-book tr { position: relative; }
.ex-book tr td:not(.depth) { z-index: 1; position: relative; }
.ex-book .ask td.p { color: var(--bad); font-weight: 700; } .ex-book .bid td.p { color: var(--good); font-weight: 700; }
.ex-book .ask { background-image: linear-gradient(to left, rgba(3,5,9,0.10) var(--w), transparent var(--w)); }
.ex-book .bid { background-image: linear-gradient(to left, rgba(3,5,9,0.10) var(--w), transparent var(--w)); }
.ex-book .mid td { text-align: center !important; font-family: var(--head); font-weight: 800; color: var(--acc-top); background: var(--gl); padding: 8px; }
.ex-trades ol { list-style: none; margin: 0; padding: 0; max-height: 430px; overflow-y: auto; font-variant-numeric: tabular-nums; font-size: .9rem; }
.ex-trades li { display: grid; grid-template-columns: 70px 1fr 1fr; gap: 8px; padding: 6px 16px; border-bottom: 1px solid var(--edge); }
.ex-trades li span:nth-child(2), .ex-trades li span:nth-child(3) { text-align: right; }
.ex-trades li.hd { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--t2); background: rgba(120,170,255,.12); font-weight: 700; }
.ex-order { padding-bottom: 14px; }
.ex-order .tabs2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px 16px 6px; }
.ex-order .tabs2 button { font-family: var(--head); font-weight: 800; border: 0; border-radius: 4px; padding: 10px; color: #fff; opacity: .55; cursor: not-allowed; }
.ex-order .tabs2 .b { background: #0a7a3e; } .ex-order .tabs2 .s { background: #b3261e; }
.ex-order label { display: block; padding: 6px 16px 0; font-size: .82rem; color: var(--t2); font-weight: 600; }
.ex-order input { display: block; width: calc(100% - 32px); margin: 4px 16px 0; padding: 9px 10px; border: 1px solid var(--edge); border-radius: 4px; font: inherit; background: var(--gl); color: var(--t2); }
.ex-order p { margin: 12px 16px 0; font-size: .88rem; color: var(--t2); }
.ex-side { display: grid; gap: 22px; min-width: 0; }
#ex, #ex section, .ex-card { min-width: 0; max-width: 100%; }

.ex-lead td .mayor { display: inline-flex; gap: 10px; align-items: center; color: var(--t1); text-decoration: none; font-weight: 600; }
.ex-lead td .mayor img, .ex-lead td .mayor .avatar { width: 28px; height: 28px; border-radius: 6px; }
.ex-lead td.rank { font-family: var(--head); font-weight: 800; color: var(--acc-top); width: 1%; }
.ex-lead tbody tr { cursor: default; }

.ex-how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.ex-how .ex-card { padding: 18px 20px; }
.ex-how .n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #00653a; color: #fff; font-family: var(--head); font-weight: 800; }
.ex-how h3 { margin: 10px 0 6px; font-size: 1.1rem; } .ex-how p { margin: 0; color: var(--t2); font-size: .96rem; }
.ex-units { margin-top: 18px; font-size: .92rem; color: var(--t2); }
.ex-units b { color: var(--acc-top); }

@media (max-width: 1000px) {
  .ex-grid2 { grid-template-columns: minmax(0, 1fr); }
  .ex-kv { grid-template-columns: repeat(3, 1fr); } .ex-kv div:nth-child(3) { border-right: 0; } .ex-kv div:nth-child(-n+3) { border-bottom: 1px solid var(--edge); }
  .ex-how { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .ex-head, .ex-tk { grid-template-columns: 1fr; } .ex-px { text-align: left; }
  .ex-stats { grid-template-columns: 1fr 1fr; } .ex-stats > div:nth-child(2) { border-right: 0; } .ex-stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--edge); }
  .ex-how { grid-template-columns: 1fr; }
  .ex-table .hide-m { display: none; }
  .ex-sec > h2 small { flex-basis: 100%; }
  .ex-table th, .ex-table td { padding: 10px 8px; }
  .ex-sym .code { min-width: 54px; } .ex-sym small { display: none; }
  .ex-spark { width: 64px; }
}

/* ---- "Take the tour" button and the guided tour (exchange-tour.js) */
.ex-head-r { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.ex-tour-btn { font-family: var(--head); font-weight: 700; font-size: .9rem; color: var(--acc-top); background: var(--gl); border: 2px solid var(--edge2); border-radius: 999px; padding: 6px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.ex-tour-btn::before { content: "?"; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--gl3); color: #fff; font-size: .72rem; }
.ex-tour-btn:hover { background: var(--gl); }
.ex-tour-btn.small { font-size: .78rem; padding: 2px 10px; margin-left: 10px; border-width: 1px; vertical-align: middle; }
.ex-tour { position: fixed; inset: 0; z-index: 1000; }
.ex-tour-block { position: fixed; inset: 0; background: transparent; }
.ex-tour-hole { position: fixed; border-radius: 10px; box-shadow: 0 0 0 4px #f2b705, 0 0 0 9999px rgba(9, 18, 34, .66); transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease; pointer-events: none; }
.ex-tour-card { position: fixed; width: min(400px, calc(100vw - 24px)); background: var(--gl); color: var(--t1); border-radius: 12px; border-top: 5px solid #f0a63a; box-shadow: 0 24px 60px rgba(0,0,0,.35);
  padding: 18px 20px 16px; transition: opacity .15s ease;backdrop-filter:var(--bf);-webkit-backdrop-filter:var(--bf);}
.ex-tour-card.hide { opacity: 0; }
.ex-tour-card.center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(480px, calc(100vw - 24px)); }
.ex-tour-top { display: flex; justify-content: space-between; align-items: center; }
.ex-tour-n { font-family: var(--head); font-weight: 700; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--good); }
.ex-tour-x { border: 0; background: none; font-size: 1.6rem; line-height: 1; color: var(--t2); cursor: pointer; padding: 0 4px; }
.ex-tour-card h2 { margin: 6px 0 6px; font-size: 1.3rem; }
.ex-tour-card p { margin: 0; color: var(--t2); font-size: .98rem; line-height: 1.55; }
.ex-tour-card p b { color: var(--acc-top); }
.ex-tour-dots { display: flex; gap: 6px; margin: 14px 0 12px; }
.ex-tour-dots i { flex: 1; height: 4px; border-radius: 2px; background: var(--gl); }
.ex-tour-dots i.done { background: rgba(255,255,255,.12); } .ex-tour-dots i.on { background: #00653a; }
.ex-tour-nav { display: flex; align-items: center; gap: 8px; } .ex-tour-nav span { flex: 1; }
.ex-tour-nav button { font-family: var(--head); font-weight: 700; font-size: .92rem; border-radius: 6px; padding: 9px 16px; cursor: pointer; }
.ex-tour-skip { background: none; border: 0; color: var(--t2); text-decoration: underline; padding: 9px 4px !important; }
.ex-tour-back { background: var(--gl); color: var(--acc-top); border: 1px solid var(--edge); } .ex-tour-back:disabled { opacity: .4; cursor: default; }
.ex-tour-next { background: var(--gl3); color: #fff; border: 0; } .ex-tour-next:hover { background: var(--gl3); }
.ex-tour-cta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.ex-tour-cta a:not(.button) { font-family: var(--head); font-weight: 700; }
@media (max-width: 699px) {
  .ex-tour-card.sheet, .ex-tour-card.sheet.center { left: 0 !important; right: 0; top: auto !important; bottom: 0; transform: none; width: auto; border-radius: 16px 16px 0 0; padding: 16px 18px calc(14px + env(safe-area-inset-bottom)); }
  .ex-tour-card h2 { font-size: 1.15rem; } .ex-tour-card p { font-size: .94rem; }
  .ex-head-r { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  .ex-tour-btn.small { margin: 6px 0 0; }
}
@media (prefers-reduced-motion: reduce) { .ex-tour-hole { transition: none; } }
.ex-tour-hole.none { box-shadow: 0 0 0 9999px rgba(9, 18, 34, .66); }
