/* ============================================================
   MAW SILENT AUCTION — gallery design system
   Ivory · charcoal · one terracotta accent. Inter + Instrument Serif.
   8px spacing scale. Shared by the buyer site, staff console, display and print.
   ============================================================ */
:root{
  --bg:#FAF9F6;
  --surface:#FFFFFF;
  --ink:#222222;
  --ink-2:#3D3C3A;
  --mute:#6B6A67;          /* the brief's #777, darkened slightly so small text passes AA on ivory */
  --line:#E8E6E2;
  --line-2:#D6D3CD;
  --accent:#A65D45;        /* Madras terracotta — used sparingly */
  --accent-soft:#F5ECE8;
  --good:#2F6B4F;  --good-soft:#EAF3ED;
  --warn:#8A5300;  --warn-soft:#FBF1E0;
  --bad:#9B2C2C;   --bad-soft:#F9EAEA;

  --serif:"Instrument Serif", Georgia, "Times New Roman", serif;
  --sans:"Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --r:6px;
  --s1:8px; --s2:16px; --s3:24px; --s4:32px; --s5:48px; --s6:64px; --s7:96px;
  --maxw:1240px;
  --ease:cubic-bezier(.2,.7,.2,1);
}

*{ box-sizing:border-box; margin:0; padding:0; }
html{ -webkit-text-size-adjust:100%; scroll-behavior:smooth; }
body{
  background:var(--bg); color:var(--ink);
  font-family:var(--sans); font-size:17px; line-height:1.6; font-weight:400;
  -webkit-font-smoothing:antialiased; min-height:100vh; overflow-x:hidden;
  font-feature-settings:"tnum" 1, "cv11" 1;
}
img{ display:block; max-width:100%; }
a{ color:inherit; }
button,input,select,textarea{ font:inherit; color:inherit; }
button{ cursor:pointer; background:none; border:0; }
::selection{ background:var(--accent-soft); }
:focus-visible{ outline:3px solid var(--accent); outline-offset:2px; border-radius:2px; }
[hidden]{ display:none !important; }
.sr{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

.wrap{ width:100%; max-width:var(--maxw); margin:0 auto; padding:0 var(--s2); }
@media (min-width:760px){ .wrap{ padding:0 var(--s5); } }

/* ---------- type ---------- */
.serif{ font-family:var(--serif); font-weight:400; letter-spacing:-.005em; line-height:1.05; }
h1.serif{ font-size:clamp(2.6rem, 7vw, 4.4rem); }
h2.serif{ font-size:clamp(2rem, 4.5vw, 2.8rem); }
.label{ font-size:.82rem; font-weight:500; color:var(--mute); letter-spacing:.01em; }
.muted{ color:var(--mute); }
.small{ font-size:.9rem; }
.price{ font-weight:500; letter-spacing:-.01em; line-height:1.1; font-variant-numeric:tabular-nums; }
.link{ color:var(--ink); text-decoration:underline; text-underline-offset:3px; text-decoration-color:var(--line-2); }
.link:hover{ text-decoration-color:var(--ink); }

/* ---------- header ---------- */
.site-head{ background:var(--bg); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:40; }
.site-head__bar{ display:flex; align-items:center; justify-content:space-between; gap:var(--s2); height:72px; max-width:var(--maxw); margin:0 auto; padding:0 var(--s2); }
@media (min-width:760px){ .site-head__bar{ padding:0 var(--s5); height:80px; } }
.brand{ display:flex; align-items:center; gap:12px; text-decoration:none; min-width:0; }
.brand img{ width:40px; height:40px; flex:none; }
.brand__name{ font-family:var(--serif); font-size:1.35rem; line-height:1; white-space:nowrap; }
.brand__sub{ display:block; font-size:.74rem; color:var(--mute); margin-top:4px; white-space:nowrap; }
@media (max-width:420px){ .brand__sub{ display:none; } }
.nav{ display:flex; align-items:center; gap:4px; }
.nav a{ text-decoration:none; font-size:.98rem; font-weight:500; padding:10px 12px; border-radius:var(--r); color:var(--ink-2); }
.nav a:hover{ background:var(--surface); color:var(--ink); }
.nav a[aria-current="page"]{ color:var(--ink); box-shadow:inset 0 -2px 0 var(--ink); border-radius:0; }
.nav .account{ margin-left:8px; border:1px solid var(--line-2); background:var(--surface); white-space:nowrap; }
.nav .account b{ font-weight:600; }
@media (max-width:640px){ .nav .hide-sm{ display:none; } }

/* mobile bottom tab bar for buyers */
.tabbar{ display:none; }
@media (max-width:640px){
  .tabbar{ display:grid; grid-template-columns:repeat(3,1fr); position:fixed; left:0; right:0; bottom:0; z-index:45;
    background:var(--surface); border-top:1px solid var(--line); padding-bottom:env(safe-area-inset-bottom); }
  .tabbar a{ text-decoration:none; text-align:center; padding:10px 4px 12px; font-size:.82rem; font-weight:500; color:var(--mute); }
  .tabbar a svg{ display:block; margin:0 auto 4px; width:22px; height:22px; }
  .tabbar a[aria-current="page"]{ color:var(--ink); }
  body.has-tabbar{ padding-bottom:72px; }
}

/* ---------- status line ---------- */
.status{ border-bottom:1px solid var(--line); background:var(--surface); }
.status__in{ max-width:var(--maxw); margin:0 auto; padding:12px var(--s2); display:flex; justify-content:space-between; align-items:center; gap:var(--s2); flex-wrap:wrap; font-size:.95rem; }
@media (min-width:760px){ .status__in{ padding:12px var(--s5); } }
.status .dot{ display:inline-block; width:9px; height:9px; border-radius:50%; background:var(--mute); margin-right:10px; vertical-align:1px; }
.status[data-state="live"] .dot{ background:var(--good); box-shadow:0 0 0 4px var(--good-soft); }
.status[data-state="paused"] .dot{ background:var(--warn); }
.status[data-state="closed"] .dot{ background:var(--ink); }
.status .clock{ font-weight:600; font-variant-numeric:tabular-nums; }

/* ---------- buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:10px;
  min-height:52px; padding:0 24px; border-radius:var(--r);
  font-size:1rem; font-weight:500; text-decoration:none; line-height:1.2; text-align:center;
  border:1px solid var(--ink); background:var(--surface); color:var(--ink);
  transition:background .15s var(--ease), color .15s var(--ease), border-color .15s;
}
.btn:hover{ background:var(--bg); }
.btn--primary{ background:var(--ink); color:#fff; }
.btn--primary:hover{ background:#000; }
.btn--quiet{ border-color:var(--line-2); }
.btn--block{ width:100%; }
.btn--big{ min-height:60px; font-size:1.1rem; }
.btn--sm{ min-height:40px; padding:0 14px; font-size:.9rem; }
.btn--danger{ color:var(--bad); border-color:var(--bad); }
.btn[disabled]{ opacity:.45; cursor:not-allowed; }

/* ---------- forms ---------- */
.field{ display:block; margin-bottom:var(--s3); }
.field > span{ display:block; font-size:.95rem; font-weight:500; margin-bottom:8px; }
.field small{ display:block; color:var(--mute); font-size:.86rem; margin-top:6px; }
.input{
  width:100%; min-height:52px; padding:12px 14px; font-size:1.05rem;
  background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r); color:var(--ink);
  -webkit-appearance:none; appearance:none;
}
.input:hover{ border-color:#bdb9b2; }
.input:focus{ outline:none; border-color:var(--ink); box-shadow:0 0 0 3px rgba(34,34,34,.08); }
.input[readonly]{ background:var(--bg); color:var(--mute); }
textarea.input{ min-height:120px; resize:vertical; line-height:1.5; }
select.input{ background-image:linear-gradient(45deg,transparent 50%,var(--ink) 50%),linear-gradient(135deg,var(--ink) 50%,transparent 50%); background-position:calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size:5px 5px; background-repeat:no-repeat; padding-right:40px; }
.check{ display:flex; gap:12px; align-items:flex-start; cursor:pointer; font-size:1rem; }
.check input{ width:24px; height:24px; flex:none; accent-color:var(--ink); margin-top:1px; }

/* ---------- notes & messages ---------- */
.note{ border-radius:var(--r); padding:14px 16px; font-size:.98rem; display:flex; gap:12px; align-items:flex-start; border:1px solid var(--line); background:var(--surface); }
.note svg{ flex:none; width:22px; height:22px; margin-top:1px; }
.note b{ font-weight:600; }
.note--good{ background:var(--good-soft); border-color:#cfe2d5; color:#1f4a36; }
.note--warn{ background:var(--warn-soft); border-color:#efdcb8; color:#5e3a00; }
.note--bad{ background:var(--bad-soft); border-color:#ecc9c9; color:#6f1f1f; }
.note--accent{ background:var(--accent-soft); border-color:#ead6cd; color:#6b3a2b; }

.toasts{ position:fixed; left:50%; bottom:24px; transform:translateX(-50%); z-index:200; display:flex; flex-direction:column; gap:10px; width:min(92vw,460px); pointer-events:none; }
@media (max-width:640px){ body.has-tabbar .toasts{ bottom:88px; } body.has-bidbar .toasts{ bottom:172px; } }
.toast{ pointer-events:auto; background:var(--ink); color:#fff; border-radius:var(--r); padding:14px 16px; font-size:.98rem; display:flex; gap:14px; align-items:center; box-shadow:0 6px 24px rgba(0,0,0,.14); animation:toastIn .3s var(--ease); }
.toast b{ display:block; font-weight:600; }
.toast--warn{ background:var(--warn-soft); color:#4d3000; border:1px solid #e6cf9f; }
.toast--good{ background:var(--good-soft); color:#173a2a; border:1px solid #c4dccb; }
.toast--bad{ background:var(--bad-soft); color:#5c1a1a; border:1px solid #e6c2c2; }
.toast a{ margin-left:auto; white-space:nowrap; font-weight:600; color:inherit; }
@keyframes toastIn{ from{ transform:translateY(10px); opacity:0; } }

/* ---------- tags ---------- */
.tag{ display:inline-flex; align-items:center; gap:6px; font-size:.82rem; font-weight:500; padding:4px 10px; border-radius:999px; background:var(--bg); color:var(--ink-2); border:1px solid var(--line); white-space:nowrap; }
.tag::before{ content:""; width:7px; height:7px; border-radius:50%; background:currentColor; opacity:.8; }
.tag--good{ background:var(--good-soft); color:var(--good); border-color:#cfe2d5; }
.tag--warn{ background:var(--warn-soft); color:var(--warn); border-color:#efdcb8; }
.tag--bad{ background:var(--bad-soft); color:var(--bad); border-color:#ecc9c9; }
.tag--ink{ background:var(--ink); color:#fff; border-color:var(--ink); }
.tag--plain::before{ display:none; }

/* ============================================================
   BUYER — ARTWORKS
   ============================================================ */
.intro{ padding:var(--s6) 0 var(--s5); }
.intro .label{ margin-bottom:var(--s2); }
.intro h1{ max-width:14ch; }
.intro p{ font-size:1.1rem; color:var(--ink-2); max-width:56ch; margin-top:var(--s3); }
.intro__actions{ margin-top:var(--s4); display:flex; gap:var(--s2); flex-wrap:wrap; align-items:center; }
@media (max-width:640px){ .intro{ padding:var(--s5) 0 var(--s4); } }

.steps3{ display:grid; grid-template-columns:repeat(3,1fr); gap:var(--s3); border-top:1px solid var(--line); border-bottom:1px solid var(--line); padding:var(--s4) 0; margin-bottom:var(--s5); }
.steps3 div{ font-size:.98rem; color:var(--ink-2); }
.steps3 b{ display:block; font-family:var(--serif); font-weight:400; font-size:1.6rem; color:var(--ink); margin-bottom:4px; }
@media (max-width:760px){ .steps3{ grid-template-columns:1fr; gap:var(--s2); } }

.toolbar{ display:flex; gap:var(--s2); align-items:center; justify-content:space-between; flex-wrap:wrap; margin-bottom:var(--s4); }
.seg{ display:inline-flex; background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r); padding:3px; }
.seg button{ min-height:42px; padding:0 16px; border-radius:4px; font-size:.95rem; font-weight:500; color:var(--ink-2); }
.seg button.on{ background:var(--ink); color:#fff; }
.search{ flex:1 1 240px; max-width:360px; }

.grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:var(--s6) var(--s4); padding-bottom:var(--s7); }
@media (max-width:1000px){ .grid{ grid-template-columns:repeat(2,1fr); gap:var(--s5) var(--s3); } }
@media (max-width:560px){ .grid{ grid-template-columns:1fr; gap:var(--s5); } }
.work{ text-decoration:none; display:flex; flex-direction:column; }
.work__img{ background:#EFEDE8; aspect-ratio:4/5; overflow:hidden; display:flex; align-items:center; justify-content:center; }
.work__img img{ width:100%; height:100%; object-fit:cover; transition:transform .6s var(--ease); }
.work:hover .work__img img{ transform:scale(1.02); }
.work__meta{ padding-top:var(--s2); display:grid; gap:2px; }
.work__lot{ font-size:.86rem; color:var(--mute); display:flex; justify-content:space-between; gap:8px; align-items:center; }
.work__title{ font-family:var(--serif); font-size:1.65rem; line-height:1.1; margin-top:4px; }
.work__artist{ font-size:1rem; color:var(--ink-2); }
.work__price{ display:flex; justify-content:space-between; align-items:baseline; gap:12px; border-top:1px solid var(--line); margin-top:var(--s2); padding-top:12px; }
.work__price .price{ font-size:1.3rem; }
.work__price .small{ color:var(--mute); }
.flash{ animation:flash 1.6s var(--ease); }
@keyframes flash{ 0%,30%{ background:var(--accent-soft); } 100%{ background:transparent; } }
.empty{ grid-column:1/-1; text-align:center; padding:var(--s6) var(--s2); color:var(--mute); border:1px dashed var(--line-2); border-radius:var(--r); }

/* ============================================================
   BUYER — ARTWORK PAGE
   ============================================================ */
.back{ display:inline-flex; align-items:center; gap:8px; text-decoration:none; font-weight:500; padding:var(--s3) 0 var(--s2); color:var(--ink-2); min-height:44px; }
.back:hover{ color:var(--ink); }
.art{ display:grid; grid-template-columns:1fr; gap:var(--s4); padding-bottom:var(--s7); }
@media (min-width:960px){ .art{ grid-template-columns:minmax(0,1.15fr) minmax(380px,.85fr); gap:var(--s6); align-items:start; } }
.art__media{ background:#EFEDE8; }
.art__media img{ width:100%; max-height:82vh; object-fit:contain; margin:0 auto; cursor:zoom-in; }
@media (min-width:960px){ .art__media{ position:sticky; top:104px; } }
@media (max-width:959px){ .art__media img{ max-height:50vh; } .back{ padding-top:var(--s2); } }
.art__zoomhint{ font-size:.86rem; color:var(--mute); margin-top:8px; }
.art__head .label{ margin-bottom:var(--s1); }
.art__title{ font-size:clamp(2.4rem, 6vw, 3.4rem); }
.art__artist{ font-size:1.25rem; margin-top:var(--s1); }
.art__gallery{ color:var(--mute); margin-top:2px; }

.panel{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r); margin:var(--s4) 0; }
.panel__row{ padding:var(--s3); border-bottom:1px solid var(--line); }
.panel__row:last-child{ border-bottom:0; }
.panel__price{ font-size:clamp(2.6rem, 9vw, 3.2rem); margin-top:4px; }
.panel__grid{ display:grid; grid-template-columns:1fr 1fr; gap:var(--s2); }
.panel__grid .v{ font-size:1.25rem; font-weight:500; margin-top:2px; font-variant-numeric:tabular-nums; }
.panel__actions{ display:grid; gap:12px; }

.section-title{ font-family:var(--serif); font-size:1.8rem; margin:var(--s5) 0 var(--s2); }
.history{ list-style:none; border-top:1px solid var(--line); }
.history li{ display:grid; grid-template-columns:1fr auto; gap:4px 16px; padding:14px 0; border-bottom:1px solid var(--line); align-items:baseline; }
.history .who{ font-weight:500; }
.history .when{ font-size:.88rem; color:var(--mute); grid-column:1; }
.history .amt{ font-weight:500; font-size:1.1rem; grid-row:1 / span 2; grid-column:2; align-self:center; font-variant-numeric:tabular-nums; }
.history li.top .who::after{ content:"Highest"; margin-left:10px; font-size:.78rem; font-weight:500; color:var(--good); background:var(--good-soft); padding:2px 8px; border-radius:999px; }
.history li.me .who{ color:var(--accent); }
.more{ margin-top:var(--s2); }

.details{ display:grid; border-top:1px solid var(--line); }
.details div{ display:grid; grid-template-columns:150px 1fr; gap:var(--s2); padding:12px 0; border-bottom:1px solid var(--line); }
.details dt{ color:var(--mute); }
.desc{ margin-top:var(--s3); color:var(--ink-2); white-space:pre-line; max-width:62ch; }

/* sticky phone bid bar */
.bidbar{ position:fixed; left:0; right:0; bottom:0; z-index:44; background:var(--surface); border-top:1px solid var(--line); padding:12px var(--s2) calc(12px + env(safe-area-inset-bottom)); display:grid; grid-template-columns:1fr auto; gap:var(--s2); align-items:center; box-shadow:0 -6px 20px rgba(0,0,0,.05); }
.bidbar .price{ font-size:1.35rem; }
@media (min-width:960px){ .bidbar{ display:none !important; } }
@media (max-width:640px){ body.has-tabbar .bidbar{ bottom:68px; } }

/* ---------- dialog ---------- */
.dialog{ position:fixed; inset:0; z-index:100; display:flex; align-items:flex-end; justify-content:center; background:rgba(25,24,22,.45); animation:fade .2s; }
@media (min-width:640px){ .dialog{ align-items:center; padding:var(--s3); } }
.dialog__panel{ width:100%; max-width:520px; background:var(--surface); border-radius:12px 12px 0 0; padding:var(--s4) var(--s3) calc(var(--s4) + env(safe-area-inset-bottom)); max-height:94vh; overflow:auto; animation:up .28s var(--ease); }
@media (min-width:640px){ .dialog__panel{ border-radius:10px; padding:var(--s5) var(--s4); } }
.dialog__panel.wide{ max-width:820px; }
.dialog__head{ display:flex; justify-content:space-between; gap:var(--s2); align-items:flex-start; margin-bottom:var(--s3); }
.dialog__head h2{ font-family:var(--serif); font-weight:400; font-size:2rem; line-height:1.1; }
.dialog__close{ min-height:44px; min-width:44px; display:inline-flex; align-items:center; justify-content:center; border-radius:var(--r); border:1px solid var(--line-2); flex:none; }
.amount{ display:grid; grid-template-columns:64px 1fr 64px; border:1px solid var(--line-2); border-radius:var(--r); overflow:hidden; margin:8px 0 var(--s2); }
.amount button{ font-size:1.8rem; font-weight:300; background:var(--bg); }
.amount button:disabled{ opacity:.3; }
.amount input{ text-align:center; font-size:1.9rem; font-weight:500; border:0; border-left:1px solid var(--line-2); border-right:1px solid var(--line-2); padding:12px 4px; width:100%; min-width:0; background:var(--surface); }
.amount input:focus{ outline:none; background:#fffdf9; }
.confirm-amount{ font-size:2.6rem; font-weight:500; margin:var(--s1) 0 var(--s2); }
@keyframes fade{ from{ opacity:0; } }
@keyframes up{ from{ transform:translateY(24px); opacity:0; } }

.zoom{ position:fixed; inset:0; z-index:120; background:rgba(250,249,246,.98); display:flex; align-items:center; justify-content:center; cursor:zoom-out; padding:var(--s3); }
.zoom img{ max-width:100%; max-height:100%; object-fit:contain; }
.zoom .btn{ position:fixed; top:16px; right:16px; }

/* ============================================================
   BUYER — JOIN / MY BIDS / HELP
   ============================================================ */
.narrow{ max-width:560px; margin:0 auto; padding:var(--s5) var(--s2) var(--s7); }
.narrow h1{ margin-bottom:var(--s2); }
.narrow .lead{ font-size:1.08rem; color:var(--ink-2); margin-bottom:var(--s4); }
.codebox{ text-align:center; font-size:1.8rem; letter-spacing:.14em; font-weight:500; text-transform:uppercase; min-height:68px; }
.progress{ display:flex; gap:8px; margin-bottom:var(--s4); }
.progress i{ flex:1; height:4px; border-radius:2px; background:var(--line); }
.progress i.on{ background:var(--ink); }
.terms{ border:1px solid var(--line); background:var(--surface); border-radius:var(--r); padding:var(--s3); margin-bottom:var(--s3); }
.terms ul{ margin:8px 0 0 20px; color:var(--ink-2); }
.terms li{ margin:6px 0; }

.idcard{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:var(--s3); display:flex; justify-content:space-between; align-items:flex-end; gap:var(--s2); margin-bottom:var(--s4); }
.idcard .num{ font-family:var(--serif); font-size:4rem; line-height:.9; }
.idcard .name{ font-size:1.15rem; font-weight:500; text-align:right; }

.mylist{ display:grid; gap:var(--s2); }
.myrow{ display:grid; grid-template-columns:88px 1fr; gap:var(--s2); background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:12px; align-items:center; text-decoration:none; }
.myrow img{ width:88px; height:110px; object-fit:cover; background:#EFEDE8; }
.myrow h3{ font-family:var(--serif); font-weight:400; font-size:1.4rem; line-height:1.1; }
.myrow .line{ display:flex; justify-content:space-between; gap:8px; flex-wrap:wrap; align-items:center; margin-top:6px; font-size:.95rem; }
.myrow.lead{ border-color:#cfe2d5; }
.myrow.out{ border-color:#efdcb8; }
.invoice{ grid-column:1/-1; border-top:1px solid var(--line); padding-top:12px; margin-top:4px; font-size:.95rem; }
.invoice div{ display:flex; justify-content:space-between; padding:3px 0; }
.invoice .tot{ font-weight:600; font-size:1.05rem; border-top:1px solid var(--line); margin-top:6px; padding-top:8px; }
.group-title{ font-family:var(--serif); font-size:1.7rem; margin:var(--s5) 0 var(--s2); display:flex; justify-content:space-between; align-items:baseline; }
.group-title span{ font-family:var(--sans); font-size:.9rem; color:var(--mute); }

.faq{ border-top:1px solid var(--line); }
.faq details{ border-bottom:1px solid var(--line); }
.faq summary{ list-style:none; cursor:pointer; padding:var(--s3) 40px var(--s3) 0; font-size:1.12rem; font-weight:500; position:relative; }
.faq summary::-webkit-details-marker{ display:none; }
.faq summary::after{ content:"+"; position:absolute; right:4px; top:50%; transform:translateY(-50%); font-size:1.6rem; font-weight:300; }
.faq details[open] summary::after{ content:"–"; }
.faq p{ padding:0 0 var(--s3); color:var(--ink-2); max-width:62ch; }

.site-foot{ border-top:1px solid var(--line); padding:var(--s4) 0 var(--s5); color:var(--mute); font-size:.9rem; }
.site-foot .wrap{ display:flex; justify-content:space-between; gap:var(--s2); flex-wrap:wrap; }
