/* Arfi product kit — shared components for every Arfi app mock. Requires ./tokens.css */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 80px; }
body {
  margin: 0; font-family: var(--font); font-size: var(--fs-body); line-height: 1.55;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
img { max-width: 100%; display: block; }
.sr-defs { position: absolute; width: 0; height: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap { width: min(1280px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.wrap--narrow { width: min(880px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.num, .mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.up { color: var(--up); }
.down { color: var(--down); }
.gold { color: var(--gold-400); }
:focus-visible { outline: 2px solid var(--gold-400); outline-offset: 2px; }
.skip { position: absolute; left: 1rem; top: -100px; z-index: 100; background: var(--gold-400); color: var(--gold-ink); padding: .5rem 1rem; border-radius: var(--r-sm); }
.skip:focus { top: 1rem; }
.link { color: var(--gold-400); }
.link:hover { color: var(--gold-300); text-decoration: underline; }

/* Demo banner: every mock that shows sample data must carry one */
.demo-bar { background: var(--warn-soft); border-bottom: 1px solid rgba(240,163,58,.25); color: var(--text-2); font-size: var(--fs-xs); text-align: center; padding: .45rem 1rem; }
.demo-bar b { color: var(--warn); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; height: 44px; padding: 0 1.25rem; border-radius: var(--r-md); border: 1px solid transparent; font-weight: 700; font-size: var(--fs-sm); cursor: pointer; white-space: nowrap; background: none; }
.btn--sm { height: 36px; padding: 0 .9rem; border-radius: var(--r-sm); font-size: var(--fs-xs); }
.btn--lg { height: 54px; padding: 0 1.6rem; font-size: var(--fs-body); }
.btn--block { width: 100%; }
.btn--gold { background: var(--gold-400); color: var(--gold-ink); }
.btn--gold:hover { background: var(--gold-300); }
.btn--ghost { background: var(--card); border-color: var(--line); color: var(--text-2); }
.btn--ghost:hover { background: var(--card-hover); color: var(--text); }
.btn--up { background: var(--up); color: #06140e; }
.btn--down { background: var(--down); color: #fff; }
.btn[disabled], .btn.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* Pills / dots */
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; flex: none; }
.dot--up { background: var(--up); }
.dot--warn { background: var(--warn); }
.dot--down { background: var(--down); }
.pill { display: inline-flex; align-items: center; gap: .35rem; font-size: var(--fs-xs); font-weight: 700; padding: .25rem .6rem; border-radius: 6px; background: var(--card-hover); color: var(--muted); white-space: nowrap; }
.pill--up { background: var(--up-soft); color: var(--up); }
.pill--warn { background: var(--warn-soft); color: var(--warn); }
.pill--down { background: var(--down-soft); color: var(--down); }
.pill--gold { background: var(--gold-soft); color: var(--gold-400); }

/* Header */
.top { position: sticky; top: 0; z-index: 50; height: 64px; background: rgba(11,14,17,.94); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-soft); }
.top__in { height: 100%; display: flex; align-items: center; gap: 2rem; }
.logo { display: inline-flex; align-items: center; gap: .55rem; font-size: 1.2rem; font-weight: 800; white-space: nowrap; }
.logo svg { width: 30px; height: 30px; }
.logo b { color: var(--gold-400); }
.logo--sm { font-size: 1.05rem; }
.logo--sm svg { width: 24px; height: 24px; }
.nav { display: flex; align-items: center; gap: .15rem; flex: 1; }
.nav > a, .nav__drop > button { display: inline-flex; align-items: center; gap: .3rem; padding: .5rem .75rem; border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); background: none; border: 0; cursor: pointer; }
.nav > a:hover, .nav__drop > button:hover, .nav > a.is-active { color: var(--gold-400); }
.nav__drop { position: relative; }
.nav__drop svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.drop { position: absolute; top: calc(100% + 8px); left: 0; min-width: 200px; padding: .4rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-card); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s, transform .15s, visibility .15s; z-index: 60; }
.drop.is-open { opacity: 1; visibility: visible; transform: none; }
.drop a { display: block; padding: .6rem .75rem; border-radius: var(--r-sm); font-size: var(--fs-sm); color: var(--text-2); }
.drop a:hover { background: var(--card-hover); color: var(--text); }
.top__right { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.chip-net { display: inline-flex; align-items: center; gap: .5rem; height: 36px; padding: 0 .8rem; border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--line); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.burger { display: none; width: 38px; height: 38px; border: 0; background: none; cursor: pointer; flex-direction: column; justify-content: center; gap: 5px; padding: 8px; }
.burger span { height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }

/* Layout */
.page { padding: 2rem 0 4rem; }
.phead { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; padding-bottom: 1.25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--line-soft); }
.phead h1 { font-size: 1.4rem; }
.phead__sub { color: var(--muted); font-size: var(--fs-sm); }
.phead__right { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-400); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.stack > * + * { margin-top: 1.25rem; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow: hidden; }
.card--pad { padding: 1.25rem; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line-soft); }
.card__head h2, .card__head h3 { font-size: 1rem; }
.card__body { padding: 1.25rem; }
.card__foot { display: block; text-align: center; padding: .9rem; border-top: 1px solid var(--line-soft); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.card__foot:hover { color: var(--gold-400); background: var(--card); }

/* Stat */
.stat { display: flex; gap: .9rem; align-items: flex-start; }
.stat__ico { width: 40px; height: 40px; flex: none; border-radius: var(--r-sm); background: var(--gold-soft); display: grid; place-items: center; }
.stat__ico svg { width: 20px; height: 20px; fill: none; stroke: var(--gold-400); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stat span { display: block; font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .2rem; }
.stat b { font-size: 1.2rem; font-weight: 800; }
.stat small { display: block; font-size: var(--fs-xs); color: var(--faint); margin-top: .1rem; }

/* Tabs / segmented */
.tabs { display: flex; gap: .25rem; overflow-x: auto; }
.tabs a, .tabs button { padding: .5rem .9rem; border-radius: var(--r-sm); background: none; border: 0; font-size: var(--fs-sm); font-weight: 700; color: var(--muted); white-space: nowrap; cursor: pointer; }
.tabs .is-on { background: var(--card); color: var(--text); }
.seg { display: inline-flex; padding: 3px; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--r-md); }
.seg button { border: 0; background: none; padding: .45rem .9rem; border-radius: 9px; font-size: var(--fs-sm); font-weight: 700; color: var(--muted); cursor: pointer; }
.seg .is-on { background: var(--card-hover); color: var(--text); }

/* Forms */
.field { display: grid; gap: .4rem; }
.field label, .field__label { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); }
.input, .select, .textarea { width: 100%; height: 46px; padding: 0 .9rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--text); outline: 0; }
.textarea { height: auto; min-height: 110px; padding: .75rem .9rem; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold-500); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.field__hint { font-size: var(--fs-xs); color: var(--faint); }
.field__err { font-size: var(--fs-xs); color: var(--down); }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; }
.check input { accent-color: var(--gold-400); width: 16px; height: 16px; margin-top: .2rem; }

/* Token badge (coin icon + symbol) */
.tok { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; }
.tok__ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 800; background: var(--card-hover); color: var(--text-2); flex: none; }
.tok__ico--arfi { background: var(--gold-grad); color: var(--gold-ink); }

/* Key-value */
.kv { margin: 0; }
.kv > div { display: grid; grid-template-columns: 220px 1fr; gap: 1rem; padding: .9rem 1.25rem; border-bottom: 1px solid var(--line-soft); align-items: center; font-size: var(--fs-sm); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; word-break: break-word; }
.rows > div { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; font-size: var(--fs-sm); }
.rows > div > span:first-child { color: var(--muted); }

/* Table */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.t th { text-align: left; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); padding: .8rem 1.25rem; border-bottom: 1px solid var(--line-soft); white-space: nowrap; background: var(--bg-2); }
.t td { padding: .85rem 1.25rem; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: rgba(255,255,255,.015); }
.t .r { text-align: right; }

/* Progress */
.bar { display: block; height: 8px; border-radius: 4px; background: var(--card-hover); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--gold-grad); border-radius: inherit; }

/* Notes / empty */
.note { display: flex; gap: .65rem; align-items: flex-start; padding: .85rem 1.1rem; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line-soft); font-size: var(--fs-sm); color: var(--muted); }
.note b { color: var(--text-2); }
.note--warn { background: var(--warn-soft); border-color: rgba(240,163,58,.25); color: var(--text-2); }
.note--down { background: var(--down-soft); border-color: rgba(234,57,67,.25); color: var(--text-2); }
.note--up { background: var(--up-soft); border-color: rgba(22,199,132,.25); color: var(--text-2); }
.empty { text-align: center; padding: 3rem 1.5rem; color: var(--muted); font-size: var(--fs-sm); }
.empty b { display: block; color: var(--text); font-size: 1.05rem; margin-bottom: .4rem; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; background: rgba(0,0,0,.6); padding: 1rem; }
.modal.is-open { display: grid; }
.modal__box { width: min(440px, 100%); max-height: 90vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-card); }

/* Footer */
.foot { border-top: 1px solid var(--line-soft); background: var(--bg-2); padding: 2.5rem 0 1.5rem; margin-top: 2rem; }
.foot__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line-soft); }
.foot__in p { margin-top: .6rem; font-size: var(--fs-sm); color: var(--muted); max-width: 420px; }
.foot__links { display: flex; flex-wrap: wrap; gap: 1.5rem; font-size: var(--fs-sm); color: var(--muted); align-items: center; }
.foot__links a:hover { color: var(--gold-400); }
.foot__legal { padding-top: 1.25rem; font-size: var(--fs-xs); color: var(--faint); }

/* Responsive */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .nav { position: absolute; top: 100%; left: 0; right: 0; display: none; flex-direction: column; align-items: stretch; padding: .5rem var(--gutter) 1rem; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-card); }
  .top.is-open .nav { display: flex; }
  .nav > a, .nav__drop > button { width: 100%; justify-content: space-between; min-height: 48px; border-bottom: 1px solid var(--line-soft); border-radius: 0; font-size: var(--fs-body); }
  .drop { position: static; display: none; opacity: 1; visibility: visible; transform: none; box-shadow: none; margin: .25rem 0; }
  .drop.is-open { display: block; }
  .burger { display: flex; }
  .top.is-open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .top.is-open .burger span:nth-child(2) { opacity: 0; }
  .top.is-open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .grid-2 { grid-template-columns: 1fr; }
  .kv > div { grid-template-columns: 1fr; gap: .3rem; }
}
@media (max-width: 640px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .phead__right { margin-left: 0; }
  .chip-net span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
