/* SATSMARKT — light editorial: near-black ink, hairline rules, serif display,
   one restrained orange accent. Self-contained, no framework.
   NOTE: custom-property NAMES are API — applyShopConfig() overrides --orange /
   --orange-bright / --orange-soft at runtime for white-label shops. */
:root {
  --orange: #b35c0e;          /* accent: links, prices, kickers (AA on white) */
  --orange-bright: #F7931A;   /* reserved: small marks, never text on white */
  --orange-soft: #f6ede1;     /* subtle warm tint for hovers/fills */
  --cream: #faf9f7;           /* page background */
  --card: #ffffff;
  --ink: #201d18;
  --muted: #6f6a62;
  --line: #e3ded5;
  --danger: #b3382c;
  --ok: #1e7a4f;
  --radius: 4px;
  --radius-lg: 6px;
  --shadow: 0 1px 2px rgba(32, 29, 24, 0.05);
  --shadow-hover: 0 2px 10px rgba(32, 29, 24, 0.09);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}
* { box-sizing: border-box; }
/* The `hidden` attribute must always win, even over class display rules
   (.modal-backdrop{display:grid}, .user-chip{display:flex}, etc.). Without
   this, author styles override the UA `[hidden]{display:none}` and elements
   like the login modal stay visible despite being marked hidden. */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, .view-head { font-family: var(--serif); font-weight: 600; letter-spacing: 0.01em; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.85em; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.center { text-align: center; }
hr.soft { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---- header ---- */
#topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px;
  background: rgba(250, 249, 247, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 3px;
  background: var(--ink);
  color: var(--orange-bright);
  font-family: var(--serif); font-weight: 700; font-size: 1.05rem; line-height: 1;
}
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.12rem; letter-spacing: 0.14em; color: var(--ink); }
#mainnav { display: flex; gap: 2px; margin-left: 10px; flex: 1; align-items: center; }
#mainnav a {
  position: relative; color: var(--muted); padding: 8px 11px; border-radius: var(--radius);
  font-weight: 500; font-size: 0.93rem; letter-spacing: 0.01em;
  transition: color 0.15s;
}
#mainnav a:hover { color: var(--ink); text-decoration: none; }
#mainnav a.active {
  color: var(--ink);
  text-decoration: underline; text-underline-offset: 7px;
  text-decoration-thickness: 2px; text-decoration-color: var(--orange);
}
#mainnav a.nav-sell { margin-left: auto; color: var(--orange); font-weight: 600; border: 1px solid var(--line); }
#mainnav a.nav-sell:hover { border-color: var(--orange); color: var(--orange); text-decoration: none; }
/* hamburger toggle — hidden on desktop, shown on mobile */
#navToggle { display: none; place-items: center; width: 40px; height: 40px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 1.2rem; color: var(--ink); line-height: 1; }
#navToggle:hover { border-color: var(--ink); }
.badge { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 5px; margin-left: 6px; border-radius: 2px; background: var(--danger); color: #fff; font-size: 0.68rem; font-weight: 700; }
#authbox { display: flex; align-items: center; }
.user-chip { position: relative; }
.chip-btn {
  display: flex; align-items: center; gap: 7px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); padding: 7px 12px; border-radius: var(--radius);
  font-family: inherit; color: var(--ink);
}
.chip-btn:hover { border-color: var(--ink); }
.chip-btn .caret { font-size: 0.65rem; color: var(--muted); }
.chip-btn[aria-expanded="true"] .caret { color: var(--ink); }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 200px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hover); padding: 5px; display: flex; flex-direction: column; gap: 1px;
}
.user-menu a, .user-menu button {
  display: block; width: 100%; text-align: left; background: none; border: none;
  font-family: inherit; font-size: 0.9rem; color: var(--ink); cursor: pointer;
  padding: 9px 11px; border-radius: 3px; text-decoration: none;
}
.user-menu a:hover, .user-menu button:hover { background: var(--orange-soft); }
.user-menu #logoutBtn { color: var(--danger); }

/* ---- buttons ---- */
.btn {
  font-family: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--radius); padding: 10px 18px;
  letter-spacing: 0.01em;
  transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover:not(:disabled) { background: #3a352c; border-color: #3a352c; }
.btn-secondary { background: var(--card); color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover:not(:disabled) { background: var(--orange-soft); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink); background: var(--card); }
.btn-danger { background: var(--card); color: var(--danger); border-color: var(--line); }
.btn-danger:hover:not(:disabled) { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn.block { width: 100%; display: block; margin-top: 10px; }

/* ---- layout ---- */
#app { max-width: 1080px; margin: 0 auto; padding: 28px 20px 64px; }
.view { animation: fade 0.18s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; }
.panel.center { text-align: center; max-width: 460px; margin: 40px auto; }
.panel.center .btn { margin: 10px auto 0; }
.loading { text-align: center; color: var(--muted); padding: 60px; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 50px 20px; }

/* ---- hint banner ---- */
.hint-banner {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--line); border-left: 3px solid var(--orange);
  border-radius: var(--radius);
  padding: 11px 14px; margin-bottom: 20px; font-size: 0.9rem;
}
.hint-banner .x { margin-left: auto; background: none; border: none; font-size: 1.15rem; cursor: pointer; color: var(--muted); }

/* ---- toolbar ---- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; align-items: center; }
.toolbar input { flex: 1; min-width: 120px; }
input, textarea, select {
  font-family: inherit; font-size: 0.95rem; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 13px; outline: none;
  transition: border 0.15s, box-shadow 0.15s; width: 100%;
}
input:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(32, 29, 24, 0.07); }
textarea { resize: vertical; }

/* ---- grid / cards ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.card:hover { border-color: #c9c2b6; box-shadow: var(--shadow-hover); }
.thumb { width: 100%; aspect-ratio: 4 / 3; background-size: cover; background-position: center; background-color: #f1ede6; border-bottom: 1px solid var(--line); }
.thumb-empty { display: grid; place-items: center; font-size: 2.4rem; color: #c9c2b6; font-family: var(--serif); }
.thumb-empty.big { aspect-ratio: 16/10; font-size: 3.6rem; border-radius: var(--radius-lg); border: 1px solid var(--line); }
.card-body { padding: 13px 15px 15px; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card-title { margin: 0 0 4px; font-size: 1.03rem; line-height: 1.3; font-family: var(--font); font-weight: 600; }
.detail-title { margin: 0; }
.price { font-weight: 700; color: var(--orange); font-size: 1rem; font-variant-numeric: tabular-nums; }
.price.big { font-size: 1.5rem; margin: 6px 0; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; }
.rep { font-size: 0.78rem; font-weight: 600; color: #8a6d1f; white-space: nowrap; }

/* ---- my listings ---- */
.view-head { margin: 0; }
.toolbar .spacer { flex: 1; }
.mine-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.btn-ghost.danger { color: var(--danger); }
.btn-ghost.danger:hover { border-color: var(--danger); background: var(--card); }

/* ---- profile & settings ---- */
.view-settings { max-width: 620px; margin: 0 auto; }
.settings-panel { margin-bottom: 16px; }
.settings-panel h3 { margin: 0 0 12px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.setting-row:first-of-type { border-top: none; }
.setting-label { color: var(--muted); font-size: 0.9rem; flex-shrink: 0; }
.copy-box { display: flex; align-items: center; gap: 8px; min-width: 0; }
.copy-box .ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; background: var(--cream); border: 1px solid var(--line); padding: 5px 9px; border-radius: 3px; }
.settings-panel .field { margin: 8px 0 12px; }
.settings-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.warn { color: var(--danger); }
@media (max-width: 560px) { .copy-box .ellip { max-width: 180px; } }
.tag { display: inline-block; padding: 2px 8px; border-radius: 2px; font-size: 0.68rem; font-weight: 700; background: var(--cream); border: 1px solid var(--line); color: var(--muted); letter-spacing: 0.07em; text-transform: uppercase; }
.tag-sold { background: #faf0ee; color: var(--danger); border-color: #e8cfc9; }
.tag-ok { background: #eef6f0; color: var(--ok); border-color: #cde3d3; }

/* ---- profiles (avatar / header / seller storefront) ---- */
.avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: none;
  background-size: cover; background-position: center;
  background-color: #f1ede6; border: 1px solid var(--line);
}
.avatar-empty { display: grid; place-items: center; font-size: 1.5rem; color: #c9c2b6; }

.profile-head { margin: 0 0 4px; }
.profile-banner {
  height: 120px; border-radius: var(--radius); background-size: cover; background-position: center;
  background-color: #f1ede6; border: 1px solid var(--line); margin-bottom: 12px;
}
.profile-banner-empty { background: linear-gradient(180deg, #f1ede6, var(--cream)); }
/* Only the avatar dips into the banner; the name/npub/rating stay on the card
   below it so they're always readable, whatever the banner image looks like. */
.profile-id { display: flex; align-items: flex-end; gap: 14px; padding: 0 6px; }
.profile-id .avatar { width: 72px; height: 72px; margin-top: -48px; border: 2px solid var(--card); }
.profile-meta { padding-bottom: 4px; min-width: 0; }
.profile-name { font-weight: 700; font-size: 1.15rem; line-height: 1.2; font-family: var(--serif); }
.profile-npub { max-width: 260px; display: inline-block; }
.profile-about { white-space: pre-wrap; margin: 12px 6px 0; color: var(--ink); }
.profile-preview { margin: 6px 0 14px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.profile-form-actions { display: flex; gap: 10px; margin-top: 4px; }

.profile-panel { margin-bottom: 18px; }
.profile-panel .btn { margin-top: 14px; }
.seller-head { margin: 4px 0 14px; }

/* seller card on a listing detail */
.seller-card {
  display: flex; align-items: center; gap: 12px; margin: 12px 0;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); cursor: pointer; transition: border 0.12s;
}
.seller-card:hover { border-color: var(--ink); text-decoration: none; }
.seller-card .avatar { width: 46px; height: 46px; }
.seller-card-body { min-width: 0; }
.seller-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seller-card-name { font-weight: 600; color: var(--ink); }
.seller-card-link { display: block; color: var(--orange); margin-top: 2px; }

/* ---- form ---- */
.view-form .panel, .view-help .panel { max-width: 680px; margin: 0 auto; }
.field { display: block; margin-bottom: 14px; }
.field.tight { margin: 8px 0; }
.field > span { display: block; font-weight: 600; font-size: 0.78rem; margin-bottom: 5px; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; }
.img-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.img-row { display: flex; gap: 8px; align-items: center; }
.img-row input { flex: 1; min-width: 0; }
.img-thumb { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 3px; object-fit: cover;
  background: #f1ede6; border: 1px solid var(--line); }
.img-thumb.empty { display: inline-block; }
.img-status { font-size: 0.78rem; color: var(--orange); white-space: nowrap; }
.img-row.is-uploading .img-thumb { animation: imgpulse 1s ease-in-out infinite; }
@keyframes imgpulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }
.img-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- detail ---- */
.detail-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 26px; align-items: start; }
.gallery { display: flex; flex-direction: column; gap: 10px; }
.gallery img { width: 100%; border-radius: var(--radius-lg); border: 1px solid var(--line); object-fit: cover; }
.detail-info .desc { white-space: pre-wrap; margin: 14px 0; }
.seller-line { margin: 6px 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ---- messages ---- */
.msg-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; min-height: 60vh; }
.conv-list { display: flex; flex-direction: column; gap: 8px; }
.conv-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; transition: border 0.12s; }
.conv-item:hover { border-color: #c9c2b6; }
.conv-item.active { border-color: var(--ink); }
.conv-title-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.conv-title { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.conv-item.unread { border-left: 3px solid var(--orange); }
.conv-item.unread .conv-title { color: var(--ink); }
.conv-preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.chat-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); display: flex; min-height: 60vh; }
.chat-inner { display: flex; flex-direction: column; width: 100%; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; max-height: 46vh; }
.bubble { max-width: 75%; padding: 8px 12px; border-radius: var(--radius-lg); }
.bubble-text { white-space: pre-wrap; word-break: break-word; }
.bubble-time { font-size: 0.68rem; opacity: 0.6; margin-top: 3px; }
.bubble.mine { align-self: flex-end; background: var(--ink); color: #fff; }
.bubble.theirs { align-self: flex-start; background: #f1ede6; color: var(--ink); }
.system-msg { align-self: center; font-size: 0.78rem; color: var(--muted); background: var(--cream); border: 1px solid var(--line); padding: 3px 12px; border-radius: 2px; }
.composer { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }
.composer .chat-input { flex: 1; }
.reveal-box { padding: 12px 16px; border-top: 1px solid var(--line); background: var(--cream); }
.reveal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.reveal-card { background: #eef6f0; border: 1px solid #cde3d3; border-radius: var(--radius); padding: 12px 14px; }
.reveal-title { font-weight: 700; margin-bottom: 6px; }
.kv { margin: 3px 0; word-break: break-all; }
.rating-widget { margin-top: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stars { font-size: 1.6rem; cursor: pointer; margin: 6px 0; user-select: none; }
.star { color: #cfc8bb; padding: 0 1px; }
.star.on { color: var(--orange); }
.rating-comment { margin: 6px 0; }
.contact-preview { margin: 4px 0 14px; }
.contact-list { list-style: none; margin: 4px 0; padding: 0; }
.contact-list li { margin: 2px 0; word-break: break-all; }
.share-preview { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 8px 0; }
.share-preview-head { font-weight: 600; margin-bottom: 4px; }
.share-preview a { display: inline-block; margin-top: 6px; }

/* ---- modal ---- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(32, 29, 24, 0.45); display: grid; place-items: center; padding: 16px; }
.modal { position: relative; width: 100%; max-width: 440px; max-height: 92vh; overflow-y: auto; background: var(--card); border-radius: var(--radius-lg); padding: 26px; box-shadow: 0 16px 48px rgba(0,0,0,0.22); animation: fade 0.15s ease; }
.modal h2 { margin-top: 0; }
.modal-close { position: absolute; top: 12px; right: 14px; background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--muted); line-height: 1; }
.login-tabs { display: flex; margin: 14px 0 16px; border-bottom: 1px solid var(--line); }
.login-tab { flex: 1; border: none; background: transparent; padding: 9px 8px; font-weight: 600; cursor: pointer; color: var(--muted); font-family: inherit; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.login-tab.active { color: var(--ink); border-bottom-color: var(--orange); }
.hint { font-size: 0.8rem; color: var(--muted); margin: 6px 0 0; }
.error { background: #faf0ee; color: var(--danger); border: 1px solid #e8cfc9; border-radius: var(--radius); padding: 9px 12px; font-size: 0.86rem; margin-top: 12px; }

/* ---- email login (log in vs create) ---- */
.seg { display: flex; gap: 4px; margin: 4px 0 14px; background: #f1ede6; padding: 3px; border-radius: var(--radius); }
.seg-btn { flex: 1; border: none; background: transparent; padding: 7px; border-radius: 3px; font-weight: 600; font-size: 0.86rem; cursor: pointer; color: var(--muted); font-family: inherit; }
.seg-btn.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.npub-fp { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; word-break: break-all; background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 8px 0; color: var(--ink); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 0.82rem; color: var(--muted); margin: 12px 0; cursor: pointer; line-height: 1.4; }
.check input { margin-top: 2px; flex: none; }
.confirm-row { display: flex; gap: 10px; margin-top: 8px; }
.confirm-row .btn-ghost { flex: none; }
.confirm-row .btn-primary { flex: 1; }

/* ---- toast ---- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: var(--radius); font-weight: 500; font-size: 0.9rem; box-shadow: 0 8px 30px rgba(0,0,0,0.25); max-width: 90vw; }
.toast-error { background: var(--danger); }

/* ---- help ---- */
.help h1 { margin-top: 0; }
.help h2 { margin-top: 24px; color: var(--ink); font-size: 1.15rem; }
.help code { background: #f1ede6; padding: 1px 6px; border-radius: 3px; font-size: 0.85em; }
.help ul { padding-left: 20px; }
.help li { margin: 7px 0; }

/* ---- cart / checkout / orders ---- */
.view-cart, .view-checkout, .view-orders { max-width: 720px; margin: 0 auto; }
.cart-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-row:last-child { border-bottom: 0; }
.cart-thumb { width: 56px; height: 56px; flex: none; border-radius: 3px; object-fit: cover; background: #f1ede6; border: 1px solid var(--line); }
.cart-info { flex: 1; min-width: 0; }
.cart-title { font-weight: 600; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty-n { min-width: 22px; text-align: center; font-weight: 600; }
.cart-line { font-weight: 600; min-width: 90px; text-align: right; font-variant-numeric: tabular-nums; }
.cart-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.cart-total { font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; color: var(--ink-soft, var(--muted)); }
.sum-total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-weight: 700; color: var(--ink); }
.form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pay-area { margin-top: 14px; }
.pay-area .btn.block, .checkout .btn.block { margin-top: 8px; }
textarea.mono { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; word-break: break-all; }
.order-card { margin-bottom: 14px; }
.order-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.order-items { margin: 6px 0 10px; padding-left: 18px; }
.order-items li { margin: 3px 0; }
.order-ship { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.order-name { font-weight: 600; }
.tag-paid { background: #eef6f0; color: var(--ok); border: 1px solid #cde3d3; }
.tag-unpaid { background: #faf4e8; color: #8a6d1f; border: 1px solid #e6d9bd; }
.tag-stock { background: var(--cream); color: var(--ink-soft, var(--muted)); border: 1px solid var(--line); }
.order-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.btn.done { opacity: .7; }

/* ---- responsive ---- */
@media (max-width: 760px) {
  /* Row 1: brand | (space) | Log in | ☰  — nav drops to its own row when open */
  #navToggle { display: inline-grid; order: 2; }
  #authbox { order: 1; margin-left: auto; }
  /* nav collapses into a dropdown panel toggled by the hamburger */
  #mainnav {
    order: 3; width: 100%; margin-left: 0; flex: none; flex-direction: column; align-items: stretch; gap: 3px;
    display: none; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 8px;
  }
  #mainnav.open { display: flex; }
  #mainnav a { padding: 13px 12px; font-size: 1rem; border-radius: var(--radius); }
  #mainnav a.active { text-decoration: none; border-left: 3px solid var(--orange); background: var(--orange-soft); color: var(--ink); }
  #mainnav a.nav-sell { margin-left: 0; margin-top: 6px; text-align: center; }
  .detail-grid { grid-template-columns: 1fr; }
  .msg-layout { grid-template-columns: 1fr; }
  .conv-list { flex-direction: row; overflow-x: auto; }
  .conv-item { min-width: 200px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
}

/* --- site footer -------------------------------------------------------- */
#sitefooter {
  margin-top: 48px;
  padding: 22px 16px 30px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}
#sitefooter a { color: var(--orange); }
#sitefooter a:hover { text-decoration: underline; }
#sitefooter .foot-brand { font-family: var(--serif); font-weight: 600; letter-spacing: 0.1em; color: var(--ink); }
#sitefooter .foot-sep { margin: 0 8px; opacity: 0.5; }
