@font-face { font-family: 'EB Garamond'; src: url(/fonts/EBGaramond-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'EB Garamond'; src: url(/fonts/EBGaramond-Medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'EB Garamond'; src: url(/fonts/EBGaramond-Italic.woff2) format('woff2'); font-style: italic; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url(/fonts/Outfit-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url(/fonts/Outfit-Medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --purple: #2b0059; --purple-deep: #110826; --gold: #c9a84c; --gold-deep: #8a6a16;
  --cream: #f4f5e6; --paper: #fbfbf5; --ink: #1d1530; --muted: #5f5873; --line: #e3e0d2;
  --edge: #948c74;          /* input / chip borders: 3:1 against white and paper */
  --lav: #efe9f7; --green: #1f8a4c;
  --serif: 'EB Garamond', Garamond, Georgia, serif; --sans: 'Outfit', system-ui, sans-serif;
  --radius: 14px; --shadow: 0 10px 30px rgba(17, 8, 38, .10);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--sans); }
img { max-width: 100%; display: block; }
a { color: var(--purple); }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--purple); margin: 0; }
.eyebrow { color: var(--gold-deep); text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 500; margin: 0 0 8px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--gold); color: var(--purple-deep); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Header ---------- */
.top { position: sticky; top: 0; z-index: 30; background: var(--purple); color: var(--cream); box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 6px 18px rgba(17,8,38,.18); }
.topin { max-width: 1320px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 10px 24px; min-height: 64px; }
.brand { justify-self: start; display: inline-flex; }
.brand img { height: 38px; width: auto; filter: brightness(0) saturate(100%) invert(96%) sepia(8%) saturate(321%) hue-rotate(21deg); }
.pills { display: flex; gap: 4px; background: rgba(255,255,255,.07); padding: 4px; border-radius: 999px; }
.pills a { color: var(--cream); text-decoration: none; padding: 8px 16px; border-radius: 999px; font-size: 14px; letter-spacing: .02em; white-space: nowrap; min-height: 36px; display: inline-flex; align-items: center; }
.pills a:hover { background: rgba(255,255,255,.1); }
.pills a[aria-current="page"] { background: var(--gold); color: var(--purple-deep); font-weight: 500; }
.acct { justify-self: end; display: flex; align-items: center; gap: 10px; }
.btn-top { font: 500 14px var(--sans); color: var(--cream); background: transparent; border: 1px solid rgba(244,245,230,.55); border-radius: 999px; padding: 8px 16px; min-height: 40px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.btn-top:hover { background: rgba(255,255,255,.1); border-color: var(--cream); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--purple-deep); display: grid; place-items: center; font: 500 14px var(--sans); flex: none; }
.who { font-size: 14px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { display: block; color: var(--gold); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.linkbtn { background: none; border: 0; padding: 6px 4px; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; min-height: 40px; }

/* ---------- Buttons, inputs ---------- */
.btn { font: 500 15px var(--sans); border-radius: 999px; padding: 10px 20px; min-height: 44px; border: 1px solid var(--purple); background: var(--purple); color: var(--cream); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { background: #3a0a73; }
.btn.ghost { background: transparent; color: var(--purple); }
.btn.ghost:hover { background: var(--lav); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--purple-deep); }
.btn.gold:hover { background: #d6b75d; }
.btn.wa { background: #1c7c43; border-color: #1c7c43; color: #fff; }
.btn.line { background: #06803a; border-color: #06803a; color: #fff; }
.btn.mini { font-size: 13px; padding: 6px 14px; min-height: 34px; }
.btn[disabled] { opacity: .55; cursor: default; }
.link { justify-self: start; background: none; border: 0; color: var(--purple); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; padding: 6px 0; min-height: 32px; }
label, .flabel { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 500; }
input, select, textarea { font: inherit; padding: 9px 12px; border: 1px solid var(--edge); border-radius: 10px; background: #fff; color: var(--ink); width: 100%; min-width: 0; min-height: 42px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold-deep); }

/* ---------- Page head ---------- */
main { max-width: 1320px; margin: 0 auto; padding: 0 24px 56px; }
.phead { padding: 36px 0 24px; }
.phead h1 { font-size: clamp(34px, 4.6vw, 54px); line-height: 1.05; }
.live { display: inline-flex; align-items: center; gap: 8px; margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(31,138,76,.16); }
@media (prefers-reduced-motion: no-preference) { .dot { animation: pulse 2.4s ease-in-out infinite; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(31,138,76,.05); } }

/* ---------- Layout: sidebar + results ---------- */
.layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; align-items: start; }
.side { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 18px 16px; overscroll-behavior: contain; }
.sidehead { display: none; }
.sidefoot { display: none; }
.scrim { display: none; }
.fgroup { padding: 16px 0; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.fgroup:first-of-type { border-top: 0; }
.fgroup > .flabel { color: var(--purple); }
.range { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--edge); background: #fff; border-radius: 999px; padding: 6px 12px; min-height: 34px; font: 14px var(--sans); cursor: pointer; color: var(--ink); }
.chip:hover { border-color: var(--purple); }
.chip[aria-pressed="true"] { background: var(--purple); color: var(--cream); border-color: var(--purple); }
.chip.extra { display: none; }
.chips.all .chip.extra { display: inline-flex; }
/* Colour / clarity: one joined row (owner asked); scrolls sideways when there are many grades. */
.seg { display: flex; overflow-x: auto; scrollbar-width: thin; border: 1px solid var(--edge); border-radius: 10px; background: #fff; }
.seg button { flex: 1 0 36px; min-width: 36px; min-height: 40px; padding: 0 6px; border: 0; border-left: 1px solid var(--edge); background: transparent; font: 500 14px var(--sans); color: var(--ink); cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button:hover { background: var(--lav); }
.seg button[aria-pressed="true"] { background: var(--purple); color: var(--cream); }
.seg button:focus-visible { outline-offset: -3px; }

/* Results bar */
.rbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.rcount { margin: 0 auto 0 0; font-size: 15px; color: var(--muted); }
.rcount b { color: var(--ink); font-weight: 500; }
.sortbox { display: flex; align-items: center; gap: 8px; }
.sortbox select { width: auto; min-height: 40px; padding: 6px 30px 6px 12px; }
.viewt { display: inline-flex; border: 1px solid var(--edge); border-radius: 10px; overflow: hidden; background: #fff; }
.viewt button { border: 0; background: transparent; padding: 0 14px; min-height: 40px; font: 500 14px var(--sans); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.viewt button + button { border-left: 1px solid var(--edge); }
.viewt button[aria-pressed="true"] { background: var(--purple); color: var(--cream); }
.fbtn { display: none; }
.activef { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.activef:empty { display: none; }
.apill { display: inline-flex; align-items: center; gap: 6px; background: #fbf3dc; border: 1px solid var(--gold); color: var(--purple-deep); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13px; cursor: pointer; min-height: 32px; font-family: var(--sans); }
.apill span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--gold); color: var(--purple-deep); font-size: 13px; line-height: 1; }
.apill:hover { background: #f6e8bd; }

/* ---------- Photo cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 18px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card:hover { border-color: var(--gold); box-shadow: var(--shadow); }
@media (prefers-reduced-motion: no-preference) { .card:hover { transform: translateY(-2px); } }
.ph { position: relative; aspect-ratio: 1; background: radial-gradient(circle at 50% 40%, #fff 0, var(--cream) 75%); display: grid; place-items: center; overflow: hidden; }
.ph img.photo { width: 100%; height: 100%; object-fit: cover; }
.ph .ghostmark { display: grid; justify-items: center; gap: 6px; }
.ph .ghostmark img { width: 38%; opacity: .16; }
.ph .ghostmark em { font-family: var(--serif); font-style: italic; color: var(--gold-deep); font-size: 17px; }
.tag { position: absolute; top: 10px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; padding: 4px 9px; border-radius: 999px; }
.tag.l { left: 10px; background: var(--purple); color: var(--cream); }
.tag.l.nat { background: var(--purple-deep); }
.tag.r { right: 10px; background: rgba(255,255,255,.92); color: var(--purple); border: 1px solid var(--line); }
.tag.feat { left: auto; right: 10px; top: auto; bottom: 10px; background: var(--gold); color: var(--purple-deep); }
.cbody { padding: 14px 16px 16px; display: grid; gap: 8px; flex: 1; align-content: start; }
.card h3 { font-size: 22px; line-height: 1.15; }
.specs-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.sc { font-size: 12px; font-weight: 500; letter-spacing: .03em; padding: 3px 8px; border-radius: 6px; background: var(--cream); color: var(--ink); border: 1px solid var(--line); }
.cprice { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.cprice .pr { font-family: var(--serif); font-size: 24px; color: var(--purple-deep); }
.cprice .pc { font-size: 13px; color: var(--muted); }
.cprice .ask { font-size: 14px; color: var(--muted); }

/* ---------- List view (VDB style) ---------- */
.tablewrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table.lt { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 860px; }
.lt th { position: sticky; top: 0; background: var(--cream); color: var(--purple); text-align: left; font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lt td { padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lt tr.row { cursor: pointer; }
.lt tr.row:hover td { background: #faf7ee; }
.lt tr.row:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.lt .num { text-align: right; font-variant-numeric: tabular-nums; }
.lt .strong { font-weight: 500; color: var(--purple-deep); }
.lt .shp { display: flex; align-items: center; gap: 8px; }
.lt .shp img { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; background: var(--cream); }
.lt .shp .nm { width: 34px; height: 34px; border-radius: 6px; background: var(--cream); display: grid; place-items: center; }
.lt .shp .nm img { width: 20px; height: 20px; opacity: .25; background: none; }

.empty { grid-column: 1 / -1; text-align: center; padding: 56px 16px; background: #fff; border: 1px dashed var(--edge); border-radius: var(--radius); display: grid; gap: 12px; justify-items: center; }
.empty h2 { font-size: 28px; }
.empty p { color: var(--muted); margin: 0; max-width: 420px; }
.more { text-align: center; margin-top: 28px; }
.skel { border-radius: var(--radius); background: linear-gradient(90deg, #f1efe4 0, #f8f7ef 50%, #f1efe4 100%); background-size: 200% 100%; aspect-ratio: 3 / 4; }
@media (prefers-reduced-motion: no-preference) { .skel { animation: sh 1.4s linear infinite; } }
@keyframes sh { to { background-position: -200% 0; } }

/* ---------- Dialogs ---------- */
dialog { border: 0; border-radius: 18px; padding: 0; background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px rgba(17,8,38,.35); }
dialog::backdrop { background: rgba(17, 8, 38, .62); }
.close { position: absolute; right: 12px; top: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); font-size: 26px; line-height: 1; color: var(--purple); cursor: pointer; z-index: 3; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(17,8,38,.12); }
.close:hover { background: #fff; }

#detail { width: min(1040px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
.dwrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.gal { position: sticky; top: 0; align-self: start; padding: 20px; display: grid; gap: 10px; align-content: start; background: #fff; }
.gal .main { aspect-ratio: 1; background: radial-gradient(circle at 50% 40%, #fff 0, var(--cream) 75%); border-radius: 12px; overflow: hidden; display: grid; place-items: center; }
.gal .main img, .gal .main video, .gal .main iframe { width: 100%; height: 100%; object-fit: contain; border: 0; }
.gal .main .ghostmark { display: grid; justify-items: center; gap: 10px; }
.gal .main .ghostmark img { width: 34%; opacity: .16; object-fit: contain; height: auto; }
.gal .main .ghostmark em { font-family: var(--serif); font-style: italic; color: var(--gold-deep); font-size: 24px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs button { width: 64px; height: 64px; padding: 0; border: 1px solid var(--edge); border-radius: 10px; overflow: hidden; background: var(--cream); cursor: pointer; color: var(--purple); font-size: 18px; }
.thumbs button[aria-current="true"] { border: 2px solid var(--gold); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.dinfo { padding: 28px 28px 24px; display: grid; gap: 16px; align-content: start; }
.dinfo h2 { font-size: 36px; line-height: 1.1; padding-right: 40px; }
.pricebox { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pricebox .big { font-family: var(--serif); font-size: 36px; color: var(--purple-deep); line-height: 1; }
.pricebox .pc { color: var(--muted); font-size: 14px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: center; }
.tile b { display: block; font-family: var(--serif); font-weight: 500; font-size: 22px; color: var(--purple); line-height: 1.1; }
.tile span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cert { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--lav); border-radius: 12px; padding: 12px 16px; color: var(--purple); text-decoration: none; }
a.cert:hover { background: #e5dcf3; }
.cert b { font-weight: 500; }
.cert small { display: block; color: var(--muted); font-size: 13px; }
.specs { width: 100%; border-collapse: collapse; font-size: 15px; }
.specs th { text-align: left; color: var(--muted); font-weight: 400; padding: 7px 12px 7px 0; width: 44%; border-bottom: 1px solid var(--line); }
.specs td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.dactions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dactions .btn { padding: 10px 12px; }
.copy { justify-self: start; }

/* Sign-in dialog */
#signin { width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
.sgrid { display: grid; grid-template-columns: 1fr 1.15fr; min-height: 520px; }
.spanel { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--purple) 0, var(--purple-deep) 100%); color: var(--cream); padding: 40px 32px; display: grid; align-content: center; gap: 18px; }
.spanel::after { content: ''; position: absolute; right: -60px; bottom: -40px; width: 300px; height: 300px; background: url(/img/mark.png) center / contain no-repeat; opacity: .09; filter: brightness(0) invert(1); pointer-events: none; }
.spanel h2 { color: var(--cream); font-size: 32px; line-height: 1.15; }
.spanel ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; position: relative; z-index: 1; }
.spanel li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; font-size: 15px; }
.spanel li::before { content: '◆'; color: var(--gold); font-size: 13px; padding-top: 2px; }
.spanel .eyebrow { color: var(--gold); }
.sform { padding: 32px 32px 28px; display: grid; gap: 16px; align-content: start; }
.stabs { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--edge); border-radius: 12px; overflow: hidden; margin-right: 40px; }
.stabs button { border: 0; background: #fff; min-height: 44px; font: 500 15px var(--sans); color: var(--ink); cursor: pointer; }
.stabs button + button { border-left: 1px solid var(--edge); }
.stabs button[aria-selected="true"] { background: var(--purple); color: var(--cream); }
.sform form { display: grid; gap: 12px; }
.fld { display: grid; gap: 5px; }
.fld .opt { text-transform: none; letter-spacing: 0; font-weight: 400; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pw { position: relative; }
.pw input { padding-right: 70px; }
.pw button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--purple); font: 500 13px var(--sans); padding: 8px 10px; min-height: 36px; cursor: pointer; text-decoration: underline; }
.ferr { color: #9b1c1c; font-size: 14px; margin: 0; min-height: 0; }
.ferr:empty { display: none; }
.fnote { color: var(--muted); font-size: 14px; margin: 0; }
input[aria-invalid="true"] { border-color: #9b1c1c; }

/* ---------- Footer ---------- */
.foot { background: var(--purple-deep); color: var(--cream); padding: 36px 24px; font-size: 14px; }
.footin { max-width: 1320px; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.foot img { height: 30px; filter: brightness(0) invert(1); opacity: .85; }
.foot a { color: var(--gold); }
.foot p { margin: 0; }

/* ---------- Home ---------- */
.homehero { text-align: center; padding: 64px 0 40px; }
.homehero h1 { font-size: clamp(40px, 6vw, 72px); line-height: 1.02; }
.homehero .lede { color: var(--muted); max-width: 560px; margin: 16px auto 0; font-size: 17px; }
.doors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.door { position: relative; overflow: hidden; border-radius: 20px; padding: 36px 30px 30px; min-height: 340px; text-decoration: none; color: var(--cream); background: linear-gradient(165deg, #3a0a73 0, var(--purple) 45%, var(--purple-deep) 100%); display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; transition: transform .2s, box-shadow .2s; }
.door:nth-child(2) { background: linear-gradient(165deg, #2b0059 0, #1b0a3c 55%, #0a0418 100%); }
.door:nth-child(3) { background: linear-gradient(165deg, #4a1a6e 0, #2b0059 50%, #110826 100%); }
.door::before { content: ''; position: absolute; right: -50px; top: -30px; width: 260px; height: 260px; background: url(/img/mark.png) center / contain no-repeat; opacity: .12; filter: brightness(0) invert(1); }
.door:hover { box-shadow: 0 20px 50px rgba(17,8,38,.3); }
@media (prefers-reduced-motion: no-preference) { .door:hover { transform: translateY(-3px); } }
.door .eyebrow { color: var(--gold); position: relative; }
.door h2 { color: var(--cream); font-size: 38px; line-height: 1.05; position: relative; }
.door p { margin: 0; color: rgba(244,245,230,.8); position: relative; }
.door .go { position: relative; display: inline-flex; align-items: center; gap: 8px; color: var(--purple-deep); background: var(--gold); border-radius: 999px; padding: 8px 16px; font-weight: 500; font-size: 14px; align-self: flex-start; margin-top: 8px; }
.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 48px 0 0; text-align: center; }
.trust div { padding: 20px; border-top: 1px solid var(--line); }
.trust b { display: block; font-family: var(--serif); font-weight: 500; font-size: 22px; color: var(--purple); }
.trust span { color: var(--muted); font-size: 14px; }

/* ---------- Tablet / drawer ---------- */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .fbtn { display: inline-flex; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(17,8,38,.5); z-index: 40; opacity: 0; visibility: hidden; transition: opacity .2s, visibility 0s .2s; }
  .scrim.on { opacity: 1; visibility: visible; transition: opacity .2s; }
  .side { position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 92vw); max-height: none; z-index: 41; border-radius: 0; border: 0; padding: 0 20px; transform: translateX(100%); visibility: hidden; box-shadow: none; transition: transform .25s ease, visibility 0s .25s; display: flex; flex-direction: column; }
  .side.open { transform: none; visibility: visible; box-shadow: -20px 0 60px rgba(17,8,38,.3); transition: transform .25s ease; }
  .sidehead { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: #fff; padding: 16px 0 12px; z-index: 2; border-bottom: 1px solid var(--line); }
  .sidehead h2 { font-size: 26px; }
  .sidehead .close { position: static; box-shadow: none; background: var(--cream); }
  .sidefoot { display: block; position: sticky; bottom: 0; background: #fff; padding: 12px 0 16px; margin-top: auto; border-top: 1px solid var(--line); }
  .sidefoot .btn { width: 100%; }
  .doors { grid-template-columns: 1fr; }
  .door { min-height: 220px; }
  .trust { grid-template-columns: 1fr; gap: 0; }
  .dwrap { grid-template-columns: 1fr; }
  .gal { position: static; }
}

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  .topin { grid-template-columns: 1fr auto; padding: 8px 14px 10px; gap: 8px 10px; }
  .brand img { height: 30px; }
  .pills { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; overflow-x: auto; }
  .pills a { padding: 8px 12px; font-size: 13px; min-height: 40px; flex: 1; justify-content: center; }
  .who { display: none; }
  main { padding: 0 14px 40px; }
  .phead { padding: 22px 0 16px; }
  .phead h1 { font-size: 32px; }
  .rbar { gap: 8px; }
  .rcount { width: 100%; order: -1; }
  .sortbox label { display: none; }
  .sortbox { flex: 1; min-width: 0; }
  .sortbox select { width: 100%; }
  .fbtn { padding: 8px 14px; }
  .viewt button { padding: 0 12px; min-width: 44px; justify-content: center; }
  .viewt .vt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cbody { padding: 10px 10px 12px; gap: 6px; }
  .card h3 { font-size: 18px; }
  .sc { font-size: 11px; padding: 2px 6px; }
  .cprice { flex-direction: column; align-items: flex-start; gap: 0; }
  .cprice .pr { font-size: 20px; }
  .tag { font-size: 10px; padding: 3px 7px; top: 8px; }
  .tag.l { left: 8px; } .tag.r { right: 8px; }
  #detail { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  #detail .gal { padding: 0; }
  #detail .gal .main { aspect-ratio: 4 / 3; border-radius: 0; }
  #detail .thumbs { padding: 0 14px; }
  .dinfo { padding: 18px 16px 0; gap: 14px; }
  .dinfo h2 { font-size: 30px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .dactions { position: sticky; bottom: 0; background: var(--paper); padding: 10px 0 14px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; border-top: 1px solid var(--line); z-index: 2; }
  #signin { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .sgrid { grid-template-columns: 1fr; min-height: 0; }
  .spanel { padding: 24px 20px; gap: 10px; }
  .spanel h2 { font-size: 24px; }
  .spanel ul { display: none; }
  .sform { padding: 20px 16px 28px; }
  .two { grid-template-columns: 1fr; }
  .homehero { padding: 36px 0 24px; }
  .foot { padding: 28px 16px; }
}
