/* © 2026 Michael Murphy. All rights reserved. */
/* Gavely platform — slice 1 styles. Dark ink + amber, matching gavely.live. */

:root {
  --ink: #0b0b0f;
  --ink-2: #14141b;
  --ink-3: #1d1d27;
  --line: #2a2a36;
  --cream: #f3efe6;
  --muted: #9a9689;
  --amber: #e8a33d;
  --amber-2: #f0b95e;
  --red: #e2574c;
  --green: #4caf7d;
  --radius: 12px;
}

* { box-sizing: border-box; }

/* The UA stylesheet's [hidden] { display: none } is overridden by any
   display rule below, so it must be enforced explicitly. Without this, the
   onboarding buttons all show at once. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: radial-gradient(1200px 700px at 50% -10%, var(--ink-3), var(--ink) 60%);
  color: var(--cream);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
}
.auth-card.wide { max-width: 520px; }

h1 { font-size: 1.6rem; margin: 0 0 .35rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 .6rem; }
.sub { color: var(--muted); margin: 0 0 1.5rem; font-size: .95rem; }

label {
  display: block;
  margin: 1rem 0 .35rem;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: #cfcabb;
}
.opt { color: var(--muted); font-weight: 400; }

input[type=text], input[type=email], input[type=password], textarea {
  width: 100%;
  padding: .7rem .8rem;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--cream);
  font: inherit;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(232,163,61,.15);
}

.hint { color: var(--muted); font-size: .8rem; margin: .35rem 0 0; }
.hint.ok { color: var(--green); }
.hint.bad { color: var(--red); }

.check { display: flex; gap: .6rem; align-items: flex-start; margin: 1.25rem 0; font-weight: 400; font-size: .88rem; color: #cfcabb; }
.check input { margin-top: .25rem; accent-color: var(--amber); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn-primary, .btn-secondary {
  display: inline-block;
  width: 100%;
  padding: .8rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: filter .15s ease, background .15s ease;
}
.btn-primary { background: var(--amber); color: #241a06; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-secondary {
  background: transparent; color: var(--cream); border-color: var(--line); margin-top: .6rem;
}
.btn-secondary:hover { background: var(--ink-3); }

.error { color: var(--red); font-size: .9rem; margin: .9rem 0 0; min-height: 1.2em; }
.state {
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .8rem .9rem;
  font-size: .9rem;
  color: #cfcabb;
  margin-bottom: .75rem;
}
.state .pill {
  display: inline-block; padding: .12rem .55rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  margin-left: .4rem;
}
.pill.on { background: rgba(76,175,125,.15); color: var(--green); }
.pill.off { background: rgba(226,87,76,.15); color: var(--red); }
.pill.wait { background: rgba(232,163,61,.15); color: var(--amber); }

.foot { color: var(--muted); font-size: .88rem; margin-top: 1.5rem; text-align: center; }
.foot a { color: var(--amber-2); text-decoration: none; }
.foot a:hover { text-decoration: underline; }


/* ==========================================================================
   Slice 2: listings
   ========================================================================== */

.page { display: block; padding: 0; align-items: stretch; }
body.page { display: block; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.25rem; border-bottom: 1px solid var(--line);
  background: rgba(11,11,15,.85); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; color: var(--amber); text-decoration: none; letter-spacing: -.01em; }
.topbar nav a {
  color: var(--muted); text-decoration: none; margin-left: 1rem; font-size: .9rem;
}
.topbar nav a:hover, .topbar nav a.active { color: var(--cream); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.5rem; margin: 0; }

.card {
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem;
}
.card.warn { border-color: rgba(232,163,61,.4); background: rgba(232,163,61,.06); }
.card h2 { margin-top: 0; }

.btn-primary.inline, .btn-secondary.inline { width: auto; display: inline-block; padding: .55rem 1rem; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }

select {
  width: 100%; padding: .7rem .8rem; background: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; color: var(--cream); font: inherit;
}
select:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(232,163,61,.15); }

.tabs { display: flex; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tab {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  padding: .4rem .85rem; border-radius: 999px; font: inherit; font-size: .85rem; cursor: pointer;
}
.tab.active { background: var(--amber); border-color: var(--amber); color: #241a06; font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }

.listing-card {
  display: block; background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit;
  transition: border-color .15s ease, transform .15s ease;
}
.listing-card:hover { border-color: var(--amber); transform: translateY(-2px); }
.listing-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--ink-3); }
.no-photo {
  width: 100%; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
  background: var(--ink-3); color: var(--muted); font-size: .85rem;
}
.listing-card-body { padding: .75rem .85rem 1rem; }
.listing-card h3 { font-size: .95rem; margin: 0 0 .35rem; line-height: 1.3; }
.listing-card .price { color: var(--amber-2); font-weight: 700; margin-bottom: .5rem; }
.listing-card .meta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: .75rem; color: var(--muted); }

.pill.status-draft { background: rgba(154,150,137,.18); color: var(--muted); }
.pill.status-active { background: rgba(76,175,125,.16); color: var(--green); }
.pill.status-sold { background: rgba(232,163,61,.16); color: var(--amber); }
.pill.status-archived { background: rgba(226,87,76,.14); color: var(--red); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.photo-cell { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.photo-cell.cover { border-color: var(--amber); }
.photo-cell img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.cover-tag {
  position: absolute; bottom: 0; left: 0; right: 0; text-align: center;
  background: rgba(232,163,61,.9); color: #241a06; font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; padding: .15rem 0;
}
.photo-del, .photo-move {
  position: absolute; top: .3rem; border: none; border-radius: 6px;
  background: rgba(11,11,15,.8); color: var(--cream); cursor: pointer;
  width: 1.6rem; height: 1.6rem; font-size: .9rem; line-height: 1;
}
.photo-del { right: .3rem; }
.photo-del:hover { background: var(--red); }
.photo-move { left: .3rem; }
.photo-move:hover { background: var(--amber); color: #241a06; }

.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.25rem; }
.actions .btn-primary, .actions .btn-secondary { width: auto; padding: .7rem 1.1rem; }

.ok { color: var(--green); font-size: .9rem; margin: .75rem 0 0; min-height: 1.2em; }
.muted { color: var(--muted); }


/* ==========================================================================
   Slice 4: live show, studio, chat
   ========================================================================== */

.conn { font-size: .78rem; padding: .15rem .6rem; border-radius: 999px; font-weight: 600; }
.conn.on   { background: rgba(76,175,125,.16); color: var(--green); }
.conn.wait { background: rgba(232,163,61,.16); color: var(--amber); }
.conn.off  { background: rgba(226,87,76,.16); color: var(--red); }

.show-wrap { max-width: 900px; }
.show-head h1 { margin-bottom: .2rem; }

.stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  margin-bottom: 1rem;
}
.stage-inner { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
#stage-note { color: var(--muted); font-size: .9rem; }
.lot-overlay {
  position: absolute; left: 0; right: 0; bottom: 0; padding: .7rem .9rem;
  background: linear-gradient(transparent, rgba(0,0,0,.82));
  display: flex; align-items: center; gap: .8rem;
}
.lot-title { flex: 1; font-weight: 600; font-size: .95rem; overflow: hidden;
             text-overflow: ellipsis; white-space: nowrap; }
.lot-price { color: var(--amber-2); font-weight: 700; }
.lot-timer { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 3.6rem;
             text-align: right; }

.bid-panel, .chat-panel, .lots-panel {
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem;
}
.bid-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
@media (max-width: 560px) { .bid-row { grid-template-columns: 1fr; } }
.bid-field label { margin-top: 0; }
#bid-btn, #buy-btn { margin-top: 1rem; }

.chat-log {
  height: 260px; overflow-y: auto; background: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: .6rem .7rem;
  margin-bottom: .7rem; font-size: .9rem;
}
.chat-line { margin-bottom: .35rem; line-height: 1.4; }
.chat-line.mine .chat-handle { color: var(--amber); }
.chat-line.masked { opacity: .6; }
.chat-handle { color: var(--muted); font-weight: 600; margin-right: .45rem; font-size: .82rem; }
.chat-body { color: var(--cream); }
.chat-form { display: flex; gap: .5rem; }
.chat-form input { flex: 1; }
.chat-form .btn-secondary { width: auto; margin-top: 0; padding: .7rem 1rem; }

.lots-list, .my-shows, .run-lots { display: flex; flex-direction: column; gap: .4rem; }
.lot-row {
  display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem;
  background: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  color: var(--cream); font: inherit; text-align: left; width: 100%; cursor: pointer;
}
.lot-row:hover { border-color: var(--amber); }
.lot-row.current { border-color: var(--amber); background: rgba(232,163,61,.08); }
.lot-row-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lot-row-price { color: var(--amber-2); font-weight: 700; }
.pill.status-live   { background: rgba(76,175,125,.16); color: var(--green); }
.pill.status-pending{ background: rgba(154,150,137,.18); color: var(--muted); }
.pill.status-unsold { background: rgba(154,150,137,.18); color: var(--muted); }
.pill.status-skipped{ background: rgba(154,150,137,.18); color: var(--muted); }
.btn-secondary.tiny { width: auto; margin: 0; padding: .3rem .6rem; font-size: .8rem; }


/* ==========================================================================
   Slice 6: checkout, orders, sales
   ========================================================================== */

.wrap.narrow { max-width: 620px; }

.totals { margin: 1rem 0 0; }
.totals div { display: flex; justify-content: space-between; padding: .45rem 0;
              border-bottom: 1px solid var(--line); }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.totals .grand { border-bottom: none; border-top: 2px solid var(--line); margin-top: .3rem;
                 padding-top: .6rem; }
.totals .grand dt, .totals .grand dd { font-weight: 700; color: var(--cream); font-size: 1.1rem; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: .75rem; margin-bottom: .75rem; }
.stat { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius);
        padding: .8rem .9rem; display: flex; flex-direction: column; gap: .25rem; }
.stat-label { color: var(--muted); font-size: .78rem; text-transform: uppercase;
              letter-spacing: .04em; }
.stat-value { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-value.amber { color: var(--amber-2); }

.order-list { display: flex; flex-direction: column; gap: .45rem; }
.order-row { display: flex; align-items: center; gap: .7rem; padding: .65rem .75rem;
             background: var(--ink); border: 1px solid var(--line); border-radius: 8px;
             text-decoration: none; color: inherit; font-size: .9rem; }
a.order-row:hover { border-color: var(--amber); }
.order-ref { font-family: ui-monospace, monospace; color: var(--amber-2); font-size: .82rem;
             min-width: 7.5rem; }
.order-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.pill.status-requires_action { background: rgba(232,163,61,.16); color: var(--amber); }
.pill.status-pending { background: rgba(154,150,137,.18); color: var(--muted); }
.pill.status-failed, .pill.status-cancelled { background: rgba(226,87,76,.16); color: var(--red); }
.pill.status-refunded, .pill.status-partially_refunded { background: rgba(232,163,61,.16); color: var(--amber); }
.pill.status-disputed { background: rgba(226,87,76,.2); color: var(--red); }


/* ==========================================================================
   Slice 7: shipping
   ========================================================================== */

.row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: .6rem; }
@media (max-width: 560px) { .row-3 { grid-template-columns: 1fr; } }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.65);
         display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 50; }
.modal-box { background: var(--ink-2); border: 1px solid var(--line);
             border-radius: var(--radius); padding: 1.1rem; width: 100%; max-width: 520px;
             max-height: 85vh; overflow-y: auto; }
.modal-box h2 { margin-top: 0; }

.rate-list { display: flex; flex-direction: column; gap: .5rem; margin: .8rem 0; }
.rate-row { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem;
            background: var(--ink); border: 1px solid var(--line); border-radius: 8px;
            color: var(--cream); font: inherit; text-align: left; width: 100%; cursor: pointer; }
.rate-row:hover { border-color: var(--amber); }
.rate-service { flex: 1; font-weight: 600; }
.rate-carrier { color: var(--muted); font-size: .82rem; }
.rate-price { font-weight: 700; color: var(--amber-2); font-variant-numeric: tabular-nums; }


/* ==========================================================================
   Slice 5: offers, browse, listing view
   ========================================================================== */

.price-lg { font-size: 1.5rem; font-weight: 700; color: var(--amber-2);
            font-variant-numeric: tabular-nums; margin: .2rem 0 .8rem; }

.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
                gap: 1rem; }
.listing-card { background: var(--ink-2); border: 1px solid var(--line);
                border-radius: var(--radius); overflow: hidden; text-decoration: none;
                color: inherit; display: flex; flex-direction: column; }
.listing-card:hover { border-color: var(--amber); }
.listing-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.listing-card .no-photo { aspect-ratio: 4 / 3; display: flex; align-items: center;
                          justify-content: center; color: var(--muted);
                          background: var(--ink); font-size: .85rem; }
.listing-card-body { padding: .7rem .8rem; display: flex; flex-direction: column; gap: .3rem; }
.listing-card-body h3 { margin: 0; font-size: .98rem; line-height: 1.25; }
.listing-card-body .price { font-weight: 700; color: var(--amber-2);
                            font-variant-numeric: tabular-nums; }
.listing-card-body .meta { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.listing-card-body .format { color: var(--muted); font-size: .8rem; }

.view-photos { display: flex; gap: .5rem; overflow-x: auto; margin-bottom: .8rem; }
.view-photos img { height: 200px; border-radius: 8px; }

.offer-row { flex-wrap: wrap; }
.offer-amount { font-weight: 700; color: var(--amber-2); font-variant-numeric: tabular-nums; }

.btn-primary.tiny, .btn-secondary.tiny { padding: .35rem .65rem; font-size: .82rem;
                                         border-radius: 6px; }
a.btn-primary.tiny, a.btn-secondary.tiny { text-decoration: none; display: inline-block; }

#offer-card label, #counter-modal label { display: block; margin-top: .6rem;
                                          font-size: .88rem; color: var(--muted); }
