:root{
  --ink:#1a1210;
  --ink-dark:#0d0806;
  --parchment:#fbf9f6;
  --paper:#ffffff;
  --gold:#e2660a;
  --gold-light:#f4a13d;
  --crimson:#af1f06;
  --charcoal:#1a1210;
  --line: rgba(26,18,16,0.12);
  --good:#2f6d3f;
  --bad:#af1f06;
}
*{box-sizing:border-box; margin:0; padding:0;}
body{
  background:var(--parchment);
  color:var(--charcoal);
  font-family:'Inter', sans-serif;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  min-height:100vh;
}
.display{ font-family:'Bebas Neue', sans-serif; letter-spacing:0.02em; }
a{ color:inherit; }
input, select{
  width:100%;
  font-family:'Inter', sans-serif;
  font-size:0.95rem;
  padding:0.7rem 0.9rem;
  border-radius:8px;
  border:1.5px solid var(--line);
  background:var(--paper);
  color:var(--charcoal);
  outline:none;
}
input:focus{ border-color:var(--gold); }
label{
  display:block;
  font-size:0.78rem;
  font-weight:600;
  letter-spacing:0.03em;
  text-transform:uppercase;
  color:var(--ink);
  opacity:0.7;
  margin-bottom:0.35rem;
}
.field{ margin-bottom:1rem; }
.field-row{ display:flex; gap:0.6rem; }
.field-row .field{ margin-bottom:1rem; }
button, .btn-primary, .btn-ghost, .btn-danger{
  font-family:'Inter', sans-serif;
  font-weight:600;
  font-size:0.95rem;
  cursor:pointer;
  border:none;
  border-radius:8px;
  padding:0.8rem 1.4rem;
}
.btn-primary{
  background:var(--ink);
  color:var(--paper);
  box-shadow:0 5px 0 var(--ink-dark);
  transition:transform 0.1s ease, box-shadow 0.1s ease;
  width:100%;
}
.btn-primary:hover{ transform:translateY(2px); box-shadow:0 3px 0 var(--ink-dark); }
.btn-primary:active{ transform:translateY(5px); box-shadow:0 0 0 var(--ink-dark); }
.btn-primary:disabled{ opacity:0.55; cursor:default; transform:none; box-shadow:0 5px 0 var(--ink-dark); }
.btn-ghost{
  background:transparent;
  color:var(--ink);
  border:1.5px solid var(--line);
}
.btn-ghost:hover{ border-color:var(--ink); }
.btn-danger{ background:var(--crimson); color:var(--paper); }
.wrap{ max-width:960px; margin:0 auto; padding:0 1.25rem; }

header{
  display:flex; align-items:center; justify-content:space-between;
  padding:1.5rem 0; border-bottom:1px solid var(--line);
  margin-bottom:2.5rem;
}
.brand{ display:flex; align-items:center; gap:0.6rem; text-decoration:none; }
.brand img{ width:34px; height:34px; object-fit:contain; }
.brand span{ font-family:'Bebas Neue', sans-serif; font-size:1.5rem; }

.card{
  background:var(--paper);
  border:1.5px solid var(--line);
  border-radius:14px;
  padding:2rem;
  max-width:440px;
  margin:0 auto;
}
.card.wide{ max-width:760px; }
.card.xwide{ max-width:960px; }

h1.page-title{
  font-size:clamp(1.8rem, 4vw, 2.4rem);
  text-align:center;
  margin-bottom:0.35rem;
}
.subtitle{
  text-align:center; opacity:0.65; font-size:0.9rem; margin-bottom:2rem;
}

.tabbar{ display:flex; gap:0.5rem; margin-bottom:1.5rem; }
.tabbar button{ flex:1; background:transparent; border:1.5px solid var(--line); color:var(--ink); }
.tabbar button.active{ background:var(--ink); color:var(--paper); border-color:var(--ink); }

.error{ background:#fbeae6; color:var(--crimson); border:1px solid #f0c4b8; border-radius:8px; padding:0.7rem 0.9rem; font-size:0.85rem; margin-bottom:1rem; }
.success{ background:#e9f4ec; color:var(--good); border:1px solid #c6e3cd; border-radius:8px; padding:0.7rem 0.9rem; font-size:0.85rem; margin-bottom:1rem; }

.balance-hero{
  text-align:center; padding:2rem 1rem;
  background:linear-gradient(160deg, var(--ink), var(--ink-dark));
  border-radius:14px; color:var(--paper); margin-bottom:1.75rem;
}
.balance-hero .label{ font-size:0.8rem; opacity:0.7; text-transform:uppercase; letter-spacing:0.08em; margin-bottom:0.4rem; }
.balance-hero .amount{ font-family:'Bebas Neue', sans-serif; font-size:3.4rem; color:var(--gold-light); }

.row{ display:flex; justify-content:space-between; align-items:flex-start; padding:0.9rem 0; border-bottom:1px solid var(--line); gap:1rem; }
.row:last-child{ border-bottom:none; }
.row .meta{ font-size:0.78rem; opacity:0.6; margin-top:0.2rem; }
.row .reason{ font-size:0.85rem; margin-top:0.25rem; }
.amt-pos{ color:var(--good); font-weight:700; white-space:nowrap; }
.amt-neg{ color:var(--bad); font-weight:700; white-space:nowrap; }

.section-title{ font-family:'Bebas Neue', sans-serif; font-size:1.3rem; margin-bottom:0.75rem; margin-top:2rem; }
.section-title:first-child{ margin-top:0; }

.section-title-row{
  display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:0.6rem 1rem;
  margin-top:2rem;
}
.section-title-row .section-title{ margin-top:0; margin-bottom:0; }
.sort-control{ display:flex; align-items:center; gap:0.5rem; }
.sort-control label{ margin-bottom:0; white-space:nowrap; }
.sort-control select{ width:auto; padding:0.5rem 2rem 0.5rem 0.8rem; font-size:0.85rem; }

.user-list-item{
  display:flex; justify-content:space-between; align-items:center;
  padding:0.9rem 1rem; border:1.5px solid var(--line); border-radius:10px;
  margin-bottom:0.6rem; cursor:pointer; background:var(--paper);
}
.user-list-item:hover{ border-color:var(--gold); }
.user-list-item .name{ font-weight:600; }
.user-list-item .phone{ font-size:0.8rem; opacity:0.6; }
.user-list-item .credit{ font-family:'Bebas Neue', sans-serif; font-size:1.3rem; color:var(--gold); white-space:nowrap; flex-shrink:0; margin-left:1rem; }

.backlink{ display:inline-block; margin-bottom:1rem; font-size:0.85rem; font-weight:600; opacity:0.75; cursor:pointer; }
.backlink:hover{ opacity:1; }

.empty{ text-align:center; opacity:0.55; padding:2rem 0; font-size:0.9rem; }

/* A first-run empty state gets its own CTA baked in, rather than relying on
   someone noticing the small ghost "+ Add" button separately above the
   list — same list-emptiness check, just a more inviting landing than a
   line of grey text. */
.empty-state{ text-align:center; padding:2.75rem 1.25rem; }
.empty-state-title{ font-family:'Bebas Neue', sans-serif; font-size:1.5rem; letter-spacing:0.01em; margin-bottom:0.5rem; }
.empty-state-text{ font-size:0.9rem; opacity:0.65; max-width:360px; margin:0 auto 1.4rem; }
.spinner-wrap{ text-align:center; padding:3rem 0; opacity:0.6; font-size:0.9rem; }

.detail-grid{ display:grid; grid-template-columns:1fr 1fr; gap:0.8rem 1.5rem; margin-bottom:1.5rem; }
.detail-grid div span{ display:block; }
.detail-grid .k{ font-size:0.72rem; text-transform:uppercase; letter-spacing:0.04em; opacity:0.55; margin-bottom:0.15rem; }
.detail-grid .v{ font-size:0.92rem; }

.adjust-form{ display:flex; gap:0.6rem; align-items:flex-end; flex-wrap:wrap; margin-bottom:1.5rem; }
.adjust-form .field{ margin-bottom:0; }
.adjust-form .amt-field{ width:150px; }
.adjust-form .reason-field{ flex:1; min-width:220px; }

.stat-card{
  background:var(--paper);
  border:1.5px solid var(--line);
  border-radius:12px;
  padding:1.1rem 1.3rem;
  margin-bottom:1.5rem;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.stat-card .k{ font-size:0.78rem; text-transform:uppercase; letter-spacing:0.05em; opacity:0.6; }
.stat-card .v{ font-family:'Bebas Neue', sans-serif; font-size:1.9rem; color:var(--gold); white-space:nowrap; }

.stat-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(130px, 1fr)); gap:0.7rem; margin-bottom:1.5rem; }
.stat-tile{ background:var(--paper); border:1.5px solid var(--line); border-radius:10px; padding:0.8rem 1rem; }
.stat-tile .k{ display:block; font-size:0.72rem; text-transform:uppercase; letter-spacing:0.04em; opacity:0.6; margin-bottom:0.25rem; }
.stat-tile .v{ font-family:'Bebas Neue', sans-serif; font-size:1.6rem; color:var(--gold); }
.stat-tile .sub{ font-size:0.72rem; opacity:0.5; margin-left:0.3rem; }

.danger-zone{
  margin-top:2.5rem;
  padding-top:1.5rem;
  border-top:1.5px dashed var(--line);
}
.danger-zone .section-title{ color:var(--crimson); }
.danger-zone p{ font-size:0.85rem; opacity:0.7; margin-bottom:0.9rem; }
.danger-zone .row-inline{ display:flex; gap:0.6rem; flex-wrap:wrap; }
.danger-zone input{ flex:1; min-width:160px; }
.danger-zone button{ width:auto; }

/* ---------- wanted cards (public "sell your cards" page + admin manager) ---------- */

.wanted-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(220px, 1fr));
  gap:1.5rem;
  margin-bottom:2rem;
}

/* Marketplace listings — unlike .wanted-grid above, this always shows at
   least 4 columns down to the tablet breakpoint rather than however many
   220px-wide cards happen to fit, only dropping below 4 once there's
   genuinely no room (see the 640px breakpoint further down). */
.market-grid{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:1.25rem;
  margin-bottom:2rem;
}

.wanted-card{
  background:var(--paper);
  border:1.5px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

.wanted-card .thumb{
  width:100%;
  aspect-ratio:1 / 1;
  background:var(--parchment);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  border-bottom:1.5px solid var(--line);
}
.wanted-card .thumb img{ width:100%; height:100%; object-fit:contain; }
.wanted-card .thumb span{ font-size:0.85rem; opacity:0.45; }

.wanted-card .body{ padding:1.1rem 1.2rem 1.3rem; display:flex; flex-direction:column; gap:0.5rem; flex:1; }
.wanted-card .name{ font-weight:700; font-size:1rem; }
.wanted-card .price{ font-family:'Bebas Neue', sans-serif; font-size:1.7rem; color:var(--gold); }
.wanted-card .qty{ font-size:0.8rem; opacity:0.65; }
.wanted-card .contact-box{
  margin-top:0.5rem;
  background:var(--parchment);
  border:1.5px dashed var(--line);
  border-radius:10px;
  padding:0.8rem 0.9rem;
  font-size:0.85rem;
}
.wanted-card .contact-box a{ font-weight:600; color:var(--gold); text-decoration:none; }
.wanted-card .contact-box div{ margin-bottom:0.3rem; }
.wanted-card .contact-box div:last-child{ margin-bottom:0; }
.wanted-card button.btn-ghost{ margin-top:auto; width:100%; }

.buy-policy{
  max-width:640px;
  margin:2.5rem auto 0;
  text-align:center;
  font-size:0.88rem;
  opacity:0.75;
  padding:1.25rem 1.5rem;
  border-top:1.5px dashed var(--line);
}

/* admin: wanted-cards manager list */
.wanted-admin-item{
  display:flex;
  gap:1rem;
  align-items:center;
  padding:0.9rem 1rem;
  border:1.5px solid var(--line);
  border-radius:10px;
  margin-bottom:0.6rem;
  background:var(--paper);
}
.wanted-admin-item.hidden-listing{ opacity:0.55; border-style:dashed; }
.wanted-admin-item .thumb{
  width:56px; height:56px; border-radius:8px; overflow:hidden; flex-shrink:0;
  background:var(--parchment); display:flex; align-items:center; justify-content:center;
}
.wanted-admin-item .thumb img{ width:100%; height:100%; object-fit:contain; }
.wanted-admin-item .thumb span{ font-size:0.55rem; opacity:0.4; text-align:center; line-height:1.2; }
.wanted-admin-item .info{ flex:1; min-width:0; }
.wanted-admin-item .name{ font-weight:600; }
.wanted-admin-item .meta{ font-size:0.8rem; opacity:0.6; }
.wanted-admin-item .actions{ display:flex; gap:0.5rem; flex-shrink:0; }
.wanted-admin-item .actions button{ width:auto; padding:0.55rem 0.9rem; font-size:0.85rem; }
.tag-hidden{
  display:inline-block; font-size:0.7rem; font-weight:700; text-transform:uppercase;
  letter-spacing:0.04em; color:var(--crimson); margin-left:0.5rem;
}
.tag-verified{
  display:inline-block; font-size:0.7rem; font-weight:700; text-transform:uppercase;
  letter-spacing:0.04em; color:#1d78e8; margin-left:0.5rem;
}
.tag-business{
  display:inline-block; font-size:0.7rem; font-weight:700; text-transform:uppercase;
  letter-spacing:0.04em; color:var(--gold); margin-left:0.5rem;
}

.wanted-form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:0 1rem; }
.wanted-form-grid .field.full{ grid-column:1 / -1; }

.image-upload{
  display:flex; align-items:center; gap:1rem; margin-bottom:1rem;
}
.image-upload .preview{
  width:80px; height:80px; border-radius:10px; overflow:hidden;
  background:var(--parchment); border:1.5px solid var(--line);
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.image-upload .preview img{ width:100%; height:100%; object-fit:contain; }
.image-upload .preview span{ font-size:0.65rem; opacity:0.5; text-align:center; padding:0 0.3rem; }
.image-upload input[type="file"]{ padding:0.5rem; }
.image-upload .preview.round{ border-radius:50%; }
.image-upload .preview.round img{ object-fit:cover; }

/* ---------- avatars ---------- */

.avatar{
  border-radius:50%; object-fit:cover; flex-shrink:0;
  background:var(--parchment); border:1.5px solid var(--line);
}
.avatar-sm{ width:32px; height:32px; }
.avatar-md{ width:44px; height:44px; }
.avatar-lg{ width:88px; height:88px; }

.profile-header{ display:flex; align-items:center; gap:1.1rem; margin-bottom:1.75rem; }
.profile-header .page-title{ text-align:left; margin-bottom:0.2rem; }
.profile-header .subtitle{ text-align:left; margin-bottom:0; }
.profile-bio{ text-align:left; font-size:0.9rem; opacity:0.8; margin-top:0.35rem; max-width:520px; }

.profile-badges{ display:flex; flex-wrap:wrap; gap:0.4rem; margin-top:0.6rem; }
.profile-badge{
  display:inline-flex; align-items:center;
  font-size:0.7rem; font-weight:700; text-transform:uppercase; letter-spacing:0.03em;
  padding:0.3rem 0.65rem; border-radius:20px;
  background:var(--parchment); border:1px solid var(--line); color:var(--ink); opacity:0.85;
}
.profile-banner .profile-badge{ background:rgba(255,255,255,0.16); border-color:rgba(255,255,255,0.35); color:#fff; }

/* Preset banner strip — bleeds past .card's own padding so the gradient
   reaches the card's edges, then the header content sits back inside it. */
.profile-banner{
  margin:-2rem -2rem 1.5rem; padding:2.2rem 2rem 1.4rem;
  border-radius:12px 12px 0 0;
}
.profile-banner .profile-header{ margin-bottom:0; }
.profile-banner .page-title, .profile-banner .subtitle, .profile-banner .profile-bio{ color:#fff; }
.profile-banner .subtitle{ opacity:0.85; }
.profile-banner .profile-bio{ opacity:0.9; }
.profile-banner .avatar{ border-color:rgba(255,255,255,0.55); }

.profile-summary-grid{ display:flex; flex-direction:column; gap:0.7rem; }
.profile-summary-btn{
  display:flex; align-items:center; justify-content:space-between; gap:0.8rem;
  width:100%; text-align:left; padding:1rem 1.2rem; border-radius:10px;
  background:var(--paper); border:1.5px solid var(--line); cursor:pointer;
}
.profile-summary-btn:hover{ border-color:var(--profile-accent, var(--gold)); }
.profile-summary-btn-locked{ cursor:default; opacity:0.6; }
.profile-summary-btn-locked:hover{ border-color:var(--line); }
.profile-summary-label{ font-family:'Bebas Neue', sans-serif; font-size:1.3rem; letter-spacing:0.01em; }
.profile-summary-stats{ font-size:0.85rem; opacity:0.7; margin-left:auto; margin-right:0.8rem; }
.profile-summary-arrow{ font-size:1.2rem; opacity:0.5; color:var(--profile-accent, inherit); }

/* Members directory grid — one card per public collector/trader. */
.members-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:0.9rem; }
.member-card{
  display:block; text-decoration:none; color:inherit;
  border:1.5px solid var(--line); border-radius:12px; overflow:hidden;
  background:var(--paper); transition:border-color 0.15s ease, transform 0.15s ease;
}
.member-card:hover{ border-color:var(--gold); transform:translateY(-2px); }
.member-card-strip{ height:44px; }
.member-card-body{ padding:0.9rem 1rem 1rem; margin-top:-26px; }
.member-card-body .avatar{ border-width:2.5px; border-color:var(--paper); box-shadow:0 0 0 1px var(--line); }
.member-card-name{ font-family:'Bebas Neue', sans-serif; font-size:1.15rem; margin-top:0.5rem; letter-spacing:0.01em; display:flex; align-items:center; gap:0.4rem; }
.member-card-bio{ font-size:0.82rem; opacity:0.75; margin-top:0.3rem; line-height:1.4; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.member-card-stats{ font-size:0.78rem; opacity:0.6; margin-top:0.6rem; display:flex; gap:0.8rem; flex-wrap:wrap; }

/* matches.html — who wants/has your cards */
.match-members{ font-size:0.8rem; margin-top:0.35rem; }
.match-members a{ font-weight:600; text-decoration:none; }
.match-members a:hover{ text-decoration:underline; }

.trade-history-item{
  padding:0.9rem 1.1rem; border:1.5px solid var(--line); border-radius:10px;
  background:var(--paper); margin-bottom:0.8rem;
}
.trade-history-item:last-child{ margin-bottom:0; }
.trade-history-header{ display:flex; align-items:center; gap:0.6rem; margin-bottom:0.8rem; }
.trade-history-header .who{ font-weight:600; font-size:0.9rem; flex:1; }
.trade-history-header .when{ font-size:0.78rem; opacity:0.55; white-space:nowrap; }

.blocked-user-item{
  display:flex; align-items:center; gap:0.7rem;
  padding:0.7rem 0.9rem; border:1.5px solid var(--line); border-radius:10px;
  background:var(--paper); margin-bottom:0.6rem;
}
.blocked-user-item:last-child{ margin-bottom:0; }
.blocked-user-item .name{ font-weight:600; font-size:0.9rem; flex:1; }
.blocked-user-item button{ width:auto; padding:0.45rem 0.9rem; font-size:0.8rem; }

.collection-form{
  padding:1rem 1.1rem; border:1.5px solid var(--gold); border-radius:10px;
  background:var(--parchment); margin-bottom:1rem;
}
.collection-bulk-bar{
  display:none; justify-content:space-between; align-items:center;
  gap:0.8rem; flex-wrap:wrap;
  background:var(--parchment); border:1.5px solid var(--gold); border-radius:10px;
  padding:0.7rem 1rem; margin-bottom:0.9rem;
}
.collection-bulk-bar span{ font-size:0.85rem; font-weight:600; }
.collection-list{ display:flex; flex-direction:column; gap:0.6rem; }
.collection-item{
  display:flex; align-items:center; gap:0.8rem;
  padding:0.7rem 0.9rem; border:1.5px solid var(--line); border-radius:10px;
  background:var(--paper);
}
.collection-item-select{ display:flex; align-items:center; flex-shrink:0; }
.collection-item-select input{ width:18px; height:18px; cursor:pointer; }
.collection-item-info{ flex:1; min-width:0; }
.collection-item-name{ font-weight:600; font-size:0.9rem; display:flex; align-items:center; gap:0.4rem; flex-wrap:wrap; }
.collection-item-notes{ font-size:0.8rem; opacity:0.65; margin-top:0.35rem; }
.collection-item-price{ font-size:0.8rem; font-weight:600; color:var(--gold-light); margin-top:0.35rem; }
.collection-item-actions{ display:flex; flex-wrap:wrap; justify-content:flex-end; gap:0.5rem; flex-shrink:0; }
.collection-item-actions button{ width:auto; padding:0.45rem 0.9rem; font-size:0.8rem; }
.collection-value{
  background:var(--parchment); border:1.5px solid var(--gold); border-radius:10px;
  padding:0.9rem 1.1rem; margin-bottom:1.2rem;
}
.collection-value-label{ font-size:0.78rem; font-weight:700; text-transform:uppercase; letter-spacing:0.03em; opacity:0.65; }
.collection-value-amount{ font-family:'Bebas Neue', sans-serif; font-size:1.6rem; letter-spacing:0.01em; line-height:1.3; }
.collection-value-note{ font-size:0.72rem; opacity:0.55; font-weight:400; font-family:'Inter', sans-serif; }
.collection-value-row{ display:flex; align-items:center; justify-content:space-between; gap:0.8rem; flex-wrap:wrap; }
.collection-value-toggle{ width:auto; padding:0.35rem 0.75rem; font-size:0.78rem; }
.collection-value-breakdown{
  margin-top:0.6rem; padding-top:0.6rem; border-top:1px solid var(--line);
  font-size:0.85rem; display:flex; flex-direction:column; gap:0.3rem;
}
.collection-value-gain{ color:var(--good); font-weight:600; }
.collection-value-loss{ color:var(--crimson); font-weight:600; }
.collection-view-toggle{ margin-bottom:1rem; }
.collection-set-group{ margin-bottom:1.4rem; }
.collection-set-group .collection-item{ margin-bottom:0.6rem; }
.collection-set-heading{
  font-size:0.95rem; font-weight:700; margin-bottom:0.4rem;
  display:flex; align-items:baseline; gap:0.5rem; flex-wrap:wrap;
}
.collection-set-count{ font-size:0.75rem; font-weight:500; opacity:0.55; }
.collection-set-completion{
  display:flex; align-items:center; gap:0.6rem; margin-bottom:0.7rem;
  font-size:0.75rem; opacity:0.7;
}
.collection-set-completion-bar{
  flex:1; max-width:180px; height:6px; border-radius:4px;
  background:var(--line); overflow:hidden;
}
.collection-set-completion-fill{ height:100%; background:var(--gold); border-radius:4px; }
.qty-badge{
  font-size:0.72rem; font-weight:700; padding:0.1rem 0.45rem; border-radius:20px;
  background:var(--gold); color:var(--ink-dark);
}

/* ---------- marketplace ---------- */

.session-bar{
  display:flex; justify-content:space-between; align-items:center;
  gap:1rem; flex-wrap:wrap;
  background:var(--paper); border:1.5px solid var(--line); border-radius:10px;
  padding:0.8rem 1.1rem; margin-bottom:1.75rem;
}
.session-bar .who{ display:inline-flex; align-items:center; gap:0.6rem; font-size:0.88rem; font-weight:600; }
.session-bar .who span{ opacity:0.6; font-weight:500; }
.session-bar .actions{ display:flex; gap:1rem; align-items:center; }
.session-bar a{ font-size:0.85rem; font-weight:600; opacity:0.75; text-decoration:none; }
.session-bar a:hover{ opacity:1; }
.link-btn{ font-size:0.85rem; font-weight:600; opacity:0.75; cursor:pointer; }
.link-btn:hover{ opacity:1; }
.link-btn.danger{ color:var(--crimson); }

.post-list{ display:flex; flex-direction:column; gap:0.9rem; margin-bottom:1rem; }
.load-more-row{ display:flex; justify-content:center; margin-top:0.2rem; margin-bottom:1rem; }
.load-more-row button{ width:auto; padding:0.65rem 1.6rem; }
.post-item{
  background:var(--paper); border:1.5px solid var(--line); border-radius:12px;
  padding:1.1rem 1.3rem;
}
.post-item .top-row{ display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; }
.post-item .looking-for-label{ font-size:0.72rem; font-weight:700; text-transform:uppercase; letter-spacing:0.04em; opacity:0.5; margin-bottom:0.35rem; }
.post-item .card-name{ font-weight:700; font-size:1.05rem; }
.post-item .looking-for-cards{ display:flex; flex-wrap:wrap; gap:0.9rem; }
.post-item .looking-for-card{ display:flex; align-items:flex-start; gap:0.7rem; }
.post-item .open-offers-note{ font-size:0.9rem; opacity:0.75; max-width:420px; }
.post-item .meta-row{ display:flex; flex-wrap:wrap; align-items:center; gap:0.35rem 1rem; font-size:0.78rem; opacity:0.6; margin-top:0.6rem; }
.post-item .meta-row .poster-meta{ display:inline-flex; align-items:center; gap:0.4rem; }
.post-item .notes{ font-size:0.85rem; opacity:0.75; margin-top:0.5rem; }
.post-item .actions{ display:flex; gap:0.5rem; flex-shrink:0; }
.post-item .actions button, .post-item .actions a{ width:auto; padding:0.55rem 1rem; font-size:0.85rem; }

.trade-block{ margin-top:0.9rem; }
.trade-label{ font-size:0.72rem; font-weight:700; text-transform:uppercase; letter-spacing:0.04em; opacity:0.5; margin-bottom:0.35rem; }
.trade-cards-row{ display:flex; flex-wrap:wrap; gap:0.5rem; }

.card-thumb{
  width:56px; height:78px; object-fit:cover; border-radius:6px;
  border:1.5px solid var(--line); background:var(--parchment); flex-shrink:0;
}
.card-thumb-sm{ width:38px; height:53px; border-radius:4px; }
.card-thumb-lg{ width:100px; height:140px; border-radius:8px; }
.card-thumb-xl{ width:100%; height:auto; aspect-ratio:5/7; object-fit:contain; border-radius:10px; padding:1rem; }

.item-detail{ display:flex; gap:2rem; flex-wrap:wrap; margin-bottom:1.5rem; }
.item-detail-image{ flex:0 0 260px; max-width:100%; }
.item-detail-info{ flex:1; min-width:240px; }
.item-detail-info .name{ font-size:1.3rem; font-weight:700; margin-bottom:0.5rem; }
.item-detail-info .price{ font-family:'Bebas Neue', sans-serif; font-size:2.2rem; color:var(--gold); margin:0.75rem 0 0.25rem; }
.item-detail-info .stock{ font-size:0.82rem; opacity:0.65; margin-bottom:1.1rem; }

@media (max-width:520px){
  .item-detail{ gap:1.25rem; }
  .item-detail-image{ flex:0 0 100%; max-width:220px; margin:0 auto; }
}

.listing-table{ border-top:1.5px solid var(--line); margin-top:0.5rem; }
.listing-row-wrap{ padding:0.9rem 0; border-bottom:1px solid var(--line); }
.listing-row{
  display:flex; align-items:center; justify-content:space-between; gap:1rem;
  flex-wrap:wrap;
}
.listing-row-logo{ width:28px; height:28px; object-fit:contain; flex-shrink:0; }
.listing-row-badges{ flex:1; min-width:180px; }
.listing-row-qty{ font-size:0.8rem; opacity:0.6; white-space:nowrap; }
.listing-row-price{ font-family:'Bebas Neue', sans-serif; font-size:1.35rem; color:var(--gold); white-space:nowrap; text-align:right; }
.listing-row-sku{ font-family:'Inter', sans-serif; font-size:0.68rem; letter-spacing:0.02em; opacity:0.55; font-weight:600; }
.listing-row button{ width:auto; flex-shrink:0; }
.listing-row-note{ font-size:0.82rem; opacity:0.7; font-style:italic; margin-top:0.5rem; }

/* events.html's agenda list + admin/index.html's events manager */
.event-filter-bar{ margin-bottom:1.5rem; }
.event-filters{ display:flex; flex-wrap:wrap; align-items:center; gap:0.5rem; margin-bottom:0.6rem; }
.event-filters:last-child{ margin-bottom:0; }
.event-filter-label{
  font-family:'Inter', sans-serif; font-size:0.72rem; font-weight:700; text-transform:uppercase;
  letter-spacing:0.04em; opacity:0.5; margin-right:0.15rem;
}
.event-filters select{ width:auto; }
.event-filter-chip{
  width:auto; padding:0.4rem 0.9rem; border:1.5px solid var(--line); border-radius:999px;
  background:var(--paper); font-family:'Inter', sans-serif; font-size:0.8rem; font-weight:600;
  color:var(--ink); cursor:pointer; opacity:0.7;
}
.event-filter-chip:hover{ border-color:var(--gold); opacity:1; }
.event-filter-chip.active{ background:var(--ink); border-color:var(--ink); color:var(--paper); opacity:1; }

/* admin/index.html's "Event locations" (event_cities) manager */
.city-manager{
  border:1px solid var(--line); border-radius:10px; padding:1rem; margin-bottom:1.5rem; background:var(--parchment);
}
.city-manager-row{
  display:flex; align-items:center; gap:0.75rem; padding:0.5rem 0; border-bottom:1px solid var(--line);
}
.city-manager-row:last-of-type{ border-bottom:none; }
.city-manager-row .label{ flex:1; font-weight:600; }
.city-manager-row .tz{ font-size:0.8rem; opacity:0.6; font-family:monospace; }
.city-manager-row button{ width:auto; flex-shrink:0; }
.city-manager-add{ display:flex; flex-wrap:wrap; gap:0.5rem; margin-top:1rem; }
.city-manager-add input{ flex:1; min-width:180px; }
.city-manager-add button{ flex-shrink:0; }

/* cart.html's payment-method choice (store credit vs. Paysera) */
.payment-method-options{ display:flex; flex-direction:column; gap:0.6rem; }
.payment-method-option{
  display:flex; align-items:flex-start; gap:0.6rem; padding:0.8rem 1rem; border:1.5px solid var(--line);
  border-radius:8px; cursor:pointer; font-size:0.88rem;
}
.payment-method-option input{ margin-top:0.2rem; width:auto; }
.payment-method-option.selected{ border-color:var(--gold); background:var(--parchment); }
.payment-method-option.disabled{ opacity:0.6; cursor:not-allowed; }

.event-group-heading{
  font-family:'Bebas Neue', sans-serif; font-size:1.1rem; letter-spacing:0.02em;
  margin:1.75rem 0 0.6rem; color:var(--gold);
}
.event-group-heading:first-child{ margin-top:0; }

.event-row{
  display:flex; flex-wrap:wrap; align-items:flex-start; gap:1rem;
  padding:1rem 0; border-bottom:1px solid var(--line);
}
.event-rsvp{
  flex:0 0 100%; display:flex; align-items:center; gap:0.75rem; flex-wrap:wrap;
  margin-top:0.6rem; padding-top:0.6rem; border-top:1px dashed var(--line);
}
.event-rsvp-count{ font-size:0.8rem; opacity:0.7; }
.event-rsvp-count.going{ color:var(--gold); font-weight:700; opacity:1; }
.event-rsvp-count.full{ color:var(--crimson); font-weight:700; opacity:1; }
.event-rsvp-btn{ width:auto; padding:0.35rem 0.9rem; font-size:0.8rem; text-decoration:none; }

.event-host{ display:flex; align-items:center; gap:0.4rem; margin-top:0.35rem; }
.event-host img{ width:18px; height:18px; object-fit:contain; border-radius:4px; flex-shrink:0; }
.event-host span{ font-size:0.78rem; opacity:0.65; }

.event-teaser-host{ display:flex; align-items:center; gap:0.35rem; margin-top:0.3rem; }
.event-teaser-host img{ width:16px; height:16px; object-fit:contain; border-radius:3px; flex-shrink:0; }
.event-teaser-host span{ font-size:0.72rem; opacity:0.6; }

.org-logo-preview{
  width:64px; height:64px; border-radius:8px; border:1.5px solid var(--line);
  background:var(--parchment); display:flex; align-items:center; justify-content:center;
  overflow:hidden; flex-shrink:0;
}
.org-logo-preview img{ width:100%; height:100%; object-fit:contain; }
.org-logo-preview span{ font-size:0.65rem; opacity:0.5; text-align:center; padding:0.3rem; }
.event-date-badge{
  flex-shrink:0; width:56px; text-align:center; background:var(--parchment);
  border:1.5px solid var(--line); border-radius:8px; padding:0.4rem 0.2rem;
}
.event-date-badge .month{ font-size:0.65rem; font-weight:700; letter-spacing:0.05em; text-transform:uppercase; opacity:0.6; }
.event-date-badge .day{ font-family:'Bebas Neue', sans-serif; font-size:1.5rem; line-height:1.1; color:var(--gold); }

.event-info{ flex:1; min-width:0; }
.event-info .title{ font-weight:700; font-size:1rem; margin-bottom:0.2rem; }
.event-info .meta{ font-size:0.82rem; opacity:0.65; margin-bottom:0.3rem; }
.event-info .desc{ font-size:0.85rem; opacity:0.8; margin-top:0.3rem; }

.event-tag{
  display:inline-block; flex-shrink:0; font-size:0.72rem; font-weight:700;
  padding:0.2rem 0.6rem; border-radius:999px; background:var(--gold);
  color:#fff; white-space:nowrap; align-self:flex-start;
}

.event-admin-item{
  display:flex; align-items:center; justify-content:space-between; gap:1rem;
  flex-wrap:wrap; padding:0.9rem 0; border-bottom:1px solid var(--line);
}
.event-admin-item .info{ flex:1; min-width:200px; }
.event-admin-item .name{ font-weight:700; font-size:0.95rem; }
.event-admin-item .meta{ font-size:0.8rem; opacity:0.65; margin-top:0.15rem; }
.event-admin-item .actions{ display:flex; gap:0.5rem; flex-shrink:0; }
.event-admin-item.draft-listing{ opacity:0.6; }

/* events.html's month-grid view (a toggle alongside the agenda list above) */
.event-view-toggle{ display:flex; gap:0.4rem; margin-bottom:1.25rem; }
.event-view-toggle button{
  width:auto; padding:0.4rem 0.9rem; border:1.5px solid var(--line); border-radius:8px;
  background:var(--paper); font-family:'Inter', sans-serif; font-size:0.8rem; font-weight:600;
  color:var(--ink); cursor:pointer; opacity:0.7;
}
.event-view-toggle button:hover{ border-color:var(--gold); opacity:1; }
.event-view-toggle button.active{ background:var(--ink); border-color:var(--ink); color:var(--paper); opacity:1; }

.event-month-header{
  display:flex; align-items:center; justify-content:space-between; gap:0.75rem;
  margin-bottom:1rem; flex-wrap:wrap;
}
.event-month-header h2{ font-family:'Bebas Neue', sans-serif; font-size:1.4rem; letter-spacing:0.02em; }
.event-month-nav{ display:flex; gap:0.4rem; align-items:center; }
.event-month-nav button{
  width:auto; padding:0.35rem 0.75rem; border:1.5px solid var(--line); border-radius:8px;
  background:var(--paper); font-weight:600; cursor:pointer; font-size:0.85rem;
}
.event-month-nav button:hover{ border-color:var(--gold); }

.event-month-grid{
  display:grid; grid-template-columns:repeat(7, 1fr); gap:1px;
  background:var(--line); border:1px solid var(--line); border-radius:8px; overflow:hidden;
}
.event-month-weekday{
  background:var(--parchment); text-align:center; font-size:0.7rem; font-weight:700;
  text-transform:uppercase; letter-spacing:0.04em; opacity:0.6; padding:0.4rem 0.2rem;
}
.event-month-day{
  background:var(--paper); min-height:5.5rem; padding:0.3rem; cursor:pointer;
  display:flex; flex-direction:column; gap:0.15rem;
}
.event-month-day:hover{ background:var(--parchment); }
.event-month-day.other-month{ opacity:0.4; }
.event-month-day .daynum{ font-size:0.78rem; font-weight:700; }
.event-month-day.today .daynum{
  display:inline-flex; align-items:center; justify-content:center;
  width:1.4rem; height:1.4rem; border-radius:50%; background:var(--gold); color:#fff;
}
.event-month-day.selected{ outline:2px solid var(--gold); outline-offset:-2px; }
.event-month-day .chip{
  font-size:0.68rem; font-weight:600; padding:0.1rem 0.35rem; border-radius:4px;
  background:var(--parchment); border:1px solid var(--line); white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis;
}
.event-month-day .more{ font-size:0.65rem; opacity:0.6; font-weight:600; }
.event-month-day .dot{ display:none; }

@media (max-width:520px){
  .event-month-day{ min-height:3.6rem; }
  .event-month-day .chip{ display:none; }
  .event-month-day .dot{
    width:5px; height:5px; border-radius:50%; background:var(--gold); display:inline-block;
  }
}

.event-day-panel{
  margin-top:1.5rem; padding-top:0.5rem; border-top:2px solid var(--line);
}
.event-day-panel .section-title{ margin-top:0; }

/* LP Express parcel-machine live search (cart.html) */
#lpTerminalResults:not(:empty){
  position:absolute; top:100%; left:0; right:0; z-index:20;
  background:var(--paper); border:1.5px solid var(--line); border-radius:8px;
  margin-top:0.3rem; max-height:260px; overflow-y:auto;
  box-shadow:0 8px 20px rgba(0,0,0,0.12);
}
.lp-terminal-result{ padding:0.6rem 0.8rem; cursor:pointer; border-bottom:1px solid var(--line); }
.lp-terminal-result:last-child{ border-bottom:none; }
.lp-terminal-result:hover{ background:var(--parchment); }

.featured-card{
  display:flex; gap:1rem; align-items:flex-start;
  padding:1rem 1.2rem; border:1.5px solid var(--line); border-radius:12px;
  border-left:4px solid var(--profile-accent, var(--gold));
  background:var(--paper); margin-bottom:1.75rem;
}
.featured-card-info{ flex:1; min-width:0; }
.featured-card-eyebrow{ font-size:0.72rem; text-transform:uppercase; letter-spacing:0.06em; opacity:0.55; margin-bottom:0.35rem; }
.featured-card-name{ font-weight:700; font-size:1.05rem; margin-bottom:0.3rem; }

.attr-badges{ display:flex; flex-wrap:wrap; gap:0.3rem; margin-top:0.35rem; }
.attr-badge{
  font-size:0.66rem; font-weight:700; text-transform:uppercase; letter-spacing:0.03em;
  padding:0.15rem 0.45rem; border-radius:20px;
  background:var(--parchment); border:1px solid var(--line); opacity:0.75;
}
.attr-badge-graded{
  background:var(--gold); border-color:var(--gold); color:var(--ink-dark); opacity:1;
}
/* Condition gradient, best to worst: MT a deeper/richer green than NM
   (better than "good" rather than a whole new hue), then NM/EX/GD/LP/PL
   sweep green -> amber -> orange, ending at PO in the same red as the
   site's existing --crimson/--bad tokens. Solid backgrounds with light
   text (like attr-badge-graded above) rather than a tint on the neutral
   badge, so the condition reads at a glance instead of needing the label
   text to be reread every time. */
.attr-badge-cond-mt{ background:#155724; border-color:#155724; color:#fff; opacity:1; }
.attr-badge-cond-nm{ background:var(--good); border-color:var(--good); color:#fff; opacity:1; }
.attr-badge-cond-ex{ background:#6b8e23; border-color:#6b8e23; color:#fff; opacity:1; }
.attr-badge-cond-gd{ background:#b8860b; border-color:#b8860b; color:#fff; opacity:1; }
.attr-badge-cond-lp{ background:#d2691e; border-color:#d2691e; color:#fff; opacity:1; }
.attr-badge-cond-pl{ background:#c2410c; border-color:#c2410c; color:#fff; opacity:1; }
.attr-badge-cond-po{ background:var(--crimson); border-color:var(--crimson); color:#fff; opacity:1; }

.trade-card-display{
  display:flex; align-items:center; gap:0.6rem;
  padding:0.4rem 0.7rem 0.4rem 0.4rem; border:1.5px solid var(--line); border-radius:10px;
  background:var(--parchment);
}
.trade-card-name{ font-weight:600; font-size:0.85rem; }

.cash-offer-chip{
  display:flex; align-items:center;
  padding:0.5rem 0.9rem; border:1.5px dashed var(--gold); border-radius:10px;
  background:var(--parchment); font-weight:600; font-size:0.85rem; color:var(--gold);
}

/* ---------- card picker (marketplace post form) ---------- */

.card-picker{ position:relative; }
.card-picker input{ margin-bottom:0; }
.card-picker-dropdown{
  display:none;
  position:absolute; top:calc(100% + 4px); left:0; right:0; z-index:20;
  background:var(--paper); border:1.5px solid var(--line); border-radius:10px;
  max-height:280px; overflow-y:auto;
  box-shadow:0 10px 24px rgba(26,18,16,0.12);
}
.card-picker-result{
  display:flex; align-items:center; gap:0.6rem;
  padding:0.45rem 0.7rem; cursor:pointer; font-size:0.85rem;
}
.card-picker-result:hover{ background:var(--parchment); }
.card-picker-result img{
  width:30px; height:42px; object-fit:cover; border-radius:4px; flex-shrink:0;
  background:var(--parchment); border:1px solid var(--line);
}
.card-picker-empty{ padding:0.6rem 0.7rem; font-size:0.85rem; opacity:0.6; }

.picked-card{
  display:flex; align-items:center; gap:0.8rem;
  padding:0.6rem 0.8rem; border:1.5px solid var(--line); border-radius:10px; background:var(--parchment);
}
.picked-card img{ width:44px; height:62px; object-fit:cover; border-radius:5px; border:1px solid var(--line); background:var(--paper); flex-shrink:0; }
.picked-card span{ flex:1; font-weight:600; font-size:0.9rem; }
.picked-card button{ width:auto; padding:0.4rem 0.8rem; font-size:0.8rem; flex-shrink:0; }

.card-attrs{ display:grid; grid-template-columns:1fr 1fr; gap:0 1rem; margin-top:0.8rem; }
.card-attrs .field{ margin-bottom:0; }
.checkbox-row{ display:flex; gap:1.3rem; margin-top:0.7rem; }
.checkbox-row label{
  display:inline-flex; align-items:center; gap:0.45rem;
  font-size:0.85rem; font-weight:500; text-transform:none; letter-spacing:normal;
  color:var(--charcoal); opacity:1; margin-bottom:0; cursor:pointer;
}
.checkbox-row input[type="checkbox"]{ width:auto; accent-color:var(--gold); cursor:pointer; }
.checkbox-row input[type="radio"]{ width:auto; accent-color:var(--gold); cursor:pointer; }

.graded-fields{ margin-top:0.8rem; padding-top:0.8rem; border-top:1.5px dashed var(--line); }
.graded-fields .field.full{ grid-column:1 / -1; margin-top:0.8rem; }

.swatch-grid{ display:flex; flex-wrap:wrap; gap:0.5rem; }
.swatch-btn{
  width:36px; height:36px; border-radius:8px; padding:0;
  border:2px solid var(--line); cursor:pointer; flex-shrink:0;
}
.swatch-btn-selected{ border-color:var(--ink); box-shadow:0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.swatch-btn-none{
  width:auto; padding:0 0.7rem; font-size:0.75rem; font-weight:600;
  background:var(--parchment); color:var(--charcoal);
}

.pending-card{
  margin-top:0.8rem; padding:0.9rem;
  border:1.5px dashed var(--gold); border-radius:10px; background:var(--parchment);
}

.trade-chip-row{ display:flex; flex-wrap:wrap; gap:0.5rem; margin-top:0.6rem; }
.trade-chip{
  display:flex; align-items:center; gap:0.4rem;
  padding:0.3rem 0.5rem 0.3rem 0.3rem; border:1.5px solid var(--line); border-radius:20px;
  background:var(--parchment); font-size:0.8rem;
}
.trade-chip img{ width:26px; height:36px; object-fit:cover; border-radius:3px; }
.trade-chip b{ margin-left:0.3rem; font-weight:700; opacity:0.55; font-size:0.72rem; }
.chip-remove{
  background:transparent; border:none; padding:0; width:16px; height:16px;
  display:flex; align-items:center; justify-content:center;
  font-size:1.1rem; line-height:1; cursor:pointer; opacity:0.5; color:var(--ink);
}
.chip-remove:hover{ opacity:1; }

.compose-box{ margin-top:0.9rem; padding-top:0.9rem; border-top:1.5px dashed var(--line); }
.compose-box textarea{
  width:100%; font-family:'Inter', sans-serif; font-size:0.9rem;
  padding:0.7rem 0.9rem; border-radius:8px; border:1.5px solid var(--line);
  background:var(--paper); color:var(--charcoal); outline:none; resize:vertical; min-height:70px;
}
.compose-box textarea:focus{ border-color:var(--gold); }
.compose-box .row{ display:flex; justify-content:flex-end; gap:0.6rem; margin-top:0.6rem; }
.compose-box button{ width:auto; padding:0.6rem 1.2rem; font-size:0.85rem; }

/* ---------- fulfill / trade proposal panel ---------- */

.fulfill-panel{
  padding:1.1rem 1.2rem; border:1.5px solid var(--gold); border-radius:10px;
  background:var(--parchment); margin-bottom:1.5rem;
}
.fulfill-panel .hint{ font-size:0.83rem; opacity:0.65; margin-bottom:0.8rem; }
.conv-pick-list{ display:flex; flex-direction:column; gap:0.5rem; margin-bottom:1rem; }
.conv-pick-option{
  display:flex; align-items:center; gap:0.7rem;
  padding:0.6rem 0.8rem; border:1.5px solid var(--line); border-radius:8px;
  background:var(--paper); cursor:pointer;
}
.conv-pick-option:has(input:checked){ border-color:var(--gold); background:var(--paper); box-shadow:0 0 0 1px var(--gold); }
.conv-pick-option input[type="radio"]{ width:auto; accent-color:var(--gold); cursor:pointer; flex-shrink:0; }
.conv-pick-option .who{ font-weight:600; font-size:0.88rem; flex:1; min-width:0; }
.conv-pick-option .preview{
  font-size:0.78rem; opacity:0.6; max-width:220px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.conv-pick-option .status-tag{ font-size:0.72rem; font-weight:700; text-transform:uppercase; letter-spacing:0.03em; flex-shrink:0; }
.conv-pick-option .status-tag.pending{ color:var(--gold); }
.conv-pick-option .status-tag.confirmed{ color:#3a7a3a; }
.conv-pick-option .status-tag.declined{ color:#a33; }
.conv-pick-option:has(input:disabled){ opacity:0.6; cursor:not-allowed; }
.fulfill-panel .row{ display:flex; justify-content:flex-end; gap:0.6rem; margin-top:1rem; }
.fulfill-panel .row button{ width:auto; padding:0.65rem 1.3rem; font-size:0.88rem; }

/* ---------- messages / conversations ---------- */

.conversation-list{ display:flex; flex-direction:column; gap:0.6rem; }
.conversation-item{
  display:flex; justify-content:space-between; align-items:center; gap:1rem;
  padding:0.9rem 1.1rem; border:1.5px solid var(--line); border-radius:10px;
  background:var(--paper); cursor:pointer;
}
.conversation-item:hover{ border-color:var(--gold); }
.conversation-item.unread{ border-color:var(--gold); background:var(--parchment); }
.conversation-item .left{ display:flex; align-items:center; gap:0.8rem; min-width:0; }
.conversation-item .texts{ min-width:0; }
.conversation-item .who{ font-weight:600; display:flex; align-items:center; gap:0.5rem; flex-wrap:wrap; }
.conversation-item.unread .who{ font-weight:800; }
.conversation-item .post-ref{ font-size:0.78rem; opacity:0.55; margin-top:0.1rem; }
.conversation-item .preview{
  font-size:0.85rem; opacity:0.7; margin-top:0.3rem; max-width:420px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.conversation-item .when{ font-size:0.75rem; opacity:0.5; white-space:nowrap; flex-shrink:0; display:flex; align-items:center; gap:0.5rem; }

/* Confirmed-trade-count + member-since popup shown on hovering an avatar,
   instead of sitting inline next to every name (too much space, too much
   info by default). */
.avatar-tooltip{ position:relative; display:inline-flex; cursor:default; }
a.avatar-tooltip{ cursor:pointer; text-decoration:none; }
.avatar-tooltip-content{
  position:absolute; bottom:calc(100% + 8px); left:50%; transform:translateX(-50%);
  background:var(--ink-dark); color:var(--paper); font-size:0.75rem; font-weight:600;
  padding:0.4rem 0.7rem; border-radius:8px; white-space:nowrap;
  opacity:0; visibility:hidden; pointer-events:none;
  transition:opacity 0.12s ease; box-shadow:0 4px 14px rgba(0,0,0,0.18); z-index:30;
}
.avatar-tooltip-content::after{
  content:''; position:absolute; top:100%; left:50%; transform:translateX(-50%);
  border:5px solid transparent; border-top-color:var(--ink-dark);
}
.avatar-tooltip:hover .avatar-tooltip-content,
.avatar-tooltip:active .avatar-tooltip-content{ opacity:1; visibility:visible; }

/* Admin-set "Verified"/"Business" badge (see admin/index.html), overlaid on
   the bottom-right corner of an avatar. Business outranks verified — the
   two never render together, since account_status is a single column. */
.account-badge{
  position:absolute; right:-2px; bottom:-2px;
  width:15px; height:15px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  color:var(--paper); border:2px solid var(--paper);
  box-shadow:0 1px 3px rgba(0,0,0,0.25);
}
.account-badge svg{ width:9px; height:9px; }
.account-badge-verified{ background:#1d78e8; }
.account-badge-business{ background:var(--gold); }

/* Unread-message count pill — on the "Messages" nav link and per conversation. */
.unread-badge{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:1.3rem; height:1.3rem; padding:0 0.35rem;
  border-radius:999px; background:var(--gold); color:var(--ink-dark);
  font-size:0.7rem; font-weight:800; line-height:1;
}
.session-bar a .unread-badge{ margin-left:0.35rem; vertical-align:middle; }

.thread-header{ display:flex; align-items:center; justify-content:space-between; margin-bottom:1rem; gap:1rem; }
.thread-header .who-row{ display:flex; align-items:center; gap:0.8rem; }
.thread-header .titles .name{ font-weight:700; display:flex; align-items:center; gap:0.5rem; flex-wrap:wrap; }
.thread-header .titles .sub{ font-size:0.8rem; opacity:0.6; }
.thread-header-actions{ display:flex; gap:1rem; flex-shrink:0; }

.thread{
  display:flex; flex-direction:column; gap:0.6rem;
  max-height:420px; overflow-y:auto;
  padding:1rem; background:var(--parchment); border:1.5px solid var(--line); border-radius:10px;
  margin-bottom:1rem;
}
.msg-bubble{
  max-width:75%; padding:0.6rem 0.85rem; border-radius:12px; font-size:0.88rem;
  background:var(--paper); border:1.5px solid var(--line); align-self:flex-start;
}
.msg-bubble.mine{ background:var(--ink); color:var(--paper); border-color:var(--ink); align-self:flex-end; }
.msg-bubble .when{ display:block; font-size:0.68rem; opacity:0.55; margin-top:0.25rem; }

.thread-compose{ display:flex; gap:0.6rem; align-items:flex-end; }
.thread-compose textarea{
  flex:1; font-family:'Inter', sans-serif; font-size:0.9rem;
  padding:0.7rem 0.9rem; border-radius:8px; border:1.5px solid var(--line);
  background:var(--paper); color:var(--charcoal); outline:none; resize:none; min-height:48px;
}
.thread-compose textarea:focus{ border-color:var(--gold); }
.thread-compose button{ width:auto; padding:0.75rem 1.3rem; white-space:nowrap; }

/* ---------- trade proposal banner (messages.html thread) ---------- */

.trade-banner{
  margin-bottom:1rem; padding:1rem 1.1rem;
  border:1.5px solid var(--gold); border-radius:10px; background:var(--parchment);
}
.trade-banner-title{
  font-size:0.72rem; font-weight:700; text-transform:uppercase; letter-spacing:0.04em;
  opacity:0.55; margin-bottom:0.7rem;
}
.trade-banner-grid{ display:grid; grid-template-columns:1fr 1fr; gap:0.9rem; }
.trade-banner-label{
  font-size:0.72rem; font-weight:700; text-transform:uppercase; letter-spacing:0.04em;
  opacity:0.5; margin-bottom:0.35rem;
}
.trade-banner .trade-cards-row{ display:flex; flex-wrap:wrap; gap:0.5rem; }
.empty-inline{ font-size:0.85rem; opacity:0.5; font-style:italic; }
.trade-banner-status{ font-size:0.85rem; margin-top:0.9rem; padding-top:0.8rem; border-top:1.5px dashed var(--line); }
.trade-banner-status.pending{ color:var(--gold); font-weight:600; }
.trade-banner-status.confirmed{ color:#3a7a3a; font-weight:600; }
.trade-banner-status.declined{ color:#a33; font-weight:600; }
.trade-banner .row{ display:flex; justify-content:flex-end; gap:0.6rem; margin-top:0.8rem; }
.trade-banner .row button{ width:auto; padding:0.6rem 1.2rem; font-size:0.85rem; }

/* Sale-invoice tool (admin/index.html) — category-row editor grid, and the
   printable invoice layout used both on screen and via window.print(). */
.invoice-items{ display:flex; flex-direction:column; gap:0.4rem; }
.invoice-item-row{
  display:grid;
  grid-template-columns:1.6fr 0.9fr 0.6fr 1.1fr 0.7fr 0.9fr 0.8fr auto;
  gap:0.4rem; align-items:center;
}
.invoice-item-row input, .invoice-item-row select{ padding:0.5rem 0.6rem; font-size:0.85rem; margin-bottom:0; }
.invoice-item-row input:disabled{ opacity:0.4; }
.invoice-item-header{ font-size:0.7rem; text-transform:uppercase; letter-spacing:0.04em; opacity:0.55; }
.inv-line-total{ font-weight:700; font-size:0.85rem; text-align:right; }
.invoice-item-row .inv-remove-row{ padding:0.3rem 0.55rem; font-size:0.9rem; }

.invoice-print{ font-size:0.92rem; }
.invoice-print-head{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:1.5rem; }
.invoice-print-logo{ display:block; height:32px; width:auto; margin-bottom:0.5rem; }
.invoice-print-title{ font-family:'Bebas Neue', sans-serif; font-size:1.6rem; letter-spacing:0.02em; }
.invoice-print-parties{ display:grid; grid-template-columns:1fr 1fr; gap:1.5rem; margin-bottom:1.5rem; }
.invoice-print-label{ font-size:0.72rem; text-transform:uppercase; letter-spacing:0.05em; opacity:0.55; margin-bottom:0.3rem; }
.invoice-print-table{ width:100%; border-collapse:collapse; font-size:0.85rem; }
.invoice-print-table th, .invoice-print-table td{ padding:0.5rem 0.6rem; border-bottom:1px solid var(--line); text-align:left; }
.invoice-print-table th{ font-size:0.72rem; text-transform:uppercase; letter-spacing:0.04em; opacity:0.6; }
.invoice-print-table tfoot td{ border-top:1.5px solid var(--line); border-bottom:none; opacity:0.75; }
.invoice-print-totals{ max-width:280px; margin-left:auto; margin-top:1rem; }
.invoice-print-totals div{ display:flex; justify-content:space-between; padding:0.3rem 0; font-size:0.9rem; }
.invoice-print-grand{ border-top:1.5px solid var(--line); margin-top:0.3rem; padding-top:0.5rem !important; font-weight:700; font-size:1.05rem !important; }

/* Date-range batch download — same invoicePrintBlockHtml() per invoice,
   stacked with a visible divider on screen and a real page break in print. */
.invoice-print-page{ margin-bottom:2.5rem; padding-bottom:2.5rem; border-bottom:2px dashed var(--line); }
.invoice-print-page:last-child{ margin-bottom:0; padding-bottom:0; border-bottom:none; }

@media print{
  body{ background:#fff; }
  .no-print{ display:none !important; }
  .card{ border:none; box-shadow:none; max-width:none; padding:0; }
  .wrap{ max-width:none; padding:0; }
  .invoice-print-page{ border-bottom:none; padding-bottom:0; margin-bottom:0; }
  .invoice-print-page-break{ page-break-after:always; }
}

@media (max-width:640px){
  .market-grid{ grid-template-columns:repeat(2, 1fr); gap:0.9rem; }
  .invoice-item-row{ grid-template-columns:1fr 1fr; }
  .invoice-item-header{ display:none; }
  .inv-line-total{ text-align:left; }
  .invoice-print-parties{ grid-template-columns:1fr; }
  header{ flex-direction:column; gap:1rem; align-items:flex-start; }
  .detail-grid{ grid-template-columns:1fr; }
  .adjust-form{ flex-direction:column; align-items:stretch; }
  .adjust-form .amt-field{ width:100%; }
  .wanted-form-grid{ grid-template-columns:1fr; }
  .stat-card{ flex-direction:column; align-items:flex-start; gap:0.3rem; }
  .field-row{ flex-direction:column; gap:0; }
  .field-row .field[style*="flex:0 0"]{ flex-basis:auto !important; }
  .card-attrs{ grid-template-columns:1fr; }
  .card-attrs .field{ margin-bottom:0.8rem; }
  .card-attrs .field:last-child{ margin-bottom:0; }
  .checkbox-row{ gap:1rem; flex-wrap:wrap; }
  .collection-item{ flex-wrap:wrap; }
  .collection-item-actions{ width:100%; }
  .collection-item-actions button{ flex:1; }

  .image-upload{ flex-direction:column; align-items:stretch; }
  .image-upload .preview{ width:100%; height:140px; }
  .image-upload input[type="file"]{ width:100%; }

  .wanted-admin-item{ flex-wrap:wrap; }
  .wanted-admin-item .info{ order:1; width:calc(100% - 72px); }
  .wanted-admin-item .actions{ order:2; width:100%; margin-top:0.8rem; }
  .wanted-admin-item .actions button{ flex:1; }

  .session-bar{ flex-direction:column; align-items:flex-start; }
  .post-item .top-row{ flex-direction:column; }
  .post-item .actions{ width:100%; }
  .post-item .actions button, .post-item .actions a{ flex:1; }
  .conversation-item{ flex-direction:column; align-items:flex-start; gap:0.3rem; }
  .conversation-item .preview{ max-width:100%; }
  .msg-bubble{ max-width:88%; }
  .thread-compose{ flex-direction:column; align-items:stretch; }
  .thread-compose button{ width:100%; }
  .conv-pick-option{ flex-wrap:wrap; }
  .conv-pick-option .preview{ max-width:100%; }
  .fulfill-panel .row{ flex-direction:column-reverse; }
  .fulfill-panel .row button{ width:100%; }
  .trade-banner-grid{ grid-template-columns:1fr; gap:0.9rem 0; }
  .trade-banner .row{ flex-direction:column-reverse; }
  .trade-banner .row button{ width:100%; }
  .trade-history-header{ flex-wrap:wrap; }
}
