@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap");

:root {
  --paper: #f7f4ec;
  --white: #fffdf8;
  --ink: #252a23;
  --muted: #535c51;
  --moss: #294334;
  --moss-hover: #3d5946;
  --sage: #e4eadf;
  --line: #d6d9cc;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --edge: clamp(18px, 4vw, 62px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--sans); }
a { color: inherit; text-underline-offset: .25em; }
p { color: var(--muted); margin: 0 0 1rem; }
h1, h2 { font: 400 clamp(2.6rem, 6vw, 4.4rem)/.98 var(--serif); margin: 0 0 .65rem; }
h1 { font-size: clamp(3.6rem, 7.3vw, 7.7rem); letter-spacing: -.036em; }
h3 { font-size: 1.08rem; line-height: 1.25; margin: 0; overflow-wrap: anywhere; }
small { color: var(--muted); }
.wrap { width: min(100% - 2 * var(--edge), 1320px); margin-inline: auto; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip:focus { position: absolute; z-index: 2; padding: 10px 16px; background: var(--white); }
:focus-visible { outline: 2px solid #477753; outline-offset: 3px; }

.site-header { border-bottom: 1px solid var(--line); }
.nav, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.nav { min-height: 70px; }
nav, .footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(12px, 3vw, 34px); font-size: .87rem; }
nav a, .footer-links a { text-decoration: none; }
nav a:hover, .footer-links a:hover { text-decoration: underline; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; letter-spacing: .15em; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.brand span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--moss); color: #fff; font: 1.2rem var(--serif); letter-spacing: 0; }

.hero { display: grid; grid-template-columns: 1fr 1.14fr; min-height: min(525px, 52vw); background: var(--sage); margin-top: clamp(18px, 3vw, 44px); }
.intro { padding: clamp(24px, 5.6vw, 84px) clamp(26px, 5vw, 76px); align-self: center; }
.intro > p:not(.eyebrow) { max-width: 31ch; margin: 1.25rem 0 1.5rem; }
.eyebrow { color: var(--moss); font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; margin-bottom: .9rem; }
.hero-image { width: 100%; height: 100%; min-height: 0; display: block; object-fit: cover; object-position: 55% 55%; }

button, .button, .import {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .5em;
  min-height: 44px;
  padding: .58rem .85rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  font: 600 .875rem/1.22 var(--sans);
  text-decoration: none;
}
.button { background: var(--moss); color: #fff; border-color: var(--moss); padding: .7rem 1rem; }
.button:hover { background: var(--moss-hover); }
button:not(:disabled):hover, .import:hover { border-color: var(--moss); }
.button.secondary { background: var(--white); color: var(--moss); border-color: var(--line); }
.button.secondary:hover { border-color: var(--moss); }
button:disabled { opacity: .56; cursor: default; }
.text-button { background: transparent; border: 0; text-decoration: underline; padding-inline: 4px; min-height: 40px; }
.icon-button { font-size: 1.35rem; width: 44px; padding: 0; }
label { display: grid; align-content: start; gap: 5px; font-size: .82rem; font-weight: 600; min-width: 0; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: .53rem .65rem;
  border: 1px solid #a9b0a4;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font: 400 1rem/1.3 var(--sans);
}
textarea { resize: vertical; }

.collection { padding-block: clamp(38px, 6vw, 82px); }
.collection .section-head { border-bottom: 1px solid var(--line); padding-bottom: .85rem; }
.collection .section-head a { font-size: .86rem; font-weight: 600; }
.section-head, .dash-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-head h2 { margin-bottom: .38rem; }
.section-head p { margin-bottom: 0; }
.section-head .eyebrow { margin-bottom: .55rem; }
.filter-bar { display: grid; grid-template-columns: minmax(150px, 2fr) repeat(3, minmax(125px, 1fr)); gap: 12px; margin-block: 18px 14px; }
.filters, .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters button { border-radius: 24px; padding: .48rem .85rem; min-height: 40px; }
.filters button[aria-pressed="true"], .photo-nav button[aria-pressed="true"] { background: var(--moss); color: #fff; }
.results-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 9px 0; min-height: 40px; }
.results-line p { margin: 0; font-size: .89rem; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 2vw, 26px); }
.card { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); min-width: 0; }
.card-picture, .product-picture { position: relative; aspect-ratio: 4 / 4.15; width: 100%; display: grid; place-items: center; overflow: hidden; background: var(--sage); }
.card-picture img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; }
.placeholder { color: var(--muted); font-size: .8rem; padding: 8px; text-align: center; }
.card-body { flex: 1; display: grid; align-content: space-between; gap: 12px; padding: clamp(10px, 1.6vw, 20px); }
.card-title { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; justify-content: space-between; }
.card-body p { margin: 5px 0 0; font-size: .84rem; }
.card-body button { width: 100%; }
.card-title strong { white-space: nowrap; color: var(--moss); }

dialog {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  width: min(650px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: clamp(14px, 3vw, 28px);
  overflow: auto;
}
dialog::backdrop { background: #202820ad; }
dialog .section-head { align-items: flex-start; }
dialog [role="status"]:empty, dialog [role="alert"]:empty { display: none; }
.product-dialog { width: min(935px, calc(100% - 24px)); padding: 0; }
.product-layout { display: grid; grid-template-columns: 1fr 1fr; }
.product-gallery { padding: 14px; background: var(--sage); }
.product-picture { aspect-ratio: 1; background: #dbe3d6; }
.product-picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.product-info { padding: clamp(22px, 4vw, 44px); padding-top: 58px; }
.product-info .icon-button { position: absolute; top: 12px; right: 12px; }
.product-info h2 { overflow-wrap: anywhere; }
.product-price { display: block; color: var(--moss); font-size: 1.15rem; margin-bottom: 15px; }
.product-facts { display: grid; grid-template-columns: auto 1fr; gap: 7px 15px; border-block: 1px solid var(--line); padding-block: 12px; font-size: .9rem; }
.product-facts dt { color: var(--muted); }
.product-facts dd { margin: 0; overflow-wrap: anywhere; }
.product-description { white-space: pre-line; overflow-wrap: anywhere; }
.fine-print { font-size: .83rem; margin-top: 10px; }
.photo-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.photo-nav button { min-width: 44px; }

.dashboard { padding-block: clamp(25px, 5vw, 66px); max-width: 1160px; }
body[data-view="dashboard"] .site-header nav { display: none; }
.dash-head h1 { font-size: clamp(3.2rem, 6.5vw, 5.8rem); }
.dash-head { margin-bottom: 20px; align-items: flex-end; }
.dash-nav { gap: 9px 20px; padding-block: 10px; border-block: 1px solid var(--line); color: var(--moss); }
.dash-nav a { padding-block: 5px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.metric, .panel { border: 1px solid var(--line); background: var(--white); border-radius: 5px; }
.metric { display: grid; min-width: 0; justify-items: start; gap: 1px; padding: clamp(10px, 2vw, 22px); color: var(--moss); text-decoration: none; }
.metric:hover { border-color: var(--moss); }
.metric strong { font: 2.5rem/.95 var(--serif); }
.metric span { color: var(--muted); font: 600 .81rem/1.25 var(--sans); }
.panel { padding: clamp(14px, 3vw, 30px); margin-top: 16px; }
.panel h2 { font-size: clamp(2.15rem, 4vw, 3.15rem); }
.panel .section-head p { font-size: .9rem; }
.inventory-tools { grid-template-columns: minmax(120px, 1fr) minmax(106px, 170px); width: min(100%, 570px); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .72rem .5rem; border-bottom: 1px solid var(--line); }
th { font-size: .78rem; color: var(--muted); }
.inventory-name { display: flex; align-items: center; gap: 10px; }
.inventory-name img { width: 38px; height: 46px; flex: none; object-fit: cover; background: var(--sage); border-radius: 3px; }
.inventory-name strong, .inventory-name small, .fulfilment-row small { display: block; overflow-wrap: anywhere; }
.row-actions { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.row-actions > button { white-space: nowrap; }
.badge { display: inline-block; background: var(--sage); color: var(--moss); font-size: .75rem; font-weight: 700; padding: .25rem .5rem; border-radius: 3px; white-space: nowrap; }
.badge-draft { background: #f0ebe0; color: #675a40; }
.badge-sold { background: #e7e9ee; color: #414c64; }
.backups { margin-top: 15px; font-size: .9rem; }
.backups summary { cursor: pointer; width: fit-content; padding-block: 7px; }
.backups .actions { margin-top: 8px; }
.import { position: relative; }
.import input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.import:focus-within { outline: 2px solid var(--moss); }
.channel { display: flex; gap: 12px; align-items: center; margin: 12px 0; }
.settings { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.settings label { flex: 1; min-width: min(100%, 230px); }
#activity { padding-left: 20px; margin-bottom: 0; color: var(--muted); }
#activity li + li { margin-top: 6px; }
.fulfilment-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding: .7rem 0; }
.fulfilment-row .badge { margin-right: 7px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.wide { grid-column: 1 / -1; }
.photo-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.photo-preview { width: min(110px, 44%); display: grid; gap: 4px; align-content: start; }
.photo-preview img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-preview button { min-height: 40px; font-size: .76rem; padding-inline: 4px; }
#empty { margin-top: 12px; }
#dashboard-status, #store-status { margin: 12px 0 0; }
#dashboard-status:empty, #store-status:empty { display: none; }
.login { max-width: 510px; margin: clamp(28px, 8vh, 100px) auto; padding: 20px; }
.login h1 { font-size: clamp(3rem, 10vw, 4.5rem); }
.login form { display: grid; gap: 14px; }
.login form .button { justify-self: start; }
.login [role="alert"] { color: #813822; }

.site-footer { border-top: 1px solid var(--line); padding-block: 22px; }
.footer-inner { align-items: flex-start; }
.footer-inner p { margin: 8px 0 0; font-size: .83rem; }
.footer-links { padding-top: 8px; color: var(--muted); }
.footer-sign-out { color: inherit; font: inherit; background: transparent; border: 0; padding: 0; text-decoration: underline; text-underline-offset: .25em; }
.footer-sign-out:hover { color: var(--moss); background: transparent; }
@media (max-width: 780px) {
  .hero { grid-template-columns: 1fr 1fr; }
  .intro { padding: 24px; }
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table, tbody { display: block; }
  tbody tr { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0 5px; border-top: 1px solid var(--line); padding: 10px 0; }
  td { border: 0; padding: 5px 0; }
  td:first-child, td:last-child { grid-column: 1 / -1; }
  .row-actions { justify-content: flex-start; }
}
@media (max-width: 575px) {
  .nav { min-height: 62px; }
  .nav a { font-size: .8rem; }
  .brand { gap: 6px; }
  .brand span { width: 32px; height: 32px; }
  .hero { grid-template-columns: 1fr; }
  .hero-image { height: clamp(190px, 51vw, 275px); object-position: center 57%; }
  .collection, .dashboard { padding-top: 34px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-title h3 { font-size: .96rem; }
  .dash-head, .section-head { flex-wrap: wrap; gap: 8px 14px; }
  .dash-head { align-items: flex-start; }
  .metrics { gap: 6px; }
  .metric { padding-inline: 7px; }
  .metric strong { font-size: 1.95rem; }
  .metric span { font-size: .73rem; }
  .product-layout { grid-template-columns: 1fr; }
  .product-picture { aspect-ratio: 5 / 3; }
  .product-info { padding-top: 18px; }
  .product-info .icon-button { background: var(--white); }
  .footer-links { gap: 7px 14px; justify-content: flex-end; }
}
@media (max-width: 345px) {
  .cards { grid-template-columns: 1fr; }
  .nav { gap: 6px; }
  .nav nav { gap: 6px; }
}
@page { size: 4in 6in; margin: 0; }
@media print {
  html, body, #print-label:not([hidden]) { background: #fff !important; }
  body > :not(#print-label), .label-print-controls { display: none !important; }
  body:has(> #print-label:not([hidden])) {
    display: grid;
    align-items: center;
    min-height: calc(6in - 1px);
    padding: 5mm;
  }
}
#print-label:not([hidden]) {
  box-sizing: border-box;
  display: flex !important;
  flex-direction: column;
  width: 100%;
  border: .5pt solid var(--moss);
  padding: 3mm;
  max-width: 100%;
  color: var(--ink);
  background: var(--white);
  font: 400 10pt/1.3 var(--sans);
  break-inside: avoid;
}
#print-label p, #print-label dl, #print-label dd { margin: 0; color: var(--ink); }
#print-label .label-header { display: flex; justify-content: space-between; align-items: center; gap: 3mm; padding-bottom: 3mm; border-bottom: 1pt solid var(--moss); }
#print-label .label-brand { display: flex; align-items: center; gap: 2mm; color: var(--moss); font-weight: 400; letter-spacing: .12em; }
#print-label .label-logo { display: grid; place-items: center; width: 9mm; height: 9mm; border: 1pt solid var(--moss); border-radius: 50%; font: 12pt var(--serif); color: var(--moss); letter-spacing: 0; }
#print-label .label-heading, #print-label dt { font-size: 8pt; font-weight: 700; }
#print-label .label-product { padding: 4mm 0; }
#print-label h1 { margin: 0 0 3mm; font-family: var(--serif); font-size: 20pt; font-weight: 400; line-height: 1.15; overflow-wrap: anywhere; }
#print-label .label-details { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 2mm; }
#print-label .label-reference { font-size: 9pt; grid-column: 1 / -1; overflow-wrap: anywhere; }
#print-label .label-codes { display: flex; align-items: center; gap: 4mm; border-top: 1pt solid var(--moss); padding-top: 3mm; }
#print-label .label-barcode { min-width: 0; flex: 1; }
#print-label .label-barcode svg { display: block; width: 100%; height: 16mm; margin: 1mm 0; }
#print-label .label-barcode-value { font-size: 8pt; overflow-wrap: anywhere; }
#print-label .label-qr-block { flex: 0 0 28mm; text-align: center; font-size: 8pt; }
#print-label .label-qr { display: block; width: 28mm; height: 28mm; }
#print-label .label-contact { border-top: 1pt solid var(--moss); margin-top: 4mm; padding-top: 2mm; font-size: 8pt; overflow-wrap: anywhere; white-space: pre-line; }
@media screen {
  body:has(> #print-label:not([hidden])) > :not(#print-label) { display: none !important; }
  #print-label:not([hidden]) {
    width: min(4in, calc(100% - 2 * var(--edge)));
    margin: clamp(1.5rem, 6vw, 4rem) auto;
  }
  #print-label .label-print-controls { padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
  #print-label .label-print-controls h1 { font-size: 2.25rem; }
  #print-label .label-print-controls p { margin-bottom: 1rem; }
}

.product-number { display: block; overflow-wrap: anywhere; }

.review-images figure { margin: 1rem 0; }
.review-images img { display: block; max-width: 100%; max-height: 24rem; object-fit: contain; }

.product-detail { max-width: 1060px; padding-block: clamp(12px, 4vw, 44px); }
.product-detail-heading { margin-bottom: 1.25rem; }
.product-detail-heading h1 { overflow-wrap: anywhere; }
.product-detail-body { display: grid; gap: clamp(1rem, 3vw, 2rem); }
.product-detail-body.with-photos { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.product-detail-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: .75rem; }
.product-detail-photos .product-picture:first-child { grid-column: 1 / -1; }
.product-detail-photos .product-picture { border-radius: .35rem; }
.product-detail-fields { display: grid; grid-template-columns: minmax(6rem, auto) minmax(0, 1fr); align-content: start; gap: .65rem 1rem; margin: 0; }
.product-detail-fields dt { font-weight: 700; }
.product-detail-fields dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.product-detail-edit { display: flex; justify-content: flex-end; border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: 1rem; }
@media (max-width: 700px) {
  .product-detail-body.with-photos { grid-template-columns: minmax(0, 1fr); }
}

.account-photo { display: block; width: 96px; height: 96px; object-fit: cover; border-radius: 50%; margin-bottom: 1rem; }

.account-layout { max-width: 920px; margin-block: 32px 64px; }
.account-layout .panel { background: var(--white); }
.account-layout form { display: grid; gap: 14px; margin-block: 1rem; }
.account-layout form > .button { justify-self: start; }
.account-layout h3 { margin-top: 1.5rem; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 2rem; }
.account-grid section { min-width: 0; }
.account-grid dd { margin-inline-start: 0; overflow-wrap: anywhere; }

.account-grid { gap: 1rem; }
.account-card { border: 1px solid var(--line); border-radius: 8px; padding: clamp(14px, 3vw, 24px); }
.account-card h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); }
.account-card h3 { margin-top: 1rem; }
