:root {
    --rose: #a8595a;
    --rose-deep: #8a4546;
    --line: #d9a7a4;
    --border: #e3bfbc;
    --soft: #eed7d4;
    --cream: #fdf8f5;
    --blush: #f7eae7;
    --mute: #a87f7d;
    --label: #b3716f;
    --ink: #6b4a4a;
    --body: #8a6060;
    --green: #66785a;
    --green-bg: #e8ede2;
    --amber: #9a6a2f;
    --amber-bg: #f6ead6;
    --serif: 'Marcellus', Georgia, serif;
    --sans: 'Jost', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--blush); color: var(--ink); font: 300 15px/1.6 var(--sans); }
h1, h2, h3, p, ul { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; color: var(--rose); line-height: 1.2; }
h1:focus { outline: none; }
a { color: var(--rose); text-decoration: none; }
a:hover { color: var(--rose-deep); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button[disabled] { cursor: default; }
input, select, textarea { font: inherit; color: var(--ink); }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
img, svg { max-width: 100%; }

/* ---------- shared pieces ---------- */
.label { font: 400 11px/1.2 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--label); }
.muted { color: var(--mute); }
.small { font-size: 13px; }
.rose { color: var(--rose); }
.green { color: var(--green); }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.between { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.mt { margin-top: 24px; }
.mt-s { margin-top: 12px; }
.mt-l { margin-top: 40px; }

.card { background: var(--cream); border: 1px solid var(--border); border-radius: 8px; padding: 22px; }
.card h2 { font-size: 20px; }
.card.empty { text-align: center; padding: 56px 20px; }
.card.empty p { margin: 8px 0 18px; }
.card.empty p:last-child { margin-bottom: 0; }

.btn { display: inline-block; padding: 15px 28px; background: var(--rose); color: var(--cream); border: 1px solid var(--rose); border-radius: 999px; font: 400 12.5px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; text-align: center; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--rose-deep); border-color: var(--rose-deep); color: var(--cream); }
.btn.outline { background: transparent; color: var(--rose); border-color: var(--line); }
.btn.outline:hover { background: var(--cream); color: var(--rose-deep); }
.btn.ghost { background: transparent; color: var(--mute); border-color: var(--soft); }
.btn.ghost:hover { color: var(--rose); border-color: var(--line); }
.btn.sm { padding: 11px 18px; font-size: 11.5px; letter-spacing: .12em; }
.btn[disabled] { opacity: .5; cursor: default; }

.pill { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--soft); background: transparent; color: var(--body); font: 400 13px/1 var(--sans); white-space: nowrap; }
.pill:hover { border-color: var(--line); }
.pill.cream { background: var(--cream); }
.pill.on { background: var(--rose); border-color: var(--rose); color: var(--cream); }
.pill .count { margin-left: 8px; opacity: .7; }

.tag { display: inline-block; padding: 5px 10px; border-radius: 999px; font: 400 11px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; background: var(--blush); color: var(--mute); white-space: nowrap; }
.tag.active { background: var(--green-bg); color: var(--green); }
.tag.archived { background: transparent; border: 1px solid var(--soft); }
.tag.low { background: var(--amber-bg); color: var(--amber); }
.tag.out { background: var(--rose); color: var(--cream); }

.thumb { width: 46px; height: 58px; flex: none; border-radius: 4px; background: var(--blush); border: 1px solid var(--soft); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.thumb.sm { width: 36px; height: 44px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.note { padding: 12px 16px; border-radius: 6px; background: var(--green-bg); color: var(--green); font-weight: 400; margin-bottom: 16px; }
.problems { padding: 14px 18px; border-radius: 6px; background: var(--cream); border: 1px solid var(--rose); color: var(--rose-deep); font-weight: 400; margin-bottom: 16px; }
.problems ul { padding-left: 20px; margin-top: 6px; font-weight: 300; }
.error { color: var(--rose-deep); font-weight: 400; margin-top: 10px; }

/* ---------- admin frame ---------- */
.brand { display: flex; align-items: center; gap: 11px; }
.brand-name { display: block; font: 400 12px/1.2 var(--serif); letter-spacing: .22em; color: var(--rose); }
.brand-sub { display: block; font: 300 10px/1.4 var(--sans); letter-spacing: .18em; color: var(--label); margin-top: 3px; }
.admin { min-height: 100vh; display: flex; background: var(--blush); font-size: 14px; }
.side { width: 230px; flex: none; background: var(--cream); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 26px 0; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 0 22px 24px; border-bottom: 1px solid var(--soft); }
.side-nav { padding: 18px 12px 0; display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 6px; border-left: 2px solid transparent; color: var(--body); font: 300 14px/1 var(--sans); white-space: nowrap; }
.side-nav a::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--border); }
.side-nav a:hover { background: var(--blush); }
.side-nav a.active { background: var(--blush); border-left-color: var(--rose); color: var(--rose); font-weight: 500; }
.side-nav a.active::before { background: var(--rose); }
.side-foot { margin-top: auto; padding: 20px 22px 0; border-top: 1px solid var(--soft); }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-top { min-height: 72px; background: var(--cream); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; padding: 12px 30px; flex-wrap: wrap; position: sticky; top: 0; z-index: 5; }
.admin-top h1 { font-size: 24px; }
.admin-sub { font-size: 13px; color: var(--mute); }
.admin-body { padding: 24px 30px 56px; }
.admin-body > h2 { font-size: 20px; }
.search { display: flex; align-items: center; gap: 9px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 999px; width: 280px; background: var(--blush); }
.search:focus-within { border-color: var(--rose); }
.search input { flex: 1; min-width: 0; border: 0; background: none; font-size: 13.5px; outline: none; }
.search input::placeholder { color: var(--mute); }
.filters { margin-bottom: 16px; gap: 8px; }
.reason { display: flex; align-items: center; gap: 10px; }
.reason select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--cream); font-size: 13.5px; }

/* ---------- tables ---------- */
.table { background: var(--cream); border: 1px solid var(--border); border-radius: 8px; overflow-x: auto; }
.table .tr { display: grid; gap: 16px; padding: 12px 20px; align-items: center; border-bottom: 1px solid var(--soft); min-width: 860px; color: var(--ink); }
.table .tr:last-child { border-bottom: 0; }
.table a.tr:hover { background: var(--blush); color: var(--ink); }
.table .th { background: var(--blush); border-bottom: 1px solid var(--border); padding: 13px 20px; }
.table .th > * { font: 400 11px/1 var(--sans); letter-spacing: .2em; color: var(--label); text-transform: uppercase; }
.tr.prod { grid-template-columns: 2.2fr .8fr .8fr 2fr .6fr .7fr; }
.tr.stock { grid-template-columns: 2.2fr .9fr .6fr 1.2fr .6fr 150px; min-width: 860px; }
.tr.move { grid-template-columns: .8fr 2fr .7fr .6fr .5fr 1.2fr; min-width: 720px; padding: 11px 20px; }
.name { display: block; font: 400 14.5px/1.35 var(--sans); color: var(--ink); }
.flag { margin-left: 6px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 9px; border: 1px solid var(--soft); border-radius: 5px; font: 300 12.5px/1.2 var(--sans); color: var(--body); white-space: nowrap; }
.chip b { font-weight: 500; color: var(--ink); margin-left: 3px; }
.chip.low { background: var(--amber-bg); border-color: transparent; color: var(--amber); }
.chip.low b { color: var(--amber); }
.chip.out { border-style: dashed; color: var(--mute); }
.chip.out b { color: var(--rose); }
.counter { display: flex; align-items: center; gap: 6px; }
.counter button { width: 32px; height: 32px; flex: none; border-radius: 50%; border: 1px solid var(--line); color: var(--rose); font-size: 17px; line-height: 1; background: var(--cream); }
.counter button:hover:not([disabled]) { background: var(--blush); }
.counter button[disabled] { opacity: .4; }
.counter input { width: 62px; padding: 7px 6px; text-align: center; border: 1px solid var(--border); border-radius: 5px; background: var(--cream); font: 400 15px/1.2 var(--sans); }
.counter input:focus { border-color: var(--rose); outline: none; }

/* ---------- product editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
.field { display: block; }
.field input, .field select, .field textarea { display: block; width: 100%; margin-top: 8px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 5px; background: #fff; font-size: 14.5px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--rose); outline: none; }
.field input::placeholder, .field textarea::placeholder, .sizes-row input::placeholder { color: #c9aeab; }
.field textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.sizes-row { display: grid; grid-template-columns: minmax(76px, 1fr) minmax(0, 1.2fr) minmax(88px, 1fr) 72px 32px; gap: 8px; align-items: center; padding: 5px 0; }
.sizes-row.head { padding-bottom: 2px; }
.sizes-row.head .label { white-space: nowrap; }
.sizes-row input { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--border); border-radius: 5px; background: #fff; font-size: 14.5px; }
.sizes-row input:focus { border-color: var(--rose); outline: none; }
.x { width: 32px; height: 32px; border-radius: 50%; color: var(--mute); font-size: 20px; line-height: 1; }
.x:hover { background: var(--blush); color: var(--rose); }
.status-pick { display: flex; flex-direction: column; gap: 8px; }
.status-pick button { text-align: left; padding: 11px 14px; border: 1px solid var(--soft); border-radius: 6px; background: #fff; }
.status-pick button:hover { border-color: var(--line); }
.status-pick button.on { border-color: var(--rose); background: var(--blush); }
.status-pick b { display: block; font: 400 14.5px/1.3 var(--sans); color: var(--ink); }
.status-pick button.on b { color: var(--rose); }
.status-pick small { font-size: 12.5px; color: var(--mute); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
.photo { position: relative; border-radius: 6px; overflow: hidden; border: 1px solid var(--soft); background: var(--blush); }
.photo img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.photo .cover { position: absolute; top: 6px; left: 6px; padding: 4px 8px; border-radius: 999px; background: var(--rose); color: var(--cream); font: 400 10px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.photo-acts { display: flex; justify-content: space-between; gap: 6px; padding: 7px 8px; background: var(--cream); font-size: 12px; }
.photo-acts button { color: var(--rose); }
.photo-acts button:last-child { color: var(--mute); margin-left: auto; }
.photo-acts button:hover { text-decoration: underline; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 14px; border: 1px dashed var(--line); border-radius: 6px; text-align: center; cursor: pointer; position: relative; }
.drop:hover, .drop:focus-within { background: var(--blush); border-color: var(--rose); }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop span { font: 400 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--rose); }
.drop small { font-size: 12.5px; color: var(--mute); }

/* ---------- categories ---------- */
.mt-xs { margin-top: 7px; }
.link { color: var(--rose); }
.link:hover { color: var(--rose-deep); text-decoration: underline; }
.act { font: 400 11.5px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--rose); white-space: nowrap; }
.act:hover:not([disabled]) { color: var(--rose-deep); }
.act[disabled] { opacity: .35; }
.act.muted { color: var(--mute); }
.acts { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.inline-input { width: 100%; padding: 8px 11px; border: 1px solid var(--border); border-radius: 5px; background: #fff; font-size: 14.5px; }
.inline-input:focus { border-color: var(--rose); outline: none; }
.inline-add { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.inline-add .inline-input { flex: 1; min-width: 0; }
.cats { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 16px; align-items: start; }
.cats > * { min-width: 0; }   /* let the table scroll inside its column instead of widening the page */
.tr.cat { grid-template-columns: 68px minmax(0, 1.6fr) minmax(0, .9fr) 190px; min-width: 560px; }
.tr.cat .name { display: inline; margin-right: 8px; }
.order { display: flex; gap: 4px; }
.order button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--soft); color: var(--rose); background: var(--cream); line-height: 1; }
.order button:hover:not([disabled]) { background: var(--blush); border-color: var(--line); }
.order button[disabled] { opacity: .35; }
.variant { margin-top: 16px; padding: 16px; border: 1px solid var(--soft); border-radius: 8px; background: #fffdfc; }
.variant-head { display: grid; grid-template-columns: 1.4fr 1fr 32px; gap: 12px; align-items: end; }
.variant-head .x { margin-bottom: 6px; }
.variant-photos { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--soft); }
.variant-photos .label { display: block; margin-bottom: 9px; }
.photos.sm { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.photos.sm .photo-acts { font-size: 11px; padding: 5px 6px; }
.drop.sm { flex-direction: row; justify-content: center; padding: 12px; }
/* ---------- sign-in ---------- */
.account { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 40px 16px; }
.account-card { width: 100%; max-width: 420px; padding: 30px 28px; }
.account-card h1 { font-size: 28px; margin-bottom: 6px; }
.account-card .btn { width: 100%; }
.signout { display: inline; }
.signout .link { font-size: 12.5px; }
.who { font: 400 13.5px/1.3 var(--sans); color: var(--ink); }
.role-line { font-size: 12px; color: var(--mute); }
.side-foot .row { gap: 10px; align-items: flex-start; }
.side-foot .links { display: flex; gap: 12px; margin-top: 4px; font-size: 12.5px; }
.tr.staff { grid-template-columns: minmax(0, 2fr) 120px 110px minmax(0, 1.6fr); min-width: 640px; }
.tr.staff.off { opacity: .55; }
.tr.staff .acts .inline-input { max-width: 150px; }
.inline-select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 5px; background: #fff; font-size: 13.5px; }
.narrow-card { max-width: 480px; }
.stack > .btn.sm { align-self: flex-start; }
.side-foot .avatar { width: 32px; height: 32px; font-size: 11.5px; }
.side-foot .shop-link { display: block; margin-top: 14px; }

/* ---------- activity log ---------- */
.note-bar { padding: 12px 16px; margin-bottom: 16px; border-radius: 6px; background: var(--cream); border: 1px solid var(--border); }
.note-bar a { margin-left: 6px; }
.log-day { font-size: 17px; margin: 24px 0 10px; }
.log-day:first-of-type { margin-top: 4px; }
.log.card { padding: 0; }
.log-entry { display: flex; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--soft); }
.log-entry:last-child { border-bottom: 0; }
.log-time { width: 64px; flex: none; padding-top: 3px; font-size: 12.5px; color: var(--mute); white-space: nowrap; }
.log-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.log-head b { font-weight: 500; color: var(--ink); }
.name-inline { color: var(--ink); }
.avatar { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--blush); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font: 400 10.5px/1 var(--sans); color: var(--rose); }
.log-changes { list-style: none; padding: 0; margin-top: 8px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.log-changes li { padding-left: 34px; color: var(--body); overflow-wrap: anywhere; }
.log-changes .what { color: var(--ink); font-weight: 400; margin-right: 6px; }
.log-changes .delta { margin-left: 6px; font-weight: 500; }
.log-changes details summary { cursor: pointer; }
.log-changes .long { margin-top: 6px; padding: 9px 12px; border-radius: 5px; background: var(--blush); white-space: pre-wrap; }
.log-changes .long .label { display: block; margin-bottom: 4px; }
.log-changes .long.after { background: var(--green-bg); }

fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.field legend { padding: 0; }
.chips-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.pill.dashed { border-style: dashed; border-color: var(--line); color: var(--rose); }


.plain { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.plain-card { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; max-width: 420px; }
.plain-card h1 { font-size: 30px; }

/* ---------- orders (admin) ---------- */
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--rose); color: var(--cream); font: 500 11px/20px var(--sans); text-align: center; }
.tr.ord { grid-template-columns: 1fr 1.6fr .5fr .8fr .8fr 1fr; min-width: 760px; }
.order-lines { display: flex; flex-direction: column; gap: 10px; }
.order-line { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--soft); }
.order-line .name { display: block; }
.order-history { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; margin-bottom: 12px; }
.cancel-box { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--soft); }
.pre { white-space: pre-wrap; }
.sum-line { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 14px; }
.sum-line.total { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--soft); font-weight: 500; color: var(--ink); font-size: 15.5px; }
.sum-lines .sum-line { color: var(--body); }

/* ---------- shop front ---------- */
.shop { min-height: 100vh; display: flex; flex-direction: column; background: var(--cream); }
.shop-in { width: 100%; max-width: 1180px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--rose); color: var(--cream); padding: 8px 14px; border-radius: 6px; z-index: 50; }
.skip:focus { left: 12px; }
.shop-top { background: var(--cream); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.shop-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 10px; }
.shop-top .brand-name { font-size: 15px; }
.logo { border-radius: 50%; object-fit: cover; background: var(--blush); }
.bag-link { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--rose); font: 400 13.5px/1 var(--sans); }
.bag-link:hover { background: var(--blush); }
.bag-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--rose); color: var(--cream); font: 500 11.5px/20px var(--sans); text-align: center; }
.shop-nav { display: flex; gap: 26px; overflow-x: auto; padding-top: 4px; padding-bottom: 0; scrollbar-width: none; }
.shop-nav a { padding: 8px 0 12px; border-bottom: 2px solid transparent; color: var(--body); font: 400 14px/1.2 var(--sans); white-space: nowrap; }
.shop-nav a:hover { color: var(--rose); }
.shop-nav a.active { color: var(--rose); border-bottom-color: var(--rose); }
.shop-main { flex: 1; }
.shop-foot { background: var(--blush); border-top: 1px solid var(--border); padding: 34px 0 40px; margin-top: 56px; }
.foot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.section { padding-top: 36px; }
.section h1 { font-size: 34px; }
.section h2 { font-size: 24px; }
.narrow-shop { max-width: 760px; }

.hero { background: var(--blush); border-bottom: 1px solid var(--border); }
.hero-in { display: grid; grid-template-columns: 1.3fr 1fr; align-items: center; gap: 40px; padding-top: 56px; padding-bottom: 56px; }
.hero h1 { font-size: 48px; line-height: 1.1; margin-top: 10px; }
.lead { font-size: 17px; color: var(--body); margin: 16px 0 26px; max-width: 460px; }
.hero-logo { width: 100%; max-width: 340px; justify-self: center; border-radius: 50%; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin-top: 16px; }
.tile { display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.tile-photo { aspect-ratio: 1; border-radius: 10px; background: var(--blush); border: 1px solid var(--soft); overflow: hidden; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.tile-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.tile:hover img { transform: scale(1.04); }
.tile-name { font: 400 18px/1.2 var(--serif); color: var(--rose); }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 28px 20px; }
.pcard { display: flex; flex-direction: column; gap: 3px; color: var(--ink); }
.pcard:hover { color: var(--ink); }
.pcard-photo { position: relative; aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; background: var(--blush); border: 1px solid var(--soft); display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.pcard-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.pcard:hover .pcard-photo img { transform: scale(1.03); }
.pcard-tag { position: absolute; left: 10px; top: 10px; padding: 5px 10px; border-radius: 999px; background: var(--cream); color: var(--rose); font: 400 11px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.pcard-name { font: 400 15.5px/1.35 var(--sans); }
.pcard-price { color: var(--rose); font-weight: 400; }
.pcard-more { font-size: 12.5px; color: var(--mute); }

.browse-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sort { display: flex; align-items: center; gap: 10px; }
.sort select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--cream); font-size: 13.5px; }

.product { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 44px; align-items: start; }
.gallery { position: sticky; top: 130px; }
.gallery-main { aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; background: var(--blush); border: 1px solid var(--soft); display: flex; align-items: center; justify-content: center; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.gallery-thumbs button { width: 68px; aspect-ratio: 4 / 5; border-radius: 6px; overflow: hidden; border: 2px solid transparent; padding: 0; }
.gallery-thumbs button.on { border-color: var(--rose); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.buy h1 { font-size: 36px; margin-top: 6px; }
.price { font: 400 22px/1.3 var(--sans); color: var(--rose); margin-top: 8px; }
.pick { border: 0; padding: 0; margin: 24px 0 0; min-width: 0; }
.pick legend { padding: 0; margin-bottom: 10px; }
.pick .chosen { color: var(--ink); letter-spacing: .06em; }
.pick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.vchip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border: 1px solid var(--border); border-radius: 999px; background: #fff; font-size: 14px; color: var(--ink); }
.vchip img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.vchip:not(:has(img)) { padding-left: 14px; }
.vchip.on { border-color: var(--rose); box-shadow: 0 0 0 1px var(--rose); }
.vchip.gone { color: var(--mute); }
.schip { min-width: 52px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 6px; background: #fff; font-size: 14px; color: var(--ink); }
.schip:hover:not([disabled]) { border-color: var(--line); }
.schip.on { border-color: var(--rose); background: var(--rose); color: var(--cream); }
.schip[disabled] { color: #c9aeab; text-decoration: line-through; background: transparent; }
.addrow { display: flex; gap: 12px; align-items: stretch; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty button { width: 42px; height: 46px; color: var(--rose); font-size: 18px; }
.qty button:hover:not([disabled]) { background: var(--blush); }
.qty button[disabled] { opacity: .35; }
.qty span { min-width: 28px; text-align: center; font-weight: 400; }
.qty.sm button { width: 32px; height: 32px; font-size: 16px; }
.soldout { padding: 14px 16px; border-radius: 6px; background: var(--blush); color: var(--rose-deep); font-weight: 400; }
.desc { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--soft); white-space: pre-wrap; color: var(--body); line-height: 1.75; }
.note a { margin-left: 6px; }

.empty-bag { margin-top: 28px; padding: 40px 20px; text-align: center; border: 1px dashed var(--line); border-radius: 10px; }
.empty-bag .btn { margin-top: 14px; }
.bag-lines { display: flex; flex-direction: column; }
.bag-line { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--soft); }
.bag-photo { width: 84px; flex: none; aspect-ratio: 4 / 5; border-radius: 6px; overflow: hidden; background: var(--blush); display: flex; align-items: center; justify-content: center; }
.bag-photo img { width: 100%; height: 100%; object-fit: cover; }
.bag-name { font: 400 16px/1.35 var(--sans); color: var(--ink); }
.bag-problem { font-weight: 500; margin-top: 2px; }
.bag-actions { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.bag-total { font-weight: 400; color: var(--ink); white-space: nowrap; }
.bag-sum b { color: var(--ink); font-weight: 500; }
.btn.block { display: block; width: 100%; }
.btn.disabled { opacity: .45; pointer-events: none; }

.checkout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
.checkout .field input, .checkout .field textarea { background: #fff; }
.checkout fieldset.field { border: 0; padding: 0; margin: 0; }
.ship-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ship-pick button { text-align: left; padding: 12px 14px; border: 1px solid var(--soft); border-radius: 6px; background: #fff; }
.ship-pick button.on { border-color: var(--rose); background: var(--blush); }
.ship-pick b { display: block; font: 400 15px/1.3 var(--sans); color: var(--ink); }
.ship-pick small { font-size: 12.5px; color: var(--mute); }
.status-line b { color: var(--rose); font-weight: 500; }
.test-pay { border: 2px dashed var(--amber); }
.test-flag { display: inline-block; margin-bottom: 12px; padding: 6px 12px; border-radius: 999px; background: var(--amber-bg); color: var(--amber); font: 500 12px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; }

.top-links { display: flex; align-items: center; gap: 10px; }
.account-link { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; color: var(--body); font: 400 13.5px/1 var(--sans); border-radius: 999px; }
.account-link:hover { color: var(--rose); background: var(--blush); }
.my-card { max-width: 440px; margin: 0 auto; padding: 30px 28px; }
.my-card h1 { font-size: 30px; }
.social { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.social-or { display: flex; align-items: center; gap: 12px; color: var(--mute); font-size: 12.5px; }
.social-or::before, .social-or::after { content: ""; flex: 1; height: 1px; background: var(--soft); }
.social-btn { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--ink); font: 400 14px/1 var(--sans); }
.social-btn[disabled] { opacity: .55; cursor: not-allowed; }
.social-note { text-align: center; }
.my-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.my-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
.my-orders { display: flex; flex-direction: column; gap: 12px; }
.my-order { display: block; color: var(--ink); padding: 16px 18px; }
.my-order:hover { border-color: var(--line); color: var(--ink); }
.my-order b { font-weight: 500; }
.my-order-lines { color: var(--body); margin-top: 4px; }
.status-pill { padding: 4px 10px; border-radius: 999px; background: var(--blush); color: var(--rose); font-size: 12px; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--body); }
.check input { width: 17px; height: 17px; accent-color: var(--rose); }

@media (max-width: 900px) {
    .hero-in, .product, .checkout, .my-grid { grid-template-columns: 1fr; }
    .hero-in { gap: 20px; padding-top: 32px; padding-bottom: 36px; }
    .hero-logo { max-width: 180px; order: -1; }
    .hero h1 { font-size: 36px; }
    .gallery { position: static; }
    .product { gap: 24px; }
}
@media (max-width: 560px) {
    .shop-in { padding-left: 16px; padding-right: 16px; }
    .shop-top .brand-sub, .bag-link > span:not(.bag-count), .account-link span { display: none; }
    .pgrid { grid-template-columns: 1fr 1fr; gap: 22px 12px; }
    .foot-grid, .ship-pick { grid-template-columns: 1fr; }
    .section h1, .buy h1 { font-size: 28px; }
    .bag-photo { width: 66px; }
}

#blazor-error-ui { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; padding: 12px 20px; background: var(--rose); color: var(--cream); }
#blazor-error-ui a { color: var(--cream); text-decoration: underline; margin-left: 12px; cursor: pointer; }
#blazor-error-ui .dismiss { float: right; text-decoration: none; }

/* ---------- dropdowns ----------
   The browser's own arrow sits flush against the edge of rounded boxes, so draw one with room around it. */
select, .field select, .sort select, .reason select, .inline-select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%23a8595a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px 8px;
    padding-right: 42px;
    cursor: pointer;
}
.inline-select { background-position: right 10px center; padding-right: 30px; }
select:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) {
    .cats { grid-template-columns: 1fr; }
    .cats > .card { order: -1; }
}
@media (max-width: 1000px) {
    .editor { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .admin { flex-direction: column; }
    .side { width: auto; height: auto; position: static; padding: 14px 0 0; border-right: 0; border-bottom: 1px solid var(--border); }
    .side .brand { padding: 0 16px 12px; }
    .side-nav { flex-direction: row; padding: 8px 10px; overflow-x: auto; }
    .side-foot { display: none; }
    .admin-top { padding: 12px 16px; position: static; }
    .admin-top .search { width: 100%; order: 3; }
    .admin-body { padding: 16px 16px 40px; }
    .form-grid { grid-template-columns: 1fr; }
    .sizes-row { grid-template-columns: minmax(72px, 1fr) minmax(0, 1fr) minmax(80px, 1fr) 64px 32px; gap: 6px; }
    .variant-head { grid-template-columns: 1fr 1fr 32px; }
}

/* Phone rules last, so they override the wider-screen rules above. */
/* ---------- narrow tables: when a table has too little room, each row becomes a small card ---------- */
.table { container-type: inline-size; }
@container (max-width: 600px) {
    .tr.cat, .tr.staff { min-width: 0; padding: 14px 16px; gap: 8px 12px; }
    .tr.th.cat, .tr.th.staff { display: none; }
    .tr.cat { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "order name" "order count" "acts acts"; }
    .tr.cat > :nth-child(1) { grid-area: order; align-self: start; }
    .tr.cat > :nth-child(2) { grid-area: name; }
    .tr.cat > :nth-child(3) { grid-area: count; }
    .tr.cat > :nth-child(4) { grid-area: acts; }
    .tr.cat .order { flex-direction: column; }
    .tr.staff { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who role" "seen seen" "acts acts"; }
    .tr.staff > :nth-child(1) { grid-area: who; }
    .tr.staff > :nth-child(2) { grid-area: role; }
    .tr.staff > :nth-child(3) { grid-area: seen; }
    .tr.staff > :nth-child(4) { grid-area: acts; }
    .acts { justify-content: flex-start; flex-wrap: wrap; gap: 14px; }
    .tr.staff .acts .inline-input { max-width: none; flex: 1 1 100%; }
}

.unit { display: none; }   /* "pieces", "items": only needed when table headers are hidden */

/* ---------- the rest of the admin on phones ---------- */
@media (max-width: 640px) {

    /* Page title on its own line, buttons underneath. */
    .admin-top { gap: 10px; }
    .admin-top > .grow { flex: 1 1 100%; }
    .admin-top h1 { font-size: 22px; }

    /* Product editor: each size on two lines (size, stock, remove / SKU, price). */
    .sizes-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px; gap: 6px 8px;
        grid-template-areas: "size stock x" "sku price ."; padding: 8px 0; border-bottom: 1px dashed var(--soft); }
    .sizes-row.head { border-bottom: 0; padding-bottom: 0; }
    .sizes-row > :nth-child(1) { grid-area: size; }
    .sizes-row > :nth-child(2) { grid-area: sku; }
    .sizes-row > :nth-child(3) { grid-area: price; }
    .sizes-row > :nth-child(4) { grid-area: stock; }
    .sizes-row > :nth-child(5) { grid-area: x; }
    .variant { padding: 12px; }
    .variant-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px; gap: 8px; }

    /* Order detail lines wrap instead of squeezing. */
    .order-line { flex-wrap: wrap; }
    .order-line .grow { flex: 1 1 60%; }

    /* Activity log: time above each entry, changes not indented. */
    .log-entry { flex-direction: column; gap: 4px; padding: 12px 16px; }
    .log-time { width: auto; padding-top: 0; }
    .log-changes li { padding-left: 0; }

    .filters { gap: 6px; }
    .reason { flex-wrap: wrap; }
    .card { padding: 18px 16px; }
}

/* Product, stock and order tables turn into cards once the table itself is narrower than its columns need. */
@container (max-width: 760px) {
    /* Tables become cards: headers hidden, each row laid out in a small grid. */
    .table .tr { min-width: 0; }
    .tr.th.prod, .tr.th.stock, .tr.th.ord { display: none; }

    .tr.prod { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 16px;
        grid-template-areas: "item item" "price status" "sizes sizes" "pieces updated"; }
    .tr.prod > :nth-child(1) { grid-area: item; }
    .tr.prod > :nth-child(2) { grid-area: status; justify-self: end; }
    .tr.prod > :nth-child(3) { grid-area: price; }
    .tr.prod > :nth-child(4) { grid-area: sizes; }
    .tr.prod > :nth-child(5) { grid-area: pieces; font-size: 13px; }
    .tr.prod > :nth-child(6) { grid-area: updated; justify-self: end; }

    .tr.stock { grid-template-columns: auto auto minmax(0, 1fr); gap: 8px 12px; padding: 14px 16px;
        grid-template-areas: "item item item" "variant size level" "sku sku count"; }
    .tr.stock > :nth-child(1) { grid-area: item; }
    .tr.stock > :nth-child(2) { grid-area: variant; }
    .tr.stock > :nth-child(3) { grid-area: size; font-weight: 400; }
    .tr.stock > :nth-child(4) { grid-area: sku; align-self: center; }
    .tr.stock > :nth-child(5) { grid-area: level; justify-self: end; }
    .tr.stock > :nth-child(6) { grid-area: count; justify-self: end; }

    .tr.ord { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 16px;
        grid-template-areas: "number status" "who total" "items getting"; }
    .tr.ord > :nth-child(1) { grid-area: number; }
    .tr.ord > :nth-child(2) { grid-area: who; }
    .tr.ord > :nth-child(3) { grid-area: items; font-size: 13px; }
    .tr.ord > :nth-child(4) { grid-area: total; justify-self: end; }
    .tr.ord > :nth-child(5) { grid-area: getting; justify-self: end; }
    .tr.ord > :nth-child(6) { grid-area: status; justify-self: end; }
}
@container (max-width: 760px) {
    .unit { display: inline; color: var(--mute); }
}

/* ---------- pop-up messages (admin) ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px; border-radius: 10px; background: var(--cream); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(107, 74, 74, .18); animation: toast-in .2s ease-out; }
.toast.good { border-left: 4px solid var(--green); }
.toast.bad { border-left: 4px solid var(--rose); }
.toast-icon { width: 22px; height: 22px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 600 12px/1 var(--sans); color: var(--cream); }
.toast.good .toast-icon { background: var(--green); }
.toast.bad .toast-icon { background: var(--rose); }
.toast-text { font: 400 14px/1.4 var(--sans); color: var(--ink); }
.toast ul { margin-top: 6px; padding-left: 18px; font-size: 13px; color: var(--body); }
.toast-link { margin-left: 8px; font-weight: 500; white-space: nowrap; }
.toast-x { width: 26px; height: 26px; flex: none; border-radius: 50%; color: var(--mute); font-size: 18px; line-height: 1; }
.toast-x:hover { background: var(--blush); color: var(--rose); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* ---------- admin on narrow screens: keep who's signed in and Sign out visible ---------- */
@media (max-width: 860px) {
    .side-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 0; padding: 10px 16px; border-top: 1px solid var(--soft); }
    .side-foot .row { align-items: center; }
    .side-foot .avatar { width: 28px; height: 28px; font-size: 10.5px; }
    .side-foot .role-line { display: none; }
    .side-foot .links { margin-top: 2px; }
    .side-foot .shop-link { margin-top: 0; font-size: 12.5px; white-space: nowrap; }
    .toasts { right: 12px; left: 12px; bottom: 12px; width: auto; }
}

/* Shop header on phones: keep the name on one line. */
@media (max-width: 560px) {
    .shop-top .brand-name { font-size: 13px; letter-spacing: .18em; white-space: nowrap; }
    .shop-top .logo { width: 36px; height: 36px; }
}

/* ---------- search on Shop all ---------- */
.search-big { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--rose); max-width: 640px; }
.search-big:focus-within { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(168, 89, 90, .12); }
.search-big input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 17px; }
.search-big input::-webkit-search-cancel-button { display: none; }
.search-clear { width: 30px; height: 30px; border-radius: 50%; color: var(--mute); font-size: 20px; line-height: 1; }
.search-clear:hover { background: var(--blush); color: var(--rose); }

/* ---------- shop filters ---------- */
.browse-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filter-toggle { display: none; align-items: center; gap: 8px; padding: 9px 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--cream); color: var(--body); font: 400 13.5px/1 var(--sans); }
.filter-toggle.on { border-color: var(--rose); color: var(--rose); }
.browse { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
.filters-panel { position: sticky; top: 140px; display: flex; flex-direction: column; gap: 22px; }
.filters-panel section { display: flex; flex-direction: column; gap: 8px; }
.filters-panel h3 { margin: 0 0 2px; }
.filters-panel .check { font-size: 14px; }
.chip-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--ink); font: 400 13px/1 var(--sans); }
.fchip:hover { border-color: var(--line); }
.fchip.on { background: var(--rose); border-color: var(--rose); color: var(--cream); }
.price-row { display: flex; align-items: center; gap: 8px; }
.price-row input { width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; font-size: 14px; }
.price-row input:focus { border-color: var(--rose); outline: none; }
.filters-done { display: none; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip-x { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px 6px 12px; border-radius: 999px; background: var(--blush); border: 1px solid var(--soft); color: var(--rose); font: 400 13px/1 var(--sans); }
.chip-x span { font-size: 15px; }
.chip-x:hover { border-color: var(--line); }
.browse-results .empty-bag { margin-top: 0; }

@media (max-width: 900px) {
    .filter-toggle { display: inline-flex; }
    .browse { grid-template-columns: 1fr; gap: 16px; }
    .filters-panel { display: none; position: static; padding: 18px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--cream); }
    .filters-panel.open { display: flex; }
    .filters-done { display: block; width: 100%; }
}

/* ---------- sales and forecast ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--cream); }
.stat b { font: 500 24px/1.2 var(--sans); color: var(--ink); }
.delta.up { color: var(--green); }
.delta.down { color: var(--rose-deep); }

.chart { margin-top: 14px; }
.chart-readout { min-height: 44px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.chart-readout b { font: 500 20px/1.3 var(--sans); color: var(--ink); }
.chart-readout span { font-size: 13px; color: var(--body); }
.chart-body { display: flex; gap: 8px; height: 220px; }
.chart-y { position: relative; width: 56px; flex: none; }
.chart-y span { position: absolute; right: 0; transform: translateY(50%); font-size: 11.5px; color: var(--mute); white-space: nowrap; }
.chart-plot { position: relative; flex: 1; min-width: 0; border-bottom: 1px solid var(--border); }
.chart-grid { position: absolute; left: 0; right: 0; height: 1px; background: var(--soft); }
.chart-cols { position: absolute; inset: 0; display: flex; align-items: stretch; }
.chart-col { flex: 1; min-width: 0; position: relative; display: flex; align-items: flex-end; justify-content: center; padding: 0 1px; border-radius: 4px 4px 0 0; }
.chart-col:hover, .chart-col.on, .chart-col:focus-visible { background: rgba(168, 89, 90, .07); }
.chart-bar { display: block; width: min(24px, 72%); min-height: 2px; background: var(--rose); border-radius: 4px 4px 0 0; }
.chart-col.now .chart-bar { background: repeating-linear-gradient(135deg, var(--rose) 0 4px, #c98586 4px 7px); }
.chart-x { display: flex; margin-left: 64px; margin-top: 6px; }
.chart-x span { flex: 1; min-width: 0; text-align: center; font-size: 11.5px; color: var(--mute); white-space: nowrap; overflow: visible; }
.chart-table { margin-top: 14px; }
.chart-table summary { cursor: pointer; color: var(--rose); }
.tr.sales-row { grid-template-columns: 2fr 1fr .7fr .7fr; min-width: 0; padding: 9px 16px; }
.top-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.top-list li { display: grid; grid-template-columns: minmax(0, 1.4fr) auto minmax(60px, 1fr) auto; align-items: center; gap: 12px; }
.top-list .hbar { height: 8px; background: var(--blush); border-radius: 4px; }
.top-list .hbar i { display: block; height: 100%; background: var(--rose); border-radius: 4px; }
.top-list b { font-weight: 500; color: var(--ink); }

.forecast-settings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; }
.forecast-settings p { grid-column: 1 / -1; margin: 0; }
.forecast-settings input { max-width: 140px; }
.tr.fc { grid-template-columns: minmax(0, 2.2fr) .7fr .9fr .9fr 1.3fr .7fr; min-width: 840px; }
.tr.fc .runs { display: block; margin-top: 4px; }
.fc-order { font-weight: 500; color: var(--rose); }
.tr.slow { grid-template-columns: minmax(0, 2fr) .7fr .9fr .9fr .9fr 2fr; min-width: 840px; }

@media (max-width: 900px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .forecast-settings { grid-template-columns: 1fr; }
}
@container (max-width: 760px) {
    .tr.th.fc, .tr.th.slow { display: none; }
    .tr.fc, .tr.slow { min-width: 0; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 16px; }
    .tr.fc { grid-template-areas: "item order" "stock status" "sold status" "pace pace"; }
    .tr.fc > :nth-child(1) { grid-area: item; }
    .tr.fc > :nth-child(2) { grid-area: stock; }
    .tr.fc > :nth-child(3) { grid-area: sold; }
    .tr.fc > :nth-child(4) { grid-area: pace; color: var(--mute); }
    .tr.fc > :nth-child(5) { grid-area: status; justify-self: end; text-align: right; }
    .tr.fc > :nth-child(6) { grid-area: order; justify-self: end; }
    .tr.slow { grid-template-areas: "item value" "stock last" "sold sold" "advice advice"; }
    .tr.slow > :nth-child(1) { grid-area: item; }
    .tr.slow > :nth-child(2) { grid-area: stock; }
    .tr.slow > :nth-child(3) { grid-area: sold; }
    .tr.slow > :nth-child(4) { grid-area: last; justify-self: end; }
    .tr.slow > :nth-child(5) { grid-area: value; justify-self: end; }
    .tr.slow > :nth-child(6) { grid-area: advice; color: var(--rose-deep); }
}
@media (max-width: 560px) {
    .chart-y { width: 44px; }
    .chart-x { margin-left: 52px; }
    .top-list li { grid-template-columns: minmax(0, 1fr) auto; }
    .top-list .hbar { grid-column: 1 / -1; }
}


/* ---------- size guides ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tr.guide { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, 1.4fr) .8fr .7fr; min-width: 680px; }
.field textarea.short { min-height: 72px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sg-edit { overflow-x: auto; padding-bottom: 4px; }
.sg-grid { display: grid; gap: 8px; align-items: center; min-width: max-content; }
.sg-grid > .label { white-space: nowrap; }
.sg-grid input { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--border); border-radius: 5px; background: #fff; font-size: 14.5px; }
.sg-grid input:focus { border-color: var(--rose); outline: none; }
.sg-grid input::placeholder { color: #c9aeab; }
.sg-measure { display: flex; align-items: center; gap: 2px; }
.sg-measure input { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--label); background: var(--blush); }
.sg-measure .x { flex: none; width: 26px; height: 26px; font-size: 17px; }
.pill:disabled { opacity: .45; cursor: default; }

.unit-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 2px; background: #fff; }
.unit-switch button { padding: 6px 13px; border-radius: 999px; font: 400 12.5px/1 var(--sans); color: var(--body); }
.unit-switch button.on { background: var(--rose); color: var(--cream); }

.sg-scroll { overflow-x: auto; border: 1px solid var(--soft); border-radius: 8px; background: var(--cream); }
.sg-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sg-table th, .sg-table td { padding: 10px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--soft); }
.sg-table thead th { background: var(--blush); font: 400 11px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--label); }
.sg-table tbody th { font-weight: 500; color: var(--ink); }
.sg-table tbody tr:last-child > * { border-bottom: 0; }
.sg-table tr.on > * { background: var(--blush); }
.sg-table tr.on th { color: var(--rose); box-shadow: inset 3px 0 0 var(--rose); }

.pick { position: relative; }
.guide-link { position: absolute; top: -4px; right: 0; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; font: 400 13px/1 var(--sans); color: var(--rose); text-decoration: underline; text-underline-offset: 3px; }
.guide-link:hover { color: var(--rose-deep); }
.sg-backdrop { position: fixed; inset: 0; background: rgba(74, 46, 46, .38); z-index: 60; }
.sg-dialog { position: fixed; z-index: 61; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto;
    background: var(--cream); border-radius: 12px; padding: 22px 24px 24px; box-shadow: 0 18px 50px rgba(74, 46, 46, .22); }
.sg-head h2 { margin: 4px 0 0; font-size: 24px; }
.sg-head .x { flex: none; }
.sg-note { color: var(--body); }
@media (max-width: 560px) {
    .sg-dialog { top: auto; bottom: 0; left: 0; transform: none; width: 100%; max-height: 88vh; border-radius: 14px 14px 0 0; padding: 18px 16px 24px; }
    .sg-table th, .sg-table td { padding: 10px 9px; }
}
@container (max-width: 640px) {
    .tr.th.guide { display: none; }
    .tr.guide { min-width: 0; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 16px; }
    .tr.guide > :nth-child(3) { grid-column: 1 / -1; }
}

/* ---------- policies ---------- */
.tr.policy { grid-template-columns: minmax(0, 1.6fr) 130px minmax(0, 1fr) 110px; min-width: 560px; }
.policy-text { min-height: 460px !important; font-size: 14px !important; line-height: 1.65; }
code { font: 13px/1 ui-monospace, Menlo, monospace; background: var(--blush); padding: 2px 5px; border-radius: 4px; color: var(--ink); }
.policy-body { color: var(--body); }
.policy-body h2 { font-size: 21px; margin: 26px 0 8px; }
.policy-body p { margin: 0 0 12px; }
.policy-body ul { margin: 0 0 12px; padding-left: 20px; }
.policy-body li { margin-bottom: 5px; }
.policy-body li::marker { color: var(--line); }
.policy-body mark { background: var(--amber-bg); color: var(--amber); padding: 0 3px; border-radius: 3px; }
.policy-preview { max-height: 640px; overflow-y: auto; padding-right: 6px; }
.policy-preview h1 { font-size: 26px; margin: 0 0 6px; }
.policy-preview .policy-body h2 { font-size: 18px; }
.policy-page { max-width: 720px; }
.policy-page h1 { margin: 6px 0 0; }
.policy-more { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 18px; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--soft); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--soft); font-size: 13px; }
@container (max-width: 560px) {
    .tr.th.policy { display: none; }
    .tr.policy { min-width: 0; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 16px; }
}

/* ---------- live chat: shop ---------- */
.chat-fab { position: fixed; right: 20px; bottom: 20px; z-index: 150; display: inline-flex; align-items: center; gap: 8px; height: 52px; min-width: 52px; padding: 0 20px 0 16px; border-radius: 999px;
    background: var(--rose); color: var(--cream); box-shadow: 0 10px 26px rgba(107, 74, 74, .28); font: 500 14px/1 var(--sans); letter-spacing: .04em; }
.chat-fab:hover { background: var(--rose-deep); }
.chat-fab.is-open { padding: 0; justify-content: center; }
.chat-fab .fab-x { font-size: 26px; line-height: 1; }
.chat-fab .fab-count { position: absolute; top: -5px; right: -5px; background: var(--ink); box-shadow: 0 0 0 2px var(--cream); }
.chat-fab ~ .toasts { bottom: 86px; }
.chat-panel { position: fixed; right: 20px; bottom: 84px; z-index: 151; width: min(370px, calc(100vw - 32px)); height: min(560px, calc(100vh - 120px)); display: flex; flex-direction: column;
    background: var(--cream); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 50px rgba(74, 46, 46, .22); overflow: hidden; }
.chat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px 14px 12px 18px; background: var(--blush); border-bottom: 1px solid var(--soft); }
.chat-head b { display: block; font: 400 19px/1.2 var(--serif); color: var(--rose); }
.chat-status { display: inline-flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12.5px; color: var(--body); }
.chat-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.chat-status.on .dot { background: var(--green); }
.chat-start { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.chat-start .field input, .chat-start .field textarea { margin-top: 6px; }
.chat-start .field textarea { min-height: 76px; }
.chat-thread { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; flex-direction: column; max-width: 82%; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.them { align-self: flex-start; }
.bubble { padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.msg.me .bubble { background: var(--rose); color: var(--cream); border-bottom-right-radius: 4px; }
.msg.them .bubble { background: #fff; border: 1px solid var(--soft); color: var(--ink); border-bottom-left-radius: 4px; }
.msg-meta { margin-top: 3px; font-size: 11.5px; color: var(--mute); }
.chat-wait { text-align: center; margin: 6px 0 0; }
.chat-send { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--soft); background: var(--cream); }
.chat-send input, .chat-send textarea { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 14.5px; resize: none; }
.chat-send input:focus, .chat-send textarea:focus { border-color: var(--rose); outline: none; }
.chat-send .btn { flex: none; }
.chat-error { padding: 0 14px 10px; margin: 0; }
@media (max-width: 560px) {
    .chat-fab { right: 14px; bottom: 14px; height: 48px; min-width: 48px; }
    .chat-fab:not(.is-open) .fab-text { display: none; }
    .chat-fab:not(.is-open) { padding: 0; justify-content: center; }
    .chat-panel { right: 0; left: 0; bottom: 0; width: 100%; height: min(88vh, 100dvh - 60px); border-radius: 14px 14px 0 0; border-bottom: 0; }
    .chat-panel ~ .chat-fab { display: none; }
    .chat-fab ~ .toasts { bottom: 72px; }
}

/* ---------- live chat: admin ---------- */
.chats { display: grid; grid-template-columns: minmax(250px, 330px) minmax(0, 1fr); gap: 16px; align-items: start; }
.chat-list { display: flex; flex-direction: column; background: var(--cream); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.chat-item { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-bottom: 1px solid var(--soft); color: var(--ink); }
.chat-item:last-child { border-bottom: 0; }
.chat-item:hover { background: var(--blush); color: var(--ink); }
.chat-item.on { background: var(--blush); box-shadow: inset 3px 0 0 var(--rose); }
.chat-item b { font-weight: 500; }
.chat-item.unread b { color: var(--rose-deep); }
.chat-item .preview { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--body); }
.chat-item .nav-count { margin-left: 8px; flex: none; }
.chat-view { display: flex; flex-direction: column; padding: 0; height: min(680px, calc(100vh - 150px)); overflow: hidden; }
.chat-view > .empty { margin: auto; }
.chat-view-head { padding: 16px 20px 12px; border-bottom: 1px solid var(--soft); }
.chat-view-head h2 { margin: 0; }
.chat-view .back-link { display: none; margin-bottom: 6px; }
.chat-view .chat-send { padding: 12px 16px; }
.chat-view > .small.mt-xs { padding: 0 16px 12px; margin: 0; }
.chat-view > .small.mt-xs:empty { display: none; }
@media (max-width: 860px) {
    .chats { grid-template-columns: 1fr; }
    .chats.has-chat .chat-list-col { display: none; }
    .chats:not(.has-chat) .chat-view { display: none; }
    .chat-view .back-link { display: inline-block; }
    .chat-view { height: calc(100dvh - 190px); min-height: 420px; }
}

/* ---------- admin: Local / UTC times switch ---------- */
.side-extra { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.side-extra .shop-link { margin-top: 0; }
.tz-switch { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; }
.tz-switch .tz-label { color: var(--mute); margin-right: 6px; }
.tz-switch button { padding: 3px 9px; border: 1px solid var(--border); background: transparent; color: var(--body); font: 500 12px/1.3 var(--sans); cursor: pointer; }
.tz-switch button:first-of-type { border-radius: 999px 0 0 999px; }
.tz-switch button:last-of-type { border-radius: 0 999px 999px 0; margin-left: -1px; }
.tz-switch button.on { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.tz-switch button:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
@media (max-width: 860px) {
    .side-foot { flex-wrap: wrap; row-gap: 8px; }
    .side-foot .links { white-space: nowrap; }
    .side-extra { margin-top: 0; flex-direction: row; align-items: center; gap: 12px; margin-left: auto; }
    .tz-switch .tz-label { display: none; }
}

/* ---------- couriers and tracking ---------- */
.courier-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.courier-fields { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(0, 2fr); gap: 12px; }
.courier-row code, .tracking code { font: 500 13px/1.3 ui-monospace, Menlo, monospace; background: var(--blush); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.tracking { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.tracking .label { margin-right: 6px; }
.tracking-no { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.received-box { border-left: 4px solid var(--rose); }
@media (max-width: 640px) {
    .courier-fields { grid-template-columns: 1fr; }
}
