.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-size: .92rem; }
.link-btn:hover { text-decoration: underline; }
.link-btn.center { display: block; margin: 4px auto 0; color: var(--muted); }

/* ── header ───────────────────────────────────────────── */
.bar { position: sticky; top: 0; z-index: 20; background: rgba(10,10,10,.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.bar-in { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand .sub { font-weight: 400; }
.search { flex: 1; max-width: 420px; margin-left: auto; }
.search input { width: 100%; height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); }
.search input:focus { outline: none; border-color: #4a4a4a; }
.acct { display: flex; align-items: center; gap: 8px; }
.me { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.me img { width: 28px; height: 28px; border-radius: 6px; image-rendering: pixelated; }
.me .bal { font-family: var(--mono); color: var(--muted); }
.count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--surface-2); font-size: .78rem; display: inline-grid; place-items: center; }
.count.has { background: var(--accent); color: #000; font-weight: 600; }

/* ── page ─────────────────────────────────────────────── */
.main { padding: 32px 0 96px; }
.notice { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 32px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.notice strong { color: var(--text); font-weight: 500; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); margin-right: 6px; vertical-align: 1px; }
.dot.on { background: var(--ok); }

.toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 24px; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 0; padding: 0 0 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tabs .n { color: var(--faint); margin-left: 4px; font-size: .85em; }
#sort { margin-bottom: 8px; height: 32px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface); font-size: .88rem; color: var(--muted); }
.count-line { font-size: .85rem; margin: 16px 0; }

/* ── items ────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; }
.item { display: flex; flex-direction: column; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); transition: border-color .15s; }
.item:hover { border-color: #353535; }
.ico { width: 40px; height: 40px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; color: var(--faint); font-weight: 600; flex: none; }
.ico img { width: 32px; height: 32px; image-rendering: pixelated; }
.item h3 { font-family: inherit; font-size: .95rem; font-weight: 500; letter-spacing: 0; margin: 0 0 2px; line-height: 1.3; overflow-wrap: anywhere; }
.item .price { font-family: var(--mono); font-size: .88rem; color: var(--muted); }
.item .add { margin-top: auto; height: 34px; font-size: .88rem; }
.item .add.done { border-color: var(--accent); color: var(--accent); }
.more { text-align: center; margin-top: 24px; }
.empty { text-align: center; padding: 64px 0; }

/* ── orders ───────────────────────────────────────────── */
.orders { margin-top: 72px; }
.orders h2 { font-size: 1.1rem; margin: 0 0 12px; }
.order { display: grid; grid-template-columns: 90px 1fr auto; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.order .what { color: var(--muted); }
.order .msg { display: block; color: var(--faint); font-size: .85rem; }
.order .right { text-align: right; font-family: var(--mono); }
.status { display: block; font-family: system-ui, sans-serif; font-size: .8rem; color: var(--muted); }
.status.pending { color: var(--accent); }
.status.completed { color: var(--ok); }
.status.failed, .status.expired { color: var(--bad); }

/* ── cart drawer ──────────────────────────────────────── */
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.6); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(400px, 100%); display: flex; flex-direction: column; background: var(--bg); border-left: 1px solid var(--line); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; height: 64px; padding: 0 12px 0 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 1.05rem; }
.cart-lines { flex: 1; overflow-y: auto; padding: 0 20px; }
.cart-empty { color: var(--muted); padding: 32px 0; text-align: center; }
.line { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line b { display: block; font-weight: 500; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line .each { font-family: var(--mono); font-size: .8rem; color: var(--faint); }
.line .sum { font-family: var(--mono); font-size: .9rem; text-align: right; }
.qty { display: flex; align-items: center; margin-top: 6px; }
.qty button { width: 26px; height: 26px; border: 1px solid var(--line-2); background: none; border-radius: 6px; color: var(--muted); line-height: 1; }
.qty button:hover { color: var(--text); border-color: #444; }
.qty input { width: 52px; height: 26px; text-align: center; border: 0; background: none; font-family: var(--mono); font-size: .88rem; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty .rm { width: auto; border: 0; margin-left: 8px; font-size: .8rem; color: var(--faint); }
.qty .rm:hover { color: var(--bad); }
.drawer-foot { padding: 16px 20px 20px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.drawer-foot dl { margin: 0; display: grid; gap: 6px; font-size: .92rem; }
.drawer-foot dl div { display: flex; justify-content: space-between; }
.drawer-foot dt { color: var(--muted); }
.drawer-foot dd { margin: 0; font-family: var(--mono); }
.drawer-foot dd.neg { color: var(--bad); }
.note { font-size: .85rem; margin: 0; }
.wide { width: 100%; height: 44px; }

/* ── dialog + toasts ──────────────────────────────────── */
.dialog { width: min(380px, calc(100% - 32px)); padding: 28px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--bg); color: var(--text); }
.dialog::backdrop { background: rgba(0,0,0,.7); }
.dialog h2 { margin: 0 0 16px; font-size: 1.2rem; }
.dialog ol { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 8px; }
.dialog .note { margin-bottom: 20px; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(380px, calc(100% - 32px)); }
.toast { padding: 12px 16px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: .92rem; }
.toast.err { border-color: rgba(255,107,94,.5); }

@media (max-width: 720px) {
  .bar-in { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; height: auto; padding: 12px 0; }
  .search { grid-column: 1 / -1; grid-row: 2; max-width: none; margin: 0; }
  .acct .btn.ghost { padding: 0 8px; }
  .me .name, .me .bal, .brand .sub { display: none; }
  .brand { font-size: 0; gap: 0; } /* logo only on phones */
  .brand img { width: 32px; height: 32px; }
  .bar-in > * { min-width: 0; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .order { grid-template-columns: 1fr auto; }
  .order .when { display: none; }
}
