/* Gear Swap pages (/swap, /swap/new, /swap/:id, /swap/:id/edit). Built on skiai-tokens.css, so light and dark follow. */
* { box-sizing: border-box }
html, body { margin: 0; min-height: 100%; background: var(--bg-radial, var(--bg)); background-color: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased }
a { color: var(--accent) }
button, input, select, textarea { font: inherit; color: inherit }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent-focus); outline-offset: 2px }
.glass { background: var(--panel); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: var(--r-panel, 16px); box-shadow: var(--shadow) }
[hidden] { display: none !important }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }

/* header (same shape as /videos) */
header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 16px; margin: 12px; height: 54px }
.sk-wordmark { font: 800 21px/1 var(--font-display); letter-spacing: -.02em; color: var(--text); text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px } .sk-wordmark span { color: var(--accent) }
header nav { display: flex; gap: 3px; background: var(--panel2); border-radius: 10px; padding: 3px; white-space: nowrap }
header nav a { color: var(--muted); padding: 5px 11px; font-weight: 600; font-size: 12.5px; border-radius: 8px; text-decoration: none } header nav a.on { background: var(--accent); color: var(--on-accent) }
.hspace { flex: 1 }
.btn { background: var(--panel2); color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 12px; font: 600 13px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px }
.btn:hover { border-color: var(--accent-line) }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; font-weight: 700 } .btn.primary:hover { background: var(--accent-hover) }
.btn.quiet { background: none; border-color: transparent; color: var(--accent) } .btn.quiet:hover { color: var(--text) }
.btn.danger { color: var(--bad); border-color: var(--bad-line); background: var(--bad-bg) }
.btn.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line) }
.btn[disabled] { opacity: .55; cursor: default }
.ibtn { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--panel2); border: 1px solid var(--line-strong); color: var(--muted); cursor: pointer; flex: none }
.ibtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round }

/* page frame */
.wrap { max-width: 1240px; margin: 0 auto; padding: 4px 16px 60px }
.crumbs { font-size: 13px; color: var(--muted); margin: 6px 2px 12px } .crumbs a { color: var(--muted); text-decoration: none } .crumbs a:hover { color: var(--accent) }
h1.page { font: 800 30px/1.1 var(--font-display); letter-spacing: -.02em; margin: 0 }
.sub { color: var(--muted); font-size: 13.5px }
.h { font: 700 11px var(--font-display); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 8px }
.muted { color: var(--muted) }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px }

/* form controls */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0 }
.field > label, .lbl { font-weight: 600; font-size: 12.5px; color: var(--text-2) }
.field .hint { color: var(--muted); font-size: 12px }
.in { width: 100%; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; min-height: 40px; font-size: 14px; color: var(--text) }
.in:focus { border-color: var(--accent-focus); box-shadow: 0 0 0 3px var(--accent-ring); outline: none }
textarea.in { resize: vertical; min-height: 140px; line-height: 1.5 }
select.in { appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; min-height: 40px; font-size: 13.5px }
.check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none }
.chips { display: flex; flex-wrap: wrap; gap: 6px }
.chip { border: 1px solid var(--line-strong); background: var(--panel2); color: var(--text); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; min-height: 36px }
.chip.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line) }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
.row3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px }

/* typeahead */
.ta { position: relative }
.ta-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop, var(--shadow)); padding: 4px; max-height: 280px; overflow: auto }
.ta-list button { display: flex; width: 100%; justify-content: space-between; gap: 8px; text-align: left; background: none; border: 0; border-radius: 8px; padding: 9px 10px; cursor: pointer; min-height: 40px; color: var(--text) }
.ta-list button:hover, .ta-list button.hl { background: var(--accent-soft) }
.ta-list .c { color: var(--muted); font-size: 12px }
.picked { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); border-radius: 999px; padding: 4px 6px 4px 12px; font-weight: 600; font-size: 13px }
.picked button { background: none; border: 0; color: inherit; cursor: pointer; width: 30px; height: 30px; border-radius: 50%; font-size: 15px }

/* listing cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px }
.lc { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform .15s, border-color .15s }
.lc:hover { transform: translateY(-2px); border-color: var(--accent-line) }
.lc .ph { position: relative; aspect-ratio: 4/3; background: var(--placeholder-stripe, var(--panel2)); overflow: hidden }
.lc .ph img { width: 100%; height: 100%; object-fit: cover; display: block }
.lc .ph .none { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px }
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 6px; padding: 2px 7px; font: 700 10.5px var(--font); letter-spacing: .02em; white-space: nowrap }
.badge.feat { background: var(--accent); color: var(--on-accent) }
.badge.sold { background: var(--d5-bg); color: var(--d5-text) }
.badge.soft { background: var(--panel2); color: var(--text-2); border: 1px solid var(--line) }
.badge.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line) }
.badge.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line) }
.lc .ph .tl { position: absolute; left: 8px; top: 8px; display: flex; gap: 5px }
.lc .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1 }
.lc .price { font: 800 17px/1.2 var(--font-display); letter-spacing: -.01em }
.lc .price small { font: 600 11px var(--font); color: var(--muted); margin-left: 4px }
.lc h3 { margin: 0; font: 600 13.5px/1.35 var(--font); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden }
.lc .meta { color: var(--muted); font-size: 12px; margin-top: auto; padding-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }

/* modal */
.modal { position: fixed; inset: 0; z-index: 70; background: rgba(8,14,28,.55); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 16px }
.modal .box { width: min(520px, 100%); max-height: 92vh; overflow: auto; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow-frame, var(--shadow)) }
.modal h2 { margin: 0 0 6px; font: 800 20px/1.2 var(--font-display) }
.modal .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 80; background: var(--panel-solid); color: var(--text); border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 16px; box-shadow: var(--shadow-pop, var(--shadow)); font-weight: 600; max-width: calc(100vw - 32px) }
.toast.bad { border-color: var(--bad-line); color: var(--bad) }
.err { background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad); border-radius: 10px; padding: 10px 12px; font-size: 13.5px }
.err a { color: inherit; font-weight: 700 }
.empty { border: 1px dashed var(--line-dashed); border-radius: 14px; padding: 36px 16px; text-align: center; color: var(--muted) }

@media (max-width: 720px) {
  header { margin: 8px; gap: 8px; padding: 8px 10px }
  .wrap { padding: 4px 12px 48px }
  h1.page { font-size: 25px }
  .row2, .row3 { grid-template-columns: 1fr }
  .in, input, select, textarea { font-size: 16px }
  .btn, .ibtn, .chip, .check { min-height: 44px }
  .ibtn { min-width: 44px }
  .grid { grid-template-columns: 1fr; gap: 10px }
  .lc { flex-direction: row; min-height: 118px }                    /* one column of compact rows on phones */
  .lc:hover { transform: none }
  .lc .ph { flex: 0 0 132px; aspect-ratio: auto }
  .lc .ph .tl { left: 6px; top: 6px; flex-direction: column; align-items: flex-start }
  .lc .body { padding: 10px 12px; min-width: 0 }
  .lc .price { font-size: 16px }
  .lc .meta { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical }
}
@media (max-width: 520px) { #acct { display: none } }   /* the shell's menu carries Account on phones */
