/* Minnesota Made 3D — storefront styles */

:root {
  /* Brand palette — taken from the Minnesota Made 3D logo: cyan #00d0f8, deep teal #20464d, black, white.
     The cyan is too light for text, so buttons/links use darker teals of the same hue; cyan is the accent
     with dark text on it. Every pairing below meets WCAG AA (checked 2026-09-13). */
  --bg: #f3f8f9;
  --surface: #ffffff;
  --ink: #0f1a1d;
  --muted: #4f6368;
  --line: #d7e4e7;
  --brand: #137586;
  --brand-dark: #0e5a68;
  --brand-soft: #e0f6fa;
  --accent: #00d0f8;
  --accent-ink: #0f1a1d;
  --teal-deep: #20464d;
  --tint: #eaf3f5;
  --ok: #2e8b57;
  --danger: #b3261e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 26, 29, 0.06), 0 8px 24px rgba(15, 26, 29, 0.06);
  --max: 1100px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}
img, svg { max-width: 100%; display: block; }
a { color: var(--brand); }
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.container { max-width: var(--max); margin: 0 auto; padding-inline: 20px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(243, 248, 249, 0.92);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.05rem; }
.logo img { width: 44px; height: 44px; object-fit: contain; }
.logo img.wordmark { width: auto; height: 44px; }
.logo .tagline-text { display: none; }
@media (min-width: 900px) { .logo .tagline-text { display: block; font-weight: 500; font-size: 0.7rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-left: 6px; } }
.footer-tagline { height: 24px; width: auto; margin-bottom: 10px; }
.logo svg { width: 32px; height: 32px; }
.logo span small { display: block; font-weight: 500; font-size: 0.7rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.cart-link { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.cart-link .count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-size: 0.75rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.cart-link .count[hidden] { display: none; }
@media (max-width: 560px) {
  .nav a:not(.cart-link) { display: none; }
  .logo span small { display: none; }
}

/* ---------- hero ---------- */
.hero {
  padding-block: clamp(40px, 8vw, 88px);
  background:
    radial-gradient(1200px 400px at 10% -10%, #d3f3f8 0%, transparent 60%),
    radial-gradient(800px 300px at 100% 0%, #dfe9eb 0%, transparent 60%);
}
.hero .container { display: grid; gap: 28px; grid-template-columns: 1.15fr 0.85fr; align-items: center; }
.hero .eyebrow { color: var(--brand-dark); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.8rem; margin-bottom: 12px; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 52ch; }
.hero .art { justify-self: center; width: min(100%, 420px); }
@media (max-width: 760px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero .art { order: -1; width: min(100%, 300px); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  background: var(--brand); color: #fff; transition: background 0.15s, transform 0.05s;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--brand-soft); }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.accent:hover { background: #00bde2; }
.btn.block { width: 100%; }
.btn.lg { padding: 15px 26px; font-size: 1.05rem; }
.btn.sm { padding: 7px 12px; font-size: 0.9rem; border-radius: 8px; }
.btn.ghost { background: transparent; color: var(--brand-dark); border-color: transparent; }
.btn.ghost:hover { background: var(--brand-soft); }

/* ---------- sections & cards ---------- */
.section { padding-block: clamp(32px, 6vw, 64px); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.product-card { text-decoration: none; color: inherit; transition: transform 0.15s, box-shadow 0.15s; }
.product-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(28,36,48,0.06), 0 14px 32px rgba(28,36,48,0.10); }
.product-card .thumb { aspect-ratio: 4 / 3; background: var(--tint); display: grid; place-items: center; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card h3 { margin: 0; font-size: 1.05rem; }
.product-card .short { color: var(--muted); font-size: 0.93rem; margin: 0; flex: 1; }
.price { font-weight: 700; font-size: 1.1rem; }
.price .compare { color: var(--muted); text-decoration: line-through; font-weight: 500; font-size: 0.9rem; margin-left: 6px; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; background: var(--brand-soft); color: var(--brand-dark); }
.badge.accent { background: #fbe7d6; color: #a54f13; }

.steps { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.step .num { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; display: grid; place-items: center; margin-bottom: 10px; }
.step h3 { margin-bottom: 4px; }
.step p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- product page ---------- */
.product { display: grid; gap: 36px; grid-template-columns: 1.1fr 0.9fr; align-items: start; padding-block: 28px 56px; }
.product .gallery { position: relative; background: var(--tint); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; aspect-ratio: 4 / 3; }
/* Pinned to the box so portrait and landscape photos alike are cover-cropped around their centre. */
.product .gallery img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.product .buy { display: flex; flex-direction: column; gap: 16px; }
.product .price { font-size: 1.5rem; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 0.95rem; }
select, input[type="text"], input[type="number"], input[type="search"], textarea {
  font: inherit; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink);
}
select:focus, input:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.qty { display: inline-flex; align-self: flex-start; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.qty button { font: inherit; font-size: 1.1rem; width: 42px; border: 0; background: var(--tint); cursor: pointer; color: var(--ink); }
.qty button:hover { background: #e9e4dc; }
.qty input { width: 56px; text-align: center; border: 0; border-radius: 0; padding: 10px 4px; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.details { padding-left: 1.2em; margin: 0; color: var(--muted); }
.details li { margin-bottom: 4px; }
.ship-note { background: var(--brand-soft); border-radius: 10px; padding: 10px 14px; font-size: 0.92rem; color: var(--brand-dark); }
@media (max-width: 760px) { .product { grid-template-columns: 1fr; gap: 22px; } }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow);
  display: flex; gap: 14px; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 50;
  max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast a { color: #fff; font-weight: 700; }

/* ---------- cart ---------- */
.cart-layout { display: grid; gap: 28px; grid-template-columns: 1.4fr 0.8fr; align-items: start; padding-block: 24px 56px; }
@media (max-width: 800px) { .cart-layout { grid-template-columns: 1fr; } }
.cart-lines { display: flex; flex-direction: column; gap: 12px; }
.cart-line { display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; align-items: center; padding: 14px; }
.cart-line .thumb { width: 84px; height: 84px; border-radius: 10px; background: var(--tint); overflow: hidden; }
.cart-line .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-line .name { font-weight: 600; margin: 0; }
.cart-line .opts { margin: 0; color: var(--muted); font-size: 0.9rem; }
.cart-line .controls { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.cart-line .line-total { font-weight: 700; text-align: right; white-space: nowrap; }
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.9rem; cursor: pointer; text-decoration: underline; padding: 0; }
.link-btn:hover { color: var(--danger); }
@media (max-width: 480px) {
  .cart-line { grid-template-columns: 64px 1fr; }
  .cart-line .thumb { width: 64px; height: 64px; }
  .cart-line .line-total { grid-column: 2; text-align: left; }
}
.summary { padding: 20px; position: sticky; top: 84px; }
.summary h2 { font-size: 1.2rem; }
.summary .row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.summary .row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-weight: 700; font-size: 1.1rem; }
.summary .note { font-size: 0.88rem; color: var(--muted); margin: 10px 0 0; }
.pay-methods { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pay-methods span { font-size: 0.75rem; font-weight: 600; padding: 4px 8px; border-radius: 6px; background: var(--tint); color: var(--muted); }
.alert { padding: 12px 14px; border-radius: 10px; font-size: 0.95rem; }
.alert.error { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c2; }
.alert.info { background: var(--brand-soft); color: var(--brand-dark); }
.alert[hidden] { display: none; }
.empty { text-align: center; padding: 56px 20px; }
.empty svg { width: 72px; height: 72px; margin: 0 auto 12px; color: #b9c3cc; }

/* ---------- success ---------- */
.success { max-width: 640px; margin: 0 auto; padding-block: 40px 64px; }
.success .check { width: 64px; height: 64px; border-radius: 50%; background: #e3f3e9; color: var(--ok); display: grid; place-items: center; margin-bottom: 16px; }
.receipt { padding: 20px; margin-top: 20px; }
.receipt .row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.receipt .row:last-child { border-bottom: 0; font-weight: 700; }
.address { white-space: pre-line; color: var(--muted); }

/* ---------- prose pages ---------- */
.prose { max-width: 720px; padding-block: 28px 64px; }
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 32px; color: var(--muted); font-size: 0.92rem; margin-top: 24px; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 16px 28px; justify-content: space-between; align-items: center; }
.site-footer a { color: var(--muted); }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- admin ---------- */
.admin { padding-block: 24px 64px; }
.admin .toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.admin .toolbar .spacer { flex: 1; }
.orders { display: flex; flex-direction: column; gap: 12px; }
.order { padding: 16px 18px; }
.order .top { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.order .top .id { font-weight: 700; }
.order .top .when { color: var(--muted); font-size: 0.9rem; }
.order .top .amt { margin-left: auto; font-weight: 700; }
.status { font-size: 0.75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; }
.status.new { background: #fbe7d6; color: #a54f13; }
.status.printing { background: var(--brand-soft); color: var(--brand-dark); }
.status.shipped { background: #e3f3e9; color: #1f6b3f; }
.status.canceled { background: #eee; color: #666; }
.status.unpaid { background: #fdecea; color: var(--danger); }
.order .body { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; margin-top: 12px; }
@media (max-width: 640px) { .order .body { grid-template-columns: 1fr; } }
.order .items { margin: 0; padding-left: 1.1em; }
.order .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.order textarea { width: 100%; min-height: 56px; resize: vertical; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88rem; }

/* ---------- catalog extras (tiers, stock, categories) ---------- */
.cat-head { grid-column: 1 / -1; margin: 12px 0 -6px; font-size: 1.15rem; }
.cat-head:first-child { margin-top: 0; }
.product-card .thumb { position: relative; }
.product-card .badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.product-card.is-soldout .thumb img { opacity: 0.55; }
.badge.soldout { background: var(--tint); color: var(--muted); }
.badge.sale { background: #fdecea; color: var(--danger); }
.badge.low { background: #fff3e0; color: #9a4f00; }
.price .tier-hint { display: block; font-weight: 500; }
.tiers { border-collapse: collapse; font-size: 0.93rem; width: 100%; max-width: 360px; }
.tiers caption { text-align: left; font-weight: 600; padding-bottom: 6px; }
.tiers td { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.tiers td:last-child { text-align: right; font-weight: 600; }

/* ---------- product gallery + featured card ---------- */
.gallery-wrap { display: flex; flex-direction: column; gap: 10px; }
.product .media { display: flex; flex-direction: column; gap: 16px; }
.product .media .details { margin-top: 4px; }
.product .buy .tiers { margin-top: 6px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.thumb-btn { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--tint); cursor: pointer; aspect-ratio: 1; }
.thumb-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-btn.on, .thumb-btn:hover { border-color: var(--brand); }
.thumb-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.product-card.featured { grid-column: span 2; }
.product-card.featured .thumb { aspect-ratio: 16 / 9; }
.color-strip { display: flex; align-items: center; gap: 6px; margin: 2px 0 8px; }
.color-strip img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.color-strip .more { font-size: 0.8rem; color: var(--muted); margin-left: 4px; }
@media (max-width: 560px) { .product-card.featured { grid-column: span 1; } .product-card.featured .thumb { aspect-ratio: 4 / 3; } }

/* ---------- product page: color/count stack (price-table products) ---------- */
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack-row select { flex: 1; min-width: 140px; }
.stack-row .qty { align-self: auto; }
.stack-row .qty input { width: 56px; }
.stack-total { font-size: 1.05rem; }

/* ---------- admin: tabs, catalog table, editors ---------- */
.tabs a.on { background: var(--brand-soft); color: var(--brand-dark); }
.table-wrap { overflow-x: auto; }
.cat-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cat-table th, .cat-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 0.95rem; }
.cat-table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: var(--tint); }
.cat-table tr.off td { opacity: 0.55; }
.cat-table .name { font-weight: 600; }
.cat-table .id { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.78rem; color: var(--muted); }
.cat-table .stock { white-space: nowrap; }
.cat-table .stock.low strong { color: #9a4f00; }
.cat-table .stock.out strong { color: var(--danger); }
.cat-table .stock button { width: 26px; height: 26px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; font: inherit; }
.cat-table .actions { white-space: nowrap; text-align: right; }
.cat-table .history td { background: var(--tint); padding: 8px 12px 12px; }
.moves { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.moves td { padding: 4px 8px; border-bottom: 1px dashed var(--line); }
.moves td.delta { font-weight: 700; text-align: right; }
.moves td.delta.neg { color: var(--danger); }
.moves td.delta.pos { color: var(--ok); }
dialog.editor { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 0; width: min(820px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
dialog.editor::backdrop { background: rgba(28, 36, 48, 0.45); }
dialog.editor form { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
dialog.editor header, dialog.editor footer { display: flex; align-items: center; gap: 10px; padding: 14px 20px; }
dialog.editor header { border-bottom: 1px solid var(--line); }
dialog.editor header h2 { margin: 0; font-size: 1.15rem; flex: 1; }
dialog.editor footer { border-top: 1px solid var(--line); }
dialog.editor > form > [data-pane], dialog.editor > form > .alert { margin: 0 20px; }
dialog.editor > form > [data-pane] { padding-block: 4px 16px; overflow-y: auto; min-height: 0; }
dialog.editor > form > .alert { margin-top: 12px; }
dialog.editor fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 14px; margin: 12px 0 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
dialog.editor legend { font-weight: 700; padding: 0 6px; }
dialog.editor label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; font-weight: 600; }
dialog.editor label small { font-weight: 400; color: var(--muted); }
dialog.editor label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
dialog.editor input, dialog.editor select, dialog.editor textarea { width: 100%; padding: 8px 10px; }
dialog.editor input[type="checkbox"], dialog.editor input[type="radio"] { width: auto; }
.grid2 { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid3 { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { font: inherit; padding: 6px 12px; border: 0; background: #fff; cursor: pointer; }
.seg button.on { background: var(--brand); color: #fff; }
table.rows { width: 100%; border-collapse: collapse; }
table.rows th { text-align: left; font-size: 0.75rem; text-transform: uppercase; color: var(--muted); padding: 0 6px 4px; }
table.rows td { padding: 3px 6px 3px 0; }
table.rows td:last-child { width: 36px; }
table.rows input { padding: 6px 8px; }
.option-row { border: 1px dashed var(--line); border-radius: 8px; padding: 10px; display: grid; gap: 8px; grid-template-columns: 1fr 1fr 1fr auto; align-items: end; }
.option-row textarea { grid-column: 1 / -1; }
.x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 6px; }
.x:hover { color: var(--danger); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; }
@media (max-width: 640px) { .option-row { grid-template-columns: 1fr 1fr; } }

/* ---------- admin: filament cards + shopping list ---------- */
.filaments { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.filament { display: grid; grid-template-columns: 88px 1fr; gap: 12px; padding: 12px; }
.filament .swatch { width: 88px; height: 88px; border-radius: 10px; border: 1px solid var(--line); background: var(--tint); object-fit: contain; display: grid; place-items: center; color: var(--muted); font-size: 0.75rem; text-align: center; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filament .fields { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.filament .fields input { padding: 6px 8px; font-size: 0.9rem; min-width: 0; }
.filament .fields input:not([type="checkbox"]) { width: 100%; }
.filament .row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.nav.tabs { flex-wrap: wrap; }
body[data-page="admin"] .site-header .container { flex-wrap: wrap; }
.filament .foot { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; }
.filament.off { opacity: 0.6; }
.shop-swatch { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); background: var(--tint); display: block; }
.color-swatch { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); vertical-align: middle; flex: none; }

/* ---------- admin: pages editor ---------- */
.pages-form { display: flex; flex-direction: column; gap: 14px; max-width: 900px; }
.pages-form label, #doc-editor label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; font-weight: 600; }
.pages-form label small, #doc-editor label small { font-weight: 400; color: var(--muted); }
.pages-form input, .pages-form textarea, #doc-editor input { width: 100%; padding: 8px 10px; }
.pages-form textarea { min-height: 96px; font-family: inherit; }
.pages-form .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pages-form .rows { display: flex; flex-direction: column; gap: 10px; }
.pages-form .row-card { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; background: var(--surface); }
.pages-form .row-card .head { display: flex; gap: 8px; align-items: center; }
.pages-form .row-card .head input { flex: 1; }
.pages-form .row-card .head .x { flex: none; }
@media (max-width: 560px) { .pages-form .pair { grid-template-columns: 1fr; } }

/* ---------- markdown pages ---------- */
.prose img { border-radius: var(--radius); border: 1px solid var(--line); margin: 8px 0; }
.prose blockquote { margin: 0 0 1em; padding: 8px 16px; border-left: 4px solid var(--accent); background: var(--brand-soft); border-radius: 0 10px 10px 0; }
.prose blockquote p { margin: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.prose code { background: var(--tint); padding: 1px 6px; border-radius: 6px; font-size: 0.92em; }
.prose h2 { margin-top: 1.6em; }
.prose-center p { margin: 0 0 12px; color: var(--muted); }
/* admin: markdown editor */
.md-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.md-editor textarea { min-height: 520px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9rem; line-height: 1.5; width: 100%; padding: 12px; }
.md-preview { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 18px 22px; min-height: 520px; max-height: 70vh; overflow: auto; }
.md-preview h1 { font-size: 1.6rem; }
.md-help { font-size: 0.85rem; color: var(--muted); }
.md-help code { background: var(--tint); padding: 1px 5px; border-radius: 5px; }
@media (max-width: 860px) { .md-editor { grid-template-columns: 1fr; } }

/* admin: EasyMDE toolbar editor + photo picker */
.md-editor .EasyMDEContainer { width: 100%; }
.md-editor .EasyMDEContainer .CodeMirror { min-height: 520px; border-radius: 10px; border-color: var(--line); font-size: 0.95rem; line-height: 1.55; }
.md-editor .editor-toolbar { border-radius: 10px 10px 0 0; border-color: var(--line); background: var(--surface); }
.md-editor .editor-toolbar button.active, .md-editor .editor-toolbar button:hover { background: var(--brand-soft); border-color: var(--line); }
.md-editor .editor-toolbar + .CodeMirror { border-radius: 0 0 10px 10px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.pick-grid button { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--tint); cursor: pointer; text-align: left; }
.pick-grid button img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; }
.pick-grid button span { display: block; font-size: 0.75rem; padding: 4px 6px; color: var(--muted); overflow-wrap: anywhere; }
.pick-grid button.on { border-color: var(--brand); }

/* home page markdown blocks */
.home-md { padding-top: 0; }
.home-md .container.prose { max-width: 760px; margin-inline: auto; padding-block: 0; }
.step p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.step ul { margin: 6px 0 0; padding-left: 1.1em; color: var(--muted); font-size: 0.95rem; }
/* admin: home block editor */
.blocks { display: flex; flex-direction: column; gap: 12px; max-width: 980px; }
.block { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.block .bar { display: flex; align-items: center; gap: 8px; }
.block .bar .badge { text-transform: uppercase; letter-spacing: 0.04em; }
.block .bar .spacer { flex: 1; }
.block .bar button { font: inherit; }
.block label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; font-weight: 600; }
.block label small { font-weight: 400; color: var(--muted); }
.block input, .block textarea, .block select { width: 100%; padding: 8px 10px; }
.block .EasyMDEContainer .CodeMirror { min-height: 220px; }
.block-add { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* Storefront audit repairs: product information and controls precede detail on phones. */
:root { --focus: #0e5a68; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
[id] { scroll-margin-top: 112px; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 100; padding: 12px; background: var(--surface); color: var(--ink); }
.skip-link:focus { top: 12px; }
.hero { padding-block: 48px; }
.hero h1 { max-width: 14ch; font-size: clamp(2rem, 4.4vw, 3.8rem); letter-spacing: -0.045em; }
.hero p.lead { max-width: 42ch; }
.hero .art { width: min(100%, 360px); }
.hero .art img { width: 100%; height: auto; max-height: 380px; object-fit: contain; border-radius: var(--radius); }
.hero .container { grid-template-columns: 1.15fr 0.85fr; }
.section { padding-block: 36px; }
.section-head { align-items: center; }
.collection { background: var(--surface); border-block: 1px solid var(--line); }
.collection + .collection { border-top: 0; }
.collection .section-head h2 { max-width: 22ch; }
.product-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.product-card.featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; box-shadow: none; }
.product-card.featured .thumb { aspect-ratio: 4 / 3; }
.product-card.featured .body { justify-content: center; gap: 12px; padding: 32px; }
.product-card.featured h3 { font-size: clamp(1.3rem, 2.5vw, 1.9rem); max-width: 20ch; }
.product-card.featured .short { flex: none; }
.product-card .thumb { min-width: 0; }
.product-card .thumb img { position: absolute; inset: 0; object-fit: contain; }
.sticker-card .thumb img { padding: inherit; }
.sticker-card .thumb { aspect-ratio: 1; padding: 12px; }
.sticker-card h3 { font-size: 1rem; }
.card-action { margin-top: 8px; color: var(--brand-dark); font-weight: 650; font-size: 0.92rem; }
.more-products { margin-top: 24px; }
.more-products > summary, .price-details > summary { cursor: pointer; padding: 12px 0; color: var(--brand-dark); font-weight: 650; }
.more-products .grid { margin-top: 18px; }
.product { grid-template-areas: 'media heading' 'media buy' 'details buy'; grid-template-rows: auto auto 1fr; row-gap: 18px; }
.product .media { grid-area: media; min-width: 0; }
.product-heading { grid-area: heading; }
.product .buy { grid-area: buy; min-width: 0; gap: 14px; }
.product-details { grid-area: details; padding-top: 12px; }
.product-details h2 { font-size: 1.15rem; }
.product-heading h1 { font-size: clamp(1.65rem, 3vw, 2.45rem); }
.product .gallery { display: block; width: 100%; padding: 0; cursor: zoom-in; aspect-ratio: 4 / 3; }
.product .gallery img { object-fit: contain; }
.sticker-gallery .gallery { aspect-ratio: 1; }
.enlarge-label { position: absolute; bottom: 8px; right: 8px; padding: 4px 10px; border-radius: 5px; background: var(--surface); color: var(--brand-dark); font-size: 0.8rem; }
.thumbs { display: flex; overflow-x: auto; padding: 4px; gap: 8px; }
.thumb-btn { flex: 0 0 56px; height: 56px; }
.thumb-btn img { object-fit: contain; }
.gallery-caption { margin: 0; font-size: 0.82rem; }
.photo-dialog { border: 0; border-radius: var(--radius); background: var(--surface); max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); padding: 12px; }
.photo-dialog::backdrop { background: rgba(15,26,29,0.8); }
.photo-dialog form { display: flex; justify-content: end; margin-bottom: 8px; }
.photo-dialog img { object-fit: contain; max-height: 75vh; max-width: 85vw; width: auto; }
.product-description { margin: 0; }
#purchase-feedback { margin: 0; padding: 12px; background: var(--brand-soft); border-radius: 8px; }
.stack-row { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.stack-row [data-remove] { min-height: 32px; }
.qty button { min-height: 44px; }
.site-footer { margin-top: 0; }
@media (max-width: 760px) {
  .hero { padding-block: 28px; }
  .hero .container { grid-template-columns: 1fr; gap: 16px; }
  .hero .art { order: 0; width: 100%; }
  .hero .art img { max-height: 240px; }
  .hero h1 { max-width: 18ch; }
  .hero p.lead { font-size: 1rem; }
  .hero .btn.lg { font-size: 0.95rem; padding: 12px 16px; }
  .product { grid-template-areas: 'heading' 'media' 'buy' 'details'; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; gap: 16px; padding-top: 18px; }
  .product .gallery { aspect-ratio: 4 / 3; }
  .product-card.featured { grid-template-columns: 1fr; }
  .product-card.featured .body { padding: 20px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .sticker-card .body { padding: 12px; }
  .sticker-card h3 { font-size: 0.9rem; }
  .sticker-card .short { display: none; }
  .sticker-card .thumb { padding: 6px; }
  .more-products .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .section { padding-block: 28px; }
}
@media (max-width: 560px) {
  .site-header .container { flex-wrap: wrap; gap: 0; padding-top: 6px; }
  .logo { margin: auto; }
  .nav { margin: 0; width: 100%; justify-content: space-between; }
  .nav a:not(.cart-link) { display: inline-flex; }
  .nav a { padding: 9px 6px; font-size: 0.8rem; }
  .site-header .wordmark { height: 34px; }
  .site-header .logo img:first-child { height: 34px; width: 34px; }
  .product-description { font-size: 0.95rem; }
  .stack-row { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
@media (min-width: 761px) { .product-grid:has(> .sticker-card) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Keep the enlargement affordance off the artwork itself. */
.product .gallery img { height: calc(100% - 32px); }
.enlarge-label { bottom: 0; right: 0; left: 0; text-align: right; height: 32px; border-radius: 0; }

/* Filament photos are one slot per available color; missing photos use the brand. */
.placeholder-swatch img { width: 66px; height: 54px; object-fit: contain; }
.placeholder-swatch span { font-size: 0.7rem; }
.placeholder-text { position: absolute; bottom: 10px; left: 0; width: 100%; text-align: center; font-size: 0.9rem; color: var(--muted); }
.product .gallery.coming-soon { cursor: default; opacity: 1; }
.product .gallery.coming-soon img { padding: 30px; }
.filament-thumbs .thumb-btn { flex-basis: 74px; height: 90px; display: flex; flex-direction: column; align-items: center; }
.filament-thumbs .thumb-btn img { height: 56px; flex: none; }
.filament-thumbs .thumb-btn span { font-size: 0.7rem; line-height: 1.1; padding: 3px; overflow-wrap: anywhere; }
.color-swatch, .cart-line .thumb img { object-fit: contain; }

/* Homepage product carousel: stable frame for both portrait prints and square art. */
.hero .art.hero-carousel { width: min(100%, 420px); min-width: 0; }
.hero-slide a { display: block; color: var(--ink); text-decoration: none; }
.hero .hero-slide img { display: block; width: 100%; height: clamp(230px, 29vw, 350px); max-height: none; object-fit: contain; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.hero-slide-label { display: flex; align-items: center; justify-content: center; min-height: 3.5em; padding: 8px 4px; font-size: 0.85rem; line-height: 1.3; text-align: center; }
.hero-carousel-controls { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; }
.hero-dots { display: flex; gap: 2px; }
.hero-dots button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 50%; width: 26px; height: 32px; padding: 0; cursor: pointer; }
.hero-dots button[aria-pressed="true"] { background: var(--brand); color: white; border-color: var(--brand); }
.hero-carousel-controls button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* A lightweight, decorative Minnesota shoreline beneath the home hero. */
body[data-page="home"] .hero {
  padding-bottom: 116px;
  background:
    url('/img/brand/minnesota-landscape.svg') center bottom / max(100%, 1200px) auto no-repeat,
    radial-gradient(1200px 400px at 10% -10%, #d3f3f8 0%, transparent 60%),
    radial-gradient(800px 300px at 100% 0%, #dfe9eb 0%, transparent 60%);
}
@media (max-width: 760px) {
  body[data-page="home"] .hero {
    padding-bottom: 86px;
    background-size: 800px auto, auto, auto;
  }
}

/* Privacy controls share the admin card and toolbar styles. */
.privacy-order { padding: 20px; margin: 16px 0; }
.privacy-order h2 { font-size: 1.15rem; }
.privacy-order .toolbar { flex-wrap: wrap; align-items: end; }
.privacy-order label { display: grid; gap: 4px; }

.privacy-order input[type="date"] { font: inherit; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; min-width: 0; max-width: 100%; }

.mail-setup { margin: 16px 0; }
.mail-workspace { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.mail-list-item { display: grid; text-align: left; gap: 6px; width: 100%; padding: 15px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; overflow-wrap: anywhere; }
.mail-list-item.selected { border-color: var(--accent); background: var(--tint); }
.mail-list-item small { color: var(--muted); }
.mail-detail { padding: 20px; min-width: 0; }
.mail-detail h2 { margin-top: 0; font-size: 1.2rem; }
.mail-detail form, .mail-detail label { display: grid; gap: 8px; min-width: 0; }
.mail-detail label { margin-bottom: 12px; }
.mail-detail input, .mail-detail textarea { width: 100%; min-width: 0; font: inherit; padding: 10px; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.mail-detail textarea { white-space: pre-wrap; overflow-wrap: anywhere; resize: vertical; }
.mail-detail .toolbar, #tab-email > .toolbar { flex-wrap: wrap; }
.mail-detail details { margin-top: 22px; }
@media (max-width: 700px) { .mail-workspace { grid-template-columns: minmax(0,1fr); } }

#tab-email[aria-busy=true] { cursor: progress; }
#tab-email[aria-busy=true] button, #tab-email[aria-busy=true] input, #tab-email[aria-busy=true] textarea, #tab-email[aria-busy=true] select { pointer-events: none; opacity: .65; }

/* Extra effects stay inside their filament's single gallery slot. */
.photo-views { min-width: 0; border-top: 1px solid var(--line); padding-top: 8px; }
.photo-views > p { margin: 0 0 4px; font-weight: 600; }
.view-btn { flex: 0 0 98px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px; border: 2px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; }
.view-btn img { width: 100%; height: 54px; object-fit: contain; }
.view-btn span { font-size: .75rem; line-height: 1.2; overflow-wrap: anywhere; }
.view-btn[aria-pressed="true"] { border-color: var(--brand); }
.view-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.filament-views { border-block: 1px solid var(--line); padding: 8px 0; }
.filament-views summary { cursor: pointer; font-size: .85rem; }
.filament-view { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 6px; border-top: 1px solid var(--line); padding: 10px 0; }
.filament-view > img { width: 42px; height: 58px; object-fit: contain; }
.view-fields { min-width: 0; }
.view-fields label { font-size: .75rem; }
.view-fields textarea { width: 100%; min-width: 0; padding: 6px; font-size: .85rem; }
.view-fields .photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 480px) { .filament:has(.filament-views[open]) { grid-template-columns: 1fr; } }

.mail-blocks { margin: 16px 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.mail-blocks summary { cursor: pointer; font-weight: 600; }
.mail-blocks .toolbar { align-items: end; }
.mail-blocks input { max-width: 100%; }
.blocked-sender { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.blocked-sender span { min-width: 0; overflow-wrap: anywhere; }
.blocked-sender small { display: block; color: var(--muted); }
.mail-blocks form label { display: flex; flex-direction: column; gap: 6px; flex: 1 1 220px; min-width: 0; }
.mail-blocks input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
