/* ==========================================================
   YinYang — store styles
   The 3 main colors are set in the Store manager (Website → Brand).
   Every other shade below is mixed from them automatically.
   ========================================================== */
:root {
  --ink: #141414;
  --paper: #f7f4ee;
  --accent: #b23a2b;
  --ink-2: color-mix(in srgb, var(--ink) 86%, var(--paper));
  --paper-2: color-mix(in srgb, var(--paper) 92%, var(--ink));
  --white: color-mix(in srgb, var(--paper) 45%, #fff);
  --line: color-mix(in srgb, var(--paper) 88%, var(--ink));
  --muted: color-mix(in srgb, var(--ink) 60%, var(--paper));
  --ok: #2f6b3a;
  --warn: #9a5b00;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20, 20, 20, 0.06), 0 10px 30px rgba(20, 20, 20, 0.1);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --header-h: 68px;
}
/* Page size (Website → Brand → Page size). Everything measured in rem grows with the text. */
:root { --container: 1200px; }
:root[data-size="large"] { font-size: 112.5%; --container: 1360px; --header-h: 76px; }
:root[data-size="xlarge"] { font-size: 125%; --container: 1520px; --header-h: 84px; }
:root[data-font="sans"] { --font-display: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; }
:root[data-font="classic"] { --font-display: Georgia, "Times New Roman", serif; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.4em; }
p { margin: 0 0 1em; }

.container { width: min(var(--container), 100% - 40px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.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; }
[hidden] { display: none !important; }

/* ---------- yin yang mark ---------- */
.yy { display: block; width: 100%; height: 100%; color: var(--ink); }
.yy-d { fill: currentColor; }
.yy-l { fill: var(--yy-light, var(--white)); }
.yy-ring { fill: none; stroke: currentColor; stroke-width: 2.5; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.75em 1.35em; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 600; font-size: 0.95rem; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover:not(:disabled) { background: var(--ink-2); }
.btn-light { background: var(--paper); color: var(--ink); }
.btn-light:hover { background: var(--white); }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-sm { padding: 0.5em 1em; font-size: 0.85rem; }
.btn-block { width: 100%; }

.link-btn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--ink-2); }
.link-btn.danger { color: var(--accent); }
.link-reset { all: unset; cursor: pointer; }
.link-reset:hover { text-decoration: underline; text-underline-offset: 3px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent;
  font-size: 1.6rem; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.icon-btn:hover { background: var(--paper-2); }

:focus-visible, .link-reset:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- form controls ---------- */
input, select, textarea {
  width: 100%; padding: 0.6rem 0.8rem; font-size: 0.95rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent);
}
textarea { resize: vertical; }
select { width: auto; cursor: pointer; }
input[type="radio"], input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--ink); }

label { display: grid; gap: 0.35rem; font-size: 0.88rem; font-weight: 500; }
/* Keep "(optional)" on the same line as its label, with the box underneath. */
label:has(> .opt) { grid-template-columns: auto 1fr; column-gap: 0.35rem; }
label:has(> .opt) > :is(input, select, textarea, .hint) { grid-column: 1 / -1; }
.field-label { display: block; font-size: 0.88rem; font-weight: 500; margin-bottom: 0.35rem; }
.opt { color: var(--muted); font-weight: 400; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; align-items: end; }
.row-2.row-steps { grid-template-columns: 2fr 3fr; }
.row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0.85rem; align-items: end; }
fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.85rem; }
legend { padding: 0; margin-bottom: 0.75rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.radio, .check {
  display: flex; align-items: center; gap: 0.65rem; padding: 0.8rem 1rem; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); font-size: 0.95rem;
}
.radio:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

/* ---------- announcement + header ---------- */
.announce { background: var(--ink); color: var(--paper); text-align: center; font-size: 0.8rem; letter-spacing: 0.03em; padding: 0.5em 1em; }

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 2.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; }
.logo { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; flex: none; }
.logo .yy { width: 100%; height: 100%; }
.logo.custom { width: auto; height: auto; }
.logo.custom img { height: 36px; width: auto; max-width: 180px; object-fit: contain; }
.brand-sub { font-family: var(--font-body); font-size: 0.8rem; font-weight: 500; color: var(--muted); border-left: 1px solid var(--line); padding-left: 0.7rem; margin-left: 0.2rem; }
.main-nav { display: flex; gap: 1.75rem; }
.main-nav a { text-decoration: none; font-weight: 500; font-size: 0.95rem; color: var(--ink-2); }
.main-nav a:hover { text-decoration: underline; text-underline-offset: 5px; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }

.cart-btn {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.55rem 1rem; cursor: pointer;
  border-radius: 999px; border: 1.5px solid var(--ink); background: transparent; font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.cart-btn:hover { background: var(--ink); color: var(--paper); }
.cart-btn svg { width: 18px; height: 18px; }
.cart-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.75rem; }
.cart-btn.bump { animation: bump 0.4s ease; }
@keyframes bump { 35% { transform: scale(1.1); } }

/* ---------- admin login button + menu (next to the cart) ---------- */
.account-btn {
  display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.55rem 0.95rem; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink);
  font-weight: 600; font-size: 0.95rem; text-decoration: none; white-space: nowrap; transition: border-color 0.15s;
}
.account-btn:hover { border-color: var(--ink); }
.account-btn svg { width: 18px; height: 18px; }
.account-menu { position: relative; }
.account-avatar { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 0.75rem; }
.account-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; display: grid; min-width: 210px; padding: 0.4rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); box-shadow: var(--shadow);
}
.account-dropdown a, .account-dropdown button {
  padding: 0.6rem 0.8rem; border: 0; border-radius: 6px; background: none; color: var(--ink);
  font-size: 0.92rem; text-align: left; text-decoration: none; cursor: pointer;
}
.account-dropdown a:hover, .account-dropdown button:hover { background: var(--paper-2); }

/* ---------- pages: Home (banner + About) and Shop (products + category tabs) ---------- */
.home-page .shop { display: none; }
.shop-page .hero, .shop-page .about { display: none; }
.shop-page .shop { padding-top: 3rem; }
.main-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px; }

/* category tabs inside the Shop: one page per category */
.category-tabs { display: flex; gap: 0.25rem; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.category-tabs::-webkit-scrollbar { display: none; }
.category-tab {
  padding: 0.55rem 1.05rem; border: 1px solid var(--line); border-radius: 999px; background: var(--white);
  color: var(--ink-2); font-size: 0.9rem; font-weight: 600; text-decoration: none; white-space: nowrap; transition: border-color 0.15s;
}
.category-tab:hover { border-color: var(--ink); }
.category-tab[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.toolbar-right { margin-left: auto; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1fr 1fr; min-height: min(76vh, 620px); }
.hero-dark { background: var(--ink); color: var(--paper); display: flex; align-items: center; justify-content: flex-end; padding: 4rem clamp(1.5rem, 5vw, 4.5rem); }
.hero-copy { max-width: 500px; }
.eyebrow { margin: 0 0 1.1rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: color-mix(in srgb, var(--paper) 60%, transparent); }
.hero h1 { font-size: clamp(2.5rem, 5vw, 4.3rem); font-weight: 400; }
.hero h1 em { font-style: italic; }
.lede { max-width: 36ch; margin: 0 0 2rem; font-size: 1.12rem; color: color-mix(in srgb, var(--paper) 78%, transparent); }
.hero-light { position: relative; overflow: hidden; display: grid; place-items: center; padding: 3rem; background: var(--paper); }
.hero-light .mark { width: min(340px, 70%); aspect-ratio: 1; animation: spin 80s linear infinite; }
.hero-light.has-image { padding: 0; min-height: 320px; }
.hero-light.has-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.announce:empty, .eyebrow:empty, .lede:empty, .hero .btn:empty { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- shop ---------- */
.shop { padding: 4.5rem 0 5.5rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.section-head h2 { font-size: clamp(1.9rem, 3vw, 2.5rem); margin: 0; }
.section-head p { margin: 0; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: 1.5rem; margin-bottom: 2rem; border-bottom: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { padding: 0.45rem 1.05rem; border-radius: 999px; border: 1px solid var(--line); background: var(--white); font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: border-color 0.15s; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.toolbar-right { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 0.85rem; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search input { width: 230px; padding-left: 2.3rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 2.25rem 1.5rem; }
.card { display: flex; flex-direction: column; }
.card-media {
  position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: pointer;
  aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--paper-2);
}
.card-media > img, .card-media > .placeholder { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease, opacity 0.2s; }
.card:hover .card-media > img { transform: scale(1.04); }
.card:hover .placeholder .yy { transform: rotate(60deg); }
.card.is-sold-out .card-media > img, .card.is-sold-out .card-media > .placeholder { opacity: 0.5; filter: grayscale(1); }
.card-tags { position: absolute; top: 0.75rem; left: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.card-body { padding: 0.95rem 0.15rem 0; }
.card-cat { margin: 0 0 0.15rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); }
.card-title { font-size: 1.18rem; margin: 0 0 0.65rem; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }

.tag { display: inline-block; padding: 0.25em 0.7em; border-radius: 999px; background: var(--white); color: var(--ink); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.tag-dark { background: var(--ink); color: var(--paper); }
.tag-accent { background: var(--accent); color: #fff; }
.tag-sm { margin-left: 0.5rem; box-shadow: none; border: 1px solid var(--line); font-size: 0.68rem; vertical-align: middle; }

.price { font-weight: 600; font-size: 1.05rem; }
.price.on-sale { color: var(--accent); }
.compare { margin-left: 0.45rem; font-size: 0.9rem; color: var(--muted); }

.placeholder { display: grid; place-items: center; }
.placeholder .yy { width: 42%; height: auto; aspect-ratio: 1; transition: transform 0.8s ease; }
/* Drawn product pictures (Store.productArt): each product gets a soft tile in its own color. */
.placeholder.art { --tile: color-mix(in srgb, var(--art, var(--ink)) 12%, var(--paper)); background: var(--tile); }
.art-svg { width: 68%; height: auto; aspect-ratio: 1; overflow: visible; transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.card:hover .art-svg, .category-card:hover .art-svg { transform: translateY(-5px) rotate(-3deg) scale(1.03); }
.a-main { fill: var(--art); }
.a-shade { fill: color-mix(in srgb, var(--art) 70%, #000); }
.a-light { fill: color-mix(in srgb, var(--art) 55%, #fff); }
.a-paper { fill: #fff; }
.a-bg { fill: var(--tile); }
.a-ink { fill: none; stroke: color-mix(in srgb, var(--art) 30%, #c9c9c9); stroke-width: 4; stroke-linecap: round; }
.a-ink-fill { fill: #26262b; }
.a-screen { fill: color-mix(in srgb, var(--art) 35%, #eef2f7); }
.a-ring { fill: none; stroke: #8d8d93; stroke-width: 6; stroke-linecap: round; }
.a-layer { fill: none; stroke: rgba(255, 255, 255, 0.2); stroke-width: 1.5; }

.empty { text-align: center; padding: 4rem 1rem; color: var(--muted); }
.empty .yy, .cart-empty .yy { width: 56px; height: 56px; margin: 0 auto 1rem; opacity: 0.35; }

/* ---------- home page: categories, popular, how to order ---------- */
.shop-page .home-only { display: none; }
.home-section { padding-top: 4.5rem; }
.see-all { font-weight: 600; text-decoration: none; white-space: nowrap; }
.see-all:hover { text-decoration: underline; text-underline-offset: 4px; }

.category-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr)); gap: 1.25rem; }
.category-card {
  display: grid; grid-template-columns: 116px 1fr auto; align-items: center; gap: 1.2rem;
  padding: 0.75rem 1.4rem 0.75rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white); color: inherit; text-decoration: none;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.category-card:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow); }
.category-card-media { width: 116px; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--paper-2); }
.category-card-media > img, .category-card-media > .placeholder { width: 100%; height: 100%; object-fit: cover; }
.category-card-body { display: grid; gap: 0.2rem; }
.category-card-body strong { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; }
.category-card-arrow { font-size: 1.35rem; transition: transform 0.15s; }
.category-card:hover .category-card-arrow { transform: translateX(4px); }

.how { margin-top: 5rem; padding: 4.5rem 0; background: var(--paper-2); }
.how h2 { margin: 0 0 2rem; text-align: center; font-size: clamp(1.9rem, 3vw, 2.5rem); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.steps li { padding: 1.75rem; border-radius: var(--radius); background: var(--white); }
.step-num {
  display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; margin-bottom: 1rem;
  border-radius: 50%; background: var(--ink); color: var(--paper); font-weight: 700;
}
.steps h3 { margin: 0 0 0.4rem; font-size: 1.25rem; }
.steps p { margin: 0; color: var(--ink-2); }

/* ---------- about + footer ---------- */
.about { background: var(--ink); color: var(--paper); padding: 5.5rem 0; }
.about-inner { display: grid; grid-template-columns: 180px 1fr; gap: 3.5rem; align-items: center; max-width: 920px; }
.about-visual .yy { color: var(--paper); --yy-light: var(--ink); }
.about-inner:has(.about-visual.has-image) { grid-template-columns: minmax(240px, 380px) 1fr; max-width: 1100px; }
.about-visual.has-image img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }
.about h2 { font-size: clamp(1.9rem, 3vw, 2.5rem); }
.about p { max-width: 60ch; font-size: 1.05rem; color: color-mix(in srgb, var(--paper) 80%, transparent); }

.site-footer { padding: 3.5rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.footer-address { margin: 0.2rem 0 0; font-size: 0.95rem; }
.social-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem; margin-top: 1rem; }
.social-links a { font-size: 0.9rem; font-weight: 500; text-underline-offset: 3px; }
.footer-tag { margin-top: 0.75rem; }
.footer-links h3 { margin-bottom: 0.85rem; font-family: var(--font-body); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.footer-links a { display: block; margin-bottom: 0.45rem; font-size: 0.95rem; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--muted); }

/* ---------- cart drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(20, 20, 20, 0.45); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.scrim.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; z-index: 50; width: min(420px, 100%); height: 100%;
  display: flex; flex-direction: column; background: var(--paper);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.14);
  transform: translateX(105%); transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 1.45rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: 0.25rem 1.25rem; }
.drawer-foot { display: grid; gap: 0.8rem; padding: 1.25rem; border-top: 1px solid var(--line); background: var(--white); }
.drawer-foot .link-btn { justify-self: center; font-size: 0.9rem; }

.cart-line { display: grid; grid-template-columns: 72px 1fr auto; gap: 0.9rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.cart-thumb { width: 72px; height: 90px; border-radius: var(--radius-sm); overflow: hidden; background: var(--paper-2); }
.cart-thumb > img, .cart-thumb > .placeholder { width: 100%; height: 100%; object-fit: cover; }
.cart-info p { margin: 0 0 0.35rem; }
.cart-name { font-weight: 600; }
.cart-right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.cart-total { margin: 0; font-weight: 600; }
.cart-empty { text-align: center; padding: 4.5rem 1rem; color: var(--muted); }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--white); overflow: hidden; }
.qty button { width: 38px; height: 42px; border: 0; background: transparent; cursor: pointer; font-size: 1.1rem; }
.qty button:hover:not(:disabled) { background: var(--paper-2); }
.qty button:disabled { opacity: 0.3; cursor: not-allowed; }
.qty input { width: 46px; padding: 0; border: 0; text-align: center; background: transparent; box-shadow: none; -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-inner-spin-button, .qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty-sm button { width: 30px; height: 30px; font-size: 1rem; }
.qty-sm span { min-width: 22px; text-align: center; font-size: 0.9rem; font-weight: 600; }

.summary { display: grid; gap: 0.4rem; margin: 0; }
.summary div { display: flex; justify-content: space-between; font-size: 0.95rem; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 500; }
.summary .grand { margin-top: 0.3rem; padding-top: 0.65rem; border-top: 1px solid var(--line); font-size: 1.1rem; }
.summary .grand dt { color: var(--ink); font-weight: 600; }
.summary .grand dd { font-weight: 700; }

/* ---------- dialogs ---------- */
.modal {
  width: min(940px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto;
  padding: 0; border: 0; border-radius: 20px; background: var(--paper); color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}
.modal::backdrop { background: rgba(20, 20, 20, 0.5); backdrop-filter: blur(2px); }
.modal[open] { animation: pop 0.22s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
.modal-close { position: absolute; top: 12px; right: 12px; z-index: 2; background: var(--white); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
.modal-inner { padding: 2.25rem; }

.pd { display: grid; grid-template-columns: 1fr 1fr; }
.pd-media { min-height: 26rem; background: var(--paper-2); } /* stretches to the height of the text beside it */
.pd-media > img, .pd-media > .placeholder { width: 100%; height: 100%; object-fit: cover; }
.pd-info { display: flex; flex-direction: column; padding: 3rem 2.25rem 2.25rem; }
.pd-info h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
.pd-price { margin-bottom: 1.25rem; }
.pd-price .price { font-size: 1.4rem; }
.pd-desc { white-space: pre-line; color: var(--ink-2); }
.pd-stock { font-size: 0.9rem; font-weight: 600; color: var(--ok); margin-bottom: 1.75rem; }
.pd-stock.low { color: var(--warn); }
.pd-stock.out { color: var(--accent); }
.pd-buy { display: flex; gap: 0.75rem; margin-top: auto; }
.pd-buy .btn { flex: 1; }
.pd-share { align-self: flex-start; margin-top: 1rem; font-size: 0.88rem; }

/* sizes: Small / Medium / Large */
.price .from { font-size: 0.8em; font-weight: 500; color: var(--muted); }
.pd-sizes { margin: 0 0 1.5rem; gap: 0.6rem; }
.pd-sizes legend { margin-bottom: 0.5rem; }
.size-options { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.size-option { position: relative; display: block; cursor: pointer; font-weight: 400; }
.size-option input { position: absolute; opacity: 0; pointer-events: none; }
.size-option span {
  display: grid; gap: 0.1rem; min-width: 5.5rem; padding: 0.55rem 0.9rem; text-align: center;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--white); font-size: 0.85rem; color: var(--muted);
}
.size-option b { color: var(--ink); font-size: 0.95rem; }
.size-option:hover span { border-color: var(--ink-2); }
.size-option input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.size-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.pd-sizes:disabled .size-option { cursor: not-allowed; opacity: 0.5; }

/* Custom print request (made-to-order products) */
.pd-stock.made { color: var(--ink-2); }
.pd-request { display: grid; gap: 0.75rem; }
.pd-request > fieldset { margin: 0; gap: 0.85rem; }
.pd-request > fieldset:disabled { opacity: 0.55; }
.pd-request textarea { resize: vertical; }
.pd-request .hint { margin: -0.25rem 0 0; text-align: center; }
.pd-request > .link-btn { justify-self: start; }
.pd-colors { margin: 0; gap: 0.5rem; }
.pd-colors legend { margin-bottom: 0.4rem; }
.swatches { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.swatch {
  position: relative; display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.4rem 0.75rem 0.4rem 0.45rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--white); cursor: pointer; font-size: 0.88rem;
}
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch small { margin-left: 0.3rem; color: var(--muted); font-size: 0.75rem; }
.swatch-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.swatch:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.swatch:has(input:checked) .swatch-dot { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--ink); }
.swatch:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.request-sent { margin: auto 0; text-align: center; }
.request-sent h2 { margin-top: 0.75rem; }
.request-sent p { margin: 0 0 0.5rem; }
.request-tick { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 1.6rem; }
.request-code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 1.6rem; font-weight: 700; letter-spacing: 0.08em; }
.request-sent .btn { margin-top: 0.75rem; }

/* "Check a print request" box */
.modal.modal-sm { width: min(560px, calc(100% - 32px)); }
.modal-sm h2 { margin-bottom: 0.3rem; }
.request-check-form { display: flex; gap: 0.5rem; margin: 1rem 0; }
.request-check-form input { flex: 1; text-transform: uppercase; font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.06em; }
.request-status { margin-bottom: 1.25rem; padding: 1rem 1.1rem; border-radius: var(--radius-sm); border-left: 4px solid var(--muted); background: var(--paper-2); }
.request-status p { margin: 0.25rem 0 0; }
.request-status-id { margin: 0 0 0.2rem !important; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.8rem; color: var(--muted); }
.request-status.yes { border-left-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--paper)); }
.request-status.no { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--paper)); }
.request-status.wait { border-left-color: var(--warn); }
#myRequests h3 { margin: 0.5rem 0 0.6rem; font-size: 1.05rem; }
.my-requests { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.my-requests li { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.65rem 0.8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.my-requests li > span:last-child { display: grid; gap: 0.1rem; }
.request-dot { flex: none; width: 10px; height: 10px; margin-top: 0.4rem; border-radius: 50%; background: var(--warn); }
.request-dot.yes { background: var(--ok); }
.request-dot.no { background: var(--accent); }

/* "You might also like" under the product */
.pd-related { padding: 1.5rem 2.25rem 2rem; border-top: 1px solid var(--line); }
.pd-related h3 { margin: 0 0 1rem; font-size: 1.15rem; }
.related-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; }
.related-item {
  display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 0.75rem; padding: 0.5rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white);
  color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color 0.15s;
}
.related-item:hover { border-color: var(--ink); }
.related-thumb { width: 64px; aspect-ratio: 1; border-radius: 7px; overflow: hidden; }
.related-thumb > img, .related-thumb > .placeholder { width: 100%; height: 100%; object-fit: cover; }
.related-text { display: grid; gap: 0.15rem; font-size: 0.9rem; line-height: 1.3; }
.related-name { font-weight: 600; }
.related-text .price { font-size: 0.85rem; }

.sizes-field { display: grid; gap: 0.45rem; }
.size-rows { display: grid; gap: 0.45rem; }
.size-row { display: grid; grid-template-columns: auto 1fr 7rem auto; gap: 0.5rem; align-items: center; }
.size-row input[type="checkbox"] { width: 18px; height: 18px; }
.sizes-field .link-btn { justify-self: start; }
.size-price { display: block; white-space: nowrap; }

.checkout-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 2.25rem; margin-top: 1.25rem; }
#checkoutForm { display: grid; gap: 0; }
#checkoutForm > label { margin-bottom: 1.25rem; }
.checkout-summary { align-self: start; position: sticky; top: 0; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.checkout-summary h3 { font-size: 1.2rem; margin-bottom: 1rem; }
.mini-lines { display: grid; gap: 0.85rem; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.mini-lines li { display: grid; grid-template-columns: 52px 1fr auto; gap: 0.85rem; align-items: center; font-size: 0.92rem; }
.mini-thumb { position: relative; width: 52px; height: 64px; }
.mini-thumb > img, .mini-thumb > .placeholder { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; overflow: hidden; }
.mini-thumb b { position: absolute; top: -7px; right: -7px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 0.72rem; }

.confirm { max-width: 460px; margin: 0 auto; padding: 2.5rem 0 1rem; text-align: center; }
.confirm-logo { display: grid; width: 72px; height: 72px; margin: 0 auto 1.5rem; }
.confirm-logo.custom { width: auto; height: auto; }
.payment-options { display: grid; gap: 0.6rem; }
.ship-hint { margin: 0; padding: 0.55rem 0.8rem; border-radius: var(--radius-sm); background: var(--paper-2); font-size: 0.85rem; font-weight: 500; text-align: center; }
.confirm-id { padding: 0.15em 0.5em; border: 1px solid var(--line); border-radius: 6px; background: var(--white); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 600; }
.confirm .btn { margin-top: 0.75rem; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100; max-width: calc(100% - 32px);
  padding: 0.8rem 1.3rem; border-radius: 999px; background: var(--ink); color: var(--paper);
  font-size: 0.92rem; font-weight: 500; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transform: translate(-50%, 16px); transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- store manager ---------- */
.admin { display: grid; gap: 1.5rem; padding: 2rem 0 4rem; }
.admin-grid { display: grid; grid-template-columns: minmax(320px, 430px) 1fr; gap: 1.5rem; align-items: start; }
.panel { padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.panel h2 { font-size: 1.35rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-head h2 { margin: 0; }
.panel-head h2 .small { font-family: var(--font-body); font-weight: 400; margin-left: 0.35rem; }
.panel-head input { max-width: 220px; }
.count { padding: 0.15em 0.6em; border-radius: 999px; background: var(--paper-2); font-family: var(--font-body); font-size: 0.8rem; font-weight: 600; vertical-align: middle; }

#productForm { display: grid; gap: 1rem; }
.image-drop { display: grid; grid-template-columns: 96px 1fr; gap: 1rem; align-items: start; padding: 0.9rem; border: 1.5px dashed var(--line); border-radius: var(--radius-sm); transition: border-color 0.15s, background 0.15s; }
.image-drop.drag { border-color: var(--ink); background: var(--paper); }
.image-preview { width: 96px; height: 120px; border-radius: 8px; overflow: hidden; background: var(--paper-2); display: grid; place-items: center; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-preview .yy { width: 40px; height: 40px; opacity: 0.3; }
.image-controls { display: grid; gap: 0.45rem; }
.image-controls p { margin: 0.25rem 0 0; }
.image-buttons { display: flex; align-items: center; gap: 0.9rem; }
.form-actions { display: flex; gap: 0.6rem; }
.form-error { margin: 0; padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); font-size: 0.9rem; }

.publish-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.publish-bar.dirty { background: #fbf1df; border-color: #e9cf9f; }
.publish-bar p { margin: 0.15rem 0 0; max-width: 70ch; }
.publish-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem; }

.table-wrap { overflow-x: auto; }
.product-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.product-table th { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); text-align: left; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.product-table td { padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.product-table tbody tr:last-child td { border-bottom: 0; }
.product-table tbody tr:hover td { background: var(--paper); }
.row-product { display: flex; align-items: center; gap: 0.75rem; }
.row-thumb { flex: none; display: grid; place-items: center; width: 40px; height: 50px; border-radius: 6px; overflow: hidden; background: var(--paper-2); }
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-thumb .yy { width: 22px; height: 22px; opacity: 0.4; }
.row-thumb > .placeholder { width: 100%; height: 100%; }
.row-thumb .art-svg { width: 80%; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions .link-btn + .link-btn { margin-left: 0.9rem; }
.stock.low { color: var(--warn); font-weight: 600; }
.stock.out { color: var(--accent); font-weight: 600; }
.empty-row { padding: 2.5rem 1rem !important; text-align: center; }
.storage-note { margin: 1rem 0 0; }

.order { margin-bottom: 0.6rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.order summary { display: grid; grid-template-columns: auto 1fr auto auto; gap: 1rem; align-items: center; padding: 0.8rem 1rem; cursor: pointer; font-size: 0.92rem; }
.order-body { padding: 0 1rem 1rem; }
.order-body ul { margin: 0 0 0.6rem; padding-left: 1.1rem; }
.order-body p { margin: 0; }

/* ---------- store manager: tabs, website editor, live preview ---------- */
.tabs { display: flex; gap: 0.25rem; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tab { margin-bottom: -1px; padding: 0.75rem 1.1rem; border: 0; border-bottom: 2px solid transparent; background: none; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.editor { display: grid; grid-template-columns: minmax(340px, 440px) 1fr; gap: 1.5rem; align-items: start; }
.editor-form { display: grid; gap: 0.75rem; }
.editor-intro { margin: 0; }
.editor-foot { padding: 0.5rem 0.25rem; }
.group { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.group summary { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; font-weight: 600; cursor: pointer; list-style: none; }
.group summary::-webkit-details-marker { display: none; }
.group summary::after { content: "+"; font-size: 1.25rem; font-weight: 400; color: var(--muted); }
.group[open] summary::after { content: "−"; }
.group-body { display: grid; gap: 1rem; padding: 0 1.25rem 1.25rem; }
.group-body select { width: 100%; }
.group-body > .hint { margin: 0; }
.hint { font-size: 0.8rem; font-weight: 400; color: var(--muted); }
input[type="color"] { height: 42px; padding: 4px; cursor: pointer; }

.preview { position: sticky; top: calc(var(--header-h) + 16px); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.preview-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.preview-bar #saveStatus { margin-right: auto; }
.device-toggle { display: flex; gap: 0.2rem; padding: 3px; border-radius: 999px; background: var(--paper-2); }
.device-toggle button { padding: 0.3rem 0.85rem; border: 0; border-radius: 999px; background: none; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.device-toggle button[aria-pressed="true"] { background: var(--white); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.preview-frame { position: relative; height: calc(100vh - var(--header-h) - 110px); min-height: 480px; overflow: hidden; background: var(--paper-2); }
.preview-frame iframe { position: absolute; top: 0; left: 0; border: 0; background: #fff; transform-origin: 0 0; }

.account-panel { max-width: 520px; }
.account-panel form { display: grid; gap: 1rem; }
.account-note { margin: 1.25rem 0 0; }
.header-actions .link-btn { font-weight: 500; }

/* ---------- on-page editor (only shown to the signed-in owner) ---------- */
.edit-bar {
  position: fixed; left: 50%; bottom: 20px; z-index: 30; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0.75rem; max-width: calc(100% - 24px);
  padding: 0.5rem 0.6rem 0.5rem 1.15rem; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-size: 0.88rem; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}
.edit-status { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: color-mix(in srgb, var(--paper) 78%, transparent); }
.edit-ghost { border-color: color-mix(in srgb, var(--paper) 40%, transparent); background: transparent; color: var(--paper); }
.edit-ghost:hover { border-color: var(--paper); }
.edit-link { padding-right: 0.6rem; white-space: nowrap; font-size: 0.85rem; color: var(--paper); text-underline-offset: 3px; }
.owner .site-footer { padding-bottom: 7rem; }
.owner .toast { bottom: 88px; }

.editing [contenteditable] {
  cursor: text; border-radius: 4px;
  outline: 1.5px dashed color-mix(in srgb, var(--accent) 75%, transparent); outline-offset: 5px;
  transition: outline-color 0.15s, background 0.15s;
}
.editing [contenteditable]:hover { outline-color: var(--accent); }
.editing [contenteditable]:focus { outline: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.editing [contenteditable]:empty::before { content: attr(data-placeholder); font-style: italic; opacity: 0.45; }
.editing [data-rich], .editing [data-paras] { white-space: pre-wrap; }
.editing .about-text { max-width: 60ch; font-size: 1.05rem; color: color-mix(in srgb, var(--paper) 80%, transparent); }
.editing .eyebrow:empty, .editing .lede:empty { display: block; }
.editing .hero .btn:empty { display: inline-flex; }

.hero { position: relative; }
.about-visual-wrap { position: relative; }
.photo-tools { position: absolute; z-index: 3; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.photo-tools .btn { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22); }
.hero-photo-tools { right: 1.25rem; bottom: 1.25rem; }
.about-visual-wrap .photo-tools { left: 50%; bottom: -1.25rem; width: max-content; transform: translateX(-50%); }

/* product tools in edit mode */
.card { position: relative; }
.card-owner-tools, .add-card { display: none; }
.editing .card-owner-tools { position: absolute; top: 0.6rem; right: 0.6rem; z-index: 2; display: flex; gap: 0.4rem; }
.editing .card-owner-tools .btn { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); }
.editing .add-card {
  display: grid; place-content: center; justify-items: center; gap: 0.35rem; aspect-ratio: 4 / 5;
  border: 2px dashed var(--line); border-radius: var(--radius); color: var(--muted); font-weight: 600; text-decoration: none;
}
.editing .add-card span { font-size: 2.5rem; line-height: 1; font-weight: 300; }
/* Adding and editing products happens in the Store manager, which is the main admin's only. */
body:not(.main-admin) .add-card, body:not(.main-admin) .card-owner-tools a { display: none !important; }
.switch-login { margin: 0; text-align: center; }
.editing .add-card:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- store manager: accounts & orders ---------- */
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.account-grid form { display: grid; gap: 1rem; }
.account-sub { margin: 1.5rem 0 0.75rem; font-size: 1.1rem; }
.admin-list { display: grid; gap: 0.5rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.admin-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.admin-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--paper); font-weight: 700; font-size: 0.85rem; }
.admin-name { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; font-weight: 600; }
.admin-name .tag-sm { margin-left: 0; }
.admin-actions { flex-wrap: wrap; }
.admin-actions { display: flex; gap: 0.9rem; }
/* Categories box (Products tab) */
.admin-col { display: grid; gap: 1.5rem; align-content: start; min-width: 0; }
.panel-intro { margin: -0.5rem 0 1rem; }
.category-list { display: grid; gap: 0.5rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.category-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; padding: 0.55rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.cat-name { flex: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; min-width: 10rem; }
.cat-actions { display: flex; align-items: center; gap: 0.35rem 0.8rem; }
.icon-btn.icon-sm { width: 30px; height: 30px; font-size: 1rem; border: 1px solid var(--line); }
.icon-btn.icon-sm:disabled { opacity: 0.3; cursor: not-allowed; background: transparent; }
.cat-rename, .category-add { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; width: 100%; }
.cat-rename input, .category-add input { flex: 1; min-width: 10rem; }
#categoriesPanel .form-error { margin: 0.75rem 0 0; }

/* "Made to order" checkbox in the product form */
.check.check-hint { align-items: flex-start; }
.check.check-hint input { margin-top: 0.2rem; }
.check.check-hint .hint { display: block; margin-top: 0.2rem; }

/* 3D printing tab */
.prints-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(26rem, 100%), 1fr)); gap: 1.5rem; align-items: start; }
.filament-list { display: grid; gap: 0.5rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.filament-list li { display: grid; grid-template-columns: 44px 1fr 6.5rem auto auto; align-items: center; gap: 0.5rem; }
.filament-list input[type="color"] { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); cursor: pointer; }
.filament-list .check { padding: 0.55rem 0.7rem; font-size: 0.85rem; white-space: nowrap; }
.answer-form { display: grid; gap: 0.9rem; }
.answer-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.answer-form .btn { justify-self: start; }
.answer-list { display: grid; gap: 0.5rem; margin: 0.75rem 0 0; padding: 0; list-style: none; }
.answer-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.answer-text { flex: 1; display: grid; gap: 0.1rem; min-width: 10rem; }
.answer-tag { padding: 0.2em 0.65em; border-radius: 999px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.answer-tag.yes { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.answer-tag.no { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
@media (max-width: 560px) {
  .filament-list li { grid-template-columns: 44px 1fr 5.5rem; }
  .answer-choice { grid-template-columns: 1fr; }
}

/* Checkout tab */
.checkout-settings-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.5rem 1.5rem; margin-bottom: 1.25rem; }
.checkout-settings-head h2 { margin: 0 0 0.3rem; }
.checkout-settings-head p { margin: 0; max-width: 60ch; }
.checkout-settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(24rem, 100%), 1fr)); gap: 1.25rem; align-items: start; }
.checkout-settings-grid .panel { display: grid; gap: 0.9rem; }
.checkout-settings-grid h3 { margin: 0; font-size: 1.15rem; }
.checkout-settings-grid .hint { margin: -0.4rem 0 0; }
.checkout-settings-grid select { width: 100%; }

.admin-reset { display: flex; gap: 0.5rem; align-items: center; width: 100%; }
.admin-reset input { flex: 1; }
.signed-in-as { white-space: nowrap; }
.orders-note { margin-bottom: 1.25rem; padding: 0.9rem 1rem; border-radius: var(--radius-sm); background: var(--paper-2); }
.orders-note p { margin: 0.3rem 0 0; }
.money-row .check { align-self: end; }
.admin-row { gap: 0.6rem; margin: 0; }
.admin-row legend { margin-bottom: 0.4rem; }

/* ---------- login ---------- */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: var(--paper-2); }
.login { width: min(420px, 100%); display: grid; gap: 1.5rem; justify-items: center; }
.login-brand { font-size: 1.6rem; }
.login-brand .logo:not(.custom) { width: 36px; height: 36px; }
.login-card { width: 100%; padding: 2.25rem 2rem; border: 1px solid var(--line); border-radius: 20px; background: var(--white); box-shadow: var(--shadow); }
.login-card form { display: grid; gap: 1rem; }
.login-card h1 { margin: 0; font-size: 1.9rem; }
.login-card form > p { margin: -0.5rem 0 0.25rem; }
.forgot summary { cursor: pointer; font-size: 0.85rem; color: var(--muted); text-align: center; }
.forgot p { margin: 0.75rem 0 0; }
.forgot code { font-size: 0.85em; padding: 0.1em 0.35em; border-radius: 4px; background: var(--paper-2); }
.back-link { text-decoration: none; }
.back-link:hover { text-decoration: underline; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .editor, .account-grid { grid-template-columns: 1fr; }
  .signed-in-as { display: none; }
  .preview { position: static; }
  .preview-frame { height: 70vh; }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-dark { justify-content: flex-start; padding-block: 3.5rem; }
  .hero-light { padding: 2rem; }
  .hero-light .mark { width: 160px; }
  .pd { grid-template-columns: 1fr; }
  .pd-media { aspect-ratio: 4 / 3; min-height: 0; }
  .pd-info { padding: 1.75rem 1.5rem 1.5rem; }
  .checkout-grid { grid-template-columns: 1fr; }
  .checkout-summary { position: static; order: -1; }
  .admin-grid { grid-template-columns: 1fr; }
  .about-inner, .about-inner:has(.about-visual.has-image) { grid-template-columns: 1fr; gap: 1.5rem; }
  .about-visual:not(.has-image) { width: 88px; }
  .steps { grid-template-columns: 1fr; }
  .related-list { grid-template-columns: 1fr; }
  .pd-related { padding: 1.25rem 1.5rem 1.5rem; }
  .about-visual.has-image { max-width: 420px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  :root[data-size] { font-size: 100%; } /* phones already show text at a comfortable size */
  .container { width: min(var(--container), 100% - 28px); }
  .header-inner { gap: 0.9rem; }
  .brand { font-size: 1.25rem; }
  .main-nav { gap: 0.9rem; }
  .main-nav a { font-size: 0.9rem; }
  .brand-sub { display: none; }
  .cart-label, .account-label { display: none; }
  .account-btn { padding: 0.5rem 0.7rem; }
  .header-actions { gap: 0.5rem; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 0.9rem; }
  .card-title { font-size: 1.02rem; }
  .card-foot { flex-direction: column; align-items: stretch; }
  .toolbar-right, .search { width: 100%; }
  .search input { width: 100%; }
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .modal-inner { padding: 1.5rem 1.1rem; }
  .panel-head { flex-wrap: wrap; }
  .panel-head input { max-width: none; }
  .order summary { grid-template-columns: 1fr auto; }
  .order summary span { display: none; }
  .edit-status, .edit-link { display: none; }
  .edit-bar { padding-left: 0.6rem; }
}

@media (max-width: 440px) {
  .site-header .brand-name { display: none; } /* the logo stays; the footer still shows the name */
}

@media (max-width: 400px) {
  #navContact { display: none; }
  .cart-btn { padding: 0.5rem 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-light .mark { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
