/* Jigzoo – mobile-first styles. Brand: navy #13294B, yellow #F9B52A, accessible blue #1662a8 for links/buttons; light blue #C4E7FB only behind the logo. */
:root {
  --navy: #13294B; --teal: #F9B52A; --teal-dark: #1662a8; --teal-light: #FFF6E0; --blue: #13294B; --green: #1b7a3a; --yellow: #ffc21c; --pink: #1662a8; --heart: #e5484d;
  --ink: #1b2240; --muted: #5f6680; --line: #e4e6ef; --bg: #fbfaf7; --card: #fff; --warn: #b44a00; --ok: #1b7a3a;
  --radius: 14px; --shadow: 0 1px 2px rgba(1,34,109,.06), 0 4px 16px rgba(1,34,109,.06);
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; padding-bottom: 72px; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-dark); }
h1 { color: var(--navy); font-size: 1.6rem; line-height: 1.2; margin: 1rem 0 .75rem; }
h2 { color: var(--navy); font-size: 1.2rem; margin: 1.5rem 0 .5rem; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 99; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-row { display: flex; align-items: center; gap: 10px; min-height: 60px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.brand-full { display: none; height: 64px; width: 64px; border-radius: 12px; }
.brand-mark { height: 38px; width: 38px; border-radius: 10px; }
.search { flex: 1 1 200px; display: flex; order: 3; width: 100%; background: #f2f3f8; border-radius: 999px; padding: 2px 4px 2px 14px; }
.search input { flex: 1; border: 0; background: transparent; font: inherit; padding: 8px 0; min-width: 0; }
.search input:focus { outline: none; }
.search button { border: 0; background: var(--teal-dark); border-radius: 999px; width: 38px; height: 38px; cursor: pointer; display: grid; place-items: center; }
.search svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2.4; }
.top-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav-icon { display: none; width: 40px; height: 40px; border-radius: 50%; place-items: center; cursor: pointer; list-style: none; }
.nav-icon::-webkit-details-marker { display: none; }
.nav-icon:hover { background: #f2f3f8; }
.nav-icon svg, .bottom-nav svg, .fav svg, .fav-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--navy); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.nav-link { padding: 8px 10px; text-decoration: none; color: var(--navy); font-weight: 600; }
.menu { position: relative; } .menu summary { display: grid; }
.menu-panel { position: absolute; right: 0; top: 46px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 200px; padding: 6px; display: flex; flex-direction: column; }
.menu-panel a, .menu-panel .linklike { padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); text-align: left; }
.menu-panel a:hover, .menu-panel .linklike:hover { background: #f2f3f8; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 2px solid transparent; border-radius: 999px; padding: 10px 18px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; background: var(--navy); color: #fff; line-height: 1.2; }
.btn-primary { background: var(--teal-dark); } .btn-primary:hover { background: #104f88; }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line); } .btn-ghost:hover { border-color: var(--navy); }
.btn-danger { background: #fff; color: #b3123f; border-color: #f4c2d0; } .btn-danger:hover { background: #fff1f5; }
.btn-sell { background: var(--pink); padding: 8px 14px; } .btn-sell:hover { filter: brightness(.95); }
.btn-wide { width: 100%; } .btn-sm { padding: 6px 12px; font-size: .875rem; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--teal-dark); cursor: pointer; text-decoration: underline; }
.top-nav .btn-sell { display: none; }

.flash { background: var(--teal-light); border-bottom: 1px solid #f5dfa5; color: var(--navy); padding: 10px 0; font-weight: 600; }
.notice { background: #f3f6ff; border-radius: 10px; padding: 10px 14px; margin: .75rem 0; }
.notice.warn { background: #fff4e5; color: var(--warn); } .notice.ok { background: #eaf8ee; color: var(--ok); }
.errors { background: #fff1f4; border: 1px solid #f7c6d3; color: #8f1236; border-radius: 10px; padding: 4px 14px; margin-bottom: 1rem; }
.draft-banner { background: repeating-linear-gradient(-45deg, #fff6d6, #fff6d6 12px, #ffefb0 12px, #ffefb0 24px); border: 2px dashed #e0a800; border-radius: 10px; padding: 12px 16px; margin: 1rem 0; color: #5a4300; }

/* Hero / home */
.hero { display: grid; gap: 16px; background: linear-gradient(135deg, #eaf6ff 0%, #effbe9 50%, #fff6e0 100%); border-radius: 22px; padding: 22px; margin-top: 16px; overflow: hidden; }
.hero h1 { font-size: 1.9rem; margin-top: 0; }
.hero-img { border-radius: 16px; aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { position: relative; border-radius: var(--radius); overflow: hidden; text-decoration: none; aspect-ratio: 1; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile span { position: absolute; inset: auto 0 0 0; padding: 18px 8px 8px; color: #fff; font-weight: 800; font-size: .9rem; background: linear-gradient(transparent, rgba(10,20,60,.75)); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.steps { padding-left: 1.2rem; } .steps li { margin-bottom: .5rem; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card { position: relative; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.card-img { position: relative; display: block; aspect-ratio: 1; background: #f2f3f8; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.ribbon { position: absolute; left: 8px; top: 8px; background: var(--navy); color: #fff; font-size: .75rem; font-weight: 800; padding: 3px 8px; border-radius: 999px; }
.fav-form { position: absolute; right: 6px; top: 6px; margin: 0; }
.fav { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); display: grid; place-items: center; cursor: pointer; }
.fav.on svg, .fav-btn.on svg { fill: var(--heart); stroke: var(--heart); }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.card-title { font-weight: 700; color: var(--ink); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { font-size: .8rem; color: var(--muted); }
.price { margin-top: auto; padding-top: 6px; } .price strong { font-size: 1.05rem; color: var(--navy); }
.incl { display: block; font-size: .75rem; color: var(--teal-dark); }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #eef0f7; color: var(--navy); width: fit-content; margin: 2px 0; }
.badge.ok { background: #e3f6e8; color: var(--ok); } .badge.warn { background: #fff0e0; color: var(--warn); } .badge.biz { background: #fff3c4; color: #6b5200; }
.status-completed { background: #e3f6e8; color: var(--ok); } .status-disputed, .status-refunded { background: #fff0e0; color: var(--warn); }

/* Browse */
.filters { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px; margin-bottom: 14px; }
.filters summary { font-weight: 700; cursor: pointer; color: var(--navy); padding: 4px 0; }
.filter-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 0; }
.filter-form label { display: flex; flex-direction: column; font-size: .85rem; font-weight: 600; gap: 4px; }
.filter-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.pager { display: flex; justify-content: space-between; margin: 20px 0; }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }

/* Forms */
input, select, textarea { font: inherit; border: 1.5px solid #d5d8e5; border-radius: 10px; padding: 10px 12px; background: #fff; width: 100%; color: var(--ink); }
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(249,181,42,.25); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; flex: none; margin-top: 3px; accent-color: var(--teal); }
input[type=file] { padding: 8px; background: #f7f8fc; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.stack label small, label small { font-weight: 400; color: var(--muted); }
label.check { flex-direction: row !important; align-items: flex-start; gap: 10px !important; font-weight: 400 !important; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 14px; background: #fff; }
legend { font-weight: 800; color: var(--navy); padding: 0 6px; }
.auth, .form-page { max-width: 640px; margin: 0 auto; padding-bottom: 30px; }
.auth { max-width: 420px; }
.thumbs, .preview { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { display: flex; flex-direction: column !important; font-size: .8rem; font-weight: 400 !important; }
.thumb img, .preview img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; }
.avatar-row { display: flex; gap: 16px; align-items: center; }
.inline { display: inline; } .inline-search { display: flex; gap: 8px; align-items: center; margin: 10px 0; flex-wrap: wrap; } .inline-search input[name=q] { max-width: 280px; }

/* Listing page */
.listing { display: grid; gap: 18px; margin-top: 12px; }
.gallery { position: relative; border-radius: var(--radius); overflow: hidden; background: #f2f3f8; }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track img { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 1; object-fit: cover; width: 100%; }
.gallery-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.6); } .dot.on { background: #fff; }
.listing-info h1 { margin-top: 0; }
.price-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 12px 0; }
.price-box div { display: flex; justify-content: space-between; padding: 4px 0; }
.price-box dt, .price-box dd { margin: 0; } .price-box .total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; font-weight: 800; color: var(--navy); font-size: 1.1rem; }
.actions { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; } .actions form { margin: 0; }
.attrs { display: grid; grid-template-columns: 1fr; margin: 14px 0; border-top: 1px solid var(--line); }
.attrs div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.attrs dt { color: var(--muted); } .attrs dd { margin: 0; text-align: right; font-weight: 600; }
.seller-card { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-decoration: none; color: var(--ink); margin-top: 14px; }
.avatar { border-radius: 50%; object-fit: cover; width: 48px; height: 48px; flex: none; }
.avatar.lg { width: 96px; height: 96px; } .avatar.sm { width: 32px; height: 32px; }
.avatar-letter { display: inline-grid; place-items: center; background: linear-gradient(135deg, var(--navy), var(--teal-dark)); color: #fff; font-weight: 800; font-size: 1.2rem; }
.avatar-letter.lg { font-size: 2.4rem; } .avatar-letter.sm { font-size: .9rem; }
.stars { color: var(--yellow); letter-spacing: 1px; } .stars .off { color: #d9dbe5; }
.report { margin-top: 18px; font-size: .9rem; } .report summary { cursor: pointer; color: var(--muted); }

/* Profile */
.profile-head { display: flex; gap: 16px; align-items: flex-start; margin-top: 16px; }
.profile-head h1 { margin: 0 0 4px; }
.reviews { list-style: none; padding: 0; } .reviews li { background: #fff; border-radius: 12px; padding: 12px; margin-bottom: 8px; box-shadow: var(--shadow); }

/* Inbox / thread */
.inbox { list-style: none; padding: 0; margin: 0; }
.inbox li a { display: flex; align-items: center; gap: 12px; padding: 10px; background: #fff; border-radius: 12px; margin-bottom: 8px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.inbox li img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; }
.inbox-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.inbox li.unread a { border-left: 4px solid var(--pink); }
.thread { max-width: 720px; margin: 0 auto; padding-bottom: 20px; }
.thread-listing { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 12px; padding: 10px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); margin: 12px 0; }
.thread-listing img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }
.thread-head { display: flex; align-items: center; gap: 8px; }
.messages { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 82%; padding: 10px 12px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.msg p { margin: 0; } .msg.mine { align-self: flex-end; background: #e1f5f4; } .msg.theirs { align-self: flex-start; }
.msg.system { align-self: center; background: #f2f3f8; box-shadow: none; font-size: .85rem; color: var(--muted); text-align: center; }
.when { display: block; font-size: .7rem; color: var(--muted); margin-top: 4px; }
.offer-bubble { display: flex; flex-direction: column; gap: 6px; } .offer-actions { display: flex; gap: 6px; flex-wrap: wrap; } .offer-actions form { margin: 0; }
.compose { display: flex; gap: 8px; align-items: flex-end; margin-top: 14px; } .compose textarea { flex: 1; }
.offer-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 14px; background: #fff; border-radius: 12px; padding: 12px; }
.offer-form label { display: flex; flex-direction: column; font-weight: 600; flex: 1 1 200px; }

/* Orders / admin */
.tabs { display: flex; gap: 6px; margin: 10px 0 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--navy); font-weight: 600; }
.tabs a.on { background: var(--navy); color: #fff; }
.card-pad { background: #fff; border-radius: var(--radius); padding: 14px; margin: 14px 0; box-shadow: var(--shadow); }
.card-pad h2 { margin-top: 0; } .card-pad form { margin: 6px 0; }
.timeline { padding-left: 1.2rem; } .timeline li { margin-bottom: 6px; }
.checklist li { margin-bottom: 6px; }
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; font-size: .9rem; display: block; overflow-x: auto; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { background: #f6f7fb; color: var(--navy); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; } .row-actions form { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: #fff; border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--muted); box-shadow: var(--shadow); }
.stat strong { display: block; font-size: 1.8rem; color: var(--navy); }

/* Content pages */
.prose { max-width: 760px; margin: 0 auto; padding-bottom: 30px; }
.prose details { background: #fff; border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; } .prose summary { font-weight: 700; cursor: pointer; }

/* Footer + bottom nav */
.site-footer { margin-top: 40px; background: #fff; border-top: 1px solid var(--line); padding: 24px 0 10px; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.footer-grid h2 { font-size: .95rem; margin: 0 0 6px; } .footer-grid a { display: block; text-decoration: none; padding: 3px 0; color: var(--ink); }
.footer-grid div:first-child { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; }
.footer-grid p { margin: 0; }
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); z-index: 30; }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--navy); font-size: .7rem; font-weight: 600; gap: 2px; }
.bottom-nav a.sell svg { background: var(--pink); stroke: #fff; border-radius: 50%; padding: 4px; width: 30px; height: 30px; }

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(6, 1fr); }
  .filter-form { grid-template-columns: repeat(4, 1fr); }
  .stats { grid-template-columns: repeat(5, 1fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; } .footer-grid div:first-child { grid-column: auto; }
}
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .brand-full { display: block; } .brand-mark { display: none; }
  .search { order: 0; width: auto; max-width: 520px; }
  .nav-icon { display: grid; } .top-nav .btn-sell { display: inline-flex; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
  .hero { grid-template-columns: 1fr 1fr; align-items: center; padding: 36px; }
  .hero h1 { font-size: 2.6rem; }
  .listing { grid-template-columns: 1.1fr 1fr; gap: 32px; }
  .actions { flex-direction: row; flex-wrap: wrap; } .actions .btn-wide { width: auto; }
}
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* Postage options + prepaid label panel */
.postage-options .postage-option { align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #fff; }
.postage-options .postage-option input { margin-top: 4px; }
.label-panel .qr { margin: 12px 0; text-align: center; }
.label-panel .qr img { width: 240px; height: 240px; image-rendering: pixelated; background: #fff; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
