/* ── Design tokens — warm marketplace ───────────────────── */
:root {
  --bg:        #faf8f5;
  --panel:     #ffffff;
  --panel-2:   #f5f1eb;
  --text:      #1c1814;
  --muted:     #8a7f74;
  --border:    #e8e0d5;
  --border-hv: #c9b99e;

  --orange:    #e8600a;   /* primary CTA — own this */
  --orange-hv: #c94f06;
  --amber:     #d97706;   /* declared value / price */
  --green:     #16a34a;
  --red:       #dc2626;
  --ink:       #1c1814;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-hv: 0 8px 24px rgba(0,0,0,0.13), 0 3px 8px rgba(0,0,0,0.08);

  --shell-w:   1180px;
  --left-w:    220px;
  --right-w:   260px;

  --card-h:    200px;
  --grid-gap:  14px;
  --header-h:  60px;

  --radius-card: 12px;
  --radius-btn:  8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Auth wall ───────────────────────────────────────────── */
.auth-wall {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
}
.auth-wall.hidden { display: none; }

.auth-box {
  width: 340px;
  padding: 36px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; gap: 14px;
  text-align: center;
}
.auth-logo {
  font-size: 22px; font-weight: 800;
  color: var(--text); letter-spacing: -0.01em;
}
.brand-dot { color: var(--orange); }
.auth-sub  { color: var(--muted); font-size: 14px; }
.auth-error { color: var(--red); font-size: 13px; min-height: 18px; }

/* ── Inputs ──────────────────────────────────────────────── */
input[type="text"],
input[type="url"],
input[type="password"],
input[type="number"] {
  width: 100%;
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--text);
  font-size: 14px;
  padding: 10px 13px;
  outline: none;
  transition: border-color 0.15s;
}
input:focus  { border-color: var(--orange); }
input::placeholder { color: var(--muted); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--panel);
  color: var(--text);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--panel-2); border-color: var(--border-hv); text-decoration: none; }
.btn.btn-primary {
  background: var(--orange); color: #fff;
  border-color: var(--orange);
}
.btn.btn-primary:hover { background: var(--orange-hv); border-color: var(--orange-hv); }
.btn.btn-full, .btn.btn-block { width: 100%; }
.btn.btn-sm   { font-size: 13px; padding: 7px 13px; }
.btn.btn-connect { font-size: 13px; padding: 8px 14px; }

/* ── Header ──────────────────────────────────────────────── */
.sm-header {
  position: sticky; top: 0;
  height: var(--header-h);
  background: rgba(250,248,245,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}

.sm-shell {
  max-width: var(--shell-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--left-w) 1fr var(--right-w);
}
.sm-header .sm-shell { height: 100%; }
.sm-header .sm-center { padding: 0 16px; }

.sm-nav {
  height: 100%;
  display: flex; align-items: center; gap: 16px;
}
.sm-brand {
  font-weight: 800; font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.sm-brand:hover { text-decoration: none; }
.sm-navlinks {
  display: flex; gap: 20px; flex: 1;
  font-size: 14px;
}
.sm-navlinks a { color: var(--muted); font-weight: 500; }
.sm-navlinks a:hover { color: var(--text); text-decoration: none; }

/* ── Main shell ──────────────────────────────────────────── */
.sm-shell--main {
  max-width: var(--shell-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--left-w) 1fr var(--right-w);
  align-items: start;
  min-height: calc(100vh - var(--header-h));
  position: relative;
}

/* ── Sidebar drawers ─────────────────────────────────────── */
.sm-left,
.sm-right {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  background: var(--panel);
}
.sm-left  { border-right: 1px solid var(--border); }
.sm-right { border-left:  1px solid var(--border); }

.drawer-inner {
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.drawer-head {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}
.drawer-sub  { font-size: 11px; color: var(--muted); margin-top: -8px; }
.drawer-rule { height: 1px; background: var(--border); width: 100%; }

/* Mobile tabs */
.drawer-tab {
  display: none;
  position: fixed; top: 50%;
  z-index: 60;
  background: var(--panel);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px 6px 0 0;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.drawer-tab--left  { left: -20px;  transform: translateY(-50%) rotate(90deg); }
.drawer-tab--right { right: -20px; transform: translateY(-50%) rotate(-90deg); }

.drawer-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(28,24,20,0.4);
  z-index: 59;
}
.drawer-backdrop.visible { display: block; }

/* ── Left sidebar — buyers ───────────────────────────────── */
.buyer-list, .recent-list {
  display: flex; flex-direction: column; gap: 8px;
}
.list-empty  { color: var(--muted); font-size: 12px; font-style: italic; }

.buyer-row {
  display: grid; grid-template-columns: 18px 1fr auto;
  gap: 6px; align-items: center; font-size: 12px;
}
.buyer-rank  { color: var(--muted); font-weight: 600; }
.buyer-addr  { font-family: monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.buyer-slots { color: var(--orange); font-weight: 700; }

.recent-row  { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.recent-row .addr { color: var(--text); font-family: monospace; }

/* ── Right sidebar — stats ───────────────────────────────── */
.stat-list  { display: flex; flex-direction: column; gap: 8px; }
.stat-row   {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; color: var(--muted);
}
.stat-row strong { color: var(--text); font-size: 13px; font-weight: 700; }
.stat-label { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.stat-big   { font-size: 20px; font-weight: 800; color: var(--amber); line-height: 1.2; }
.stat-today { font-size: 12px; color: var(--muted); font-weight: 400; }
.stat-muted { font-size: 12px; color: var(--muted); }

/* ── Center content ──────────────────────────────────────── */
.sm-content { padding: 16px; background: var(--bg); }

/* ── Surface grid ────────────────────────────────────────── */
.surface-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
}

/* ── Surface card ────────────────────────────────────────── */
.surface-card {
  position: relative;
  display: flex; flex-direction: column;
  height: var(--card-h);
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s, transform 0.15s, border-color 0.18s;
}
.surface-card:hover {
  box-shadow: var(--shadow-hv);
  transform: translateY(-2px);
  border-color: var(--border-hv);
  text-decoration: none;
}

/* Image zone — 62% of card height */
.card-image {
  flex: 0 0 62%;
  overflow: hidden;
  background: var(--panel-2);
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--border);
}
.card-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}
.surface-card:hover .card-image img { transform: scale(1.03); }

.card-image--empty {
  background: linear-gradient(135deg, #f5f1eb 0%, #ede7dc 100%);
}
.slot-num { font-size: 12px; color: var(--border-hv); font-family: monospace; }

/* Bio avatar zone */
.card-avatar {
  flex: 0 0 62%;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}
.card-avatar img {
  width: 56px; height: 56px;
  border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border);
}
.avatar-placeholder {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--border); display: flex;
  align-items: center; justify-content: center;
  font-size: 22px;
}

/* Body zone */
.card-body {
  flex: 1;
  padding: 6px 8px 4px;
  display: flex; flex-direction: column; justify-content: space-between;
  min-width: 0;
}
.card-title {
  font-size: 11px; font-weight: 500; line-height: 1.35;
  overflow: hidden;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  color: var(--text);
}
.card-title.muted { color: var(--muted); }
.card-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 3px;
}
.card-dv    { font-size: 11px; color: var(--amber); font-weight: 700; }
.card-owner { font-size: 10px; color: var(--muted); font-family: monospace; }

/* Own This — always visible, bottom of card */
.card-claim {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 5px;
  background: var(--orange);
  color: #fff;
  border: none;
  font-size: 10px; font-weight: 700;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.surface-card:hover .card-claim { opacity: 1; }
.surface-card--empty .card-claim {
  opacity: 1;  /* always show on empty slots */
  background: var(--orange);
}

/* ── Claim modal ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 16px;
}
.modal-overlay.hidden { display: none; }

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(28,24,20,0.6);
  z-index: 99;
}
.modal-backdrop.hidden { display: none; }

.modal-box {
  position: relative;
  width: 100%; max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  display: flex; flex-direction: column; gap: 18px;
  z-index: 101;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-hv);
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none;
  color: var(--muted); font-size: 16px; cursor: pointer;
}
.modal-close:hover { color: var(--text); }
.modal-title { font-size: 20px; font-weight: 800; color: var(--text); }

.modal-section { display: flex; flex-direction: column; gap: 8px; }
.modal-section.hidden { display: none; }
.modal-label {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.07em;
  display: flex; justify-content: space-between;
}
.modal-opt { font-weight: 400; text-transform: none; letter-spacing: 0; }
.modal-input { display: block; }

.type-toggle { display: flex; gap: 8px; }
.type-btn {
  flex: 1; padding: 9px;
  background: var(--panel-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--muted); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.type-btn.active { background: var(--orange); color: #fff; border-color: var(--orange); }

.char-count { font-size: 11px; color: var(--muted); font-weight: 400; font-family: monospace; }

.dv-wrap { position: relative; }
.dv-prefix {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 14px; pointer-events: none;
}
.dv-input { padding-left: 26px !important; }
.dv-hint  { font-size: 12px; color: var(--muted); }

/* ── Mobile < 720px ──────────────────────────────────────── */
@media (max-width: 720px) {
  :root {
    --card-h:   130px;
    --grid-gap: 8px;
  }

  .sm-header .sm-shell { display: block; }
  .sm-left-spacer, .sm-right-spacer { display: none; }
  .sm-header .sm-center { padding: 0 12px; }
  .sm-navlinks { display: none; }

  .sm-shell--main { display: block; max-width: 100%; }

  .sm-left,
  .sm-right {
    position: fixed; top: 0; bottom: 0;
    width: 270px; height: 100vh; height: 100dvh;
    z-index: 60;
    transition: transform 0.28s ease;
    overflow-y: auto; border: none;
    box-shadow: none;
  }
  .sm-left  { left: 0;  transform: translateX(-100%); border-right: 1px solid var(--border); padding-top: 54px; }
  .sm-right { right: 0; transform: translateX(100%);  border-left:  1px solid var(--border); padding-top: 54px; }

  .sm-left.is-open  { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.15); }
  .sm-right.is-open { transform: translateX(0); box-shadow: -4px 0 24px rgba(0,0,0,0.15); }

  .drawer-tab { display: block; }
  .sm-content { padding: 10px; }

  /* Always show claim button on mobile (no hover) */
  .card-claim { opacity: 1; }
}
