/* Purpose: All styles for the Shopping Board app.
   Design language (DESIGN.md): white and black, serif display type, quiet sans for text,
   hairline rules instead of shadows; a selected or active thing gets a 1px ink border.
   Light and dark themes are the two token sets below — re-theme there, not per component.
   The mood board canvas keeps its own (light) colours in both themes. */

/* ── Fonts ──
   Served from our own static/fonts folder (see the README there): nothing on a page is
   loaded from another site. Each file is a variable font covering the weights used. */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url('../fonts/cormorant-garamond-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url('../fonts/cormorant-garamond-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/cormorant-garamond-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/cormorant-garamond-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url('../fonts/jost-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url('../fonts/jost-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* The mood board studio's font pairings (phase 5, B2) — licences and checksums in static/fonts/README.md */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/playfair-display-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/playfair-display-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/source-sans-3-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/source-sans-3-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/dm-serif-display-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/dm-serif-display-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/dm-sans-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/dm-sans-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Italiana';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/italiana-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/montserrat-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/montserrat-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Libre Baskerville';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/libre-baskerville-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Libre Baskerville';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/libre-baskerville-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/lato-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/lato-bold-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/caveat-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/caveat-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Tokens ──
   Light is the default. Dark applies when the person chose it (data-theme="dark", set by
   the server on <html>) or chose "System" and the device is dark. Contrast ratios against
   the page and fill colours are recorded in DESIGN.md (all text ≥ 4.5:1).
   .canvas and .mood-card__canvas (a mood board and its miniature) keep the light set. */
:root, .canvas, .mood-card__canvas, .tile-board {
  color-scheme: light;
  --paper:      #ffffff;   /* page background */
  --surface:    #ffffff;   /* cards, panels */
  --sunken:     #f5f5f5;   /* image wells, fills */
  --ink:        #111111;   /* primary text; also the highlight border */
  --ink-soft:   #3d3d3d;   /* secondary text */
  --muted:      #5f5f5f;   /* captions, hints */
  --line:       #e4e4e4;   /* hairlines (decoration only — never the only sign of state) */
  --accent:     #111111;   /* links, active states: ink, not a colour */
  --accent-bg:  #f5f5f5;
  --danger:     #b3261e;
  --danger-bg:  #fbeae8;
  --positive:   #1e6b3a;
  --warning:    #8a5300;
  --paper-ch:   255 255 255;   /* the page colour as channels, for see-through layers */
  --shade:      17 17 17;      /* shadows and scrims */
  --photo-edge: transparent;   /* a border round product photos (shown in dark) */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0e0e0e; --surface: #171717; --sunken: #1f1f1f;
    --ink: #f2f2f2; --ink-soft: #cfcfcf; --muted: #a8a8a8; --line: #2b2b2b;
    --accent: #f2f2f2; --accent-bg: #1f1f1f;
    --danger: #f2a49d; --danger-bg: #3a1c1a; --positive: #7fd19b; --warning: #f0b65a;
    --paper-ch: 14 14 14; --shade: 0 0 0; --photo-edge: #2b2b2b;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0e0e0e; --surface: #171717; --sunken: #1f1f1f;
  --ink: #f2f2f2; --ink-soft: #cfcfcf; --muted: #a8a8a8; --line: #2b2b2b;
  --accent: #f2f2f2; --accent-bg: #1f1f1f;
  --danger: #f2a49d; --danger-bg: #3a1c1a; --positive: #7fd19b; --warning: #f0b65a;
  --paper-ch: 14 14 14; --shade: 0 0 0; --photo-edge: #2b2b2b;
}
/* Printing is always on white */
@media print {
  html:root:root {
    color-scheme: light;
    --paper: #ffffff; --surface: #ffffff; --sunken: #f5f5f5;
    --ink: #111111; --ink-soft: #3d3d3d; --muted: #5f5f5f; --line: #e4e4e4;
    --accent: #111111; --accent-bg: #f5f5f5;
    --danger: #b3261e; --danger-bg: #fbeae8; --positive: #1e6b3a; --warning: #8a5300;
    --paper-ch: 255 255 255; --shade: 17 17 17; --photo-edge: transparent;
  }
}
:root {
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans:  "Jost", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;

  --radius: 8px;      /* buttons, boxes, menus */
  --radius-lg: 14px;  /* cards and pictures */
  --gutter: clamp(20px, 4vw, 56px);
  --topbar-h: 64px;
  --shadow-lift: 0 14px 34px -18px rgb(var(--shade) / 0.35);
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Small uppercase label used for brands, counts and captions */
.eyebrow,
.card__brand, .detail-brand, .detail-site, .brand-note__label, .look__brand,
.board-head__count, .mood-card__count, .tray__hint, .stage__status {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Top bar ── */
.topbar {
  height: var(--topbar-h);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.logo {
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.topnav { display: flex; gap: 28px; }
.topnav__link {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.topnav__link:hover { color: var(--ink); }
.topnav__link--active { color: var(--ink); border-bottom-color: var(--ink); }

/* ── Flash messages ── */
.flash-wrap { padding: 16px var(--gutter) 0; }
.flash {
  padding: 11px 16px;
  margin-bottom: 8px;
  font-size: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  border-radius: var(--radius);
}
.flash--success { border-left-color: var(--positive); }
.flash--error   { border-left-color: var(--danger); }
.flash--info    { border-left-color: var(--accent); }

/* ── Board tabs ── */
.board-tabs {
  display: flex;
  align-items: center;
  gap: 4px 28px;
  flex-wrap: wrap;
  padding: 18px var(--gutter) 0;
  border-bottom: 1px solid var(--line);
}
.tab {
  padding: 0 0 12px;
  margin-bottom: -1px;
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--ink); }
.tab--active { color: var(--ink); border-bottom-color: var(--ink); }
.tab--new {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.tab--new:hover { color: var(--ink); }

.new-board-form { display: flex; gap: 8px; align-items: center; padding-bottom: 10px; }
.new-board-form input {
  padding: 6px 10px;
  width: 180px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
}
.new-board-form input:focus { border-color: var(--ink); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--accent); }
.btn--outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--paper); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink-soft); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn--danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn--danger:hover { background: var(--danger); color: var(--paper); }
.btn--sm { padding: 7px 14px; font-size: 0.7rem; }
.btn:disabled { opacity: 0.4; cursor: default; pointer-events: none; }

.link-danger {
  background: none;
  border: none;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.15s;
}
.link-danger:hover { color: var(--danger); }

/* ── Main content ── */
.main-content { padding: 0 var(--gutter) 72px; }

/* ── Board header ── */
.board-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  flex-wrap: wrap;
  padding: 40px 0 0;
}
.board-head__title {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  font-weight: 500;
  line-height: 1.05;
}
.board-head__count { margin-top: 10px; }
.board-head__lede { margin-top: 10px; max-width: 52ch; color: var(--ink-soft); }

/* ── Brand note ── */
/* A quiet editorial line under the board title: FEATURING  Ekaya · Raw Mango · Tilfi */
.brand-note {
  display: flex;
  align-items: baseline;
  gap: 6px 18px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.brand-note__label { flex: none; }
.brand-note__list {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 0;
  list-style: none;
  flex: 1;
  min-width: 0;
}
.brand-note__list li { display: flex; align-items: baseline; }
/* The separator follows each name (not before the next), so a wrapped line never
   starts with a dot */
.brand-note__list li:not(:last-child)::after {
  content: "·";
  margin: 0 12px;
  color: var(--muted);
}
.brand-note__brand {
  background: none;
  border: none;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.3;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.brand-note__brand sup {
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.62rem;
  margin-left: 3px;
  color: var(--muted);
}
.brand-note__brand:hover { color: var(--accent); }
.brand-note__brand[aria-pressed="true"] { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Board toolbar: filters on the left, count and sort on the right ── */
.board-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 28px;
  flex-wrap: wrap;
  margin-top: 16px;
  min-height: 34px;
}
.board-tools__filters, .board-tools__view {
  display: flex;
  align-items: center;
  gap: 8px 22px;
  flex-wrap: wrap;
}
.board-tools__count { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* Quiet text button used in the toolbar */
.tools-link {
  padding: 0;
  background: none;
  border: none;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  transition: color 0.15s;
}
.tools-link:hover { color: var(--ink); }

/* Filter dropdown (a <details> element, so it opens without any script) */
.filter { position: relative; }
.filter__summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
  list-style: none;
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s;
}
.filter__summary::-webkit-details-marker { display: none; }
.filter__summary::after {
  content: "";
  width: 5px;
  height: 5px;
  margin-left: 2px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.15s;
}
.filter[open] .filter__summary::after { transform: translateY(1px) rotate(225deg); }
.filter__summary:hover, .filter[open] .filter__summary { color: var(--ink); }
.filter--active .filter__summary { color: var(--accent); border-bottom-color: var(--accent); }
.filter__n:empty { display: none; }
.filter__n { font-size: 0.68rem; letter-spacing: 0; }

.filter__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  min-width: 200px;
  max-height: 320px;
  overflow-y: auto;
  padding: 8px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
}
.filter__option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}
.filter__option:hover { background: var(--paper); }
.filter__option input { accent-color: var(--accent); width: 14px; height: 14px; }
.filter__count { margin-left: auto; padding-left: 18px; font-size: 0.75rem; color: var(--muted); }
.filter__menu--price { padding: 14px 16px; min-width: 250px; }
.filter__hint { margin-top: 10px; max-width: 240px; font-size: 0.78rem; line-height: 1.4; color: var(--muted); white-space: normal; }
.price-range { display: flex; align-items: center; gap: 8px; }
.price-range__symbol, .price-range__dash { color: var(--muted); }
.price-range input {
  width: 92px;
  padding: 7px 9px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
}
.price-range input:focus { border-color: var(--ink); }

/* Sort */
.sort { display: flex; align-items: center; gap: 8px; }
.sort__label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.sort select {
  padding: 6px 22px 6px 0;
  font-size: 0.9rem;
  color: var(--ink);
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%238f867b'/%3E%3C/svg%3E") no-repeat right center;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.sort select:hover, .sort select:focus { border-bottom-color: var(--ink); }

/* ── Details editor and fill-in note ── */
.panel-title { font-family: var(--serif); font-size: 1.5rem; font-weight: 500; line-height: 1.2; }
.panel-lede { margin: 6px 0 18px; font-size: 0.9rem; color: var(--ink-soft); }
.panel-foot { margin-top: 14px; font-size: 0.8rem; color: var(--muted); }
.panel-status { margin-bottom: 14px; font-size: 0.88rem; color: var(--ink-soft); }
.panel-status--error { color: var(--danger); }
.details-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.details-inputs input[type="text"] {
  width: 100%;
  padding: 9px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
}
.details-inputs input[type="text"]:focus { border-color: var(--ink); }
.details-panel { max-width: 860px; }
.details-panel .edit-actions { flex-wrap: wrap; }

/* A quiet line about background work (earlier pieces' pictures being found) */
.board-quiet-note { margin-top: 14px; font-family: var(--serif); font-style: italic; font-size: 0.98rem; color: var(--ink-soft); }
.board-quiet-note::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 9px; vertical-align: 0.15em; border-radius: 50%; background: var(--accent); animation: quiet-pulse 1.6s ease-in-out infinite; }
@keyframes quiet-pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .board-quiet-note::before { animation: none; } }

.fill-note {
  display: flex;
  align-items: center;
  gap: 10px 18px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 12px 16px;
  background: var(--accent-bg);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
}
.fill-note__text { font-size: 0.9rem; color: var(--ink-soft); }

/* ── Add product panel ── */
.add-panel {
  margin-top: 24px;
  padding: 22px 24px 24px;
  max-width: 640px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.input-tabs { display: flex; gap: 22px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.input-tab {
  padding: 0 0 10px;
  margin-bottom: -1px;
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.input-tab--active { color: var(--ink); border-bottom-color: var(--ink); }

.add-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.url-input {
  flex: 1;
  min-width: 220px;
  padding: 10px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
}
.url-input:focus { border-color: var(--ink); }
/* Something you have: a short stacked form (photos, an optional name and note) */
.add-form--own { flex-direction: column; align-items: stretch; gap: 14px; }
.add-form--own .btn { align-self: flex-start; }
.add-form__lede { margin: 0; font-size: 0.9rem; line-height: 1.55; color: var(--ink-soft); }
.add-form__field { display: flex; flex-direction: column; gap: 6px; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.add-form__field .url-input { min-width: 0; text-transform: none; letter-spacing: 0; font-size: 0.95rem; }
.add-form__field input[type="file"] { text-transform: none; letter-spacing: 0; font-size: 0.85rem; color: var(--ink); }
.add-form__hint { text-transform: none; letter-spacing: 0; font-size: 0.8rem; color: var(--muted); }

/* ── Card grid ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 40px 28px;
  margin-top: 36px;
}
.card { position: relative; display: flex; flex-direction: column; }
.card__link { display: flex; flex-direction: column; flex: 1; }

/* Select tick, top-left of the picture. Quiet until you hover a tile; always visible
   on touch screens and once anything is selected. */
.card__select {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  width: 26px;
  height: 26px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.card:hover .card__select, .card__select:focus-within,
.card-grid--selecting .card__select { opacity: 1; }
@media (hover: none) { .card__select { opacity: 1; } }
.card__check { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.card__tick {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--paper);
  background: rgb(var(--paper-ch) / 0.85);
  border: 1px solid var(--ink-soft);
  border-radius: 50%;
  transition: background 0.15s, border-color 0.15s;
}
.card__check:checked + .card__tick { background: var(--accent); border-color: var(--accent); }
.card__check:checked + .card__tick::after { content: "✓"; }
.card__check:focus-visible + .card__tick { outline: 2px solid var(--accent); outline-offset: 2px; }
.card--selected .card__img-wrap { outline: 1.5px solid var(--accent); outline-offset: 3px; }
.card__img-wrap {
  aspect-ratio: 4 / 5;
  background: var(--sunken);
  overflow: hidden;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.card:hover .card__img-wrap img { transform: scale(1.035); }
.card__no-img, .img-missing::after { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.card__body { padding: 14px 2px 0; display: flex; flex-direction: column; gap: 4px; }
.card__title {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card:hover .card__title { color: var(--accent); }
/* The board's details, in the same order on every tile */
.card__attrs { font-size: 0.85rem; line-height: 1.35; color: var(--muted); }
.card__price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.card__shop {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* An image that failed to load (some shops block hotlinking) — set by main.js */
.img-missing img { display: none; }
.img-missing::after { content: "Image unavailable"; }

/* ── Board footer ── */
.board-foot {
  margin-top: 64px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 24px;
  flex-wrap: wrap;
}

/* ── Empty state ── */
.empty-state { text-align: center; padding: 96px 24px; color: var(--ink-soft); }
.empty-state__title { font-family: var(--serif); font-size: 1.9rem; color: var(--ink); margin-bottom: 6px; }
.empty-state strong { font-weight: 500; color: var(--ink); }

/* ── Product detail ── */
.detail-wrap { max-width: 1040px; margin: 0 auto; padding-top: 32px; }
.back-link {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.15s;
}
.back-link:hover { color: var(--ink); }
.detail-wrap > .back-link { margin-bottom: 24px; }

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
@media (max-width: 760px) {
  .detail-layout { grid-template-columns: 1fr; }
}

.detail-img-col { display: flex; flex-direction: column; gap: 16px; }
.detail-img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--sunken);
  border-radius: var(--radius);
}
.detail-img--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.view-original { width: 100%; }

.detail-meta { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; margin-bottom: 12px; }
.detail-brand { color: var(--accent); }
.detail-title {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 500;
  line-height: 1.12;
  margin-bottom: 14px;
}
.detail-price {
  font-size: 1.15rem;
  color: var(--ink-soft);
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

/* The board's details as label / value rows */
.detail-attrs { display: grid; gap: 0; margin-bottom: 24px; }
.detail-attrs__row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.detail-attrs dt { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.detail-attrs dd { font-family: var(--serif); font-size: 1.15rem; line-height: 1.25; }
.detail-attrs__none { color: var(--muted); }

.detail-specs { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 26px; }
.detail-specs li { position: relative; padding-left: 18px; color: var(--ink-soft); }
.detail-specs li::before { content: "—"; position: absolute; left: 0; color: var(--line); }

.detail-notes {
  padding: 16px 18px;
  margin-bottom: 26px;
  background: var(--accent-bg);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
}
.detail-notes h4 {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.detail-notes p { font-family: var(--serif); font-style: italic; font-size: 1.15rem; line-height: 1.4; white-space: pre-line; }

.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Edit form ── */
.edit-form { display: flex; flex-direction: column; gap: 16px; }
.edit-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.edit-form input, .edit-form textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
}
.edit-form input:focus, .edit-form textarea:focus { border-color: var(--ink); }
.hint { letter-spacing: 0.04em; text-transform: none; }
.edit-actions { display: flex; gap: 10px; }

/* ── Mood board gallery ── */
.mood-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 40px 32px;
  margin-top: 36px;
}
.mood-card { display: flex; flex-direction: column; }
/* Miniature of the editor canvas: same 3:2 shape, same % coordinates */
.mood-card__canvas {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: box-shadow 0.25s, transform 0.25s;
}
.mood-card:hover .mood-card__canvas { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.mood-card__canvas img { position: absolute; height: auto; max-width: none; }
.mood-card__canvas img.is-broken { display: none; }
.mood-card__blank {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--muted);
}
.mood-card__meta { padding: 14px 2px 0; }
.mood-card__name { font-family: var(--serif); font-size: 1.4rem; font-weight: 500; line-height: 1.2; }
.mood-card:hover .mood-card__name { color: var(--accent); }
.mood-card__count { margin-top: 4px; }

/* ── Home: boards and projects as two sections ── */
.home-section { padding-top: 40px; }
.home-section + .home-section { margin-top: 48px; border-top: 1px solid var(--line); }
.home-section__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.home-section__title { font-family: var(--serif); font-size: 2.2rem; font-weight: 500; line-height: 1.1; }
.home-section__lede { flex: 1 1 260px; color: var(--ink-soft); }
.home-section__more { margin-left: auto; }
.home-section__empty { margin-top: 18px; font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: var(--muted); }
.home-boards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 32px 24px;
  margin-top: 28px;
}
.home-board { display: flex; flex-direction: column; }
.home-board__covers {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  aspect-ratio: 4 / 5; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: box-shadow 0.25s, transform 0.25s;
}
.home-board__covers img { width: 100%; height: 100%; object-fit: cover; }
.home-board__covers--1 { grid-template-columns: 1fr; }
.home-board__covers--1 img { grid-row: span 2; }
.home-board__covers--2 img, .home-board__covers--3 img:first-child { grid-row: span 2; }
.home-board__covers--3 { grid-template-rows: 1fr 1fr; }
.home-board:hover .home-board__covers { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.home-board__name { margin-top: 12px; font-family: var(--serif); font-size: 1.35rem; font-weight: 500; line-height: 1.2; }
.home-board:hover .home-board__name { color: var(--accent); }
.home-board__count { margin-top: 2px; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* ── Projects ── */
.new-project {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 28px;
  margin-top: 24px; padding: 20px 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.new-project__field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 260px; }
.new-project__field input {
  padding: 8px 0; font-size: 1rem; background: transparent;
  border: none; border-bottom: 1px solid var(--line); outline: none;
}
.new-project__field input:focus { border-bottom-color: var(--ink); }
.new-project__label { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.new-project__views { display: flex; flex-wrap: wrap; gap: 6px 18px; border: none; padding: 0; margin: 0; }
.new-project__views legend { margin-bottom: 8px; }
.choice { display: inline-flex; align-items: center; gap: 7px; font-size: 0.92rem; cursor: pointer; }
.choice input { accent-color: var(--accent); }
.new-project__actions { display: flex; gap: 8px; }

/* The top of a project view: name, views, totals */
.project-head { padding-top: 28px; }
.project-head__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-top: 12px; }
.project-head__name { flex: 1 1 280px; min-width: 0; }
.project-head__title {
  width: 100%; padding: 2px 0;
  font-family: var(--serif); font-size: 2.2rem; font-weight: 500; line-height: 1.15;
  background: transparent; border: none; border-bottom: 1px solid transparent; outline: none;
  text-overflow: ellipsis;
}
.project-head__title:hover { border-bottom-color: var(--line); }
.project-head__title:focus { border-bottom-color: var(--ink); }
.project-head__actions { display: flex; align-items: center; gap: 18px; }
.project-head__actions form { display: inline; }

.view-tabs { display: flex; gap: 22px; width: 100%; border-bottom: 1px solid var(--line); margin-top: 14px; }
.view-tab {
  padding: 8px 0 9px; margin-bottom: -1px;
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid transparent; transition: color 0.15s, border-color 0.15s;
}
.view-tab:hover { color: var(--ink); }
.view-tab--active { color: var(--ink); border-bottom-color: var(--ink); }
.stage > .view-tabs { margin-top: -6px; }

.project-totals {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.project-totals__count { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.project-totals__sum { font-family: var(--serif); font-size: 1.5rem; color: var(--ink); }
.project-totals__note { font-size: 0.82rem; color: var(--muted); }
.project-totals__note:empty, .project-totals__budget:empty { display: none; }
.project-totals__budget { margin-left: auto; font-size: 0.82rem; color: var(--ink-soft); }
.project-totals__budget--over { color: var(--danger); }

/* Small panels under the project's name: budget, sections */
.head-panel {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px;
  margin-top: 14px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.head-panel--sections { flex-direction: column; align-items: stretch; gap: 6px; }
.head-panel__field { display: flex; flex-direction: column; gap: 4px; }
.head-panel__label { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.head-panel__field input {
  padding: 6px 0; font: inherit; background: transparent;
  border: none; border-bottom: 1px solid var(--line); outline: none;
}
.head-panel__field input:focus { border-bottom-color: var(--ink); }
.section-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.section-row__name {
  flex: 1 1 180px; min-width: 0; padding: 5px 0; font: inherit;
  background: transparent; border: none; border-bottom: 1px solid var(--line); outline: none;
}
.section-row__name:focus { border-bottom-color: var(--ink); }
.section-row select { font: inherit; font-size: 0.85rem; background: transparent; border: none; border-bottom: 1px solid var(--line); }
.section-row--new { margin-top: 6px; }
.icon-btn:disabled { opacity: 0.3; cursor: default; }
.tools-link--on { color: var(--ink); border-bottom: 1px solid var(--ink); }

/* The table's tools: columns, grouping, downloads */
.table-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 14px 0 6px; }
.table-tools form { display: inline; }
.table-tools__spacer { flex: 1; }
.col-menu { position: relative; }
.col-menu > summary { list-style: none; cursor: pointer; }
.col-menu > summary::-webkit-details-marker { display: none; }
.col-menu > summary::after { content: " ▾"; font-size: 0.7em; }
.col-menu__panel {
  position: absolute; z-index: 30; top: calc(100% + 8px); left: 0;
  width: min(360px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto;
  padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 28px rgb(var(--shade) / 0.08);
}
.col-menu__row { display: flex; align-items: center; gap: 2px; padding: 2px 0; }
.col-menu__row .choice { flex: 1; min-width: 0; }
.col-menu__kind { font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-left: 6px; }
.col-menu__reset { margin-top: 10px; }
.col-menu__title { margin: 16px 0 6px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* The table */
.ptable-wrap { overflow-x: auto; }
.ptable { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.ptable__h {
  padding: 10px 10px 8px; text-align: left; white-space: nowrap; vertical-align: bottom;
  font-size: 0.68rem; font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--ink);
}
.ptable__h--quantity, .ptable__h--price, .ptable__h--total { text-align: right; }
.ptable__sort { color: inherit; }
.ptable__sort:hover, .ptable__sort--on { color: var(--ink); }
.ptable__c { padding: 10px; vertical-align: top; border-bottom: 1px solid var(--line); }
.ptable__row.is-saving { opacity: 0.7; }
.ptable__row--archived .ptable__img { filter: grayscale(0.6); opacity: 0.8; }
.ptable__c--picture { width: 52px; padding-right: 0; }
.ptable__img { display: block; width: 48px; aspect-ratio: 4 / 5; object-fit: cover;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.ptable__c--name { min-width: 200px; }
.ptable__brand { display: block; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.ptable__name { font-family: var(--serif); font-size: 1.12rem; line-height: 1.25; color: var(--ink); }
a.ptable__name:hover { color: var(--accent); }
.ptable__c--quantity, .ptable__c--price, .ptable__c--total { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ptable__c--price .price__orig { display: block; }
.ptable__total { font-family: var(--serif); font-size: 1.05rem; }
.ptable__c--notes { min-width: 180px; }
.ptable__c--section, .ptable__c--status { min-width: 130px; }
.ptable__c--detail { min-width: 90px; }
.ptable__c--remove { width: 32px; text-align: right; }
.ptable__link { font-size: 0.82rem; color: var(--accent); white-space: nowrap; }
.ptable__section th {
  padding: 22px 10px 8px; text-align: left; font-weight: 400;
  border-bottom: 1px solid var(--line);
}
.ptable__section-name { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); }
.ptable__section-count { margin-left: 8px; font-size: 0.72rem; letter-spacing: 0.1em; color: var(--muted); }
.ptable__subtotal { float: right; font-family: var(--serif); font-size: 1.05rem; color: var(--ink-soft); }
.ptable__totals th { padding: 16px 10px; text-align: right; font-weight: 400; border-top: 1px solid var(--ink); }
.ptable__totals-label { margin-right: 14px; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.ptable__totals-sum { font-family: var(--serif); font-size: 1.4rem; }
.row-error { margin-top: 4px; font-size: 0.78rem; color: var(--danger); text-align: left; white-space: normal; }

/* Cells that are edited in place: quiet until hovered or focused */
.cell-input, .cell-select {
  width: 100%; min-width: 0; padding: 2px 0; font: inherit; color: var(--ink);
  background: transparent; border: none; border-bottom: 1px solid transparent; outline: none;
}
.cell-select { cursor: pointer; }
.cell-input:hover, .cell-select:hover { border-bottom-color: var(--line); }
.cell-input:focus, .cell-select:focus { border-bottom-color: var(--ink); }
.cell-input::placeholder { color: var(--muted); font-style: italic; }
.cell-input--name { font-family: var(--serif); font-size: 1.12rem; }
.cell-input--qty { width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
.cell-input--price { width: 110px; text-align: right; }
.cell-input--number { text-align: right; font-variant-numeric: tabular-nums; }
.cell-input--notes { resize: none; overflow: hidden; line-height: 1.45; color: var(--ink-soft); }
.cell-check { width: 16px; height: 16px; accent-color: var(--accent); }
.item-row__tag { margin-left: 4px; padding: 1px 6px; font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }

/* Adding: from the boards (picker) or by hand */
.project-add { margin: 28px 0 64px; }
.project-add__buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.picker, .manual-form {
  margin-top: 16px; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.picker__search {
  width: 100%; padding: 8px 0; margin-bottom: 12px; font: inherit;
  background: transparent; border: none; border-bottom: 1px solid var(--line); outline: none;
}
.picker__search:focus { border-bottom-color: var(--ink); }
.picker__list { max-height: 420px; overflow-y: auto; }
.picker__board { margin: 14px 0 6px; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.picker__group:first-child .picker__board { margin-top: 0; }
.picker__item {
  display: flex; align-items: center; gap: 12px; padding: 6px 4px;
  border-radius: var(--radius); cursor: pointer;
}
.picker__item:hover { background: var(--paper); }
.picker__item input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.picker__item img, .picker__blank { width: 36px; aspect-ratio: 4 / 5; object-fit: cover; flex: none; border-radius: 2px; background: var(--paper); }
.picker__text { display: flex; flex-direction: column; min-width: 0; }
.picker__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker__price { font-size: 0.8rem; color: var(--muted); }
.picker__actions, .manual-form__actions { display: flex; gap: 8px; margin-top: 14px; }
.picker__empty { font-family: var(--serif); font-style: italic; color: var(--muted); }
.manual-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 22px; }
.manual-form__field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 140px; }
.manual-form__field--wide { flex: 2 1 240px; }
.manual-form__field--qty { flex: 0 0 64px; }
.manual-form__label { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.manual-form__field input {
  padding: 6px 0; font: inherit; background: transparent;
  border: none; border-bottom: 1px solid var(--line); outline: none;
}
.manual-form__field input:focus { border-bottom-color: var(--ink); }
.manual-form__field select { padding: 6px 0; font: inherit; background: transparent; border: none; border-bottom: 1px solid var(--line); }
.manual-form__actions { flex-basis: 100%; margin-top: 0; }

/* "Add to project" in quick view and on the product page */
.to-project { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.to-project__field { display: flex; align-items: center; gap: 10px; min-width: 0; }
.to-project__label { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.to-project select {
  max-width: 240px; padding: 4px 2px; font: inherit; color: var(--ink);
  background: transparent; border: none; border-bottom: 1px solid var(--line); cursor: pointer;
}
.to-project__note { flex-basis: 100%; font-size: 0.8rem; color: var(--muted); }

@media (max-width: 700px) {
  .project-head__title { font-size: 1.7rem; }
  .project-totals__budget { margin-left: 0; }
  .home-boards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
  .home-section__title { font-size: 1.8rem; }
}

/* ── Starting a project: templates ── */
.template-picker { margin-top: 24px; }
.template-picker__name { max-width: 460px; }
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 24px 0 56px; }
.template-card {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 20px;
  font: inherit; text-align: left; color: var(--ink); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.15s, transform 0.2s, box-shadow 0.2s;
}
button.template-card:hover, button.template-card:focus-visible { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.template-card__view { font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.template-card__name { font-family: var(--serif); font-size: 1.4rem; line-height: 1.2; }
.template-card__text { font-size: 0.88rem; color: var(--ink-soft); }
.template-card__sections { margin-top: 4px; font-size: 0.78rem; color: var(--muted); }
.template-card__draft { position: absolute; top: 14px; right: 14px; padding: 0 7px; font-size: 0.62rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; }
.template-card--blank { cursor: default; border-style: dashed; }
.template-card__choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

/* ── Checklist view ── */
.check-progress { font-size: 0.85rem; color: var(--ink-soft); }
.check-progress strong { font-family: var(--serif); font-size: 1.5rem; font-weight: 400; color: var(--ink); }
.checklist { display: flex; flex-direction: column; gap: 28px; margin: 12px 0 8px; }
.check-group { border-radius: var(--radius); transition: background-color 0.15s, box-shadow 0.15s; }
.check-group__head { display: flex; align-items: baseline; gap: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.check-group__name { font-family: var(--serif); font-size: 1.4rem; font-weight: 500; }
.check-group__progress { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-item {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
.check-item.is-saving { opacity: 0.7; }
.check-item__tick { display: flex; align-items: center; gap: 12px; flex: 1 1 220px; min-width: 0; cursor: pointer; }
.check-item__tick input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.check-item__name { font-size: 1rem; transition: color 0.15s; }
.check-item.is-ticked .check-item__name { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.check-item__meta { font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.check-item__move { width: auto; max-width: 160px; font-size: 0.8rem; color: var(--muted); }
.check-item .row-error { flex-basis: 100%; }
.checklist--hide-ticked .check-item.is-ticked { display: none; }
.check-add { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.check-add__plus { width: 18px; text-align: center; color: var(--muted); }
.check-add input {
  flex: 1; padding: 4px 0; font: inherit; background: transparent;
  border: none; border-bottom: 1px solid transparent; outline: none;
}
.check-add input::placeholder { color: var(--muted); font-style: italic; }
.check-add input:focus { border-bottom-color: var(--ink); }

/* Dragging items between sections and statuses */
.drag-handle {
  padding: 0 4px; font-size: 0.85rem; letter-spacing: -2px; line-height: 1; color: var(--line);
  background: none; border: none; cursor: grab; touch-action: none;
}
.check-item:hover .drag-handle, .ptable__row:hover .drag-handle { color: var(--muted); }
.drag-ghost--item {
  list-style: none; margin: 0; padding: 8px 12px; opacity: 0.92;
  background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius);
  box-shadow: 0 10px 28px rgb(var(--shade) / 0.12);
}
.drag-ghost--item td { display: none; }
.drag-ghost--item img { width: 44px; }
.drag-ghost--item td.ptable__c--name { display: block; }
.is-dragged { opacity: 0.35; }
.is-drop-target { background: var(--accent-bg); box-shadow: 0 0 0 1px var(--accent); }
@media (hover: none) { .drag-handle { display: none; } }

/* ── Status view: a column per status ── */
.status-board {
  display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 16px;
  margin: 16px 0 8px; overflow-x: auto;
}
.status-col {
  display: flex; flex-direction: column; min-height: 220px; padding: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: background-color 0.15s, box-shadow 0.15s;
}
.status-col__head { display: flex; align-items: baseline; gap: 8px; padding: 2px 4px 10px; border-bottom: 1px solid var(--line); }
.status-col__name {
  flex: 1; min-width: 0; padding: 2px 0; font-family: var(--serif); font-size: 1.25rem; color: var(--ink);
  background: transparent; border: none; border-bottom: 1px solid transparent; outline: none;
}
.status-col__name:hover { border-bottom-color: var(--line); }
.status-col__name:focus { border-bottom-color: var(--ink); }
.status-col__count { font-size: 0.75rem; color: var(--muted); }
.status-col__list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.status-card {
  padding: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.15s, opacity 0.15s;
}
.status-card:hover { border-color: var(--muted); }
.status-card.is-saving { opacity: 0.7; }
.status-card__body { display: flex; gap: 10px; cursor: grab; }
@media (pointer: fine) { .status-card__body { touch-action: none; } }
.status-card__img { width: 44px; aspect-ratio: 4 / 5; object-fit: cover; flex: none; border-radius: 2px; }
.status-card__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.status-card__brand { font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.status-card__name { font-family: var(--serif); font-size: 1.02rem; line-height: 1.25; }
.status-card__price { font-size: 0.8rem; color: var(--ink-soft); }
.status-card__section { align-self: flex-start; margin-top: 2px; padding: 0 6px; font-size: 0.66rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; }
.status-card__move { margin-top: 8px; font-size: 0.78rem; color: var(--muted); }
/* Phones: the columns sit side by side and scroll sideways, one column at a time */
@media (max-width: 700px) {
  .status-board { grid-template-columns: repeat(4, 82vw); scroll-snap-type: x mandatory; padding-bottom: 8px; }
  .status-col { scroll-snap-align: start; }
  .check-item__move { max-width: 120px; }
}

/* ── Selecting items (compare, this or that, compatibility) ── */
.select-tick { display: none; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.is-selecting .select-tick { display: inline-block; }
.status-card { position: relative; }
.status-card .select-tick { position: absolute; top: 8px; right: 8px; }
.ptable__c--remove .select-tick { margin: 2px 6px 0 0; vertical-align: top; }
.is-selecting .ptable__c--remove form { display: none; }
.select-bar {
  position: fixed; left: 50%; bottom: 20px; z-index: 50; transform: translateX(-50%);
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  width: max-content; max-width: calc(100vw - 32px); padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 14px 36px rgb(var(--shade) / 0.14);
}
.select-bar__count { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.select-bar__run { display: inline-flex; align-items: center; gap: 8px; }
.select-bar__run select { font: inherit; font-size: 0.85rem; background: transparent; border: none; border-bottom: 1px solid var(--line); }
.select-bar .is-disabled { opacity: 0.4; pointer-events: none; }
.is-selecting .main-content { padding-bottom: 120px; }
.empty-state__sections { margin-top: 14px; font-family: var(--serif); font-style: italic; color: var(--muted); }

/* ── Compatibility check ── */
.check-page { padding: 18px 0 64px; max-width: 820px; }
.check-page__title { font-family: var(--serif); font-size: 1.7rem; font-weight: 500; }
.check-page__lede { margin-top: 6px; color: var(--ink-soft); }
.check-page__items { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 10px 0 22px; padding: 0; list-style: none; }
.check-page__items li { padding: 2px 10px; font-size: 0.85rem; border: 1px solid var(--line); border-radius: 999px; }
.check-page__empty { font-family: var(--serif); font-style: italic; color: var(--muted); }
.check-page__sub { margin: 18px 0 6px; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.findings, .missing { list-style: none; margin: 14px 0 0; padding: 0; }
.finding { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; margin-bottom: 8px;
  border-left: 2px solid var(--line); background: var(--surface); }
.finding--problem { border-left-color: var(--danger); }
.finding--check { border-left-color: var(--accent); }
.finding__severity { font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.finding--problem .finding__severity { color: var(--danger); }
.finding__items { font-size: 0.8rem; color: var(--muted); }
.missing li { padding: 4px 0; font-size: 0.9rem; border-bottom: 1px solid var(--line); }
.missing__detail { font-weight: 500; }

/* ── The printable page of a project ── */
.print-tools { display: flex; justify-content: space-between; align-items: center; padding: 24px 0 8px; }
.print-sheet { padding: 12px 0 48px; }
.print-sheet__title { font-family: var(--serif); font-size: 2.2rem; font-weight: 500; }
.print-sheet__meta { margin: 4px 0 18px; font-size: 0.8rem; color: var(--muted); }
.print-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.print-table th { padding: 8px; text-align: left; font-weight: 400; font-size: 0.66rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--ink); }
.print-table td { padding: 8px; vertical-align: top; border-bottom: 1px solid var(--line); }
.print-table img { width: 40px; aspect-ratio: 4 / 5; object-fit: cover; }
.print-table__quantity, .print-table__price, .print-table__total { text-align: right; white-space: nowrap; }
.print-table__section th { padding-top: 18px; font-family: var(--serif); font-size: 1.15rem; letter-spacing: 0;
  text-transform: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.print-table__subtotal { float: right; }
.print-sheet__total { margin-top: 18px; text-align: right; font-family: var(--serif); font-size: 1.3rem; }
.print-sheet__note { display: block; font-family: var(--sans); font-size: 0.8rem; color: var(--muted); }
@media print {
  .topbar, .board-tabs, .flash-wrap, .print-tools, .site-foot, .site-legal { display: none !important; }
  .print-table tr { break-inside: avoid; }
}

/* ── Mood board editor ── */
/* The editor fills the window below the top bar: tray on the left, canvas on the right. */
.mood-editor .main-content { padding: 0; }
.mood {
  --tray-w: 320px;
  display: grid;
  grid-template-columns: var(--tray-w) minmax(0, 1fr);
  height: calc(100vh - var(--topbar-h) - 1px);
  min-height: 520px;
}

/* Tray */
.tray {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.tray__head { padding: 22px 22px 14px; }
.tray__title { font-family: var(--serif); font-size: 1.5rem; font-weight: 500; line-height: 1.1; }
.tray__hint { margin-top: 6px; }
.tray__filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 22px 14px; }
.tray__filters:empty { display: none; }
.chip {
  padding: 5px 12px;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover { border-color: var(--ink); }
.chip--active { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.tray__grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: start;
  gap: 18px 14px;
  padding: 4px 22px 28px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.tray__empty { grid-column: 1 / -1; color: var(--muted); font-size: 0.9rem; }

.tray-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  background: none;
  border: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;        /* the tray still scrolls by touch; sideways drags pick up */
}
.tray-item__thumb {
  position: relative;
  aspect-ratio: 4 / 5;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--sunken);
  border-radius: var(--radius);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: box-shadow 0.2s, transform 0.2s;
}
.tray-item__thumb img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.tray-item:hover .tray-item__thumb { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.tray-item__title {
  font-family: var(--serif);
  font-size: 0.98rem;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tray-item__price { font-size: 0.78rem; color: var(--muted); }

/* Already on the canvas: dimmed, with a small tick */
.tray-item--placed .tray-item__thumb img { opacity: 0.45; }
.tray-item--placed .tray-item__thumb::after {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  letter-spacing: 0;
  color: var(--paper);
  background: var(--ink);
  border-radius: 50%;
}

/* The preview that follows the pointer while dragging out of the tray */
.drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: 0.92;
  box-shadow: var(--shadow-lift);
  will-change: transform;
}
.drag-ghost img { width: 100%; height: auto; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; }

/* Stage */
.stage {
  --stage-pad: clamp(16px, 2.4vw, 32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 18px var(--stage-pad) 22px;
}
.stage__head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px 20px;
  flex-wrap: wrap;
}
.stage__name {
  flex: 1;
  min-width: 160px;
  padding: 2px 0;
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 500;
  line-height: 1.2;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  outline: none;
  text-overflow: ellipsis;
}
.stage__name:hover { border-bottom-color: var(--line); }
.stage__name:focus { border-bottom-color: var(--ink); }
.stage__status { white-space: nowrap; }
.stage__status--error { color: var(--danger); }

/* Canvas — always 3:2, as large as fits beside the tray and above the summary.
   Width is the smaller of the stage width and what the window height allows. */
.canvas {
  position: relative;
  flex: none;
  width: min(100%, calc((100vh - var(--topbar-h) - 236px) * 1.5));
  min-width: min(100%, 420px);
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background:
    radial-gradient(circle at 1px 1px, rgba(120, 100, 80, 0.13) 1px, transparent 0) 0 0 / 22px 22px,
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  touch-action: none;
  isolation: isolate;          /* pieces' z-index stays inside the canvas (menus above it stay on top) */
  transition: border-color 0.15s, box-shadow 0.15s;
}
.canvas--drop { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-bg); }

/* Canvas and notes side by side; the canvas keeps its 3:2 and gives the panel its room.
   --solo: no note, or it is minimised — the canvas has the whole width. */
.stage__row {
  --notes-w: 280px;
  --row-gap: 20px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: var(--row-gap);
}
.stage__row .canvas {
  width: min(calc(100% - var(--notes-w) - var(--row-gap)), calc((100vh - var(--topbar-h) - 236px) * 1.5));
  min-width: min(calc(100% - var(--notes-w) - var(--row-gap)), 420px);
}
.stage__row--solo .canvas {
  width: min(100%, calc((100vh - var(--topbar-h) - 236px) * 1.5));
  min-width: min(100%, 420px);
}

/* "Add a note" / "Show note" above the canvas; a bronze dot when a note is waiting */
.notes-show { display: inline-flex; align-items: center; gap: 7px; }
.notes-show__dot { display: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.notes-show--min .notes-show__dot { display: inline-block; }

/* ── Notes panel ── */
.notes-panel {
  flex: none;
  width: var(--notes-w);
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.notes-panel[hidden] { display: none; }
.notes-panel__head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 10px 0 16px;
}
.notes-panel__title { margin: 0; font-family: var(--serif); font-size: 1.35rem; font-weight: 400; color: var(--ink); }
.notes-panel__count { font-size: 0.7rem; letter-spacing: 0.08em; color: var(--muted); white-space: nowrap; }
.notes-panel__count--full { color: var(--danger); }
.notes-panel__actions { display: flex; gap: 2px; margin-left: auto; }

/* Small square icon buttons: quiet until hovered */
.icon-btn {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; padding: 0;
  color: var(--muted); background: none;
  border: 1px solid transparent; border-radius: var(--radius); cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { color: var(--ink); border-color: var(--line); }
.icon-btn--danger:hover { color: var(--danger); }

/* Toolbar: quiet, hairline below, one row */
.rn-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  margin: 8px 16px 0; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.rn-tool, .rn-menu__button {
  height: 30px; padding: 0;
  color: var(--ink); background: none;
  border: 1px solid transparent; border-radius: var(--radius); cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.rn-tool { width: 30px; font-family: var(--serif); font-size: 1.05rem; line-height: 1; }
.rn-tool--b { font-weight: 700; }
.rn-tool--u { text-decoration: underline; text-underline-offset: 2px; }
.rn-tool:hover, .rn-menu__button:hover, .rn-menu__button[aria-expanded="true"] { border-color: var(--line); }
.rn-tool[aria-pressed="true"] { background: var(--accent-bg); border-color: var(--accent); }
.rn-tool:focus-visible, .rn-menu__button:focus-visible, .rn-menu__item:focus-visible, .rn-swatch:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.rn-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--line); }

/* The two menus: a button, and a small sheet that opens beneath it */
.rn-menu { position: relative; }
.rn-menu__button { display: inline-flex; align-items: center; gap: 5px; padding: 0 7px; }
.rn-caret { width: 9px; height: 9px; color: var(--muted); transition: transform 0.15s; }
.rn-menu__button[aria-expanded="true"] .rn-caret { transform: rotate(180deg); }
.rn-size { min-width: 50px; justify-content: space-between; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.rn-colour__glyph { display: inline-flex; flex-direction: column; align-items: center; font-family: var(--serif); font-size: 1.05rem; line-height: 1; }
.rn-colour__bar { display: block; width: 14px; height: 3px; margin-top: 2px; border-radius: 1px; background: var(--swatch, var(--ink)); }
.rn-menu__list {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgb(var(--shade) / 0.08);
  animation: rn-menu-in 0.12s ease-out;
}
.rn-menu__list[hidden] { display: none; }
@keyframes rn-menu-in { from { opacity: 0; transform: translateY(-3px); } }
.rn-menu__list--sizes { min-width: 84px; }
.rn-menu__item {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; padding: 6px 10px;
  font-size: 0.85rem; font-variant-numeric: tabular-nums; text-align: left; color: var(--ink-soft);
  background: none; border: none; border-radius: var(--radius); cursor: pointer;
}
.rn-menu__item:hover { background: var(--paper); color: var(--ink); }
.rn-menu__item[aria-checked="true"] { color: var(--accent); }
.rn-menu__item[aria-checked="true"]::after { content: "✓"; font-size: 0.8rem; }
.rn-menu__label {
  margin: 2px 4px 10px;
  font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.rn-menu__list--colours { left: auto; right: 0; width: 164px; padding: 10px; }   /* opens leftwards: the panel is at the window edge */
.rn-colours { display: grid; grid-template-columns: repeat(5, 22px); justify-content: space-between; gap: 10px 0; }
.rn-swatch {
  width: 22px; height: 22px; padding: 0; cursor: pointer;
  background: var(--swatch, var(--ink)); border: 2px solid var(--surface); border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line);
  transition: box-shadow 0.15s;
}
.rn-swatch:hover { box-shadow: 0 0 0 1px var(--muted); }
.rn-swatch[aria-checked="true"] { box-shadow: 0 0 0 1.5px var(--ink); }
.rn-custom {
  position: relative; width: 22px; height: 22px; border-radius: 50%; overflow: hidden; cursor: pointer;
  background: conic-gradient(#c0392b, #d4ac0d, #27ae60, #2980b9, #8e44ad, #c0392b);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}
.rn-custom input { position: absolute; inset: -6px; width: 34px; height: 34px; opacity: 0; cursor: pointer; }

/* The writing area */
.rn-editor {
  position: relative;
  flex: 1;
  min-height: 180px;
  overflow-y: auto;
  padding: 12px 16px 16px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  outline: none;
  white-space: pre-wrap;          /* spaces stay as typed, even at the end of a line */
  overflow-wrap: anywhere;
  cursor: text;
}
.rn-editor:focus-visible { box-shadow: inset 0 0 0 1px var(--accent-bg); }
.rn-p { margin: 0; min-height: 1.55em; }
.rn-editor--empty::before {
  content: attr(data-placeholder);
  position: absolute; top: 12px; left: 16px; right: 16px; pointer-events: none;
  font-family: var(--serif); font-style: italic; font-size: 1.02rem; color: var(--muted);
}
.rn-b { font-weight: 600; }
.rn-u { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
/* Sizes as numbered in the size menu */
.rn-s-xs  { font-size: 11px; }
.rn-s-s   { font-size: 13px; }
.rn-s-l   { font-size: 18px; line-height: 1.45; }
.rn-s-xl  { font-size: 24px; line-height: 1.3; }
.rn-s-xxl { font-size: 32px; line-height: 1.2; }

/* Narrower windows: the notes go below the canvas, full width */
@media (max-width: 1180px) {
  .stage__row { flex-direction: column; align-items: center; }
  .stage__row .canvas { width: min(100%, calc((100vh - var(--topbar-h) - 236px) * 1.5)); min-width: min(100%, 420px); }
  .notes-panel { width: min(100%, 760px); }
  .rn-editor { min-height: 160px; max-height: 360px; }
}
.canvas__empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  padding: 24px;
  color: var(--muted);
}
.canvas__empty-title { font-family: var(--serif); font-style: italic; font-size: 1.8rem; color: var(--ink-soft); }

/* A piece on the canvas */
.piece {
  position: absolute;
  cursor: grab;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: box-shadow 0.2s;
}
.piece__img { width: 100%; height: auto; pointer-events: none; }
.piece__text {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  text-align: center;
  font-family: var(--serif);
  font-size: 0.95rem;
  line-height: 1.2;
  background: var(--sunken);
  border: 1px solid var(--line);
}
.piece:hover { box-shadow: 0 0 0 1px var(--line); }
.piece--selected, .piece--selected:hover { box-shadow: 0 0 0 1.5px var(--accent); }
/* Turning: a small round handle above the selected piece, on a short stem */
.piece { transform-origin: 50% 50%; }
.piece__rotate {
  position: absolute; top: 18px; left: 50%; width: 14px; height: 14px; margin-left: -7px; z-index: 2;
  background: var(--surface); border: 1.5px solid var(--accent); border-radius: 50%;
  cursor: grab; opacity: 0; transition: opacity 0.15s; touch-action: none;
}
.piece__rotate::after { content: "↻"; position: absolute; inset: 0; font-size: 10px; line-height: 11px; text-align: center; color: var(--accent); }
.piece--selected .piece__rotate { opacity: 1; }
@media (hover: none) { .piece__rotate { width: 24px; height: 24px; margin-left: -12px; } .piece__rotate::after { font-size: 15px; line-height: 21px; } }
/* The canvas toolbar */
.canvas-tools { display: inline-flex; align-items: center; gap: 2px; }
.canvas-tools .icon-btn { width: 30px; height: 30px; color: var(--ink-soft); }

/* ── The studio (B2): words, ornaments, frames, background ── */
.canvas { --studio-heading: "Cormorant Garamond"; --studio-body: "Jost"; }
.canvas--styled { background-image: none; }
.canvas[data-texture="paper"], .canvas[data-texture="linen"], .canvas[data-texture="plaster"], .canvas[data-texture="velvet"] {
  background-size: 256px 256px; background-repeat: repeat; background-blend-mode: multiply;
}
.canvas-text, .canvas-orn { position: absolute; cursor: grab; outline: none; user-select: none; touch-action: none;
  transform-origin: 50% 50%; color: var(--ink); }
.canvas-text { font-family: var(--studio-body), "Jost", sans-serif; line-height: 1.2; white-space: pre-wrap; overflow-wrap: break-word; }
.canvas-text__words { display: block; outline: none; }
.canvas-text--title { font-family: var(--studio-heading), "Cormorant Garamond", serif; line-height: 1.05; }
.canvas-text--tagline { font-style: normal; letter-spacing: 0.02em; opacity: 0.88; }
.canvas-text--note { font-family: "Caveat", cursive; text-align: center; line-height: 1.05; padding: 0.3em 0.6em 0.4em;
  background: #f6ecd0; color: #3a2e22; box-shadow: 0 0.25em 0.6em rgb(var(--shade) / 0.14); }
.canvas-text--caption { font-size: inherit; letter-spacing: 0.16em; text-transform: uppercase; }
.canvas-text--editing { cursor: text; user-select: text; }
.canvas-text--editing .canvas-text__words { user-select: text; }
.canvas-extra--selected { outline: 1px dashed var(--accent); outline-offset: 4px; }
.canvas-orn { padding: 0.2em 0; }
.canvas-orn svg { display: block; width: 100%; height: auto; overflow: visible; }
.canvas-text .piece__resize, .canvas-orn .piece__resize, .canvas-text .piece__rotate, .canvas-orn .piece__rotate { opacity: 0; }
.canvas-extra--selected .piece__resize, .canvas-extra--selected .piece__rotate { opacity: 1; }
.canvas-extra--selected.canvas-text--editing .piece__resize, .canvas-extra--selected.canvas-text--editing .piece__rotate { opacity: 0; }
.canvas-orn .piece__rotate { top: -22px; }

/* Frames on pieces */
.piece { container-type: inline-size; }
.piece__caption { display: none; }
.piece[data-frame="rounded"] .piece__img { border-radius: 9%; }
.piece[data-frame="circle"] .piece__img { aspect-ratio: 1; object-fit: cover; border-radius: 50%; }
.piece[data-frame="arch"] .piece__img { aspect-ratio: 3 / 4; object-fit: cover; border-radius: 50% 50% 0 0 / 34% 34% 0 0; }
.piece[data-frame="polaroid"] { background: #fff; padding: 5% 5% 0; box-shadow: 0 0.4em 1.2em rgb(var(--shade) / 0.16); }
.piece[data-frame="polaroid"] .piece__img { aspect-ratio: 1; object-fit: cover; }
.piece[data-frame="polaroid"] .piece__caption { display: block; min-height: 2.2em; padding: 0.35em 0 0.5em; font-family: "Caveat", cursive;
  font-size: 9cqw; line-height: 1.1; text-align: center; color: #3a2e22; }
.piece[data-frame="tile"] .piece__img { aspect-ratio: 4 / 5; object-fit: cover; }
.piece[data-frame="torn"] .piece__img { clip-path: polygon(0.0% 0.8%, 4.5% 0.4%, 9.1% 1.7%, 13.6% 0.2%, 18.2% 1.4%, 22.7% 1.0%, 27.3% 0.2%, 31.8% 1.3%, 36.4% 0.1%, 40.9% 1.1%, 45.5% 0.2%, 50.0% 0.2%, 54.5% 1.1%, 59.1% 2.1%, 63.6% 0.3%, 68.2% 0.6%, 72.7% 1.6%, 77.3% 2.5%, 81.8% 1.5%, 86.4% 1.0%, 90.9% 2.5%, 95.5% 0.1%, 100.0% 2.2%, 99.2% 4.5%, 99.6% 9.1%, 99.7% 13.6%, 99.2% 18.2%, 97.9% 22.7%, 99.5% 27.3%, 98.5% 31.8%, 98.3% 36.4%, 99.0% 40.9%, 98.6% 45.5%, 99.8% 50.0%, 99.8% 54.5%, 99.5% 59.1%, 98.2% 63.6%, 98.9% 68.2%, 99.2% 72.7%, 98.5% 77.3%, 98.8% 81.8%, 99.2% 86.4%, 97.9% 90.9%, 98.2% 95.5%, 99.4% 100.0%, 95.5% 98.5%, 90.9% 98.6%, 86.4% 97.7%, 81.8% 98.1%, 77.3% 99.3%, 72.7% 97.5%, 68.2% 99.7%, 63.6% 98.9%, 59.1% 98.0%, 54.5% 99.6%, 50.0% 98.7%, 45.5% 99.9%, 40.9% 98.3%, 36.4% 98.0%, 31.8% 98.5%, 27.3% 97.7%, 22.7% 99.2%, 18.2% 98.2%, 13.6% 98.5%, 9.1% 98.5%, 4.5% 98.8%, 0.0% 97.8%, 2.5% 95.5%, 1.2% 90.9%, 1.7% 86.4%, 0.2% 81.8%, 1.8% 77.3%, 1.7% 72.7%, 2.6% 68.2%, 2.1% 63.6%, 0.7% 59.1%, 1.0% 54.5%, 1.7% 50.0%, 0.1% 45.5%, 1.2% 40.9%, 0.4% 36.4%, 0.3% 31.8%, 0.2% 27.3%, 2.0% 22.7%, 0.3% 18.2%, 0.6% 13.6%, 1.0% 9.1%, 2.3% 4.5%); }

/* The Story layout: a tall canvas (9:16), as large as the window's height allows */
.canvas.canvas--story, .stage__row .canvas.canvas--story, .stage__row--solo .canvas.canvas--story {
  aspect-ratio: 9 / 16;
  width: min(100%, calc((100vh - var(--topbar-h) - 236px) * 0.5625));
  min-width: min(100%, 260px);
}
/* A tall, square or portrait miniature is centred at its own width (the card measures nothing from its contents) */
.mood-card__canvas--story { aspect-ratio: 9 / 16; width: min(100%, 202px); max-height: 360px; margin: 0 auto; }
.studio-panel__layouts { display: grid; gap: 6px; }
.studio-layout { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; text-align: left; cursor: pointer;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font: inherit; }
.studio-layout:hover { border-color: var(--accent); }
.studio-layout__name { font-family: var(--serif); font-size: 1.15rem; line-height: 1.1; }
.studio-layout__text { font-size: 0.8rem; color: var(--ink-soft); }
.studio-layout__shape { font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.studio-panel__hint { font-size: 0.78rem; color: var(--muted); }

/* Customising after a layout (B4): your layouts, shuffle and reset, save, colourways, swapping */
.studio-mine { display: flex; align-items: stretch; gap: 4px; }
.studio-mine .studio-layout { flex: 1; min-width: 0; }
.studio-mine__delete { align-self: center; padding: 4px 6px; }
.studio-panel__actions { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 10px 0 2px; border-top: 1px solid var(--line); margin-top: 10px; }
.studio-panel__actions[hidden] { display: none; }
.studio-save { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.studio-save__row { display: flex; gap: 6px; }
.studio-save__row input { flex: 1; min-width: 0; padding: 5px 8px; font: inherit; font-size: 0.85rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.studio-save__row input:focus { outline: none; border-color: var(--accent); }
.studio-panel__colourways { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.studio-colourway { display: flex; align-items: center; gap: 8px; padding: 6px 8px; font: inherit; font-size: 0.8rem; text-align: left;
  color: var(--ink); cursor: pointer; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.studio-colourway:hover, .studio-colourway[aria-pressed="true"] { border-color: var(--accent); }
.studio-colourway__swatch { flex: none; display: grid; place-items: center; width: 30px; height: 22px; border-radius: 2px;
  background: var(--cw-bg); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); font-family: var(--serif); font-size: 0.9rem;
  color: var(--cw-ink); position: relative; }
.studio-colourway__swatch::after { content: ""; position: absolute; right: 3px; bottom: 3px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--cw-accent); }
.studio-colourway__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canvas-tools__shuffle { margin-left: 10px; }
.tray--swapping .tray-item__thumb { outline: 1.5px dashed var(--accent); outline-offset: 2px; }
.piece--swapping { box-shadow: 0 0 0 2px var(--accent), 0 0 0 6px rgb(var(--shade) / 0.18); }

/* Menus above the canvas: Add and Style */
.studio-panel { width: 330px; max-width: calc(100vw - 32px); }
@media (max-width: 760px) { .palette-panel { position: fixed; left: 16px; right: 16px; top: auto; width: auto; max-height: 70vh; overflow-y: auto; } }
.studio-panel__words, .studio-panel__ornaments, .studio-panel__textures { display: flex; flex-wrap: wrap; gap: 6px; }
.studio-add, .studio-texture {
  padding: 6px 10px; font: inherit; font-size: 0.85rem; color: var(--ink); cursor: pointer;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
}
.studio-add:hover, .studio-texture:hover { border-color: var(--ink); }
.studio-add--title { font-family: var(--serif); font-size: 1.1rem; }
.studio-add--note { font-family: "Caveat", cursive; font-size: 1.15rem; background: #f6ecd0; color: #3a2e22; }
.studio-add--caption { font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; }
.studio-texture { min-width: 58px; background-size: 128px 128px; background-blend-mode: multiply; }
.studio-texture--paper { background-image: url('../textures/paper.png'); background-color: #f6f0e1; }
.studio-texture--linen { background-image: url('../textures/linen.png'); background-color: #e9dfcf; }
.studio-texture--plaster { background-image: url('../textures/plaster.png'); background-color: #e3d9c6; }
.studio-texture--velvet { background-image: url('../textures/velvet.png'); background-color: #5b1c28; color: #fff; }
.studio-texture[aria-pressed="true"], .studio-font[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.studio-panel__colours { display: flex; align-items: center; gap: 8px; }
.studio-panel__chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.studio-panel__fonts { display: grid; gap: 6px; }
.studio-font { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 7px 10px; text-align: left; cursor: pointer;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); }
.studio-font__heading { font-size: 1.15rem; line-height: 1.1; }
.studio-font__body { font-size: 0.72rem; color: var(--muted); }
.studio-font--lookbook .studio-font__heading { font-family: "Cormorant Garamond", serif; }
.studio-font--lookbook .studio-font__body { font-family: "Jost", sans-serif; }
.studio-font--editorial .studio-font__heading { font-family: "Playfair Display", serif; }
.studio-font--editorial .studio-font__body { font-family: "Source Sans 3", sans-serif; }
.studio-font--modern .studio-font__heading { font-family: "DM Serif Display", serif; }
.studio-font--modern .studio-font__body { font-family: "DM Sans", sans-serif; }
.studio-font--couture .studio-font__heading { font-family: "Italiana", serif; }
.studio-font--couture .studio-font__body { font-family: "Montserrat", sans-serif; }
.studio-font--heritage .studio-font__heading { font-family: "Libre Baskerville", serif; font-size: 1rem; }
.studio-font--heritage .studio-font__body { font-family: "Lato", sans-serif; }
.colour-chip { width: 22px; height: 22px; padding: 0; cursor: pointer; background: var(--chip, #fff);
  border: 2px solid var(--surface); border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.colour-chip[aria-pressed="true"] { box-shadow: 0 0 0 1.5px var(--ink); }

/* The bar for the selected piece, text or ornament */
.element-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; width: 100%; min-height: 34px; margin-top: -6px; }
.element-bar[hidden] { display: none; }
.element-bar__label { font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.element-bar__frame { width: 26px; height: 26px; padding: 0; cursor: pointer; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); position: relative; }
.element-bar__frame::after { content: ""; position: absolute; inset: 5px; background: var(--ink-soft); }
.element-bar__frame--tile::after { inset: 4px 6px; }
.element-bar__frame--rounded::after { border-radius: 4px; }
.element-bar__frame--circle::after { border-radius: 50%; }
.element-bar__frame--arch::after { border-radius: 50% 50% 0 0 / 40% 40% 0 0; }
.element-bar__frame--polaroid::after { inset: 4px 5px 8px; box-shadow: 0 0 0 2px #fff, 0 4px 0 2px #fff; }
.element-bar__frame--torn::after { clip-path: polygon(0 6%, 20% 0, 45% 8%, 70% 1%, 100% 7%, 95% 35%, 100% 60%, 94% 100%, 60% 93%, 35% 100%, 8% 94%, 0 70%, 5% 40%); }
.element-bar__frame[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.element-bar__caption { flex: 0 1 220px; padding: 4px 0; font: inherit; font-size: 0.85rem; background: transparent;
  border: none; border-bottom: 1px solid var(--line); outline: none; }
.element-bar__caption:focus { border-bottom-color: var(--ink); }

/* ── The colour palette strip (B1) ── */
.palette-el {
  position: absolute; cursor: grab; outline: none; touch-action: none; user-select: none;
  padding: 0.9em; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transform-origin: 50% 50%;
}
.palette-el--selected { box-shadow: 0 0 0 1.5px var(--accent); }
.palette-el .piece__resize { opacity: 0; }
.palette-el--selected .piece__resize, .palette-el:hover .piece__resize { opacity: 1; }
.palette-el__swatches { display: grid; gap: 0.7em; }
.palette-el__swatches--row { grid-auto-flow: column; grid-auto-columns: 1fr; }
.palette-el__swatches--column { grid-template-columns: 1fr; }
.palette-el__swatches--column .palette-swatch { display: grid; grid-template-columns: 2.4em 1fr; grid-template-rows: auto auto; column-gap: 0.7em; align-items: center; }
.palette-el__swatches--column .palette-swatch__chip { grid-row: 1 / span 2; aspect-ratio: 1; }
.palette-el__swatches--tile { grid-template-columns: 1fr 1fr; }
.palette-swatch { display: flex; flex-direction: column; gap: 0.25em; min-width: 0; }
.palette-swatch__chip { display: block; aspect-ratio: 4 / 3; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); }
.palette-swatch__name { font-family: var(--serif); font-size: 1.15em; line-height: 1.15; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-swatch__hex { font-size: 0.72em; letter-spacing: 0.12em; color: var(--muted); }

/* The palette panel, under "Palette" above the canvas */
.palette-menu { position: relative; display: inline-flex; margin-left: 4px; }
.palette-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; width: 300px;
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 28px rgb(var(--shade) / 0.1);
}
.palette-panel[hidden] { display: none; }
.palette-panel__status { font-size: 0.82rem; color: var(--ink-soft); }
.palette-panel__status:empty { display: none; }
.palette-panel__layouts { display: flex; gap: 14px; }
.palette-panel__layouts [aria-pressed="true"] { color: var(--ink); border-bottom: 1px solid var(--ink); }
.palette-panel__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.palette-row { display: flex; align-items: center; gap: 4px; }
.palette-row input[type="color"] { width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: none; cursor: pointer; }
.palette-row__name { flex: 1; min-width: 0; padding: 3px 0; font: inherit; font-size: 0.9rem; background: transparent;
  border: none; border-bottom: 1px solid transparent; outline: none; }
.palette-row__name:hover { border-bottom-color: var(--line); }
.palette-row__name:focus { border-bottom-color: var(--ink); }
.palette-panel__foot { display: flex; justify-content: space-between; align-items: center; }
.piece--moving { cursor: grabbing; box-shadow: 0 0 0 1.5px var(--accent), var(--shadow-lift); }

.piece__label {
  position: absolute;
  left: 0;
  bottom: 0;
  max-width: 100%;
  padding: 3px 8px;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--paper);
  background: rgb(var(--shade) / 0.78);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.piece:hover .piece__label, .piece--selected .piece__label { opacity: 1; }
.piece--moving .piece__label { opacity: 0; }

.piece__remove, .piece__resize { opacity: 0; transition: opacity 0.15s; }
.piece:hover .piece__remove, .piece:hover .piece__resize,
.piece--selected .piece__remove, .piece--selected .piece__resize { opacity: 1; }
/* Controls sit inside the piece so the canvas edge never clips them */
.piece__remove {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--paper);
  background: var(--ink);
  border: none;
  border-radius: 50%;
}
.piece__remove:hover { background: var(--danger); }

/* "Cut out" / "Original" / "Cutout" — a small pill at the piece's top-left */
.piece__cut {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 4px 9px;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--paper);
  background: rgb(var(--shade) / 0.82);
  border: none;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
.piece:hover .piece__cut, .piece--selected .piece__cut, .piece__cut--working { opacity: 1; }
.piece__cut:hover:not(:disabled) { background: var(--accent); }
.piece__cut:disabled { cursor: default; }
.piece__cut:disabled:not(.piece__cut--working) { background: rgb(var(--shade) / 0.45); }
.piece--moving .piece__cut { opacity: 0; }
/* Switching which of the product's pictures a piece shows: "‹ 2 / 4 ›", a small pill
   above the label (it may reach past a narrow piece's sides rather than crowd them) */
.piece__pics {
  position: absolute; left: 50%; bottom: 26px; translate: -50% 0; z-index: 2;
  display: flex; align-items: center; gap: 1px; padding: 2px;
  background: rgb(var(--paper-ch) / 0.94); border: 1px solid var(--line); border-radius: 999px;
  opacity: 0; transition: opacity 0.15s;
}
.piece:hover .piece__pics, .piece--selected .piece__pics, .piece__pics:focus-within { opacity: 1; }
.piece--moving .piece__pics { opacity: 0; }
.piece__pic {
  position: relative; flex: none;
  width: 24px; height: 24px; padding: 0;
  border: none; border-radius: 50%; background: none; cursor: pointer;
}
.piece__pic::before {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 6px; height: 6px; border: solid var(--ink); border-width: 0 1.2px 1.2px 0;
}
.piece__pic--prev::before { translate: -35% -50%; rotate: 135deg; }
.piece__pic--next::before { translate: -65% -50%; rotate: -45deg; }
.piece__pic:hover, .piece__pic:focus-visible { background: var(--accent-bg); }
.piece__pic-count {
  padding: 0 2px; font-size: 0.58rem; letter-spacing: 0.1em; white-space: nowrap;
  color: var(--ink-soft); pointer-events: none;
}
@media (hover: none) { .piece__pic { width: 30px; height: 30px; } }
/* While the background is being removed: a small turning ring before the words */
.piece__cut--working::before {
  content: "";
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-right: 6px;
  vertical-align: -0.08em;
  border: 1.5px solid rgb(var(--paper-ch) / 0.35);
  border-top-color: var(--paper);
  border-radius: 50%;
  animation: cut-spin 0.8s linear infinite;
}
@keyframes cut-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .piece__cut--working::before { animation: none; } }

.stage__note {
  width: 100%;
  padding: 9px 14px;
  font-size: 0.88rem;
  color: var(--ink-soft);
  background: var(--accent-bg);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
}
/* Resize handles: one on each corner, sitting slightly outside it */
.piece__resize {
  position: absolute;
  z-index: 1;
  width: 16px;
  height: 16px;
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: 50%;
}
.piece__resize--nw { left: 0;  top: 0;    transform: translate(-25%, -25%); cursor: nwse-resize; }
.piece__resize--ne { right: 0; top: 0;    transform: translate(25%, -25%);  cursor: nesw-resize; }
.piece__resize--sw { left: 0;  bottom: 0; transform: translate(-25%, 25%);  cursor: nesw-resize; }
.piece__resize--se { right: 0; bottom: 0; transform: translate(25%, 25%);   cursor: nwse-resize; }
/* A bigger invisible target around each handle, so it is easy to grab (and to touch) */
.piece__resize::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; }
/* Tapping a tray piece that is already placed points it out on the canvas */
.piece--pulse { animation: piece-pulse 0.7s ease-out; }
@keyframes piece-pulse {
  0%   { box-shadow: 0 0 0 1.5px var(--accent), 0 0 0 0 rgb(var(--shade) / 0.45); }
  100% { box-shadow: 0 0 0 1.5px var(--accent), 0 0 0 18px rgb(var(--shade) / 0); }
}

/* Look summary under the canvas */
.look {
  width: 100%;
  display: flex;
  align-items: stretch;
  gap: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.look__list {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.look__list:empty::before {
  content: "Pieces you add will be listed here with their prices.";
  color: var(--muted);
  font-size: 0.88rem;
}
.look__item {
  flex: none;
  max-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 12px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}
.look__item:hover { border-color: var(--ink); }
.look__item--selected { border-color: var(--accent); }
.look__item--off { opacity: 0.55; cursor: default; }
.look__item--off:hover { border-color: var(--line); }
.look__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.look__brand { font-size: 0.62rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.look__title {
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.look__price { font-size: 0.82rem; color: var(--ink-soft); }
/* Right-hand side of the summary: the total and, beside it, the optional budget.
   Side by side so the summary stays one short strip under the canvas. */
.look__side {
  flex: none;
  display: flex;
  align-items: center;
  gap: 26px;
  text-align: right;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}
.look__total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.look__total:empty { display: none; }

/* Budget mode */
.budget { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.budget__on { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; padding-left: 26px; border-left: 1px solid var(--line); }
.budget__field { display: flex; align-items: baseline; gap: 8px; }
.budget__label, .budget__code { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.budget__field input {
  width: 104px;
  padding: 3px 0;
  text-align: right;
  font-size: 0.95rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  -moz-appearance: textfield;
}
.budget__field input::-webkit-outer-spin-button, .budget__field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.budget__field input:focus { border-bottom-color: var(--ink); }
.budget__left { font-family: var(--serif); font-size: 1.2rem; line-height: 1.2; color: var(--ink-soft); white-space: nowrap; }
.budget__left:empty, .budget__note:empty { display: none; }
/* Over budget: clear but calm — the accent colour, never red */
.budget__left--over { color: var(--accent); }
.budget__note { max-width: 220px; font-size: 0.7rem; line-height: 1.3; color: var(--muted); }
.budget__off { font-size: 0.66rem; color: var(--muted); }
.budget__off:hover { color: var(--ink); }

/* Tray: pieces that cost more than what is left of the budget. Greyed, still addable. */
.tray__budget { display: flex; align-items: center; gap: 8px; padding: 0 22px 12px; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); cursor: pointer; }
.tray__budget input { accent-color: var(--accent); width: 14px; height: 14px; }
.tray-item__over { font-size: 0.7rem; line-height: 1.3; color: var(--accent); }
.tray-item__over:empty { display: none; }
.tray-item--over .tray-item__thumb img { opacity: 0.4; filter: grayscale(0.7); }
.tray-item--over .tray-item__title, .tray-item--over .tray-item__price { color: var(--muted); }
.tray-item--over-hidden { display: none; }
.look__total-label, .look__total-note {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.look__total-sum {
  padding: 0;
  background: none;
  border: none;
  cursor: default;
  font-family: var(--serif);
  font-size: 1.7rem;
  line-height: 1.1;
  white-space: nowrap;
  color: var(--ink);
}
/* Tappable when there is a per-currency breakdown behind it */
.look__total-sum--more { cursor: pointer; border-bottom: 1px dotted var(--muted); }
.look__breakdown { text-transform: none; letter-spacing: 0.02em; font-size: 0.8rem; }

/* Narrow screens: tray becomes a strip of pieces above the canvas */
@media (max-width: 860px) {
  .mood { grid-template-columns: minmax(0, 1fr); height: auto; }
  .tray { min-width: 0; border-right: none; border-bottom: 1px solid var(--line); }
  .tray__head { padding: 16px var(--gutter) 10px; }
  .tray__filters { padding: 0 var(--gutter) 10px; }
  .tray__grid {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 12px;
    padding: 14px var(--gutter) 16px;
  }
  .tray-item { flex: none; width: 104px; touch-action: pan-x; }   /* strip scrolls sideways; drag down to place */
  .canvas, .stage__row .canvas { width: 100%; min-width: 0; }
  .notes-panel { width: 100%; }
  .stage { overflow: visible; }
  .look { flex-direction: column; gap: 12px; }
  .look__side { flex-direction: column; align-items: flex-start; gap: 12px; text-align: left; padding-left: 0; border-left: none; }
  .look__total, .budget, .budget__on { align-items: flex-start; }
  .budget__on { padding-left: 0; border-left: none; }
  .tray__budget { padding: 0 var(--gutter) 10px; }
}

/* ── Quick view: side panel on the board (full-screen sheet on a phone) ── */
html.qv-lock { overflow: hidden; }
.qv { position: fixed; inset: 0; z-index: 100; visibility: hidden; transition: visibility 0s 0.3s; }
.qv--open { visibility: visible; transition-delay: 0s; }
.qv__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(var(--shade) / 0.32);
  opacity: 0;
  transition: opacity 0.3s;
}
.qv--open .qv__backdrop { opacity: 1; }
.qv__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 48px -32px rgb(var(--shade) / 0.45);
  outline: none;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.qv--open .qv__panel { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .qv, .qv__backdrop, .qv__panel { transition: none; }
}

.qv__bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px 10px 20px;
  border-bottom: 1px solid var(--line);
}
.qv__nav { display: flex; align-items: center; gap: 6px; }
.qv__position {
  min-width: 68px;
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.qv__btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--ink-soft);
  background: none;
  border: 1px solid transparent;
  border-radius: 50%;
  transition: color 0.15s, border-color 0.15s, opacity 0.15s;
}
.qv__btn:hover { color: var(--ink); border-color: var(--line); }
.qv__btn:disabled { opacity: 0.25; cursor: default; border-color: transparent; }
.qv__close { font-size: 1.6rem; }

.qv__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; transition: opacity 0.15s; }
.qv__body--loading { opacity: 0.45; }
.qv__error { padding: 48px 28px; text-align: center; color: var(--ink-soft); }

/* The whole picture, never cropped — this is where you look closely */
.qv-product__img { background: var(--sunken); }
.qv-product__img img { width: 100%; max-height: 62vh; object-fit: contain; margin: 0 auto; }
.qv-product__no-img {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.qv-product__info { padding: 26px 28px 40px; }
.qv-product__info .detail-title { font-size: clamp(1.6rem, 3vw, 2rem); }
.qv-product__info .detail-attrs__row { grid-template-columns: 110px 1fr; }
@media (max-width: 600px) {
  .qv__panel { width: 100%; border-left: none; }
  .qv-product__info { padding: 22px var(--gutter) 36px; }
  .qv-product__img img { max-height: 55vh; }
}

/* ── Selection bar: floats at the bottom once a piece is ticked ── */
.select-bar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 120;                     /* above the quick-view panel */
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px 18px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: calc(100% - 32px);
  padding: 10px 18px 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-lift);
}
.select-bar__hint { font-size: 0.82rem; color: var(--muted); }
.select-bar__hint:empty { display: none; }
.select-bar .btn { border-radius: 999px; }
.btn--disabled { opacity: 0.4; cursor: default; }
.btn--disabled:hover { background: var(--ink); }
/* Leave room so the bar never covers the last row, the footer or the panel's buttons */
.has-selection .site-foot { padding-bottom: 96px; }
.has-selection .qv__body { padding-bottom: 80px; }
.qv__compare { margin-left: auto; margin-right: 6px; white-space: nowrap; }
.qv__compare[aria-pressed="true"] { color: var(--ink); }

/* ── This or that: start panel ── */
.choose-panel { max-width: 640px; }
.choose-set { border: none; margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.choose-set legend { margin-bottom: 8px; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.choose-option { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.choose-option input[type="radio"] { accent-color: var(--accent); width: 15px; height: 15px; }
.choose-option input[type="number"] {
  width: 64px;
  padding: 5px 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
}
.choose-option input[type="number"]:focus { border-color: var(--ink); }

/* ── This or that: the pair being decided ── */
.duel-head { padding-top: 22px; text-align: center; }
.duel-head .back-link { display: block; text-align: left; margin-bottom: 8px; }
.duel-head__title { font-family: var(--serif); font-style: italic; font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 500; line-height: 1.05; }
.duel-head__progress { margin-top: 10px; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.duel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: clamp(10px, 3vw, 36px);
  /* Sized from the window height (the pictures are 4:5), so both pictures, titles and
     prices are on screen together; the buttons below are pinned to the window */
  max-width: min(920px, max(440px, calc(66vh + 40px)));
  margin: 22px auto 0;
}
.duel__or { align-self: center; font-family: var(--serif); font-style: italic; font-size: 1.4rem; color: var(--muted); }
.duel__card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0 0 14px;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.15s;
}
.duel__img {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 5;
  width: 100%;
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--sunken);
  border-radius: var(--radius);
  outline: 1.5px solid transparent;
  outline-offset: 4px;
  transition: outline-color 0.15s;
}
.duel__img img { width: 100%; height: 100%; object-fit: cover; }
.duel__brand { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.duel__title { font-family: var(--serif); font-size: clamp(1.1rem, 2.4vw, 1.5rem); line-height: 1.2; color: var(--ink); }
.duel__price { color: var(--ink-soft); }
.duel__details { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; font-size: 0.88rem; line-height: 1.35; color: var(--ink-soft); }
.duel__detail-label { font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-right: 6px; }
.duel__choose { margin-top: 12px; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.duel__card:hover, .duel__card:focus-visible { border-bottom-color: var(--accent); outline: none; }
.duel__card:hover .duel__img, .duel__card:focus-visible .duel__img { outline-color: var(--accent); }
.duel__card:hover .duel__choose { color: var(--ink); }
.duel--sent { opacity: 0.6; pointer-events: none; }

.duel__note { max-width: 560px; margin: 22px auto 0; text-align: center; font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: var(--ink-soft); }
/* Always reachable: stays at the bottom of the window while the pair scrolls behind it */
.duel__actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 12px 36px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding: 16px 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.duel__actions .tools-link:disabled { color: var(--line); cursor: default; }
.duel__stop { color: var(--muted); }
.duel__decided { margin-top: 22px; text-align: center; font-size: 0.82rem; color: var(--muted); }

/* ── This or that: the outcome ── */
.podium { list-style: none; max-width: 760px; margin-top: 30px; }
.podium__item { display: flex; align-items: flex-start; gap: clamp(14px, 3vw, 30px); padding: 22px 0; border-top: 1px solid var(--line); }
.podium__item:last-child { border-bottom: 1px solid var(--line); }
.podium__rank { flex: none; width: 1.2em; font-family: var(--serif); font-size: clamp(2.6rem, 6vw, 3.6rem); line-height: 0.9; color: var(--accent); text-align: center; }
.podium__piece { flex: 1; min-width: 0; display: flex; gap: clamp(14px, 3vw, 26px); }
.podium__img { flex: none; width: clamp(96px, 22vw, 150px); aspect-ratio: 4 / 5; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--sunken); border-radius: var(--radius); }
.podium__img img { width: 100%; height: 100%; object-fit: cover; }
.podium__text { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.podium__title { font-family: var(--serif); font-size: clamp(1.15rem, 2.6vw, 1.5rem); line-height: 1.2; }
a.podium__piece:hover .podium__title { color: var(--accent); }
.podium__item:first-child .podium__img { width: clamp(120px, 28vw, 200px); }
.podium__piece--gone { color: var(--muted); }

.running { max-width: 760px; margin-top: 26px; }
.running__label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.running__list { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 0; font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: var(--ink-soft); }
.running__list li:not(:last-child)::after { content: "·"; margin: 0 12px; color: var(--muted); }
.running__list a:hover { color: var(--accent); }

.outcome-actions { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-top: 30px; }
.outcome-actions__mood { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.outcome-actions__mood select { max-width: 220px; }
.outcome-links { display: flex; gap: 8px 28px; flex-wrap: wrap; align-items: baseline; }

.decided { max-width: 760px; margin-top: 30px; }
.decided summary { cursor: pointer; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.decided__list { margin: 14px 0 0 22px; display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; color: var(--ink-soft); }
.decided__list strong { font-weight: 500; color: var(--ink); }
.decided__over { font-family: var(--serif); font-style: italic; color: var(--muted); margin: 0 4px; }

/* ── Past selections ── */
.past { list-style: none; max-width: 820px; margin-top: 30px; }
.past__item { border-top: 1px solid var(--line); }
.past__item:last-child { border-bottom: 1px solid var(--line); }
.past__link { display: flex; flex-direction: column; gap: 6px; padding: 18px 0; }
.past__meta { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.past__open { color: var(--accent); }
.past__outcome { display: flex; flex-direction: column; gap: 3px; font-family: var(--serif); font-size: 1.2rem; line-height: 1.25; }
.past__rank { display: inline-block; width: 1.3em; color: var(--accent); }
.past__link:hover .past__outcome { color: var(--accent); }

@media (max-width: 600px) {
  .duel { gap: 10px; }
  .duel__or { font-size: 1.05rem; }
  .duel__details { font-size: 0.8rem; }
  .duel__actions { gap: 14px 26px; }
}

/* ── Compare page ── */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.switch input { width: 15px; height: 15px; accent-color: var(--accent); }
.board-head__main .back-link { margin-bottom: 14px; }

.compare-ai { margin-top: 26px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); max-width: 900px; }
.compare-ai__ask { display: flex; align-items: center; gap: 14px 28px; flex-wrap: wrap; }
.compare-ai__ask p { flex: 1; min-width: 240px; max-width: 58ch; color: var(--ink-soft); font-size: 0.92rem; }
/* "AI" marks: values and text that came from AI (see SECURITY.md, step 7) */
.ai-mark { display: inline-block; margin-left: 4px; padding: 0 5px; font-family: var(--sans); font-size: 0.6rem; font-weight: 500; letter-spacing: 0.1em; line-height: 1.5; color: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius); vertical-align: 0.12em; }
.ai-note { margin: 18px 0 16px; font-size: 0.8rem; color: var(--muted); }
.ai-note .ai-mark { margin: 0 6px 0 0; }
.compare-ai__by { margin-left: 8px; letter-spacing: 0.04em; text-transform: none; color: var(--muted); }
.compare-ai__label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.compare-ai__summary { font-family: var(--serif); font-size: 1.35rem; line-height: 1.35; }
.compare-ai__value { margin-top: 12px; color: var(--ink-soft); }
.compare-ai__tag { margin-right: 8px; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.compare-ai__foot { margin-top: 14px; font-size: 0.8rem; color: var(--muted); }
.compare-ai__foot .tools-link { margin-left: 8px; }
.compare-ai .panel-status { margin: 14px 0 0; }

/* The table: one column per piece. On narrow screens it scrolls sideways while the
   label column stays in place. */
.compare-wrap { margin-top: 30px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.compare--cols-2 { --cols: 2; }
.compare--cols-3 { --cols: 3; }
.compare--cols-4 { --cols: 4; }
.inline-form { display: inline; }
.compare { --label-w: 150px; border-collapse: collapse; table-layout: fixed; width: 100%; min-width: calc(var(--label-w) + var(--cols, 3) * 190px); }
.compare th, .compare td { text-align: left; vertical-align: top; font-weight: 400; }
.compare__corner, .compare__label {
  position: sticky;
  left: 0;
  z-index: 1;
  width: var(--label-w);
  background: var(--paper);
}
.compare__head { position: relative; padding: 0 12px 18px; }
.compare__piece { display: block; }
.compare__img {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 5;
  max-width: 240px;
  overflow: hidden;
  background: var(--sunken);
  border-radius: var(--radius);
}
.compare__img img { width: 100%; height: 100%; object-fit: cover; }
.compare__title { display: block; max-width: 240px; margin-top: 12px; font-family: var(--serif); font-size: 1.15rem; line-height: 1.2; }
.compare__piece:hover .compare__title { color: var(--accent); }
.compare__remove {
  position: absolute;
  top: 8px;
  left: 20px;
  z-index: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  color: var(--ink-soft);
  background: rgb(var(--paper-ch) / 0.9);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.compare__head:hover .compare__remove, .compare__remove:focus-visible { opacity: 1; }
@media (hover: none) { .compare__remove { opacity: 1; } }
.compare__remove:hover { color: var(--danger); }

/* Section headings: a rule and a small label, like a chapter break */
.compare__section-title th, .compare__section-title td { padding: 30px 12px 10px; border-bottom: 1px solid var(--ink); }
.compare__section-title th { padding-left: 0; font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--ink); white-space: nowrap; overflow: visible; }

.compare__row > * { padding: 12px 12px; border-bottom: 1px solid var(--line); }
.compare__row .compare__label { padding-left: 0; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding-top: 15px; }
.compare__cell { font-size: 0.95rem; line-height: 1.4; overflow-wrap: anywhere; }
.compare__none { color: var(--muted); font-style: italic; font-size: 0.88rem; }
.compare__by { display: block; margin-top: 2px; font-size: 0.62rem; color: var(--accent); }
.compare__lowest { display: inline-block; margin-left: 8px; font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.compare__cell .price__orig { margin-left: 6px; }

/* Rows where the pieces differ: a bronze marker on the label and slightly stronger text */
.compare__row--differs .compare__label { color: var(--ink); box-shadow: inset 2px 0 0 var(--accent); padding-left: 10px; }
.compare__row--differs .compare__cell { color: var(--ink); background: linear-gradient(var(--accent-bg), var(--accent-bg)) no-repeat 0 0 / 100% 100%; background-clip: padding-box; }
.compare__row--same .compare__cell { color: var(--ink-soft); }

/* "Mentioned for one piece only": each piece's extras listed in its own column */
.compare__section--only .compare__row .compare__label { box-shadow: none; }
.compare__section--only .compare__cell { background: none; }
.compare__list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.compare__list li { position: relative; padding-left: 16px; color: var(--ink-soft); }
.compare__list li::before { content: "—"; position: absolute; left: 0; color: var(--line); }

/* Only differences */
.compare--diff-only .compare__row--same, .compare__section--empty { display: none; }
.compare-empty { margin-top: 24px; color: var(--muted); }

@media (max-width: 700px) {
  .compare { --label-w: 104px; min-width: calc(var(--label-w) + var(--cols, 3) * 168px); }
  .compare__corner, .compare__label { box-shadow: 1px 0 0 var(--line); }
  .compare__row--differs .compare__label { box-shadow: inset 2px 0 0 var(--accent), 1px 0 0 var(--line); }
  .select-bar { bottom: 12px; }
}

/* ── Prices: converted amount, with the price as saved smaller beside it ── */
.price { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; min-width: 0; }
/* Something the person already has: "Yours" in place of a price, a small bronze label */
.price__main--yours { font-family: var(--sans); font-size: 0.68rem; font-style: normal; font-weight: 400; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.price__orig { font-size: 0.78em; color: var(--muted); white-space: nowrap; }
.detail-price .price__orig { margin-left: 10px; }
.look__price .price__orig { margin-left: 6px; }

/* ── Footer: display currency and exchange-rate note ── */
.site-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 32px;
  flex-wrap: wrap;
  padding: 18px var(--gutter) 28px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}
.site-foot__currency { display: flex; align-items: baseline; gap: 8px; }
.site-foot__currency label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; }
.site-foot__currency select {
  padding: 2px 18px 2px 0;
  color: var(--ink);
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%238f867b'/%3E%3C/svg%3E") no-repeat right center;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.site-foot__currency select:hover, .site-foot__currency select:focus { border-bottom-color: var(--ink); }
.site-foot__note { max-width: 70ch; }
.site-foot__note a { border-bottom: 1px solid var(--line); }
.site-foot__note a:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ── Sign-in and account pages ── */
.topnav { align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 4px 28px; }
.topnav__form { display: flex; }
.topnav__button { background: none; border: none; border-bottom: 1px solid transparent; }

.auth-card { max-width: 440px; margin: 0 auto; padding: 72px 0 56px; }
.auth-card--wide { max-width: 560px; }
.auth-card__title { font-family: var(--serif); font-size: clamp(2rem, 5vw, 2.6rem); font-weight: 500; line-height: 1.1; margin-bottom: 12px; }
.auth-card__lede { color: var(--ink-soft); margin-bottom: 20px; }
.auth-card__address { font-family: var(--serif); font-style: italic; font-size: 1.25rem; margin: -6px 0 22px; overflow-wrap: anywhere; }
.auth-card__error { padding: 10px 14px; margin-bottom: 18px; font-size: 0.9rem; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--danger); border-radius: var(--radius); }
.auth-card__foot { margin-top: 26px; font-size: 0.85rem; color: var(--muted); }
.auth-card__foot .tools-link { display: inline-block; margin-top: 8px; }
.auth-card__more { margin-top: -4px; }
.auth-card__more summary { cursor: pointer; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.code-input { font-size: 1.4rem !important; letter-spacing: 0.3em !important; text-align: center; }

.setup-steps { margin: 0 0 24px 20px; display: flex; flex-direction: column; gap: 14px; color: var(--ink-soft); }
.setup-steps__qr { display: block; margin: 14px 0 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.setup-steps__manual { display: block; font-size: 0.85rem; color: var(--muted); }
.setup-steps__manual code, .recovery-codes code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--ink); overflow-wrap: anywhere; }
.recovery-codes { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 16px; margin: 0 0 26px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.recovery-codes code { font-size: 1.05rem; letter-spacing: 0.06em; }

.account { max-width: 720px; }
.account--wide { max-width: 1100px; }
.account__section { padding: 30px 0; border-bottom: 1px solid var(--line); }
.account__section:first-child { padding-top: 34px; }
.session-list { list-style: none; margin: 4px 0 18px; }
.session-list__item { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 18px; padding: 12px 0; border-top: 1px solid var(--line); }
.session-list__item:last-child { border-bottom: 1px solid var(--line); }
.session-list__device { font-family: var(--serif); font-size: 1.15rem; overflow-wrap: anywhere; }
.session-list__here { margin-left: 8px; font-family: var(--sans); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.session-list__meta { flex: 1; min-width: 200px; font-size: 0.82rem; color: var(--muted); }

.admin-table-wrap { overflow-x: auto; margin-top: 6px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.admin-table th { padding: 8px 12px 8px 0; text-align: left; font-weight: 400; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--ink); white-space: nowrap; }
.admin-table td { padding: 10px 12px 10px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.admin-table__actions { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.admin-table__flag { color: var(--danger); }
.admin-table--log td { font-size: 0.82rem; color: var(--ink-soft); }
.admin-table--log td:first-child { white-space: nowrap; }

@media (max-width: 600px) {
  .auth-card { padding-top: 44px; }
  /* Phones: the name on one line, the menu on its own line below (it scrolls sideways
     rather than wrapping if it ever doesn't fit). --topbar-h is used by the mood board
     editor to size itself, so it changes here too. */
  :root { --topbar-h: 96px; }
  .topbar { flex-direction: column; align-items: stretch; justify-content: center; gap: 2px; }
  .topbar:not(:has(.topnav)) { height: 64px; }
  .topnav { flex-wrap: nowrap; justify-content: space-between; gap: 10px; overflow-x: auto; scrollbar-width: none; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav__link { font-size: 0.66rem; letter-spacing: 0.07em; white-space: nowrap; padding: 4px 0; }
}

/* ── Error page ── */
.error-page { max-width: 560px; margin: 0 auto; padding: 96px 0 72px; text-align: center; }
.error-page__status { font-size: 0.72rem; letter-spacing: 0.2em; color: var(--accent); margin-bottom: 14px; }
.error-page__title { font-family: var(--serif); font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 500; line-height: 1.1; margin-bottom: 14px; }
.error-page__message { color: var(--ink-soft); margin-bottom: 30px; }
.error-page__reference { margin-top: 34px; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Policy pages and the links to them ── */
.site-legal { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 14px var(--gutter) 26px; font-size: 0.74rem; color: var(--muted); border-top: 1px solid var(--line); }
.site-foot + .site-legal { border-top: none; padding-top: 0; }
.site-legal a { border-bottom: 1px solid var(--line); }
.site-legal a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.policy { max-width: 68ch; margin: 0 auto; padding: 56px 0 72px; }
.policy__title { font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1.1; margin-bottom: 18px; }
.policy__draft { padding: 12px 16px; margin-bottom: 30px; font-size: 0.86rem; color: var(--ink-soft); background: var(--accent-bg); border-left: 3px solid var(--accent); border-radius: var(--radius); }
.policy h2 { font-family: var(--serif); font-weight: 500; font-size: 1.45rem; margin: 34px 0 10px; }
.policy p, .policy li { font-size: 0.95rem; line-height: 1.65; color: var(--ink-soft); }
.policy p { margin-bottom: 12px; }
.policy ul { margin: 0 0 12px 1.2em; }
.policy li { margin-bottom: 7px; }
.policy a { color: var(--accent); border-bottom: 1px solid var(--line); }
/* (.edit-form label is an uppercase caption stacked above its field; this one is a sentence beside a tick box) */
.edit-form label.check-row, .check-row { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; margin: 6px 0 18px; font-size: 0.9rem; line-height: 1.5; color: var(--ink-soft); text-transform: none; letter-spacing: 0; }
.check-row input { margin-top: 4px; flex: none; width: auto; }
.check-row a { color: var(--accent); border-bottom: 1px solid var(--line); text-transform: none; letter-spacing: 0; }

/* ── Account: browser extension keys ── */
.key-reveal { margin: 14px 0 18px; padding: 14px 16px; background: var(--accent-bg); border-left: 2px solid var(--accent); border-radius: var(--radius); }
.key-reveal__title { margin: 0 0 8px; font-size: 0.9rem; color: var(--ink); }
.key-reveal__value { width: 100%; padding: 9px 12px; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.85rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.key-reveal__hint { margin: 8px 0 0; font-size: 0.85rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.key-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin-top: 12px; }
.key-form__field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 220px; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.key-form__field .url-input { min-width: 0; text-transform: none; letter-spacing: 0; font-size: 0.95rem; }

/* ── Connecting the browser extension ── */
.connect { max-width: 560px; }
.connect__question { margin: 6px 0 10px; font-family: var(--serif); font-size: 1.5rem; color: var(--ink); }
.connect__done { margin: 6px 0 10px; font-family: var(--serif); font-size: 1.6rem; color: var(--accent); }
.connect__actions { display: flex; align-items: center; gap: 18px; margin-top: 18px; }

/* ── Admin: recent uploads ── */
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 22px 18px; margin-top: 18px; }
.review-item__img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--sunken); border-radius: var(--radius); }
.review-item__meta { margin: 8px 0 6px; font-size: 0.78rem; color: var(--muted); overflow-wrap: anywhere; }
.review-item__actions { display: flex; flex-wrap: wrap; gap: 4px 14px; }

/* ── Picture galleries (tiles, quick view, product page) ──
   Quiet by design: thin chevrons in small paper-white circles, shown when the pointer
   is over the picture (always on touch screens), and a row of hairline dots. */
.gallery { position: relative; }
.gallery-nav { position: absolute; inset: 0; pointer-events: none; }
.gallery-nav--card { inset: 0 0 auto 0; aspect-ratio: 4 / 5; z-index: 1; }
.gallery-nav--detail { bottom: auto; aspect-ratio: 4 / 5; }
.gallery-nav__step {
  pointer-events: auto;
  position: absolute; top: 50%; translate: 0 -50%;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%;
  background: rgb(var(--paper-ch) / 0.92);
  cursor: pointer;
  opacity: 0; transition: opacity 0.18s, border-color 0.18s;
}
.gallery-nav__step::before {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 7px; height: 7px; border: solid var(--ink); border-width: 0 1.2px 1.2px 0;
}
.gallery-nav__step--prev { left: 10px; }
.gallery-nav__step--next { right: 10px; }
.gallery-nav__step--prev::before { translate: -35% -50%; rotate: 135deg; }
.gallery-nav__step--next::before { translate: -65% -50%; rotate: -45deg; }
.gallery-nav__step:hover, .gallery-nav__step:focus-visible { border-color: var(--ink); }
.card:hover .gallery-nav__step, [data-gallery]:hover > .gallery-nav .gallery-nav__step,
.gallery-nav__step:focus-visible { opacity: 1; }
@media (hover: none) { .gallery-nav__step { opacity: 0.9; width: 30px; height: 30px; } }
.gallery-nav__dots {
  position: absolute; left: 0; right: 0; bottom: 10px;
  display: flex; justify-content: center; gap: 5px;
}
.gallery-nav__dot { width: 5px; height: 5px; border-radius: 50%; background: rgb(var(--paper-ch) / 0.75); box-shadow: 0 0 0 0.5px rgb(var(--shade) / 0.35); transition: background 0.18s; }
.gallery-nav__dot.is-current { background: var(--ink); box-shadow: none; }
.qv-product__img { position: relative; }

.gallery-thumbs { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; margin-top: 12px; }
.gallery-thumbs__item { position: relative; }
.gallery-thumbs__pick { display: block; width: 100%; padding: 0; border: 1px solid transparent; border-radius: var(--radius); background: var(--sunken); cursor: pointer; overflow: hidden; }
.gallery-thumbs__pick img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; opacity: 0.72; transition: opacity 0.15s; }
.gallery-thumbs__pick:hover img, .gallery-thumbs__pick.is-current img { opacity: 1; }
.gallery-thumbs__pick.is-current { border-color: var(--ink); }
.gallery-thumbs__remove { position: absolute; top: 3px; right: 3px; opacity: 0; transition: opacity 0.15s; }
.gallery-thumbs__item:hover .gallery-thumbs__remove, .gallery-thumbs__remove:focus-within { opacity: 1; }
@media (hover: none) { .gallery-thumbs__remove { opacity: 1; } }
.gallery-thumbs__remove button { width: 18px; height: 18px; padding: 0; line-height: 16px; font-size: 13px; border: 1px solid var(--line); border-radius: 50%; background: rgb(var(--paper-ch) / 0.95); color: var(--ink-soft); cursor: pointer; }
.gallery-thumbs__remove button:hover { color: var(--danger); border-color: var(--danger); }
.gallery-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin-top: 10px; font-size: 0.8rem; color: var(--muted); }
.gallery-foot:empty { display: none; }
.gallery-foot__note .ai-mark { margin: 0 6px 0 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* On a phone the canvas's menus (Layout, Add, Style, Palette) open as a sheet along the
   bottom of the screen, and the toolbar wraps instead of running off the edge (B4) */
@media (max-width: 760px) {
  .canvas-tools { flex-wrap: wrap; row-gap: 6px; }
  .canvas-tools .palette-panel, .stage__head .palette-panel {
    position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; max-width: none;
    max-height: 62vh; overflow-y: auto; z-index: 60; box-shadow: 0 -8px 30px rgb(var(--shade) / 0.18);
  }
}

/* ── Your own pictures and material swatches on the mood board (B5) ── */
.tray__own { padding: 0 22px 14px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.tray__own-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tray__own-title { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.tray__upload { cursor: pointer; }
.tray__upload--off { opacity: 0.45; cursor: not-allowed; }
.tray__upload--working { opacity: 0.6; pointer-events: none; }
.tray__upload:focus-within { outline: 1px solid var(--accent); outline-offset: 2px; }
.tray__own-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.tray__own-grid:empty { display: none; }
.tray__own-hint { margin-top: 6px; font-size: 0.74rem; line-height: 1.35; color: var(--muted); }
.own-image { position: relative; }
.own-image__add { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sunken); cursor: pointer; overflow: hidden; }
.own-image__add:hover { border-color: var(--accent); }
.own-image__add img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.own-image__remove { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%;
  background: rgb(var(--shade) / 0.66); color: #fff; font-size: 12px; line-height: 18px; cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.own-image:hover .own-image__remove, .own-image__remove:focus-visible { opacity: 1; }
@media (hover: none) { .own-image__remove { opacity: 1; } }

.canvas-image { box-shadow: none; }
.canvas-image:hover { box-shadow: none; }
/* A swatch is a small paper sample card: the cut, and its name underneath */
.canvas-swatch { position: absolute; cursor: grab; outline: none; user-select: none; touch-action: none; transform-origin: 50% 50%;
  container-type: inline-size; background: #fbf8f2; border-radius: 2px;
  box-shadow: 0 0.3em 0.9em rgb(var(--shade) / 0.2); }
.canvas-swatch__crop { position: relative; aspect-ratio: 1; overflow: hidden; margin: 7cqw; background: var(--sunken);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); }
.canvas-swatch__crop img { position: absolute; left: 0; top: 0; max-width: none; height: auto; pointer-events: none; }
.canvas-swatch[data-shape="circle"] .canvas-swatch__crop { border-radius: 50%; }
.canvas-swatch__label { display: block; margin-top: -1.5cqw; padding: 0 5cqw 6cqw; font-family: var(--studio-body), "Jost", sans-serif; font-size: 8.5cqw;
  letter-spacing: 0.1em; text-transform: uppercase; text-align: center; line-height: 1.25; color: #3a2e22; overflow-wrap: anywhere; }
.canvas-swatch__label:empty { display: none; }
.canvas-swatch .piece__resize, .canvas-swatch .piece__rotate, .canvas-image .piece__resize, .canvas-image .piece__rotate { opacity: 0; }
.canvas-swatch.canvas-extra--selected .piece__resize, .canvas-swatch.canvas-extra--selected .piece__rotate,
.canvas-image.canvas-extra--selected .piece__resize, .canvas-image.canvas-extra--selected .piece__rotate { opacity: 1; }

.swatch-dialog { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgb(var(--shade) / 0.42); }
.swatch-dialog[hidden] { display: none; }
.swatch-dialog__box { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 50px rgb(var(--shade) / 0.25); }
.swatch-dialog__stage { position: relative; width: fit-content; max-width: 100%; margin: 12px auto; line-height: 0; touch-action: none; }
.swatch-dialog__stage img { display: block; max-width: 100%; max-height: 52vh; width: auto; height: auto; user-select: none; }
.swatch-dialog__cut { position: absolute; cursor: move; touch-action: none; border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgb(var(--shade) / 0.55), 0 0 0 9999px rgb(var(--shade) / 0.38); }
.swatch-dialog__cut[data-shape="circle"] { border-radius: 50%; }
.swatch-dialog__handle { position: absolute; right: 2px; bottom: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 1.5px solid var(--accent); cursor: nwse-resize; touch-action: none; }
.swatch-dialog__stage { overflow: hidden; }
.swatch-dialog__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.swatch-dialog__shapes { display: flex; gap: 12px; }
.swatch-dialog__shapes [aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.swatch-dialog__row input { flex: 1; min-width: 160px; padding: 6px 8px; font: inherit; font-size: 0.85rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.swatch-dialog__actions { display: flex; justify-content: flex-end; align-items: center; gap: 16px; margin-top: 14px; }

/* "Style this board for me" (B6): the button, and the bar that marks what Claude did */
.studio-ai { margin: 0 10px; }
.studio-ai:disabled { opacity: 0.6; cursor: progress; }
.ai-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; width: 100%; padding: 8px 12px;
  border: 1px solid var(--line); border-left: 2px solid var(--accent); border-radius: var(--radius); background: var(--surface); }
.ai-bar[hidden] { display: none; }
.ai-bar__badge { font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 2px; padding: 2px 6px; }
.ai-bar__text { flex: 1; min-width: 200px; font-family: var(--serif); font-style: italic; font-size: 1rem; color: var(--ink-soft); }
.ai-bar__actions { display: flex; gap: 14px; }

/* Export (B7): the sizes as small shapes, the options and the button */
.studio-export { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.studio-export__size { display: grid; grid-template-columns: 22px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
  padding: 7px 9px; font: inherit; font-size: 0.82rem; text-align: left; color: var(--ink); cursor: pointer;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.studio-export__size small { grid-column: 2; font-size: 0.66rem; letter-spacing: 0.06em; color: var(--muted); }
.studio-export__size:hover, .studio-export__size[aria-pressed="true"] { border-color: var(--accent); }
.studio-export__shape { grid-row: 1 / span 2; justify-self: center; border: 1.2px solid var(--ink-soft); border-radius: 1px; }
.studio-export__shape--story { width: 10px; height: 18px; }
.studio-export__shape--square { width: 15px; height: 15px; }
.studio-export__shape--portrait { width: 13px; height: 16px; }
.studio-export__shape--a4 { width: 13px; height: 18px; }
.studio-export__option { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 0.82rem; color: var(--ink-soft); cursor: pointer; }
.studio-export__option[hidden] { display: none; }
.studio-export__option input { accent-color: var(--accent); }
#export-go { margin: 8px 0 6px; }

/* Project cards' miniatures (B7): the board's background, frames, words and palette */
.mood-card__canvas { container-type: inline-size; --studio-heading: "Cormorant Garamond"; --studio-body: "Jost"; }
.mood-card__canvas--styled { background-size: 128px 128px; background-repeat: repeat; background-blend-mode: multiply; }
.mood-card__canvas img[data-frame="rounded"] { border-radius: 9%; }
.mood-card__canvas img[data-frame="circle"] { aspect-ratio: 1; object-fit: cover; border-radius: 50%; }
.mood-card__canvas img[data-frame="arch"] { aspect-ratio: 3 / 4; object-fit: cover; border-radius: 50% 50% 0 0 / 34% 34% 0 0; }
.mood-card__canvas img[data-frame="tile"] { aspect-ratio: 4 / 5; object-fit: cover; }
.mood-card__canvas img[data-frame="polaroid"] { aspect-ratio: 1 / 1.12; object-fit: cover; padding: 5% 5% 14%; background: #fff; box-sizing: border-box; }
.mood-card__word { position: absolute; line-height: 1.15; color: var(--ink); white-space: pre-wrap; overflow-wrap: break-word;
  font-family: var(--studio-body), "Jost", sans-serif; pointer-events: none; }
.mood-card__word--title { font-family: var(--studio-heading), "Cormorant Garamond", serif; line-height: 1.05; }
.mood-card__word--tagline { opacity: 0.88; }
.mood-card__word--note { font-family: "Caveat", cursive; text-align: center; padding: 0.3em 0.6em 0.4em; background: #f6ecd0; color: #3a2e22; }
.mood-card__word--caption { letter-spacing: 0.16em; text-transform: uppercase; }
.mood-card__palette { position: absolute; display: grid; grid-auto-flow: column; gap: 4%; padding: 2.5%; background: var(--surface); border-radius: 2px; }
.mood-card__palette--column { grid-auto-flow: row; }
.mood-card__palette--tile { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
.mood-card__chip { display: block; aspect-ratio: 4 / 3; border-radius: 1px; }

/* The board's shape (square 1:1, portrait 4:5 — wide 3:2 and tall 9:16 are above), as large as the window allows */
.canvas[data-aspect="1:1"], .stage__row .canvas[data-aspect="1:1"], .stage__row--solo .canvas[data-aspect="1:1"] {
  aspect-ratio: 1; width: min(100%, calc(100vh - var(--topbar-h) - 236px)); min-width: min(100%, 320px);
}
.canvas[data-aspect="4:5"], .stage__row .canvas[data-aspect="4:5"], .stage__row--solo .canvas[data-aspect="4:5"] {
  aspect-ratio: 4 / 5; width: min(100%, calc((100vh - var(--topbar-h) - 236px) * 0.8)); min-width: min(100%, 300px);
}
.mood-card__canvas--square { aspect-ratio: 1; width: min(100%, 360px); max-height: 360px; margin: 0 auto; }
.mood-card__canvas--portrait { aspect-ratio: 4 / 5; width: min(100%, 288px); max-height: 360px; margin: 0 auto; }
.studio-panel__shapes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.studio-shape { display: flex; align-items: center; gap: 8px; padding: 6px 9px; font: inherit; font-size: 0.82rem; color: var(--ink);
  cursor: pointer; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.studio-shape:hover, .studio-shape[aria-pressed="true"] { border-color: var(--accent); }
.studio-shape__icon { flex: none; border: 1.2px solid var(--ink-soft); border-radius: 1px; }
.studio-shape__icon--3-2 { width: 18px; height: 12px; }
.studio-shape__icon--1-1 { width: 14px; height: 14px; }
.studio-shape__icon--4-5 { width: 12px; height: 15px; }
.studio-shape__icon--9-16 { width: 9px; height: 16px; }

/* The grip beside the board's bottom-right corner: drag to change how big the board is on screen */
.stage__row { position: relative; }
.canvas-grip { position: absolute; z-index: 5; width: 16px; height: 16px; cursor: nwse-resize; touch-action: none; opacity: 0.55;
  background: linear-gradient(135deg, transparent 45%, var(--ink-soft) 45%, var(--ink-soft) 52%, transparent 52%,
              transparent 66%, var(--ink-soft) 66%, var(--ink-soft) 73%, transparent 73%); }
.canvas-grip:hover, .canvas-grip:focus-visible { opacity: 1; outline: none; }
@media (max-width: 760px) { .canvas-grip { display: none; } }

/* A selected word, ornament, swatch or the palette: a small × at its top-right corner to take it off */
.canvas-text .canvas-extra__remove, .canvas-orn .canvas-extra__remove, .canvas-swatch .canvas-extra__remove,
.palette-el .canvas-extra__remove { top: -11px; right: -11px; width: 20px; height: 20px; font-size: 0.85rem; z-index: 3; opacity: 0; }
.canvas-extra--selected .canvas-extra__remove, .palette-el--selected .canvas-extra__remove { opacity: 1; }
.canvas-text--editing .canvas-extra__remove { opacity: 0; pointer-events: none; }

/* More to add (owner's request): a text box, a label (a small paper tag), pins and tape */
.canvas-text--text { line-height: 1.4; }
.canvas-text--label { text-align: center; text-transform: uppercase; letter-spacing: 0.14em; line-height: 1.2;
  padding: 0.35em 0.7em; background: #fbf8f2; border: 1px solid currentColor; border-radius: 2px; }
.mood-card__word--text { line-height: 1.4; }
.mood-card__word--label { text-align: center; text-transform: uppercase; letter-spacing: 0.14em; padding: 0.35em 0.7em;
  background: #fbf8f2; border: 1px solid currentColor; border-radius: 2px; }
.studio-add--text { font-size: 0.8rem; }
.studio-add--label { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.68rem; border-color: var(--ink-soft); }
.studio-add--pin::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #a8322d; vertical-align: 1px; }
.studio-add--tape::before { content: ""; display: inline-block; width: 18px; height: 7px; margin-right: 6px; background: rgba(217, 195, 160, 0.75); transform: rotate(-4deg); vertical-align: 1px; }
.studio-add-btn { margin-left: 10px; padding: 4px 11px; font: inherit; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); background: transparent; border: 1px solid var(--accent); border-radius: 999px; cursor: pointer; }
.studio-add-btn:hover, .studio-add-btn[aria-expanded="true"] { color: var(--paper); background: var(--accent); }
.studio-layout--plain { border-style: dashed; margin-bottom: 10px; }

/* The right-click menu on the board */
.canvas-menu { position: fixed; z-index: 90; min-width: 210px; padding: 6px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 12px 34px rgb(var(--shade) / 0.18); }
.canvas-menu[hidden] { display: none; }
.canvas-menu__item { display: flex; justify-content: space-between; gap: 18px; width: 100%; padding: 6px 10px; font: inherit; font-size: 0.86rem;
  text-align: left; color: var(--ink); background: none; border: 0; border-radius: 2px; cursor: pointer; }
.canvas-menu__item:hover, .canvas-menu__item:focus-visible { background: var(--accent-bg); outline: none; }
.canvas-menu__key { font-size: 0.7rem; letter-spacing: 0.06em; color: var(--muted); }
.canvas-menu__label { margin: 6px 10px 2px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 0.64rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* The board's tools on their own row under the project's name, in groups:
   undo · layers | + Add | Layout · Style · Palette · Shuffle | Style for me | Export */
.canvas-tools--row { order: 10; flex: 1 0 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 4px;
  padding: 8px 0 2px; border-top: 1px solid var(--line); }
.canvas-tools--row .palette-menu { margin-left: 0; }
.canvas-tools--row .tools-link { padding: 4px 8px; }
.canvas-tools--row .rn-sep { margin: 0 8px; }
.canvas-tools--row .studio-add-btn { margin-left: 2px; margin-right: 6px; }
.canvas-tools--row .studio-ai, .canvas-tools--row .canvas-tools__shuffle { margin: 0; }
.canvas-tools--row .palette-panel { left: 0; right: auto; }

/* ── Phones (Android first): a bottom bar, folded filters, the mood board's tray as a sheet ── */
.bottombar, .add-sheet, .tray__toggle, .board-head__filters { display: none; }
@media (max-width: 760px) {
  /* The bottom bar: Boards · Projects · ＋ Add · Account */
  .bottombar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line);
    box-shadow: 0 -6px 18px rgb(var(--shade) / 0.06); }
  .bottombar__link, .bottombar__add { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0;
    font: inherit; font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
    text-decoration: none; background: none; border: 0; cursor: pointer; }
  .bottombar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
  .bottombar__link--active { color: var(--ink); }
  .bottombar__add { color: var(--accent); }
  .bottombar__add svg { width: 30px; height: 30px; padding: 5px; margin-top: -4px; color: var(--paper); background: var(--accent);
    border-radius: 50%; stroke-width: 2; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .add-sheet { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 61; display: grid; gap: 2px;
    max-height: 60vh; overflow-y: auto; padding: 14px; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: 0 12px 34px rgb(var(--shade) / 0.2); }
  .add-sheet.hidden { display: none; }
  .add-sheet__label { margin-bottom: 6px; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
  .add-sheet__board { padding: 12px 6px; font-family: var(--serif); font-size: 1.25rem; color: var(--ink); text-decoration: none;
    border-bottom: 1px solid var(--line); }
  .add-sheet__empty { font-size: 0.9rem; color: var(--ink-soft); }
  .add-sheet__close { justify-self: end; margin-top: 8px; }

  /* The top bar keeps the name and the Account menu (Admin, colours, Sign out); the rest is in the bottom bar */
  .topnav > a.topnav__link[href$="/boards"], .topnav > a.topnav__link[href$="/projects"], .topnav > a.topnav__link[href$="/notes"],
  .topnav > a.topnav__link[href$="/account"] { display: none; }
  /* Board tabs: one line that scrolls sideways */
  .board-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 4px 22px; padding-top: 12px; }
  .board-tabs::-webkit-scrollbar { display: none; }
  .board-tabs .tab { flex: none; white-space: nowrap; }
  .new-board-form { flex: none; }

  /* A board: brands, filters and sorting behind "Filter & sort" */
  .board-head__filters { display: inline-flex; align-items: center; gap: 6px; }
  .board-head__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
  .board-head__dot[hidden] { display: none; }
  body:not(.filters-open) #brand-note, body:not(.filters-open) #board-tools { display: none; }

  /* The mood board: the board first; the tray is a panel along the bottom */
  .mood-editor .bottombar { display: none; }
  body.mood-editor { padding-bottom: 64px; }
  .mood { display: flex; flex-direction: column; }
  .mood .stage { order: 1; }
  .mood .tray { position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; order: 2; max-height: 56px; overflow: hidden;
    background: var(--surface); border-top: 1px solid var(--line); border-bottom: 0; box-shadow: 0 -8px 24px rgb(var(--shade) / 0.12);
    transition: max-height 0.25s ease; padding-bottom: env(safe-area-inset-bottom); }
  .mood .tray.tray--open { max-height: 62vh; overflow-y: auto; }
  .tray__title, .tray__hint { display: none; }
  .tray__head { padding: 0; }
  .tray__toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; height: 56px;
    padding: 0 var(--gutter); font: inherit; color: var(--ink); background: none; border: 0; cursor: pointer; }
  .tray__toggle::before { content: ""; position: absolute; left: 50%; top: 6px; width: 36px; height: 4px; margin-left: -18px;
    border-radius: 2px; background: var(--line); }
  .tray__toggle-label { font-family: var(--serif); font-size: 1.2rem; }
  .tray__toggle-hint { font-size: 0.68rem; letter-spacing: 0.08em; color: var(--muted); }
  .is-dragging .mood .tray { opacity: 0.35; }
}
@media (max-width: 760px) {
  /* The board's tools: one line that scrolls sideways (their menus open as sheets along the bottom) */
  .canvas-tools--row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
  .canvas-tools--row::-webkit-scrollbar { display: none; }
  .canvas-tools--row > * { flex: none; }
}

/* The installed app's offline page */
.offline { max-width: 460px; margin: 0 auto; padding: 80px 0; text-align: center; }
.offline__title { font-family: var(--serif); font-size: 2.2rem; font-weight: 500; margin-bottom: 12px; }
.offline__text { color: var(--ink-soft); margin-bottom: 24px; }

/* "Share → Shopping Board" (Android's share menu) */
.share { max-width: 560px; margin: 0 auto; padding: 32px 0 48px; }
.share__title { font-family: var(--serif); font-size: 2rem; font-weight: 500; margin-bottom: 6px; }
.share__name { font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--ink-soft); margin-bottom: 18px; }
.share__label { display: block; margin: 18px 0 8px; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.share__address { width: 100%; padding: 10px 12px; font: inherit; font-size: 0.9rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); }
.share__address:focus { outline: none; border-color: var(--accent); }
.share__boards { display: grid; gap: 8px; }
.share__board { padding: 14px 16px; font-family: var(--serif); font-size: 1.3rem; text-align: left; color: var(--ink); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.share__board:hover, .share__board:focus-visible { border-color: var(--accent); outline: none; }
.share__form[aria-busy="true"] .share__board { opacity: 0.55; pointer-events: none; }
.share__hint { margin-top: 18px; font-size: 0.85rem; color: var(--ink-soft); }

/* Editing a project's items in place: the checklist's own lines, the × on items, the progress word */
.check-item__box { flex: none; width: 18px; height: 18px; accent-color: var(--accent); }
.check-item__name--edit { flex: 1; min-width: 0; font: inherit; font-size: 1rem; }
.is-ticked .check-item__name--edit { color: var(--muted); text-decoration: line-through; }
.check-item__qty { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-size: 0.85rem; }
.check-item__qty .cell-input { width: 3.2em; text-align: center; }
.item-remove { display: inline-flex; margin-left: 2px; }
.item-remove__btn { width: 26px; height: 26px; color: var(--muted); opacity: 0.55; }
.check-item:hover .item-remove__btn, .status-card:hover .item-remove__btn, .item-remove__btn:focus-visible { opacity: 1; }
@media (hover: none) { .item-remove__btn { opacity: 0.8; } }
.status-card { position: relative; }
.status-card .item-remove { position: absolute; top: 4px; right: 4px; }
.check-word { display: inline-flex; margin-left: -4px; }
.check-word__input { width: 7em; padding: 2px 4px; font: inherit; color: var(--ink-soft); border-bottom: 1px dashed var(--line); }
.select-bar__remove { display: inline-flex; }

/* Pieces shared from the phone: being added, or couldn't be */
.shared-notes { display: grid; gap: 8px; margin: 0 0 16px; }
.shared-note { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--line); border-left: 2px solid var(--accent); border-radius: var(--radius); }
.shared-note__text { flex: 1 1 260px; font-size: 0.9rem; color: var(--ink-soft); }
.shared-note__link { color: var(--ink); overflow-wrap: anywhere; }
.shared-note form { display: inline-flex; }
.share__form[hidden], .share__done[hidden] { display: none; }
.share__error { margin-top: 12px; color: var(--danger); font-size: 0.9rem; }
.share__done { padding: 24px 0; }
.share__done-title { font-family: var(--serif); font-size: 1.6rem; margin-bottom: 8px; }
.check-item__qty-label { font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; }

/* ── Phase 6, U1: the project header and tools ── */
/* Menus (<details class="menu">): a button, and a small panel of choices under it */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__more::after { content: " ▾"; font-size: 0.7em; }
.menu__dots { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink-soft); }
.menu__dots svg { width: 16px; height: 16px; fill: currentColor; }
.menu[open] > .menu__dots, .menu__dots:hover { border-color: var(--ink-soft); color: var(--ink); }
.menu__panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; min-width: 230px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 30px rgb(var(--shade) / 0.14); }
.menu__panel--right { left: auto; right: 0; }
.menu__panel form { display: block; }
.menu__item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; padding: 8px 10px;
  font: inherit; font-size: 0.92rem; text-align: left; color: var(--ink); text-decoration: none;
  background: none; border: 0; border-radius: 2px; cursor: pointer; }
.menu__item:hover, .menu__item:focus-visible { background: var(--accent-bg); outline: none; }
.menu__hint { font-size: 0.76rem; color: var(--muted); }
.menu__item--danger { color: var(--danger); }
.menu__sep { height: 1px; margin: 6px 4px; background: var(--line); }

.project-head__actions { gap: 10px; }
.project-head__title { cursor: text; }
.project-head__nav { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 18px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line); }

/* The views: one control, an icon and a word each */
.view-switch { display: inline-flex; padding: 3px; gap: 2px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.view-switch__tab { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 4px;
  font-size: 0.86rem; color: var(--ink-soft); text-decoration: none; transition: background 0.15s, color 0.15s; }
.view-switch__tab svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.view-switch__tab:hover { color: var(--ink); background: var(--accent-bg); }
.view-switch__tab--active, .view-switch__tab--active:hover { color: var(--paper); background: var(--ink); }
.stage > .view-switch { margin: -2px 0 6px; }

/* Totals: one quiet line — how many, how much, the budget; the breakdown after it, small */
.project-head__nav .project-totals { flex: 1 1 auto; justify-content: flex-end; padding: 0; border-bottom: 0; gap: 2px 12px; }
.project-head__nav .project-totals__count { font-size: 0.86rem; letter-spacing: 0; text-transform: none; color: var(--ink-soft); }
.project-head__nav .project-totals__sum { font-size: 1.35rem; }
.project-head__nav .project-totals__budget { margin-left: 0; padding: 2px 8px; border-radius: 999px; background: var(--accent-bg); }
.project-head__nav .project-totals__budget--over { background: var(--danger-bg); }
.project-head__nav .project-totals__note { flex-basis: 100%; text-align: right; font-size: 0.78rem; }

@media (max-width: 760px) {
  .project-head { padding-top: 16px; }
  .project-head__row { margin-top: 6px; flex-wrap: nowrap; }
  .project-head__name { flex: 1 1 auto; }
  .project-head__title { font-size: 1.6rem; }
  .project-head__nav { margin-top: 10px; gap: 8px; }
  .view-switch { width: 100%; }
  .view-switch__tab { flex: 1; justify-content: center; flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 0.72rem; }
  .project-head__nav .project-totals { justify-content: flex-start; }
  .project-head__nav .project-totals__note { text-align: left; }
  .menu__panel { max-width: calc(100vw - 24px); }
}
/* The add panels sit right under the header now: no space of their own while closed */
.project-head + .project-add { margin: 0; }
.project-head + .project-add .picker, .project-head + .project-add .manual-form { margin: 16px 0 4px; }
@media (max-width: 760px) {
  .project-head__nav .project-totals__note { flex-basis: auto; }
}

/* ── Themes (phase 6, S1) ──
   In dark, product photos (mostly shot on white) sit in tiles with a hairline edge, so a
   white photo doesn't float on the black page. --photo-edge is transparent in light. */
.card__img-wrap, .detail-img, .tray-item__thumb, .qv-product__img, .duel__img, .podium__img,
.compare__img, .review-item__img, .gallery-thumbs__pick {
  outline: 1px solid var(--photo-edge); outline-offset: -1px;
}
/* The mood board canvas is a light area of its own; on a dark page it gets an edge */
:root[data-theme="dark"] .canvas { border-color: #3a3a3a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .canvas { border-color: #3a3a3a; } }

/* The theme choice (Account page and footer) */
.theme-choice { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; gap: 2px; }
.theme-choice__option { font: inherit; font-size: 0.78rem; letter-spacing: 0.04em; padding: 4px 12px; border: 1px solid transparent;
  border-radius: 999px; background: none; color: var(--ink-soft); cursor: pointer; }
.theme-choice__option:hover { color: var(--ink); }
.theme-choice__option[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); }
.theme-choice__option:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.site-foot__theme { display: flex; align-items: center; gap: 10px; }

/* ── Phase 6, S2: the same header in every project view ──
   Name, Add and ⋯ on one row; one summary line (items · total · date · budget) with a slim
   budget bar; the view tabs directly under it; then each view's one line of controls. */
.project-head { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.project-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 0; margin-top: 6px;
  font-size: 0.9rem; color: var(--ink-soft); }
.project-summary > span:empty, .project-summary__more:has(> span:empty + span:empty) { display: none; }
.project-summary > span:not(:first-child):not(.project-summary__more)::before { content: "·"; margin: 0 10px; color: var(--muted); }
.project-summary__sum { font-family: var(--serif); font-size: 1.2rem; color: var(--ink); }
.project-summary__budget--over { color: var(--danger); }
.project-summary__note { flex-basis: 100%; font-size: 0.78rem; color: var(--muted); }
.budget-bar { display: block; width: 100%; max-width: 360px; height: 3px; margin-top: 8px; border: 0;
  -webkit-appearance: none; appearance: none; background: var(--line); border-radius: 2px; overflow: hidden; color: var(--ink); }
.budget-bar::-webkit-progress-bar { background: var(--line); }
.budget-bar::-webkit-progress-value { background: var(--ink); }
.budget-bar::-moz-progress-bar { background: var(--ink); }
.budget-bar--over::-webkit-progress-value { background: var(--danger); }
.budget-bar--over::-moz-progress-bar { background: var(--danger); }
.project-head > .view-switch { margin-top: 16px; }
.head-panel__title { flex-basis: 100%; margin-top: 6px; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.head-panel__title:first-child { margin-top: 0; }
.head-panel__hint { flex-basis: 100%; font-size: 0.78rem; color: var(--muted); }
.manual-form__note { flex-basis: 100%; font-size: 0.8rem; color: var(--muted); }
.project-head ~ .project-add .manual-form { margin: 16px 0 4px; }
.project-head ~ .project-add { margin: 0; }

/* Highlight = a 1px ink border (DESIGN.md): the active view tab, not a filled block */
.view-switch__tab { border: 1px solid transparent; }
.view-switch__tab--active, .view-switch__tab--active:hover { color: var(--ink); background: none; border-color: var(--ink); }

/* The mood board: the header sits above its one line of canvas tools */
.stage > .project-head { width: 100%; padding-top: 0; }
.stage > .stage__head { margin-top: 2px; }
@media (max-width: 760px) {
  .budget-bar { max-width: none; }
  .project-summary > span:not(:first-child):not(.project-summary__more)::before { margin: 0 7px; }
}

/* The Account menu in the top bar */
.topnav__account > summary { list-style: none; }
.topnav__account .menu__panel { min-width: 250px; text-transform: none; letter-spacing: 0; }
.menu__block { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px 10px; }
.menu__label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* The mood board's one line: canvas tools first, then Saved · note · Start over at its end */
.stage > .stage__head { flex-wrap: nowrap; gap: 10px; padding: 8px 0 2px; }
.stage > .stage__head > .canvas-tools--row { order: 0; flex: 1 1 auto; border-top: 0; padding: 0; }
.stage > .stage__head > .stage__status, .stage > .stage__head > .notes-show,
.stage > .stage__head > .palette-menu { order: 1; flex: none; }
@media (max-width: 760px) {
  .stage > .stage__head { flex-wrap: wrap; }
  .stage > .stage__head > .canvas-tools--row { flex: 1 0 100%; }
}
/* The breakdown and what isn't counted: one small line under the summary */
.project-summary__more { flex-basis: 100%; font-size: 0.78rem; color: var(--muted); }
.project-summary__more > span:empty { display: none; }
.project-summary__more > span + span:not(:empty)::before { content: "·"; margin: 0 8px; }
/* …and its two buttons as quiet words, so the line fits beside the canvas */
.stage > .stage__head > .notes-show, .stage > .stage__head #clear-btn { border-color: transparent; padding-left: 8px; padding-right: 8px; }
.stage > .stage__head > .notes-show:hover, .stage > .stage__head #clear-btn:hover { border-color: var(--line); }
.stage > .stage__head > .canvas-tools--row { gap: 4px 2px; }
.stage > .stage__head > .canvas-tools--row .tools-link { padding: 4px 6px; }
.stage > .stage__head > .canvas-tools--row .rn-sep { margin: 0 4px; }
.stage > .stage__head > .canvas-tools--row .studio-add-btn { margin-right: 2px; }

/* ── Phase 6, S2b: rows and selecting ──
   Each row ends in a quiet ⋯ (shown on hover or focus on a desktop; always, faintly, on a
   phone, where a long press opens it too); ticks are round; nothing shows in an empty cell. */
.row-menu { flex: none; }
.row-menu__dots { width: 28px; height: 28px; color: var(--muted); border: 1px solid transparent; border-radius: var(--radius);
  opacity: 0; transition: opacity 0.12s; }
.row-menu__dots svg { width: 15px; height: 15px; fill: currentColor; }
[data-item-url]:hover .row-menu__dots, .row-menu__dots:focus-visible, .row-menu[open] > .row-menu__dots { opacity: 1; }
.row-menu[open] > .row-menu__dots, .row-menu__dots:hover { color: var(--ink); border-color: var(--line); }
@media (hover: none) { .row-menu__dots { opacity: 0.7; } }
.row-menu .menu__panel { min-width: 220px; }
.row-menu .menu__block .cell-select { width: 100%; font-size: 0.9rem; }
.status-card .row-menu { position: absolute; top: 4px; right: 4px; }

/* A board card's ⋯ (move to another board, delete): top-right of the picture, quiet until
   the card is hovered; faintly always on touch screens. Above the gallery arrows. */
.card-menu { position: absolute; top: 8px; right: 8px; z-index: 3; }
.card-menu__dots { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  color: var(--ink); background: rgb(var(--paper-ch) / 0.88); border: 1px solid var(--line); border-radius: 50%;
  opacity: 0; transition: opacity 0.12s; }
.card-menu__dots svg { width: 15px; height: 15px; fill: currentColor; }
.card:hover .card-menu__dots, .card-menu__dots:focus-visible, .card-menu[open] > .card-menu__dots { opacity: 1; }
.card-menu[open] > .card-menu__dots, .card-menu__dots:hover { border-color: var(--ink-soft); }
@media (hover: none) { .card-menu__dots { opacity: 0.8; } }
.card-menu .menu__panel { min-width: 200px; max-height: 60vh; overflow-y: auto; }
.card-menu .menu__item { text-transform: none; letter-spacing: 0; }
.menu__label--pad { display: block; padding: 6px 10px 2px; }
.product-board { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; }
.product-board .product-section { margin-bottom: 0; }
.product-board__delete { margin: 14px 0 4px; }
.select-bar__delete { padding: 0 4px; }
.ptable__c--remove { white-space: nowrap; }
.ptable__c--remove .row-menu, .ptable__c--remove .select-tick { vertical-align: middle; }

/* Round ticks: an outlined circle; ticked = filled with ink */
.check-item__box, .check-item__tick input[type="checkbox"], .select-tick {
  -webkit-appearance: none; appearance: none; flex: none; width: 20px; height: 20px; margin: 0;
  border: 1px solid var(--ink-soft); border-radius: 50%; background: var(--paper); cursor: pointer;
  display: inline-grid; place-content: center; transition: background 0.12s, border-color 0.12s; }
.check-item__box::after, .check-item__tick input[type="checkbox"]::after, .select-tick::after {
  content: ""; width: 9px; height: 5px; margin-top: -2px; border: solid var(--paper); border-width: 0 0 1.6px 1.6px;
  transform: rotate(-45deg) scale(0); transition: transform 0.12s; }
.check-item__box:checked, .check-item__tick input[type="checkbox"]:checked, .select-tick:checked { background: var(--ink); border-color: var(--ink); }
.check-item__box:checked::after, .check-item__tick input[type="checkbox"]:checked::after, .select-tick:checked::after { transform: rotate(-45deg) scale(1); }
.check-item__box:focus-visible, .check-item__tick input:focus-visible, .select-tick:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Something to edit says so quietly: a dotted line under it on hover, a solid one while typing */
.ptable .cell-input, .ptable .cell-select { border-bottom: 1px dotted transparent; }
.ptable__row:hover .cell-input, .ptable__row:hover .cell-select { border-bottom-color: var(--line); }
.ptable .cell-input:focus, .ptable .cell-select:focus { border-bottom: 1px solid var(--ink); }

/* The table: the picture keeps its size; the item's name gets the room */
.ptable__c--picture { width: 56px; min-width: 56px; }
.ptable__img { width: 44px; min-width: 44px; }
.ptable__c--name { min-width: 200px; }

/* The selection bar: "2 selected · Compare · This or that · Move to · Remove · ✕" */
.select-bar__move { display: inline-block; }
.select-bar__move .menu__panel { top: auto; bottom: calc(100% + 8px); }
.select-bar__close { width: 30px; height: 30px; color: var(--ink-soft); }
.select-bar__close svg { width: 15px; height: 15px; }

/* The checklist on a phone: tick · name · price · ⋯ on one line; quantity under the name */
@media (max-width: 760px) {
  .check-item { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 2px 10px; }
  .check-item > .select-tick { grid-column: 1; }
  .check-item > .drag-handle { display: none; }
  .check-item__tick, .check-item__name--edit { grid-column: 1 / 3; min-width: 0; }
  .check-item__box + .check-item__name--edit { grid-column: 2; }
  .check-item__qty { grid-column: 2; grid-row: 2; justify-self: start; }
  .check-item__meta { grid-column: 3; grid-row: 1; text-align: right; }
  .check-item > .row-menu { grid-column: 4; grid-row: 1; }
  .check-item .row-error { grid-column: 1 / -1; }
  .is-selecting .check-item { grid-template-columns: auto auto 1fr auto auto; }
}
/* Selection ticks only while selecting (the round style above must not show them otherwise) */
body:not(.is-selecting) .select-tick { display: none; }
.is-selecting .select-tick { display: inline-grid; }
/* An empty status column says what it is for */
.status-col__list:not(:has(li))::after { content: "Drag an item here"; display: block; padding: 18px 8px; text-align: center;
  font-size: 0.82rem; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
@media (hover: none) { .status-col__list:not(:has(li))::after { content: "Move an item here with its status"; } }

/* ── Phase 6, S2c: project cards and starting a project ──
   A card shows its mood board when one is arranged, otherwise a 2×2 collage of its items'
   pictures (one picture fills it; two sit side by side; three: one large and two small) —
   always the same 3:2 shape, never blank. Then the name, a meta line and a progress line. */
.mood-card__collage { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px;
  aspect-ratio: 3 / 2; overflow: hidden; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius);
  transition: box-shadow 0.25s, transform 0.25s; }
.mood-card:hover .mood-card__collage { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.mood-card__collage img { width: 100%; height: 100%; min-height: 0; object-fit: cover; background: var(--surface); }
.mood-card__collage img.is-broken { visibility: hidden; }
.mood-card__cell { background: var(--sunken); }
.mood-card__collage--1 img { grid-column: 1 / -1; grid-row: 1 / -1; }
.mood-card__collage--1 .mood-card__cell, .mood-card__collage--2 .mood-card__cell { display: none; }
.mood-card__collage--2 img { grid-row: 1 / -1; }
.mood-card__collage--3 img:first-child { grid-row: 1 / -1; }
.mood-card__collage--3 .mood-card__cell { display: none; }
.mood-card__count { font-size: 0.85rem; color: var(--ink-soft); }
.mood-card__progress { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; font-size: 0.8rem; color: var(--muted); }
.mood-card__progress progress { width: 72px; height: 3px; border: 0; -webkit-appearance: none; appearance: none;
  background: var(--line); border-radius: 2px; overflow: hidden; }
.mood-card__progress progress::-webkit-progress-bar { background: var(--line); }
.mood-card__progress progress::-webkit-progress-value { background: var(--ink); }
.mood-card__progress progress::-moz-progress-bar { background: var(--ink); }
.mood-card__changed { margin-left: auto; }
.mood-card:hover .mood-card__name { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

/* "Start a new project": a dashed card in the grid */
.mood-card--new { align-items: center; justify-content: center; gap: 6px; aspect-ratio: 3 / 2; padding: 20px; text-align: center;
  color: var(--ink-soft); text-decoration: none; border: 1px dashed var(--ink-soft); border-radius: var(--radius); transition: border-color 0.15s, color 0.15s; }
.mood-card--new:hover, .mood-card--new:focus-visible { color: var(--ink); border-color: var(--ink); outline: none; }
.mood-card__new-plus { font-size: 1.6rem; line-height: 1; }
.mood-card__new-text { font-family: var(--serif); font-size: 1.35rem; color: var(--ink); }
.mood-card__new-hint { font-size: 0.8rem; color: var(--muted); }

/* Dialogs (the New project dialog) */
.dialog { width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 48px); margin: auto; padding: 24px 28px 28px;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 24px 60px rgb(var(--shade) / 0.25); }
.dialog::backdrop { background: rgb(var(--shade) / 0.45); }
.dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dialog__title { font-family: var(--serif); font-size: 1.8rem; font-weight: 500; }
.dialog__close { width: 34px; height: 34px; color: var(--ink-soft); }
.dialog__close svg { width: 16px; height: 16px; }
.dialog__lede { margin: 4px 0 18px; color: var(--ink-soft); font-size: 0.92rem; }
.dialog .template-picker { margin: 0; }
.template-picker__label { margin: 18px 0 10px; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 760px) {
  .dialog { width: 100vw; max-width: none; max-height: 92vh; margin: auto 0 0; padding: 18px 16px 24px; border-radius: 8px 8px 0 0; }
  .dialog__title { font-size: 1.5rem; }
}
.mood-card .mood-card__count { text-transform: none; letter-spacing: 0; }

/* ── Phase 6, S3: choosing in a project ── */
.choose-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin: 0 0 14px; }
.choose-bar__hint { font-size: 0.8rem; color: var(--muted); }
.compare__choose { margin-top: 10px; }
.outcome-actions__shortlist { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
/* Set aside: still listed, quieter, and its money isn't counted */
.ptable__row[data-status="set_aside"], .check-item[data-status="set_aside"] { opacity: 0.55; }
.status-col[data-drop-value="set_aside"] { opacity: 0.8; }

/* ── Phase 6, S4: sections inside a board ──
   One quiet line of tabs under the brand note (All · each section · Unsorted); the one shown
   has the ink border. A card dragged over a tab marks it as the place to drop. */
.section-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 18px; }
.section-filter__tab { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 12px; font: inherit; font-size: 0.88rem;
  color: var(--ink-soft); background: none; border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s; }
.section-filter__tab:hover { color: var(--ink); border-color: var(--ink-soft); }
.section-filter__tab[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); }
.section-filter__tab--quiet { border-style: dashed; }
.section-filter__n { font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.is-dragging-card .section-filter__tab[data-drop-section] { border-style: dashed; border-color: var(--ink-soft); }
.section-filter__tab.is-drop { background: var(--sunken); border-color: var(--ink); border-style: solid; }
@media (max-width: 760px) {
  .section-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; }
  .section-filter::-webkit-scrollbar { display: none; }
  .section-filter__tab { flex: none; white-space: nowrap; }
}

.sections-panel .section-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 0; }
.sections-panel .section-row__name { flex: 1 1 200px; }
.section-row__count { font-size: 0.8rem; color: var(--muted); min-width: 2ch; text-align: right; }
.sections-ai { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.sections-ai__note { margin-top: 8px; font-size: 0.82rem; color: var(--muted); }
.sections-ai__badge { margin: 12px 0 6px; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.sections-ai__list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.sections-ai__list li { display: grid; gap: 2px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.sections-ai__list strong { font-family: var(--serif); font-size: 1.1rem; font-weight: 500; }
.sections-ai__list span { font-size: 0.82rem; color: var(--ink-soft); }
.sections-ai__actions { display: flex; align-items: center; gap: 16px; }

.product-section { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 14px 0 4px; }
.product-section__label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.product-section__select { width: auto; min-width: 160px; }
.product-section__status { font-size: 0.78rem; color: var(--muted); }

/* ── Phase 6, S5: the simple tile board ──
   A grid that snaps: 4 columns on a desktop, 2 on a phone; rows as tall as a 4:5 small tile.
   Sizes: s 1×1, w 2×1, t 1×2, l 2×2 (dense packing fills the gaps). The column width comes
   from the wrapper's own width (container units), so the board fits beside the tray. */
.tile-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; width: 100%; padding: 10px 0 6px; }
.tile-tools .icon-btn { width: 30px; height: 30px; color: var(--ink-soft); }
.tile-tools .icon-btn svg { width: 16px; height: 16px; }
.tile-tools__hint { font-size: 0.8rem; color: var(--muted); }
.tile-tools__spacer { flex: 1; }
.tile-wrap { width: 100%; container-type: inline-size; padding-bottom: 48px; }
.tile-board { --cols: 4; --gap: 12px; display: grid; grid-template-columns: repeat(var(--cols), 1fr);
  grid-auto-rows: calc((100cqw - (var(--cols) - 1) * var(--gap)) / var(--cols) * 1.25);
  grid-auto-flow: dense; gap: var(--gap); }
.tile { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  touch-action: manipulation; transition: box-shadow 0.15s, opacity 0.15s; }
.tile--w { grid-column: span 2; }
.tile--t { grid-row: span 2; }
.tile--l { grid-column: span 2; grid-row: span 2; }
.tile:not(.tile--note) { cursor: grab; }
.tile__img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; }
.tile--broken .tile__img { visibility: hidden; }
.tile__caption { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; gap: 8px;
  padding: 18px 10px 8px; font-size: 0.78rem; color: #ffffff;
  background: linear-gradient(to top, rgb(0 0 0 / 0.55), rgb(0 0 0 / 0)); opacity: 0; transition: opacity 0.15s; }
.tile__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile__price { flex: none; }
.tile:hover .tile__caption, .tile:focus-within .tile__caption { opacity: 1; }
.tile__grip { position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; display: grid; place-items: center;
  font-size: 14px; color: var(--ink-soft); background: rgb(var(--paper-ch) / 0.9); border-radius: 3px; cursor: grab;
  opacity: 0; transition: opacity 0.12s; touch-action: none; }
.tile__menu { position: absolute; top: 6px; right: 6px; opacity: 0; transition: opacity 0.12s; }
.tile__dots { width: 26px; height: 26px; color: var(--ink); background: rgb(var(--paper-ch) / 0.9); border: 0; font-size: 16px; line-height: 1; }
.tile:hover .tile__grip, .tile:hover .tile__menu, .tile:focus-within .tile__grip, .tile:focus-within .tile__menu,
.tile__menu[open] { opacity: 1; }
@media (hover: none) { .tile__grip, .tile__menu { opacity: 0.85; } }
.tile__menu .menu__panel { min-width: 200px; }
.tile__menu-label { display: block; padding: 6px 10px 2px; }
.tile__sizes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px 6px 6px; }
.tile__size { font: inherit; font-size: 0.82rem; padding: 5px 8px; color: var(--ink-soft); background: none;
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.tile__size[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); }
.tile--dragging { opacity: 0.35; outline: 1px dashed var(--ink); outline-offset: -1px; }
.is-dragging-tile, .is-dragging-tile * { cursor: grabbing !important; user-select: none; }
.tile--flash { animation: tile-flash 0.9s ease-out; }
@keyframes tile-flash { from { box-shadow: 0 0 0 3px var(--ink); } to { box-shadow: 0 0 0 3px rgb(17 17 17 / 0); } }

/* A note: paper-white in both themes (the board keeps its own colours), its toolbar while editing */
.tile--note { display: flex; flex-direction: column; color: var(--ink); background: var(--sunken); cursor: text; }
.tile--note .rn-toolbar { display: none; flex: none; flex-wrap: wrap; padding: 4px 34px 4px 34px; border-bottom: 1px solid var(--line); background: var(--surface); }
.tile--note:focus-within .rn-toolbar { display: flex; }
.tile__note { flex: 1; min-height: 0; overflow-y: auto; padding: 36px 14px 14px; outline: none; font-size: 15px; line-height: 1.45; }
.tile--note:focus-within .tile__note { padding-top: 10px; }
.tile__note.rn-editor--empty::before { content: attr(data-placeholder); color: var(--muted); }

.tile-board__empty { padding: 40px 20px; text-align: center; color: var(--ink-soft); border: 1px dashed var(--line); border-radius: var(--radius); }
.tile-board__empty-title { font-family: var(--serif); font-size: 1.5rem; color: var(--ink); margin-bottom: 4px; }

@media (max-width: 760px) {
  .tile-board { --cols: 2; --gap: 8px; }
  .tile-tools__hint { display: none; }
}
.stage > .stage__head > .stage__mode { order: 1; flex: none; }
/* The tile board's Export menu (S5b) */
.tile-export .tile-export__panel { width: 320px; padding: 10px 12px 12px; display: grid; gap: 8px; }
.tile-export .studio-export { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tile-export__hint { font-size: 0.76rem; }
@media (max-width: 760px) { .tile-export .tile-export__panel { width: auto; } }
/* A note redraws itself when it loses focus; without this the browser's scroll anchoring
   jumps the board while a button is being pressed, and the press misses */
.tile-editor .stage, .tile-editor .tile-wrap { overflow-anchor: none; }
/* The tiles' positions are measured from the board (the export draws from them) */
.tile-board { position: relative; }

/* ── Phase 6, S6a: price and stock ── */
.price-track { margin: 0 0 18px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.price-track__title { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
.price-track__state { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 6px; font-size: 0.88rem; color: var(--ink-soft); }
.price-track__note { flex-basis: 100%; font-size: 0.8rem; color: var(--muted); }
.price-track__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 10px; }
.price-track__watch button[aria-pressed="true"] { color: var(--ink); }
.price-track__history { margin-top: 10px; font-size: 0.82rem; }
.price-track__history summary { cursor: pointer; color: var(--ink-soft); }
.price-track__history ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; }
.price-track__history li { display: flex; gap: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.price-track__when { color: var(--muted); min-width: 9em; }
.price-track__status { color: var(--muted); }
.price-track__hint { margin-top: 8px; font-size: 0.76rem; color: var(--muted); }
.price-track__checked { margin-left: 10px; font-size: 0.76rem; color: var(--muted); }
.stock { display: inline-block; padding: 1px 8px; font-size: 0.74rem; letter-spacing: 0.04em; border: 1px solid currentColor; border-radius: 999px; }
.stock--in { color: var(--positive); }
.stock--out { color: var(--danger); }

/* ── Phase 6, S6b: price badges and the price chart ── */
.price-badges { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.card__img-wrap .price-badges { position: absolute; top: 8px; left: 8px; z-index: 2; }
.price-badge { display: inline-block; padding: 2px 8px; font-size: 0.72rem; letter-spacing: 0.03em; line-height: 1.4;
  color: var(--ink); background: rgb(var(--paper-ch) / 0.92); border: 1px solid var(--ink); border-radius: 999px; }
.price-badge--drop { color: var(--positive); border-color: var(--positive); }
.price-badge--out { color: var(--danger); border-color: var(--danger); }
.price-badge--back { color: var(--positive); border-color: var(--positive); }
.detail-price .price-badges, .qv .price-badges { margin-left: 8px; }
.price-chart { margin: 12px 0 4px; }
.price-chart__svg { display: block; width: 100%; max-width: 360px; height: auto; }
.price-chart__line { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.price-chart__dot { fill: var(--paper); stroke: var(--ink); stroke-width: 1.2; }
.price-chart__caption { display: flex; justify-content: space-between; max-width: 360px; font-size: 0.74rem; color: var(--muted); }
.card__img-wrap { position: relative; }

/* ── Phase 6, S6c: the bell and the alerts page ── */
.topnav__bell { position: relative; display: inline-flex; align-items: center; }
.topnav__bell svg { width: 18px; height: 18px; }
.topnav__count { position: absolute; top: -6px; right: -10px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 0.62rem;
  line-height: 16px; letter-spacing: 0; text-align: center; color: var(--paper); background: var(--ink); border-radius: 999px; }
.alerts { list-style: none; margin: 24px 0; padding: 0; }
.alert-row { display: grid; grid-template-columns: 10px 1fr auto auto; align-items: baseline; gap: 4px 14px; padding: 12px 0;
  border-bottom: 1px solid var(--line); }
.alert-row__dot { width: 7px; height: 7px; border-radius: 50%; background: transparent; align-self: center; }
.alert-row--new .alert-row__dot { background: var(--ink); }
.alert-row__title { font-family: var(--serif); font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.alert-row__title:hover { text-decoration: underline; text-underline-offset: 3px; }
.alert-row__text { font-size: 0.88rem; color: var(--ink-soft); }
.alert-row__text--drop, .alert-row__text--back { color: var(--positive); }
.alert-row__when { font-size: 0.78rem; color: var(--muted); }
.alerts-email { margin: 18px 0 48px; font-size: 0.88rem; color: var(--ink-soft); }
@media (max-width: 760px) {
  .alert-row { grid-template-columns: 10px 1fr; }
  .alert-row__text, .alert-row__when { grid-column: 2; }
}


/* ── Rounder, clearer cards; the boards list; Large / Grid; a one-line top bar on phones
   (owner's requests, 2026-11-22) ── */

/* Each piece on a board is a card of its own: a hairline box with round corners, the
   picture across its top, the words inside it. The ⋯ menu must not be clipped, so the card
   has no overflow: hidden; the picture's well is rounded instead. */
.card-grid { gap: 32px 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  transition: box-shadow 0.25s, border-color 0.25s; }
.card:hover { box-shadow: var(--shadow-lift); }
.card__img-wrap { border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0; }
.card__body { padding: 14px 16px 16px; }
.card--selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card--selected .card__img-wrap { outline: 1px solid var(--photo-edge); outline-offset: -1px; }
.card__select { top: 12px; left: 12px; }
.card-menu { top: 10px; right: 10px; }
.card__img-wrap .price-badges { top: 12px; left: 46px; }

/* Pictures and cards elsewhere get the same round corners */
.home-board__covers, .mood-card__canvas, .mood-card--new, .detail-img, .qv-product__img,
.compare__img, .duel__img, .podium__img { border-radius: var(--radius-lg); }
.detail-img, .qv-product__img { overflow: hidden; }

/* The boards list: a dashed card to start a new board, its name typed right there */
.boards-list { margin-top: 28px; }
.board-new { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  aspect-ratio: 4 / 5; padding: 18px; text-align: center; border: 1px dashed var(--ink-soft); border-radius: var(--radius-lg); }
.board-new:focus-within { border-color: var(--ink); }
.board-new__label { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: text; }
.board-new__plus { font-size: 1.6rem; line-height: 1; color: var(--ink-soft); }
.board-new__text { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); }
.board-new__name { width: 100%; padding: 8px 10px; font: inherit; font-size: 0.9rem; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); }

/* The board's piece count, with Large / Grid beside it */
.board-head__meta { display: flex; align-items: center; gap: 18px; margin-top: 10px; }
.board-head__meta .board-head__count { margin-top: 0; }
.layout-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.layout-switch__btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 26px;
  color: var(--muted); background: none; border: none; border-radius: 999px; cursor: pointer; }
.layout-switch__btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.layout-switch__btn[aria-pressed="true"] { color: var(--paper); background: var(--ink); }
.layout-switch__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.board-back { display: none; }

/* Grid: a wall of pictures at their own shapes. Rows are 4px; main.js gives each card the
   number of rows it is tall (--wall-gap is the space under it). */
.card-grid--wall { --wall-gap: 16px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  grid-auto-rows: 4px; row-gap: 0; column-gap: var(--wall-gap); align-items: start; }
.card-grid--wall .card { align-self: start; }
.card-grid--wall .card__img-wrap { aspect-ratio: auto; display: block; min-height: 80px; }
.card-grid--wall .card__img-wrap img { height: auto; display: block; }
.card-grid--wall .card__no-img { aspect-ratio: 4 / 5; display: flex; align-items: center; justify-content: center; }
.card-grid--wall .gallery-nav--card, .card-grid--wall .card__attrs, .card-grid--wall .card__shop { display: none; }
.card-grid--wall .card__body { padding: 10px 12px 12px; gap: 2px; }
.card-grid--wall .card__brand { font-size: 0.6rem; }
.card-grid--wall .card__title { font-size: 1.02rem; }
.card-grid--wall .card__price { font-size: 0.82rem; }

@media (max-width: 760px) {
  /* Large on a phone: one card after another, with room between them */
  .card-grid { gap: 22px; margin-top: 24px; }
  /* Grid on a phone: two columns, small words */
  .card-grid--wall { --wall-gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 0; }
  .card-grid--wall .card__body { padding: 8px 10px 10px; }
  .card-grid--wall .card__title { font-size: 0.95rem; line-height: 1.15; }
  .card-grid--wall .price__orig { display: none; }
  .card-grid--wall .card__select { top: 8px; left: 8px; width: 24px; height: 24px; }
  .card-grid--wall .card-menu { top: 6px; right: 6px; }
  .card-grid--wall .card-menu__dots { width: 26px; height: 26px; }
  .card-grid--wall .card__img-wrap .price-badges { top: auto; bottom: 8px; left: 8px; }
  /* The board tabs give way to "← All boards" (the Boards list has them all) */
  .board-tabs { display: none; }
  .board-back { display: inline-block; margin-top: 18px; }
  .board-back + .board-head { padding-top: 10px; }
}

@media (max-width: 600px) {
  /* One line: the name on the left, the bell and Account on the right */
  :root { --topbar-h: 54px; }
  .topbar { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
  .logo { font-size: 1.3rem; }
  .topnav { flex-wrap: nowrap; justify-content: flex-end; gap: 20px; overflow: visible; }
}
.home-board__covers--0 { display: flex; align-items: center; justify-content: center; }
.home-board__covers--0::after { content: "No pieces yet"; font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--muted); }

/* Phones: the table stays a table (owner's request, 2026-11-23) — small type, the picture
   and the name pinned on the left while the other columns scroll sideways under them. */
@media (max-width: 700px) {
  .table-tools__spacer { display: none; }
  .ptable { font-size: 0.82rem; width: max-content; min-width: 100%; }
  .ptable__h { padding: 8px 8px 6px; font-size: 0.6rem; letter-spacing: 0.1em; }
  .ptable__c { padding: 8px; vertical-align: middle; }
  .ptable__c--picture, .ptable__h--picture { position: sticky; left: 0; z-index: 1; width: 44px; min-width: 44px; padding-right: 4px;
    background: var(--paper); }
  .ptable__img { width: 36px; min-width: 36px; border-radius: 6px; }
  .ptable__c--name, .ptable__h--name { position: sticky; left: 44px; z-index: 1; background: var(--paper);
    box-shadow: 1px 0 0 var(--line); }
  .ptable:not(:has(.ptable__c--picture)) .ptable__c--name, .ptable:not(:has(.ptable__h--picture)) .ptable__h--name { left: 0; }
  .ptable__c--name { min-width: 0; width: 140px; max-width: 140px; }
  .ptable__name { font-size: 0.98rem; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .ptable__brand { font-size: 0.56rem; }
  .ptable__total { font-size: 0.95rem; }
  .ptable__c--notes { min-width: 150px; }
  .ptable__c--section, .ptable__c--status { min-width: 110px; }
  .ptable__c--detail { min-width: 80px; max-width: 160px; }
  .ptable__c--remove { padding-left: 4px; }
  .ptable__section th { padding: 14px 8px 6px; }
  .ptable__section-name { position: sticky; left: 8px; font-size: 1.1rem; }
  .ptable__subtotal { float: none; margin-left: 12px; font-size: 0.95rem; }
  .ptable__totals th { text-align: left; padding: 12px 8px; }
  .ptable__totals th > span { position: sticky; left: 8px; }
}
.status-card { border-radius: var(--radius-lg); }

/* ── A quieter project page on a phone (owner's request, 2026-11-23) ──
   The header keeps what matters — name, Add, ⋯, how many items and the total — and the
   breakdown by currency waits for a bigger screen. The view tabs are one slim line. On the
   tile board a tile shows its grip, ⋯ and name only once tapped (tileboard.js). */
@media (max-width: 760px) {
  .project-head { padding-top: 12px; padding-bottom: 10px; }
  .project-head > .back-link { font-size: 0.64rem; }
  .project-head__title { font-size: 1.5rem; }
  .project-summary { margin-top: 4px; }
  .project-summary__more { display: none; }
  .project-head > .view-switch { margin-top: 10px; }
  .view-switch { padding: 2px; border-radius: 999px; }
  .view-switch__tab { flex-direction: row; gap: 5px; padding: 5px 2px; font-size: 0.72rem; border-radius: 999px; }
  .view-switch__tab svg { width: 14px; height: 14px; }
  .tile-tools { padding: 8px 0 4px; gap: 4px 8px; }
  .tile-tools .btn--sm { padding: 6px 12px; font-size: 0.66rem; }
}
@media (hover: none) {
  .tile__grip, .tile__menu { opacity: 0; pointer-events: none; }
  .tile--active .tile__grip, .tile--active .tile__menu, .tile__menu[open] { opacity: 1; pointer-events: auto; }
  .tile--active .tile__caption { opacity: 1; }
  .tile--active { outline: 1.5px solid var(--ink); outline-offset: 2px; }
}

/* Home's sections head like the Boards and Projects pages: the title, then its line under it
   (owner's request, 2026-11-23) */
.home-section__head { display: block; }
.home-section__title { font-size: clamp(2.2rem, 4.5vw, 3.2rem); line-height: 1.05; }
.home-section__lede { margin-top: 10px; max-width: 52ch; }
.home-section__more { display: inline-block; margin-top: 10px; }
@media (max-width: 700px) { .home-section__title { font-size: 2.2rem; } }
/* The add panels take no room in the page's column while all of them are closed */
.project-add:not(:has(> :not(.hidden))) { display: none; }
@media (max-width: 760px) {
  .view-switch__tab { white-space: nowrap; font-size: 0.7rem; }
}
@media (max-width: 420px) { .view-switch__tab svg { display: none; } }
@media (max-width: 700px) {
  .ptable__totals th > span { position: static; }
  .ptable__totals th > .ptable__totals-label { position: sticky; left: 8px; }
  .ptable__totals th > .ptable__totals-sum { position: sticky; left: 72px; }
}

/* ── The cart (2026-11-23) ── */
.card__in-cart { margin-left: 8px; padding: 1px 7px; font-size: 0.58rem; letter-spacing: 0.12em; color: var(--ink);
  border: 1px solid var(--ink-soft); border-radius: 999px; vertical-align: 1px; }
.cart-button { display: inline-flex; align-items: center; gap: 10px; }
.cart-shop { margin-top: 36px; }
.cart-shop__head { display: flex; align-items: baseline; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.cart-shop__name { font-family: var(--serif); font-size: 1.45rem; font-weight: 500; }
.cart-shop__count { font-size: 0.72rem; letter-spacing: 0.1em; color: var(--muted); }
.cart-shop__total { margin-left: auto; font-family: var(--serif); font-size: 1.15rem; color: var(--ink-soft); }
.cart-list { list-style: none; }
.cart-item { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.cart-item__pic { display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--sunken); border-radius: var(--radius);
  outline: 1px solid var(--photo-edge); outline-offset: -1px; }
.cart-item__pic img { width: 100%; height: 100%; object-fit: cover; }
.cart-item__nopic { display: flex; height: 100%; align-items: center; justify-content: center; font-size: 0.6rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.cart-item__meta { display: flex; flex-wrap: wrap; gap: 0 12px; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.cart-item__meta span + span::before { content: "·"; margin-right: 12px; }
.cart-item__title { display: block; margin-top: 3px; font-family: var(--serif); font-size: 1.2rem; line-height: 1.25; color: var(--ink); }
.cart-item__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 4px; font-size: 0.95rem; }
.cart-item__price .price-badges { position: static; }
.cart-item__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 12px; }
.cart-item__qty { display: inline-flex; align-items: center; gap: 8px; }
.cart-item__qty-label { font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.cart-item__line { font-family: var(--serif); font-size: 1.05rem; color: var(--ink-soft); }
.cart-item__remove { margin-left: auto; }
.cart-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--ink); }
.cart-total__label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.cart-total__sum { margin-left: auto; font-family: var(--serif); font-size: 1.8rem; }
.cart-total__note, .cart-total__hint { flex-basis: 100%; text-align: right; font-size: 0.8rem; color: var(--muted); }
.cart-empty { margin: 40px 0 24px; text-align: right; }
@media (max-width: 760px) {
  .cart-item { grid-template-columns: 72px minmax(0, 1fr); gap: 14px; }
  .cart-item__title { font-size: 1.05rem; }
  .cart-item__actions { gap: 8px 14px; }
  .cart-item__remove { margin-left: 0; }
  .cart-total__note, .cart-total__hint { text-align: left; }
  .topnav { gap: 18px; }
}

/* Phones: a menu opens from its own button (main.js places it, "menu__panel--placed"), kept
   inside the screen and above the bottom bar — not as a sheet at the bottom (2026-11-23) */
.menu__panel--placed { position: fixed; right: auto; bottom: auto; overflow-y: auto; z-index: 80; }

/* Phones: the board's name, Filter & sort and Add on one row (owner's request, 2026-11-23) */
@media (max-width: 760px) {
  .board-head:has(.board-head__filters) { flex-wrap: nowrap; align-items: flex-start; gap: 10px; }
  .board-head:has(.board-head__filters) .board-head__main { flex: 1 1 auto; min-width: 0; }
  .board-head:has(.board-head__filters) .board-head__title { font-size: 2rem; overflow-wrap: anywhere; }
  .board-head:has(.board-head__filters) .board-head__actions { flex: none; display: flex; align-items: center; gap: 8px; padding-top: 4px; }
  .board-head__filters { position: relative; width: 38px; height: 38px; justify-content: center; color: var(--ink);
    border: 1px solid var(--line); border-radius: 999px; }
  .board-head__filters svg { width: 17px; height: 17px; }
  .board-head__filters[aria-expanded="true"] { border-color: var(--ink); }
  .board-head__filters .board-head__dot { position: absolute; top: 5px; right: 5px; }
  .board-head__add { padding: 9px 14px; }
  .board-head__add-more { display: none; }
}

/* ── Shopping notes (2026-11-26): tiles like a board's pieces, List or Grid ── */
.note-grid { grid-template-columns: minmax(0, 1fr); max-width: 820px; gap: 16px; }
.note-grid.card-grid--wall { max-width: none; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.note-grid--home { max-width: none; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.note-card { padding: 0; }
.note-card__link { display: flex; flex-direction: column; gap: 8px; padding: 18px 48px 16px 20px; color: var(--ink); text-decoration: none; }
.note-card__title { font-family: var(--serif); font-size: 1.4rem; font-weight: 500; line-height: 1.2; overflow-wrap: anywhere; }
.note-card:hover .note-card__title { color: var(--accent); }
.note-card__text { font-size: 0.92rem; line-height: 1.5; color: var(--ink-soft); overflow-wrap: anywhere; }
.note-card__p { margin: 0; min-height: 0.4em; }
.note-card__more, .note-card__empty { font-family: var(--serif); font-style: italic; color: var(--muted); }
.note-card__changed { margin-top: 2px; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.note-card .card-menu { top: 12px; right: 12px; }
.note-card .card-menu__dots { opacity: 1; background: none; border-color: transparent; color: var(--muted); }
.note-card .card-menu__dots:hover, .note-card .card-menu[open] > .card-menu__dots { border-color: var(--line); color: var(--ink); }
.card-grid--wall .note-card__link { padding: 14px 40px 12px 16px; }
.card-grid--wall .note-card__title { font-size: 1.2rem; }

/* List items in formatted text (the editor and the note tiles): a bullet or a number before
   each; numbers count up through a run of numbered items and start again after one */
.rn-li { position: relative; padding-left: 1.6em; }
.rn-li::before { position: absolute; left: 0.25em; color: var(--ink-soft); }
.rn-li--bullet::before { content: ""; top: 0.68em; left: 0.5em; width: 0.32em; height: 0.32em; border-radius: 50%;
  background: currentColor; }
.rn-li--number { counter-increment: rn-number; }
.rn-li--number::before { content: counter(rn-number) "."; font-variant-numeric: tabular-nums; }
.rn-editor, .note-card__text { counter-reset: rn-number; }
.rn-p:not(.rn-li--number), .note-card__p:not(.rn-li--number) { counter-reset: rn-number; }
.rn-tool--list svg { width: 16px; height: 16px; fill: currentColor; }
.rn-tool--list svg text { fill: currentColor; }

/* One note: a heading, then the text on a rounded sheet with its toolbar */
.note-page { max-width: 820px; margin: 0 auto; padding-top: 28px; }
.note-page__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.note-page__title { width: 100%; margin-top: 18px; padding: 4px 0; font-family: var(--serif); font-size: clamp(2rem, 4.5vw, 2.8rem);
  font-weight: 500; line-height: 1.1; color: var(--ink); background: none; border: 0; border-bottom: 1px solid transparent; outline: none; }
.note-page__title:focus { border-bottom-color: var(--line); }
.note-page__title::placeholder { color: var(--muted); font-style: italic; }
.note-page__sheet { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.note-page__sheet .rn-toolbar { position: sticky; top: 0; z-index: 5; margin: 0; padding: 8px 12px; background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.note-page__editor { min-height: 46vh; padding: 16px 20px 24px; font-size: 16px; }
.note-page__editor.rn-editor--empty::before { top: 16px; left: 20px; right: 20px; }
.note-page__limit { margin-top: 10px; font-size: 0.85rem; color: var(--danger); }
.note-page__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  margin: 18px 0 40px; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 760px) {
  .note-page { padding-top: 14px; }
  .note-page__title { font-size: 1.9rem; margin-top: 10px; }
  .note-page__sheet .rn-toolbar { top: 0; }
  .note-page__editor { min-height: 50vh; padding: 14px 16px 20px; }
  .note-card__link { padding: 16px 44px 14px 16px; }
  .note-grid.card-grid--wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid--wall .note-card__link { padding: 12px 34px 10px 12px; }
  .card-grid--wall .note-card__title { font-size: 1.05rem; }
  .card-grid--wall .note-card__text { font-size: 0.82rem; }
}
