/* ============================================================
   KiNecta Exchange — market.css
   Shares the KiNecta design language with the marketing site.
   ============================================================ */

:root {
  --bg: #0b0f17; --bg-soft: #0d1424; --panel: #121a2b;
  --line: rgba(148,170,210,.14); --line-2: rgba(148,170,210,.26);
  --text: #e8eef7; --muted: #97a5ba; --faint: #66748c;
  --accent: #3ddc97; --accent-dim: rgba(61,220,151,.12);
  --blue: #5eb1ff; --copper: #e8a15c; --red: #ff7a8a;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; font: 16px/1.6 var(--sans); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.25rem; }
code { font-family: var(--mono); font-size: .85em; background: rgba(94,177,255,.1); border: 1px solid var(--line); padding: .1em .35em; border-radius: 5px; }
.mono { font-family: var(--mono); font-size: .86em; }
.muted { color: var(--muted); } .hint { color: var(--faint); font-size: .82em; font-weight: 400; }
.center { text-align: center; }
.skip { position: absolute; left: -9999px; } .skip:focus { left: 8px; top: 8px; z-index: 99; background: var(--accent); color: #04241a; padding: .4rem .8rem; border-radius: 6px; }

/* topbar */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(11,15,23,.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1160px; margin: 0 auto; padding: 0 20px; min-height: 60px; display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand svg { color: var(--accent); }
.brand em { color: var(--accent); font-style: normal; }
.topnav { display: flex; gap: 1rem; flex-wrap: wrap; }
.topnav a { color: var(--muted); font-weight: 500; font-size: .95rem; padding: .3rem .1rem; border-bottom: 2px solid transparent; }
.topnav a:hover { color: var(--text); text-decoration: none; }
.topnav a.active { color: var(--accent); border-bottom-color: var(--accent); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .7rem; }
.topbar-right .muted { color: var(--faint); font-size: .85rem; }
.whoami { color: var(--muted); font-size: .88rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* layout */
.wrap { max-width: 1160px; margin: 0 auto; padding: 1.8rem 20px 3.5rem; }
.page-head { margin: 1.2rem 0 1.8rem; }
.lede { color: var(--muted); max-width: 60ch; }
.lede strong { color: var(--text); }
.subhead { margin: 2.6rem 0 1rem; font-size: 1.05rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-family: var(--mono); }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font: 600 .92rem/1.2 var(--sans);
  padding: .6rem 1.05rem; border-radius: 9px; border: 1px solid transparent; cursor: pointer; transition: .12s; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: linear-gradient(180deg,#45e6a2,#2fc484); color: #04241a; }
.btn-ghost { background: rgba(148,170,210,.06); color: var(--text); border-color: var(--line-2); }
.btn-lg { padding: .8rem 1.3rem; font-size: 1rem; }
.btn-sm { padding: .35rem .7rem; font-size: .82rem; }
.wfull { width: 100%; }
.input { width: 100%; font: 400 .95rem var(--sans); color: var(--text); background: #0d1424;
  border: 1px solid var(--line-2); border-radius: 9px; padding: .6rem .8rem; margin-top: .3rem; }
.input:focus { outline: 2px solid rgba(61,220,151,.4); border-color: var(--accent); }
.input.file { padding: .45rem; }
select.input { appearance: auto; }
textarea.input { resize: vertical; }
label { display: block; font-weight: 600; font-size: .92rem; color: var(--muted); }
.grow { flex: 1; }

/* flash */
.flash { border-radius: 10px; padding: .8rem 1rem; margin: 0 0 1.1rem; font-size: .93rem; border: 1px solid; }
.flash-ok   { background: rgba(61,220,151,.09);  border-color: rgba(61,220,151,.4);  color: #9fe8c8; }
.flash-err  { background: rgba(255,122,138,.09); border-color: rgba(255,122,138,.4); color: #ffb3bc; }
.flash-warn { background: rgba(232,161,92,.09);  border-color: rgba(232,161,92,.4);  color: #f3c89b; }

/* cards & grid */
.card { background: linear-gradient(180deg,var(--panel),var(--bg-soft)); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.1rem; margin: 1.4rem 0; }
.lcard { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--text); transition: transform .15s, border-color .15s; }
a.lcard:hover { transform: translateY(-3px); border-color: var(--line-2); text-decoration: none; }
.lcard-cover { position: relative; aspect-ratio: 16/8.5; display: grid; place-items: center; }
.lcard-cover img { width: 100%; height: 100%; object-fit: cover; }
.lcard-cover::after { content: ""; position: absolute; inset: 0; background:
  repeating-linear-gradient(0deg, transparent 0 23px, rgba(148,170,210,.05) 23px 24px),
  repeating-linear-gradient(90deg, transparent 0 23px, rgba(148,170,210,.05) 23px 24px); pointer-events: none; }
.lcard-body { padding: .95rem 1rem 1.1rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.lcard-body h3 { font-size: 1rem; margin: 0; }
.lcard-sum { color: var(--muted); font-size: .86rem; margin: 0; flex: 1; }
.lcard-meta { display: flex; justify-content: space-between; gap: .8rem; color: var(--faint); font-size: .8rem; margin: 0; font-family: var(--mono); }
.badge { position: absolute; font: 700 .62rem var(--mono); letter-spacing: .07em; padding: .22rem .5rem; border-radius: 6px; backdrop-filter: blur(4px); }
.badge-type { top: .6rem; left: .6rem; color: var(--blue); background: rgba(13,20,36,.75); border: 1px solid rgba(94,177,255,.4); }
.badge-price { bottom: .6rem; right: .6rem; color: var(--copper); background: rgba(13,20,36,.75); border: 1px solid rgba(232,161,92,.45); }
.badge-price.free { color: var(--accent); border-color: rgba(61,220,151,.45); }

/* filters */
.filters { display: flex; gap: .7rem; flex-wrap: wrap; margin: 1.2rem 0 .4rem; }
.filters .input { margin-top: 0; width: auto; min-width: 130px; }

/* detail page */
.detail { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2.2rem; align-items: start; }
.detail-cover { position: relative; border-radius: var(--radius); border: 1px solid var(--line); aspect-ratio: 16/7; overflow: hidden; }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-meta { color: var(--faint); font-size: .88rem; }
.prose { color: var(--muted); white-space: pre-wrap; margin: 1.2rem 0; }
.tags { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip-tag { font: 500 .74rem var(--mono); color: var(--blue); border: 1px solid rgba(94,177,255,.35); border-radius: 999px; padding: .18rem .55rem; background: rgba(94,177,255,.07); }
.buybox .price-big { font-size: 2rem; font-weight: 800; margin: 0 0 .8rem; }
.buybox .note { color: var(--faint); font-size: .84rem; margin: .7rem 0 0; }
.buybox .note.ok { color: var(--accent); }
.meta-card h3 { font-size: .95rem; color: var(--muted); }
.kv { margin: 0; display: grid; gap: .6rem; }
.kv > div { display: grid; grid-template-columns: 90px 1fr; gap: .6rem; border-bottom: 1px dashed var(--line); padding-bottom: .55rem; }
.kv dt { color: var(--faint); font-size: .85rem; } .kv dd { margin: 0; font-size: .9rem; }

/* fee lines */
.fee-lines { margin: 1.1rem 0; display: grid; gap: .7rem; }
.fee-lines > div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed var(--line); padding-bottom: .65rem; }
.fee-lines dt { color: var(--muted); }
.fee-lines dd { margin: 0; font-family: var(--mono); }
.fee-lines .total { border-bottom: none; padding-bottom: 0; }
.fee-lines .total dt { color: var(--text); font-weight: 700; }
.fee-lines .total dd { color: var(--accent); font-weight: 700; font-size: 1.2rem; }
.fee-lines.big { font-size: 1.02rem; }
.transparency { border: 1px solid rgba(61,220,151,.3); background: rgba(61,220,151,.06); border-radius: 10px; padding: .9rem 1.05rem; margin: 1.2rem 0; font-size: .9rem; color: var(--muted); }
.transparency strong { color: var(--accent); }

/* forms */
.authbox { max-width: 460px; margin: 1.5rem auto; }
.authbox.wide { max-width: 720px; }
.stack { display: grid; gap: 1rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.radio-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.radio { border: 1px solid var(--line-2); border-radius: 10px; padding: .8rem .9rem; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--accent); background: var(--accent-dim); }
.radio input { accent-color: var(--accent); margin-right: .45rem; }
.radio small { color: var(--faint); }
fieldset { border: none; padding: 0; margin: 0; }
legend { font-weight: 600; color: var(--muted); margin-bottom: .5rem; padding: 0; }
.alt { color: var(--muted); margin-top: 1.1rem; font-size: .92rem; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

/* stats */
.statrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .9rem; margin: 1.2rem 0 2rem; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; display: grid; gap: .25rem; }
.stat-num { font-size: 1.45rem; font-weight: 800; font-family: var(--mono); }
.stat-num.ok { color: var(--accent); } .stat-num.fee { color: var(--copper); }
.stat-label { color: var(--faint); font-size: .8rem; }

/* tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 640px; }
.tbl th, .tbl td { text-align: left; padding: .65rem .85rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl thead th { font: 600 .68rem var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--faint); background: rgba(10,15,26,.5); }
.tbl tbody tr:last-child td { border-bottom: none; }
.pill { font: 650 .68rem var(--mono); border-radius: 999px; padding: .18rem .55rem; white-space: nowrap; }
.pill.ok { color: var(--accent); background: var(--accent-dim); border: 1px solid rgba(61,220,151,.35); }
.pill.no { color: var(--red); background: rgba(255,122,138,.08); border: 1px solid rgba(255,122,138,.35); }
.pill.soon { color: var(--copper); background: rgba(232,161,92,.08); border: 1px solid rgba(232,161,92,.35); }
.inline { display: inline; }
.fee { color: var(--copper); } .ok { color: var(--accent); }

/* misc */
.empty { text-align: center; border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 2.6rem 1rem; color: var(--muted); margin: 1.5rem 0; }
.empty h2 { color: var(--text); }
.foot { border-top: 1px solid var(--line); background: #080c14; padding: 1.6rem 0; color: var(--faint); font-size: .85rem; }
.foot-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.foot p { margin: 0; }
.foot strong { color: var(--muted); }

/* verify banner + big check */
.verify-banner { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.bigcheck { font-size: 3rem; color: var(--accent); line-height: 1; margin: .4rem 0 .8rem; }

/* store page */
.store-head { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1.7rem; margin-bottom: 1.6rem; position: relative; overflow: hidden; }
.store-head::after { content: ""; position: absolute; inset: 0; background:
  repeating-linear-gradient(0deg, transparent 0 23px, rgba(148,170,210,.06) 23px 24px),
  repeating-linear-gradient(90deg, transparent 0 23px, rgba(148,170,210,.06) 23px 24px); pointer-events: none; }
.store-id { display: flex; gap: 1.1rem; align-items: center; position: relative; z-index: 1; }
.store-avatar { flex: none; width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center;
  font: 800 1.7rem var(--sans); color: var(--accent); background: rgba(11,15,23,.75); border: 1px solid rgba(61,220,151,.4); }
.store-head h1 { margin: 0; }
.store-meta { color: var(--muted); font-size: .88rem; margin: .3rem 0 0; }
.store-bio { color: var(--text); max-width: 70ch; margin: 1rem 0 0; position: relative; z-index: 1; }
.profile-status { margin: 1.1rem 0 1.4rem; }
.btn-row { display: flex; gap: .8rem; flex-wrap: wrap; }

/* archive + danger zone */
.archive-actions { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.btn-danger { background: linear-gradient(180deg,#ff8b98,#e5484f); color: #2a0509; }
.btn-danger:hover { box-shadow: 0 8px 22px rgba(229,72,79,.35); }
.danger-zone { border: 1px solid rgba(255,122,138,.4); background: rgba(255,122,138,.07); border-radius: 10px; padding: 1rem 1.2rem; margin: 1.1rem 0 1.5rem; }
.danger-zone ul { margin: .6rem 0 .4rem; padding-left: 1.2rem; color: var(--muted); }
.danger-zone li { margin: .25rem 0; }
.store-search { position: relative; z-index: 1; margin-top: 1.1rem; }

@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; }
  .two-col, .radio-row { grid-template-columns: 1fr; }
  .topbar-right .muted { display: none; }
}
