/* Market Edition. Paper, black ink, and a single orange print plate. */
:root {
  color-scheme: light;
  --bg: #f8f4e9;
  --panel: #fffcf3;
  --wash: #eee8d9;
  --text: #261a11;
  --muted: #625345;
  --dim: #6d5e4d;
  --border: #cbbfa9;
  --control: #8c7a64;
  --orange: #ff7438;
  --accent: #a5300b;
  --mint: var(--accent);
  --green: #216144;
  --red: #a13125;
  --display: Georgia, 'Times New Roman', serif;
  --gutter: clamp(16px, 4vw, 58px);
  --width: 1440px;
  --gap: clamp(42px, 7vw, 94px);
}

body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; }
.site-frame { min-height: 100svh; display: flex; flex-direction: column; }
.content { width: 100%; max-width: var(--width); margin-inline: auto; padding: 36px var(--gutter) var(--gap); flex: 1; }
.content.edition-content { padding-top: 0; }
.masthead, :is(body, #root) > .header { background: var(--bg); border-bottom: 1px solid var(--text); }
.masthead { position: sticky; top: 0; z-index: 30; }
.masthead-inner, .edition-footer-inner {
  width: min(100%, var(--width));
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.masthead-inner { min-height: 70px; }
.masthead-brand { display: inline-flex; align-items: center; gap: 10px; flex: none; color: var(--text); font: bold 23px/1 var(--display); letter-spacing: -.045em; }
.brand-stamp { width: 23px; height: 23px; background: repeating-radial-gradient(circle, var(--text) 0 1px, transparent 1px 3px), var(--orange); border: 1px solid var(--text); border-radius: 50%; flex: none; }
.masthead-nav, .masthead-tools { display: flex; align-items: center; gap: 5px; }
.masthead-nav .nav-link { background: transparent; box-shadow: none; color: var(--muted); padding: 8px 10px; border-radius: 0; border: 0; font-size: 13px; white-space: nowrap; }
.masthead-nav .nav-link.active, .masthead-nav .nav-link:hover { color: var(--text); text-decoration: underline 2px var(--accent); text-underline-offset: 6px; }
.masthead-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid transparent; }
.masthead-icon:hover { border-color: var(--control); background: var(--wash); }
.masthead-menu { display: none; }
.masthead-tools .wallet-button { white-space: nowrap; }
.edition-footer { border-top: 1px solid var(--text); background: var(--wash); }
.edition-footer-inner { min-height: 112px; padding-block: 24px; flex-wrap: wrap; }
.edition-footer-inner > span { color: var(--muted); font-size: 13px; }
.edition-footer-inner > div { display: flex; flex-wrap: wrap; gap: 12px 20px; font-size: 13px; }
.edition-footer a:hover { text-decoration: underline; }

.edition-kicker { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.edition-kicker, .art-caption, .eyebrow, .edition-process li > span { font: 11px/1.5 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.edition-kicker i { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: var(--green); }
.edition-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: stretch; gap: clamp(20px, 4vw, 64px); padding-block: clamp(20px, 3.5vw, 48px); }
.edition-hero-copy { align-self: center; padding-block: 20px; }
.edition-hero h1, .workspace-intro h1, .detail-identity h1, .content .page-heading:not(.workspace-intro) h1 {
  font-family: var(--display);
  font-weight: 400;
  text-transform: none;
  letter-spacing: -.073em;
  color: var(--text);
  line-height: .97;
  animation: none;
}
.edition-hero h1 { margin: 0; font-size: clamp(43px, 7.4vw, 109px); }
.edition-hero h1 em { color: var(--accent); font-weight: inherit; }
.edition-hero-copy p { max-width: 43ch; margin: 24px 0 0; color: var(--muted); font-size: clamp(15px, 1.45vw, 19px); line-height: 1.65; }
.edition-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 25px; }
.edition-actions > a:not(.button), .edition-text-link { display: inline-flex; align-items: center; gap: 8px; padding-block: 10px; color: var(--accent); font-weight: 600; }
.edition-actions > a:hover, .edition-text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.edition-art { position: relative; isolation: isolate; overflow: hidden; min-height: clamp(300px, 37vw, 505px); margin: 0; border: 1px solid var(--text); background: var(--orange); }
.edition-art svg { position: absolute; width: 100%; height: 100%; inset: 0; }
.art-caption { position: absolute; left: 12px; bottom: 12px; padding: 4px 7px; background: var(--orange); color: var(--text); font-size: 9px; }

.edition-section { margin-top: var(--gap); scroll-margin-top: 96px; }
.edition-section-heading { margin-bottom: 18px; }
.edition-section-heading h2, .section-toolbar h2, .docs-section h2, .disconnected-portfolio h2 {
  margin: 0;
  font: 400 clamp(29px, 4vw, 54px)/1.05 var(--display);
  text-transform: none;
  letter-spacing: -.055em;
}
.edition-section-heading .eyebrow { margin: 0 0 9px; }
.edition-section-row { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 8px 16px; }
.edition-discovery, .edition-process { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: clamp(24px, 6vw, 88px); border-top: 1px solid var(--text); padding-top: 28px; }
.pair-list a { display: flex; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--border); }
.pair-list a:hover { background: var(--wash); }
.pair-list a > span:last-child { margin-left: auto; color: var(--accent); display: inline-flex; align-items: center; gap: 8px; font-size: 12px; }
.pair-list .asset-symbol { flex: none; }
.edition-process ol { list-style: none; padding: 0; margin: 0; }
.edition-process li { padding: 15px 0; border-bottom: 1px solid var(--border); }
.edition-process li:first-child { padding-top: 0; }
.edition-process li > span { color: var(--accent); }
.edition-process h3 { margin: 4px 0; font: 400 25px/1.2 var(--display); text-transform: none; }
.edition-process p { margin: 0; color: var(--muted); }

.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; padding: 0; margin: 24px 0; background: var(--wash); border-block: 1px solid var(--text); }
.market-home > .stats { margin: 0; }
.stats .stat, .stats .stat:first-child, .stats .stat:last-child { display: block; grid-column: auto; padding: clamp(10px, 2.2vw, 28px); border: 0; border-radius: 0; background: transparent; }
.stats .stat + .stat { border-left: 1px solid var(--border); }
.stats .stat .metric-value, .stats .stat:last-child .metric-value { font: 400 clamp(21px, 3.6vw, 46px)/1 var(--display); margin-top: 8px; }
.metric-label { color: var(--muted); }
.metric-value, .card-specs dd { color: var(--text); }
.section-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 18px; }
.section-toolbar h2 { display: flex; align-items: center; gap: 8px; }
.section-toolbar .segmented { margin-left: auto; }
.section-toolbar .count { color: var(--accent); margin: 0; background: var(--wash); border: 1px solid var(--border); font: 12px var(--mono); padding: 5px 8px; }
.token-grid { gap: 0; border-top: 1px solid var(--text); }
.token-card { padding: 18px; border-width: 0 1px 1px 0; min-width: 0; }
.token-card:hover { transform: none; box-shadow: none; background: var(--wash); }
.token-top { min-width: 0; }
.card-specs { grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 0; }
.card-specs > div { padding: 8px; border: 0; }
.card-specs > div:first-child { padding-left: 8px; }
.card-specs dd { white-space: normal; overflow-wrap: anywhere; }
.token-meta, .token-meta .symbol, .card-specs dt { color: var(--muted); }
.token-avatar { background: var(--wash) !important; color: var(--text) !important; }
.empty { padding: clamp(24px, 4vw, 52px) 18px; }
.token-grid > .empty { border-top: 0; }
.empty h3 { text-transform: none; font-size: 19px; }

.landing-workspace { min-width: 0; background: var(--panel); border: 1px solid var(--text); }
.landing-windowbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); font: 12px var(--mono); text-transform: uppercase; }
.landing-workspace-chart, .spotlight-empty { padding: 18px; }
.preview-identity { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.preview-identity p { font-size: 12px; color: var(--muted); }
.preview-price { font: 22px var(--display); margin-left: auto; }
.preview-price small { display: block; font: 11px Geist, sans-serif; color: var(--muted); }
.preview-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.official-ca-row, .official-token-status { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; margin-top: 16px; }
.official-ca-row code { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.official-token-status button { text-decoration: underline; color: var(--accent); }

.workspace-intro { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: end; gap: 24px; padding: 18px 0 28px; margin: 0 0 32px; border-bottom: 1px solid var(--text); }
.workspace-intro h1, .detail-identity h1, .content .page-heading:not(.workspace-intro) h1 { font-size: clamp(42px, 7vw, 95px); margin: 10px 0 14px; }
.workspace-intro-copy > p:last-child { color: var(--muted); max-width: 58ch; }
.workspace-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--wash); border-top: 1px solid var(--text); }
.workspace-facts > div { padding: 12px; min-width: 0; }
.workspace-facts > div + div { border-left: 1px solid var(--border); }
.workspace-facts strong { display: block; font: 400 clamp(19px, 2.7vw, 32px)/1.1 var(--display); overflow-wrap: anywhere; }
.workspace-facts span { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.workspace-subbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin: 0 0 18px; }
.workspace-subbar a, .back-link { color: var(--accent); }
.explore-market-rail { display: flex; overflow-x: auto; margin-bottom: 22px; border-block: 1px solid var(--border); }
.explore-market-rail button { min-width: 92px; flex: 1 0 auto; display: grid; align-content: start; justify-items: start; gap: 7px; padding: 12px; border-right: 1px solid var(--border); }
.explore-market-rail button:is(:hover, .selected) { background: var(--wash); box-shadow: inset 0 -3px var(--accent); }
.explore-market-rail small { color: var(--muted); }
.explore-search { margin-bottom: 14px; }
.launch-layout, .detail-layout { gap: clamp(14px, 3vw, 36px); }
.summary-panel, .trade-box { top: 88px; }
.panel-heading, .launch-form .panel-heading { background: var(--wash); border-color: var(--border); padding: 16px 18px; font: 400 24px/1.15 var(--display); text-transform: none; }
.panel-body { padding: clamp(14px, 2.5vw, 26px); }
.launch-form .panel, .position-detail, .token-description { margin-bottom: 14px; }
.summary-row b, .market-option b, .market-option-head, .preview-token h3 { color: var(--text); }
.market-option small { color: var(--muted); }
.market-option .asset-symbol, .direction-button .icon { flex: none; }
.market-option.selected, .direction-button.selected.long, .direction-button.selected.short { background: var(--wash); border-color: var(--accent); box-shadow: inset 0 -2px var(--accent); }
.detail-top { margin: 16px 0 24px; }
.detail-identity { min-width: 0; }
.detail-identity h1 { font-size: clamp(31px, 5vw, 68px); overflow-wrap: anywhere; }
.detail-identity p { overflow-wrap: anywhere; }
.detail-chart-heading { padding: 16px 20px; }
.detail-chart { height: 260px; padding: 12px 16px; }
.detail-chart svg { width: 100%; height: 100%; }
.detail-stats { background: var(--border); }
.detail-stats > div, .chart-footer { background: var(--wash); color: var(--muted); }
.disconnected-portfolio { padding: clamp(24px, 5vw, 56px); }
.disconnected-portfolio h2, .disconnected-portfolio p { margin-block: 12px; }
.docs-loop { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.docs-layout { gap: clamp(18px, 4vw, 52px); }
.docs-nav { background: var(--wash); padding: 14px; border-left: 2px solid var(--accent); top: 94px; }
.docs-nav a { color: var(--muted); }
.docs-nav a:hover, .docs-section a { color: var(--accent); text-decoration: underline; }
.docs-content { min-width: 0; max-width: 78ch; }
.docs-section { padding-top: 24px; margin-top: 28px; scroll-margin-top: 90px; border-top: 1px solid var(--border); }
.docs-section h2 { font-size: clamp(27px, 3.5vw, 40px); margin-bottom: 12px; }
.docs-section p, .docs-list { color: var(--muted); line-height: 1.75; }
.docs-start-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.docs-start-grid > a { padding: 14px; border: 1px solid var(--border); }
.docs-section .formula { background: var(--wash); border-color: var(--border); color: var(--text); overflow-wrap: anywhere; }
.docs-glossary dt { font-weight: 600; }
.docs-glossary dd { margin: 0 0 10px; color: var(--muted); }

.button, .segmented, input, textarea, select, .market-option, .direction-button, .wallet-option {
  color: var(--text); border-color: var(--control); border-radius: 0; background: var(--panel); box-shadow: none;
}
.button, .masthead-icon { transition: background-color 140ms ease-out, border-color 140ms ease-out; }
.button:hover, .market-option:hover, .wallet-option:hover, .direction-button:hover { color: var(--text); background: var(--wash); border-color: var(--text); box-shadow: none; transform: none; }
.button.primary, .button.white { color: var(--panel); background: var(--text); border-color: var(--text); min-height: 43px; padding-inline: 17px; }
.button.primary:hover, .button.white:hover { color: var(--text); background: var(--orange); border-color: var(--text); }
.segmented button { color: var(--muted); border-radius: 0; }
.segmented button.active, .segmented button:hover { color: var(--text); background: var(--wash); border-color: var(--control); }
.panel, .token-card, .table-wrap, .empty, .summary-panel, .trade-box, .portfolio-stats .stat, .docs-section details {
  background: var(--panel); border-color: var(--border); border-radius: 0; box-shadow: none;
}
.token-card:hover { background: var(--wash); border-color: var(--control); }
.table-wrap thead th, .activity-icon, .step, .hint, .notice, .upload, .docs-loop { background: var(--wash); color: var(--text); border-color: var(--border); }
.table-wrap th, .table-wrap td { border-color: var(--border); }
.table-wrap tbody tr:hover { background: var(--wash); }
.badge, .token-top .bonding { color: var(--muted) !important; background: var(--wash) !important; border-color: var(--control) !important; border-radius: 0; }
.positive { color: var(--green); }
.negative, .form-error { color: var(--red); }
.demo-note { color: var(--muted); border-color: var(--border); }

.filter-search { display: block; position: relative; height: 42px; padding: 0; border: 0; background: transparent; }
.filter-search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.filter-search input { width: 100%; height: 100%; padding-left: 34px; }
.market-filter-panel { margin: 0 0 16px; padding: 14px; background: var(--wash); border: 1px solid var(--border); }
.market-filter-primary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.market-filter-panel label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.market-filter-panel select { width: 100%; min-width: 0; }
.market-filter-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.filter-reset { padding: 4px; color: var(--accent); text-decoration: underline; }
.filter-note { font-size: 11px; color: var(--muted); margin-top: 7px; }
.filter-note .icon { vertical-align: middle; }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--text); border-radius: 0; }
dialog:has(.market-search-dialog) { width: min(720px, calc(100vw - 28px)); max-height: calc(100svh - 28px); }
dialog::backdrop { background: #261a1170; }
.modal-header, #toast { color: var(--text); background: var(--wash); border-color: var(--border); }
.modal-header h2 { font: 400 24px var(--display); text-transform: none; }
.search-input-wrap { display: flex; gap: 8px; align-items: center; border: 1px solid var(--control); background: var(--panel); padding: 0 10px; }
.search-input-wrap input { flex: 1; min-width: 0; border: 0; background: transparent; }
.search-help, .search-result-heading, .modal-footnote { font-size: 12px; color: var(--muted); margin: 10px 0; }
.search-result-heading { display: flex; justify-content: space-between; gap: 10px; }
.search-result { min-width: 0; border-bottom: 1px solid var(--border); }
.search-result:hover { background: var(--wash); }
.search-result-identity { min-width: 0; overflow-wrap: anywhere; }
.result-value { text-align: right; flex: none; }
.search-empty { padding-block: 14px; }
.search-empty p { color: var(--muted); margin-bottom: 10px; }
.loading { color: var(--muted); }
:is(a, button, input, select, textarea, summary):focus-visible, .search-input-wrap:focus-within {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

:is(body, #root) > .header { position: static; top: auto; padding: 12px var(--gutter); min-height: 62px; height: auto; }
:is(body, #root) > .header .header-spacer { display: block; flex: 1; }

@media (max-width: 980px) {
  .masthead-menu { display: inline-grid; }
  .masthead-nav { display: none; position: absolute; top: 100%; inset-inline: 0; background: var(--bg); border-bottom: 1px solid var(--text); padding: 10px var(--gutter); }
  .masthead-nav.open { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .edition-hero, .edition-discovery, .edition-process, .workspace-intro { grid-template-columns: minmax(0, 1fr); }
  :is(body, #root) > .header { flex-wrap: wrap; }
  :is(body, #root) > .header .header-spacer { display: none; }
  .docs-loop { grid-template-columns: 1fr; }
  .edition-hero-copy { padding-block: 6px 0; }
  .edition-hero h1 { font-size: clamp(40px, 10vw, 70px); }
  .edition-art { min-height: clamp(225px, 63vw, 345px); }
  .masthead-inner { min-height: 58px; gap: 5px; }
  .masthead-brand { font-size: 19px; gap: 6px; }
  .brand-stamp { width: 17px; height: 17px; }
  .masthead-tools { gap: 0; }
  .masthead-icon { width: 34px; }
  .masthead-tools .wallet-button { max-width: 108px; white-space: normal; line-height: 1.15; display: inline-flex; padding-inline: 7px; min-height: 34px; font-size: 10px; }
  .section-toolbar .filter-search { order: 1; flex: 1 0 100%; margin: 0; }
  .section-toolbar .segmented { margin-left: 0; }
  .summary-panel, .trade-box { position: static; }
  .edition-footer-inner > span { flex-basis: 100%; }
}
@media (max-width: 370px) {
  .masthead-brand { font-size: 17px; }
  .masthead-icon { width: 30px; }
  .masthead-tools .wallet-button { max-width: 94px; white-space: normal; line-height: 1.15; }
}
