/* Material 3 rebuild. The supplied M3 kit informs the adaptive scaffold and components. */
:root,
:root[data-theme="light"] {
  --md-ref-typeface-brand: "Roboto", system-ui, sans-serif;
  --md-ref-typeface-plain: "Roboto", system-ui, sans-serif;
  --md-sys-color-background: #faf8ff;
  --md-sys-color-on-background: #1d1b20;
  --md-sys-color-surface: #faf8ff;
  --md-sys-color-surface-dim: #ded8e1;
  --md-sys-color-surface-bright: #faf8ff;
  --md-sys-color-surface-container-lowest: #fff;
  --md-sys-color-surface-container-low: #f5f2fa;
  --md-sys-color-surface-container: #f0edf5;
  --md-sys-color-surface-container-high: #eae7ef;
  --md-sys-color-surface-container-highest: #e4e1e9;
  --md-sys-color-on-surface: #1d1b20;
  --md-sys-color-on-surface-variant: #49454f;
  --md-sys-color-primary: #6750a4;
  --md-sys-color-on-primary: #fff;
  --md-sys-color-primary-container: #eaddff;
  --md-sys-color-on-primary-container: #21005d;
  --md-sys-color-secondary: #625b71;
  --md-sys-color-on-secondary: #fff;
  --md-sys-color-secondary-container: #e8def8;
  --md-sys-color-on-secondary-container: #1d192b;
  --md-sys-color-tertiary: #7d5260;
  --md-sys-color-on-tertiary: #fff;
  --md-sys-color-tertiary-container: #ffd8e4;
  --md-sys-color-on-tertiary-container: #31111d;
  --md-sys-color-outline: #79747e;
  --md-sys-color-outline-variant: #cac4d0;
  --md-sys-color-inverse-surface: #322f35;
  --md-sys-color-inverse-on-surface: #f5eff7;
  --md-sys-color-inverse-primary: #d0bcff;
  --md-sys-color-scrim: rgba(0, 0, 0, .64);
  --canvas: var(--md-sys-color-background);
  --surface: var(--md-sys-color-surface-container-lowest);
  --surface-soft: var(--md-sys-color-surface-container);
  --text: var(--md-sys-color-on-surface);
  --text-secondary: var(--md-sys-color-on-surface-variant);
  --brown: var(--md-sys-color-primary);
  --on-brown: var(--md-sys-color-on-primary);
  --mint: var(--md-sys-color-secondary-container);
  --on-mint: var(--md-sys-color-on-secondary-container);
  --sunflower: var(--md-sys-color-primary);
  --on-sunflower: var(--md-sys-color-on-primary);
  --rose: var(--md-sys-color-tertiary-container);
  --on-rose: var(--md-sys-color-on-tertiary-container);
  --outline: var(--md-sys-color-outline);
  --outline-soft: var(--md-sys-color-outline-variant);
  --focus: var(--md-sys-color-primary);
  --radius-small: var(--md-sys-shape-corner-small);
  --radius-medium: var(--md-sys-shape-corner-medium);
  --radius-large: var(--md-sys-shape-corner-extra-large);
  --radius-full: var(--md-sys-shape-corner-full);
  --font-body: var(--md-ref-typeface-plain);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --md-sys-color-background: #141218;
  --md-sys-color-on-background: #e6e0e9;
  --md-sys-color-surface: #141218;
  --md-sys-color-surface-container-lowest: #0f0d13;
  --md-sys-color-surface-container-low: #1d1b20;
  --md-sys-color-surface-container: #211f26;
  --md-sys-color-surface-container-high: #2b2930;
  --md-sys-color-surface-container-highest: #36343b;
  --md-sys-color-on-surface: #e6e0e9;
  --md-sys-color-on-surface-variant: #cac4d0;
  --md-sys-color-primary: #d0bcff;
  --md-sys-color-on-primary: #381e72;
  --md-sys-color-primary-container: #4f378b;
  --md-sys-color-on-primary-container: #eaddff;
  --md-sys-color-secondary: #ccc2dc;
  --md-sys-color-on-secondary: #332d41;
  --md-sys-color-secondary-container: #4a4458;
  --md-sys-color-on-secondary-container: #e8def8;
  --md-sys-color-tertiary: #efb8c8;
  --md-sys-color-on-tertiary: #492532;
  --md-sys-color-tertiary-container: #633b48;
  --md-sys-color-on-tertiary-container: #ffd8e4;
  --md-sys-color-outline: #938f99;
  --md-sys-color-outline-variant: #49454f;
  --md-sys-color-inverse-surface: #e6e0e9;
  --md-sys-color-inverse-on-surface: #322f35;
  --md-sys-color-inverse-primary: #6750a4;
  --surface: var(--md-sys-color-surface-container-low);
  --sunflower: var(--md-sys-color-primary-container);
  --on-sunflower: var(--md-sys-color-on-primary-container);
}
:root[data-theme="contrast"] {
  --canvas: #fff;
  --surface: #fff;
  --surface-soft: #f1f1f1;
  --text: #000;
  --text-secondary: #161616;
  --brown: #000;
  --on-brown: #fff;
  --mint: #e5e5e5;
  --on-mint: #000;
  --sunflower: #000;
  --on-sunflower: #fff;
  --outline: #000;
  --outline-soft: #444;
  --focus: #000;
}

html { scroll-padding-block-start: 5.5rem; }
body { background: var(--canvas); color: var(--text); font-family: var(--font-body); }
.threshold { background: var(--md-sys-color-surface-container-low); border: 0; padding-inline: 0; }
.threshold nav:first-child {
  position: relative;
  z-index: 22;
  max-width: none;
  min-height: 72px;
  margin: 0;
  padding: .75rem max(1rem, calc((100vw - 88rem) / 2));
  border: 0;
  background: var(--md-sys-color-surface-container-low);
  gap: 1rem;
  flex-wrap: nowrap;
}
.threshold .seal { flex: 0 1 19rem; min-width: 0; font-size: .9375rem; line-height: 1.25; }
.threshold .seal img { width: 44px; height: 44px; padding: 3px; background: var(--md-sys-color-primary-container); }
.appbar-search {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  min-height: 48px;
  width: min(28rem, 32vw);
  margin-inline: auto;
  padding: .65rem 1.25rem;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  background: var(--md-sys-color-surface-container-high);
  text-decoration: none;
}
.appbar-search:hover { background: var(--md-sys-color-surface-container-highest); }
.threshold nav #roomsButton { margin-left: 0; padding-inline: 1rem; border-radius: var(--radius-full); background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); white-space: nowrap; }
.appearance-control select { border-radius: var(--radius-full); background: var(--surface); padding-inline: 1rem 1.75rem; }
.notebook-link { display: inline-flex; white-space: nowrap; background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); border: 0; }
.room-menu { inset: 4.75rem 1rem auto auto; width: min(24rem, calc(100vw - 2rem)); background: var(--md-sys-color-surface-container); }
.room-menu a { color: var(--text); border-radius: var(--radius-medium); }
.room-menu a:hover, .room-menu a:focus-visible { background: var(--md-sys-color-secondary-container); }

.hero {
  display: grid;
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  max-width: 88rem;
  margin: auto;
  padding: clamp(2rem, 5vw, 5rem) var(--page-gutter);
}
.hero-content { min-width: 0; }
.hero .eyebrow { color: var(--md-sys-color-primary); }
.hero h1 { max-width: 14ch; font-size: clamp(2.5rem, 6vw, 5.5rem); line-height: 1.05; letter-spacing: -.035em; }
.hero h1 span { color: var(--md-sys-color-primary); }
.hero > .hero-content > p:not(.eyebrow) { max-width: 52ch; font-size: clamp(1rem, 1.5vw, 1.25rem); line-height: 1.5; color: var(--text-secondary); }
.library-shortcuts a { display: inline-flex; gap: .5rem; align-items: center; border-radius: var(--radius-full); background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); border: 0; }
.library-shortcuts a:nth-child(2), .library-shortcuts a:nth-child(3) { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); border: 0; }
.library-shortcuts a:first-child { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.hero-gallery { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: .75rem; min-height: 24rem; }
.hero-gallery img { width: 100%; height: 100%; min-height: 0; object-fit: cover; border-radius: var(--radius-large); background: var(--surface-soft); }
.hero-gallery img:first-child { grid-row: span 2; }

.dark, .light, .source-library { background: var(--canvas); color: var(--text); }
main > section { max-width: 88rem; margin-inline: auto; }
main > section > .head { border-color: var(--outline-soft); }
.eyebrow, .lab-number { color: var(--md-sys-color-primary); letter-spacing: .04em; }
h1, h2, h3, h4 { font-family: var(--md-ref-typeface-brand); }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1.2; max-width: 35ch; }
.head > p { color: var(--text-secondary); }
.count { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.search-field { border-radius: var(--radius-full); background: var(--md-sys-color-surface-container-high); }
.search-field:focus-within { outline: 2px solid var(--focus); }
select, input[type="number"], textarea { border-radius: var(--md-sys-shape-corner-extra-small); background: var(--surface); }
:where(.filters, .reading-tools) button, #kindTabs button, #viewTabs button, #bookFilters button, .hues button { border-radius: var(--radius-full); }
button[aria-pressed="true"], #kindTabs button[aria-pressed="true"], #viewTabs button[aria-pressed="true"] { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); border-color: transparent; }
/* Atlas controls: category chips, direct swatches and an inset view switch. */
#atlasFilterPanel { gap: .65rem; min-width: 0; grid-template-columns: minmax(0, 1fr); }
#atlasFilterPanel > * { min-width: 0; }
#atlasFilterPanel .atlas-control-label { margin: .8rem 0 0; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); }
#kindTabs { gap: .4rem; }
#kindTabs button { min-height: 44px; padding: .45rem .85rem; border: 0; background: var(--surface-soft); color: var(--text); }
#kindTabs button[aria-pressed="true"] { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
#hues { display: grid; grid-template-columns: repeat(auto-fit, minmax(86px, 1fr)); gap: .65rem .35rem; max-width: 60rem; }
#hues button { display: flex; flex-direction: column; justify-content: flex-start; gap: .65rem; min-height: 80px; min-width: 0; padding: .4rem .15rem; border: 0; border-radius: var(--radius-small); background: transparent; color: var(--text); font-size: .75rem; line-height: 1.35; text-align: center; }
#hues i { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; border: 0; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 25%); border-radius: 50%; }
#hues button[aria-pressed="true"] { background: transparent; color: var(--text); }
#hues button[aria-pressed="true"] i { outline: 3px solid var(--text); outline-offset: 3px; }
#hues .hue-check { display: none; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #fff; color: #161616; font: 700 14px/1 sans-serif; }
#hues button[aria-pressed="true"] .hue-check { display: grid; }
#hues button[aria-pressed="true"] > span { font-weight: 700; }
#hues button:hover i { box-shadow: inset 0 0 0 2px var(--text); }
#atlasFilterPanel .filter-details { border: 0; padding: 0; }
#atlasFilterPanel .filter-details > summary { color: var(--text-secondary); font-size: .875rem; }
#viewTabs { display: flex; flex-wrap: wrap; width: fit-content; max-width: 100%; gap: .25rem; padding: .25rem; border-radius: var(--radius-small); background: var(--surface-soft); }
#viewTabs button { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; flex: 1 1 auto; min-height: 44px; padding: .45rem .65rem; border: 0; border-radius: var(--md-sys-shape-corner-extra-small); background: transparent; color: var(--text-secondary); font-size: .8125rem; }
#viewTabs button .material-symbols-rounded { font-size: 1.2rem; }
#viewTabs button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--md-sys-elevation-level1); font-weight: 700; }
#atlasFilterPanel :is(button, summary, select):focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
:root[data-theme="contrast"] #hues button[aria-pressed="true"] { background: transparent !important; color: var(--text) !important; }
@media (max-width: 599px) { #viewTabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; } #viewTabs button { flex-direction: column; min-width: 0; min-height: 64px; padding: .4rem .2rem; } }
@media (forced-colors: active) { #hues i { forced-color-adjust: none; } #hues button[aria-pressed="true"] i { outline-color: CanvasText; } #kindTabs button[aria-pressed="true"], #viewTabs button[aria-pressed="true"] { outline: 2px solid Highlight; } }
.tile, .rail button, .saved button, .rooms a, .exhibition, .type-card, .six article, .four article, .plan-card, .shelves article, .source-hit, .heat-line article, .judith-records article {
  border: 1px solid var(--outline-soft);
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: none;
}
.tile:hover, .rail button:hover, .rooms a:hover, .exhibition:hover, .source-hit:hover, .shelves article:hover {
  box-shadow: var(--md-sys-elevation-level1);
  border-color: var(--outline);
  transform: translateY(-2px);
}
.tile, .rail button, .rooms a, .exhibition, .source-hit, .shelves article { transition: box-shadow 160ms ease, border-color 160ms ease, transform 160ms ease; }
.rooms a { border-top-width: 1px; padding: 1.5rem; }
.rooms a:nth-child(n) { border-top-color: var(--outline-soft); }
.rooms a small { display: inline-grid; place-items: center; min-width: 2.5rem; min-height: 2.5rem; border-radius: var(--radius-full); background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); font-weight: 600; }
.rooms a h3 { margin-top: 1rem; color: var(--text); }
.rooms a p, .rooms a small, .exhibition small { color: var(--text-secondary); }
.exhibition { border: 1px solid var(--outline-soft); }
.exhibition b { color: var(--md-sys-color-primary); }
.tribute-entry-mark, .tribute-monogram { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); border-color: var(--md-sys-color-primary-container); }
.lesson > span, .event time { border-radius: var(--radius-full); background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.lab-shell, .lab-controls, .lab-visual, .diagnostic, .book, .modal article, dialog { border-radius: var(--radius-large); }
.modal { background: var(--md-sys-color-scrim); }
.modal article, dialog { background: var(--md-sys-color-surface-container-low); color: var(--text); }
footer { background: var(--md-sys-color-surface-container); }
::selection { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.system-guide .hero { display: block; }
.system-guide .hero h1 { max-width: none; }
.system-guide .hero > p:not(.eyebrow) { max-width: 65ch; }

.mobile-nav { background: var(--md-sys-color-surface-container); border-color: var(--outline-soft); }
.mobile-nav a { color: var(--text-secondary); }
.mobile-nav a.active > span { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.mobile-nav a.active { color: var(--md-sys-color-primary); }
.mobile-nav a.active b { font-weight: 700; }

@media (min-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1.1fr) minmax(18rem, .9fr); }
}
@media (min-width: 840px) {
  body { padding-left: 88px; }
  body.system-guide { padding-left: 0; }
  .mobile-nav { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: .5rem; position: fixed; inset: 0 auto 0 0; width: 88px; height: 100dvh; padding: 5.5rem .5rem 1rem; border-top: 0; border-right: 1px solid var(--outline-soft); }
  .mobile-nav a { width: 100%; min-height: 64px; }
  .mobile-nav a > span { width: 56px; height: 32px; }
  .mobile-nav b { font-size: .75rem; }
  .threshold nav:first-child { padding-inline: clamp(1.5rem, 4vw, 4rem); }
  .appearance-control > span { display: none; }
  main > section { padding-inline: clamp(1.5rem, 4vw, 4rem); }
  .hero { padding-inline: clamp(1.5rem, 4vw, 4rem); }
}
@media (max-width: 839px) {
  .threshold nav:first-child { padding-inline: 1rem; }
  .threshold .seal { flex: 1 1 auto; }
  .appbar-search { width: 48px; height: 48px; justify-content: center; padding: 0; margin-left: auto; }
  .appbar-search span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .notebook-link { display: none; }
}
@media (max-width: 599px) {
  .threshold nav:first-child { min-height: 64px; gap: .5rem; padding-block: .5rem; }
  .threshold nav .seal { flex: 0 0 40px; }
  .threshold nav #roomsButton { min-width: 44px; padding-inline: .55rem; }
  .threshold nav #roomsButton > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .appearance-control select { width: 7.5rem; border-radius: var(--radius-full); }
  .hero { gap: 1.25rem; padding-block: 2rem; }
  .hero h1 { font-size: clamp(2.25rem, 10vw, 3.5rem); }
  .hero-gallery { min-height: 11rem; height: 11rem; grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr; }
  .hero-gallery img:first-child { grid-row: auto; }
  .library-shortcuts { gap: .5rem; }
  .library-shortcuts a { min-height: 44px; }
  .mobile-nav { height: calc(80px + env(safe-area-inset-bottom)); }
  body { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* Ceramic window stories: expressive colour within the shared M3 components. */
body[data-page], main > section {
  --story-accent: #17695d;
  --story-light: #8cdfc9;
  --story-position: 75%;
}
body[data-page="atlas"], #atlas, [data-room-tone="cobalt"] { --story-accent: #245394; --story-light: #b1ceff; --story-position: 75%; }
body[data-page="recipes"], #recipes, [data-room-tone="rose"] { --story-accent: #95375d; --story-light: #ffb2cc; --story-position: 75%; }
body[data-page="kiln"], #kiln, [data-room-tone="ember"] { --story-accent: #993b15; --story-light: #ffb18a; --story-position: 50%; }
body[data-page="materials"], #materials, [data-room-tone="ochre"] { --story-accent: #78511a; --story-light: #edc478; --story-position: 0%; }
body[data-page="restoration"], #restoration, [data-room-tone="jade"] { --story-accent: #216751; --story-light: #8bdcba; --story-position: 75%; }
body[data-page="masters"], body[data-page="tribute"], #masters, #tribute, [data-room-tone="amethyst"] { --story-accent: #704592; --story-light: #ddb7fa; --story-position: 25%; }
body[data-page="notebook"], #notebook, [data-room-tone="terracotta"] { --story-accent: #914c35; --story-light: #ffc0a8; --story-position: 100%; }
body[data-page="reading"], #reading, #source-library, [data-room-tone="teal"] { --story-accent: #096773; --story-light: #8cdae4; --story-position: 100%; }
body[data-page="layering"], #layering { --story-accent: #803c84; --story-light: #efb0ed; --story-position: 75%; }
body[data-page="learn"], #path { --story-accent: #66531b; --story-light: #e7ce83; --story-position: 25%; }
body[data-page], main > section {
  --story-ink: var(--story-accent);
  --story-container: color-mix(in srgb, var(--story-accent) 12%, var(--surface));
  --md-sys-color-primary: var(--story-ink);
  --md-sys-color-on-primary: #fff;
  --md-sys-color-primary-container: var(--story-container);
  --md-sys-color-on-primary-container: var(--text);
  --md-sys-color-secondary-container: var(--story-container);
  --md-sys-color-on-secondary-container: var(--text);
  --brown: var(--story-ink);
  --on-brown: #fff;
  --sunflower: var(--story-accent);
  --on-sunflower: #fff;
  --mint: var(--story-container);
  --on-mint: var(--text);
  --focus: var(--story-ink);
}
:root[data-theme="dark"] body[data-page], :root[data-theme="dark"] main > section {
  --story-ink: var(--story-light);
  --story-container: color-mix(in srgb, var(--story-accent) 28%, var(--surface));
  --md-sys-color-on-primary: #111b21;
}
body[data-page="home"] .threshold { background: var(--story-container); }
.threshold .seal img, footer .seal img { background: #efd393; }
body[data-page="home"] .hero {
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  padding-top: clamp(1.5rem, 3vw, 3rem);
  padding-bottom: 2rem;
}
.hero-content { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); column-gap: 3rem; align-items: start; }
.hero-content .eyebrow { grid-column: 1 / -1; }
.hero-content h1 { grid-row: span 2; max-width: 19ch; font-size: clamp(2.25rem, 4.3vw, 4rem); }
.hero h1 .hero-title-phrase { color: inherit; white-space: nowrap; }
.hero-content .library-shortcuts { margin-top: .75rem; }
.hero-content > p:not(.eyebrow) { margin-top: 0; }
@media (max-width: 900px) {
  .hero-content { grid-template-columns: minmax(0, 1fr); row-gap: .75rem; }
  .hero-content h1 { grid-row: auto; max-width: 22ch; }
  .hero-content .library-shortcuts { margin-top: .25rem; }
}

.ceramic-mural { margin: 0; min-width: 0; }
.ceramic-mural img { width: 100%; height: auto; border-radius: var(--radius-large); border: 2px solid #374f48; box-shadow: var(--md-sys-elevation-level2); }
.ceramic-mural figcaption { padding-top: .75rem; color: var(--story-ink); font-size: .8125rem; letter-spacing: .08em; text-align: center; }

body[data-page="home"] #rooms {
  max-width: none;
  background: #172e35;
  color: #fff7e8;
  padding-block: clamp(1.75rem, 4vw, 3rem);
}
body[data-page="home"] #rooms > h2 { color: #fff7e8; }
body[data-page="home"] #rooms > .eyebrow { color: #efc875; }
.floor-intro { color: #d0e0df; max-width: 60ch; }
#roomGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.5rem; }
#roomGrid .room-card {
  display: flex;
  flex-direction: column;
  padding: .75rem;
  border: 1px solid color-mix(in srgb, var(--story-light) 45%, #243b40);
  border-radius: var(--radius-large);
  background: color-mix(in srgb, var(--story-accent) 65%, #122a32);
  color: #fff9ef;
  text-decoration: none;
  overflow: hidden;
}
#roomGrid .room-card:hover { border-color: var(--story-light); box-shadow: 0 6px 22px #0005; }
#roomGrid .room-card:focus-visible { outline-color: #fff3c8; }
.room-picture {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 50% 50% 12px 12px;
  border: 2px solid var(--story-light);
  background-color: #152e35;
}
.room-picture img { width: 100%; height: 100%; object-fit: cover; }
.room-illustration { background-image: url("assets/artwork/ceramic-window-stories.jpg"); background-size: 500% auto; background-position: var(--window-position) center; }
[data-room-tone="terracotta"] .room-illustration { background-position: 100% 100%; }
[data-room-tone="teal"] .room-illustration { background-position: 100% 0%; }
#roomGrid .room-copy { display: flex; flex: 1; flex-direction: column; padding: 1rem .25rem .25rem; color: #fff9ef; }
.room-kicker { color: var(--story-light); font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
#roomGrid .room-card h3 { margin: .6rem 0; color: #fff9ef; font-size: 1.25rem; line-height: 1.2; }
#roomGrid .room-card p { margin: 0 0 1rem; color: #f1e9e0; font-size: .875rem; line-height: 1.45; }
.room-enter { display: flex; gap: .5rem; align-items: center; justify-content: space-between; margin-top: auto; padding-top: .75rem; border-top: 1px solid #ffffff40; color: var(--story-light); font-size: .8125rem; font-weight: 500; }
.room-enter .material-symbols-rounded { font-size: 20px; width: 20px; height: 20px; }

/* Chapter headers carry a piece of the same decorative ceramic story. */
body:not([data-page="home"]) main > section > .head {
  position: relative;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  padding: 1.5rem;
  border: 0;
  border-inline-start: 6px solid var(--story-accent);
  border-radius: var(--radius-large);
  background: var(--story-container);
  overflow: hidden;
}
body:not([data-page="home"]) main > section > .head::before {
  content: "";
  display: block;
  grid-column: 1 / -1;
  height: 120px;
  border-radius: 20px;
  background: url("assets/artwork/ceramic-window-stories.jpg") var(--story-position) 50% / cover;
}
main > section > .head h2 { color: var(--text); }
main > section > .head .eyebrow { color: var(--story-ink); }
.tile, .rail button, .material-card, .plan-card, .shelves article, .heat-line article { border-color: color-mix(in srgb, var(--story-ink) 36%, var(--outline-soft)); }
.tile-copy, .rail button > span:not(.no-photo), .shelves article { background: var(--story-container); }
.exhibition:nth-child(4n + 1) { --story-accent: #704592; }
.exhibition:nth-child(4n + 2) { --story-accent: #245394; }
.exhibition:nth-child(4n + 3) { --story-accent: #993b15; }
.exhibition:nth-child(4n + 4) { --story-accent: #216751; }
.exhibition { background: color-mix(in srgb, var(--story-accent) 10%, var(--surface)); border-color: color-mix(in srgb, var(--story-accent) 40%, var(--outline-soft)); }
.exhibition h3, .exhibition small { color: var(--text); }
.exhibition b { color: var(--text); }
.tribute-entry-mark { background: #704592; color: #fff0ce; }
.tribute-monogram { background: var(--story-container); border-color: var(--story-accent); color: var(--story-ink); }
.tribute-head { padding: 1.5rem; border-radius: var(--radius-large); background: var(--story-container); border: 1px solid color-mix(in srgb, var(--story-ink) 35%, var(--outline-soft)); }
.lesson > span, .event time { background: var(--story-container); color: var(--story-ink); }
.lesson, .event { border-color: color-mix(in srgb, var(--story-ink) 30%, var(--outline-soft)); }
.heat-line article { background: var(--story-container); }
body > footer { border-top: 6px solid #ad7d39; background: #172e35; color: #fff7e8; }
body > footer a, body > footer .seal { color: #f3d793; }

@media (min-width: 840px) {
  #roomGrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body:not([data-page="home"]) main > section > .head { grid-template-columns: 130px minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: 1.5rem; }
  body:not([data-page="home"]) main > section > .head::before { grid-column: auto; width: 130px; height: 160px; border-radius: 65px 65px 12px 12px; background-size: 500% auto; }
  body:not([data-page="home"]) main > section > .head > div:only-child { grid-column: 2 / -1; }
}
@media (max-width: 759px) {
  .hero-content { display: block; }
  .hero-content h1 { max-width: 18ch; font-size: clamp(2rem, 8vw, 3rem); }
  .hero-content > p:not(.eyebrow) { margin-top: .75rem; }
  .ceramic-mural img { min-height: 175px; object-fit: cover; object-position: center; }
  .ceramic-mural figcaption { font-size: .7rem; letter-spacing: .03em; }
}
@media (max-width: 599px) {
  #roomGrid { gap: .65rem; }
  #roomGrid .room-card { padding: .5rem; border-radius: 20px; }
  #roomGrid .room-copy { padding-top: .75rem; }
  #roomGrid .room-card h3 { font-size: 1.05rem; }
  #roomGrid .room-card p { font-size: .8125rem; }
  .room-enter { font-size: .75rem; }
  body:not([data-page="home"]) main > section > .head { grid-template-columns: minmax(0, 1fr); padding: 1rem; }
  body:not([data-page="home"]) main > section > .head::before { height: 88px; }
}
:root[data-theme="contrast"] body[data-page], :root[data-theme="contrast"] main > section { --story-ink: #000; --story-container: #fff; --md-sys-color-primary: #000; --md-sys-color-on-primary: #fff; --focus: #000; }
:root[data-theme="contrast"] #roomGrid .room-card { background: #000; border-color: #fff; }
:root[data-theme="contrast"] #roomGrid .room-card :is(h3,p,.room-kicker,.room-enter) { color: #fff; }

/* Illustrated room openings and the ceramic library collection. */
.room-frontispiece { margin: 1.5rem auto 0; max-width: 1440px; overflow: hidden; border-radius: 28px; background: #172e35; color: #fff7e8; border: 1px solid #b68b50; }
.room-frontispiece > img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; object-fit: cover; }
.frontispiece-caption { padding: clamp(1.25rem, 3vw, 2.5rem); border-top: 4px solid #bb9155; background: color-mix(in srgb, var(--story-accent) 32%, #13262b); }
.frontispiece-caption h1 { color: #fff7e8; font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.1; margin: .5rem 0 .75rem; }
.frontispiece-caption p { max-width: 65ch; margin: .5rem 0; color: #fff7e8; }
.frontispiece-caption .eyebrow, .frontispiece-caption small { color: #efd393; }
.frontispiece-caption small { display: block; margin-top: 1rem; font-size: .7rem; }
body:not([data-page="home"]) main > section > .head::before { display: none; }
body:not([data-page="home"]) main > section > .head { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
body:not([data-page="home"]) main > section > .head > div:only-child { grid-column: 1 / -1; }
.recipe-library-tools { padding: 1.25rem; margin-bottom: 1.5rem; border-radius: 20px; background: var(--story-container); }
.recipe-library-tools label { display: grid; gap: .5rem; font-weight: 500; }
.recipe-library-tools input { width: 100%; max-width: 42rem; min-height: 48px; }
#recipeRail { background: #342830; padding: 1.25rem; border-radius: 24px; gap: 1.5rem; align-items: stretch; }
#recipeRail .recipe-volume { display: flex; flex-direction: column; text-align: left; position: relative; padding: 0 0 0 8px; overflow: hidden; background: #f7ebd3; color: #38281f; border: 1px solid #c9a97c; border-left: 8px solid #8b3d55; border-radius: 6px 20px 20px 6px; box-shadow: 3px 4px 0 #c1a780; }
#recipeRail .recipe-volume:nth-child(3n+2) { border-left-color: #276c68; }
#recipeRail .recipe-volume:nth-child(3n) { border-left-color: #675186; }
#recipeRail .recipe-volume > .volume-number { background: #f7ebd3; color: #634e35; padding: .85rem 1rem; display: block; font-size: .65rem; letter-spacing: .12em; }
#recipeRail .recipe-volume > img { width: calc(100% - 2rem); margin: 0 1rem; height: 165px; object-fit: contain; border-radius: 70px 70px 8px 8px; background: #e7d7b9; }
#recipeRail .recipe-volume .no-photo { display: grid; align-content: center; text-align: center; height: 165px; width: calc(100% - 2rem); margin: 0 1rem; background: #e7d7b9; color: #634e35; font-family: Georgia, serif; font-size: 1rem; }
#recipeRail .recipe-volume > .volume-copy { display: flex; flex-direction: column; flex: 1; gap: .7rem; padding: 1rem; background: #f7ebd3; color: #38281f; }
.volume-copy strong { font: 600 1.35rem/1.25 Georgia, serif; }
.volume-copy small { color: #674636; font-size: .7rem; }
.volume-source { font: italic .85rem/1.5 Georgia, serif; }
.volume-open { display: flex; justify-content: space-between; border-top: 1px solid #b89f7c; padding-top: .75rem; margin-top: auto; color: #74304c; font-size: .8rem; font-weight: 600; }
.chapter-shelf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; padding: 1.5rem; border-radius: 24px; background: #183c3f; margin-bottom: 2rem; }
.chapter-book { overflow: hidden; display: flex; flex-direction: column; border: 1px solid #c29b5b; border-radius: 90px 90px 12px 12px; background: #f6e8cb; color: #302c21; text-decoration: none; }
.chapter-book > img { width: 100%; aspect-ratio: 1.25; object-fit: cover; }
.chapter-book > span { display: flex; flex-direction: column; flex: 1; padding: 1rem; gap: .75rem; }
.chapter-book small { font-size: .65rem; letter-spacing: .1em; color: #66532c; }
.chapter-book strong { font: 600 1.15rem/1.3 Georgia, serif; }
.chapter-book b { margin-top: auto; padding-top: .5rem; font-size: .75rem; color: #236161; }
#lessons { display: grid; gap: 1.5rem; }
#lessons .lesson { padding: 1.5rem; border: 1px solid var(--outline-soft); border-radius: 24px; background: var(--surface); scroll-margin-top: 110px; }
#lessons .lesson h3 { font-family: Georgia, serif; font-size: 1.6rem; }
#lessons .lesson > span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
#lessons .lesson figure { margin: 0; }
#lessons .lesson figure img { height: 210px; border-radius: 80px 80px 12px 12px; object-fit: cover; }
.gallery-note { padding: 1rem; border-left: 3px solid var(--story-ink); color: var(--text); font-size: .85rem; }
#timeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
#timeline .event { display: flex; flex-direction: column; padding: 1rem; border: 1px solid var(--outline-soft); border-radius: 100px 100px 24px 24px; background: var(--story-container); gap: .75rem; }
#timeline .event figure { margin: 0; }
#timeline .event figure img { display: block; width: 100%; height: 230px; object-fit: cover; border-radius: 90px 90px 12px 12px; background: var(--surface); }
#timeline .event figcaption { text-align: center; color: var(--text-soft); font-size: .65rem; padding: .65rem 0 0; }
#timeline .event time { font-size: .8rem; padding: .5rem .75rem; width: fit-content; border-radius: 20px; background: var(--surface); }
#timeline .event h3 { font: 600 1.5rem/1.2 Georgia, serif; }
#timeline .event p { font-size: .9rem; line-height: 1.6; }
.masters-feature { background: #443151; color: #fff5e2; border: 1px solid #c29b5b; padding: 2rem; border-radius: 28px; }
.masters-feature :is(strong,span,b) { color: #fff5e2; }
.masters-feature strong { font-family: Georgia, serif; }
@media (max-width: 839px) {
  .room-frontispiece { margin: 1rem; }
  .chapter-shelf, #timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 599px) {
  .room-frontispiece { border-radius: 20px; }
  .room-frontispiece > img { aspect-ratio: 1.7; }
  body:not([data-page="home"]) main > section > .head { grid-template-columns: minmax(0, 1fr); }
  #recipeRail { padding: .75rem; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #recipeRail .recipe-volume > img, #recipeRail .recipe-volume .no-photo { height: 100px; margin: 0 .5rem; width: calc(100% - 1rem); }
  #recipeRail .recipe-volume > .volume-copy { padding: .65rem; gap: .5rem; }
  #recipeRail .recipe-volume > .volume-number { padding: .7rem .5rem; font-size: .55rem; }
  .volume-copy strong { font-size: 1.05rem; overflow-wrap: anywhere; }
  .volume-source { font-size: .75rem; overflow-wrap: anywhere; }
  .chapter-shelf { padding: .75rem; gap: .75rem; }
  .chapter-book > span { padding: .75rem; }
  .chapter-book strong { font-size: 1rem; }
  #timeline { grid-template-columns: minmax(0, 1fr); }
  #timeline .event figure img { height: 260px; }
  #lessons .lesson { padding: 1rem; }
}
:root[data-theme="dark"] #recipeRail .recipe-volume { background: #392e28; color: #f7ebd3; box-shadow: 3px 4px 0 #73563e; }
:root[data-theme="dark"] #recipeRail .recipe-volume > :is(.volume-number,.volume-copy) { background: #392e28; color: #f7ebd3; }
:root[data-theme="dark"] .volume-copy small, :root[data-theme="dark"] .volume-open { color: #efc3ac; }
#timeline .event figure { width: 100%; }
:root[data-theme="contrast"] .frontispiece-caption { background: #000; }
:root[data-theme="contrast"] .chapter-book { background: #fff; color: #000; }
:root[data-theme="contrast"] .chapter-book :is(small,b) { color: #000; }

/* A readable manuscript with a distinct, live chemistry workbench. */
#modal { --folio-paper: #fff5df; --folio-ink: #302517; --folio-muted: #59442e; --folio-rose: #682340; --folio-teal: #174c49; --folio-line: #aa8b61; }
#modal article, #modal .book { background: var(--folio-paper); color: var(--folio-ink); }
#modal article { border: 2px solid #b78f52; }
#modal .book { background-image: linear-gradient(90deg, #b38a3f12 0, transparent 4%, transparent 96%, #b38a3f12 100%); }
#modal :is(h2,h3,h4,p,li,td,th,label,dt,dd,.caution,.intro) { color: var(--folio-ink); }
#modal :is(h2,h3) { font-family: Georgia, serif; }
#modal h2 { font-size: clamp(1.8rem, 4vw, 2.75rem); }
#modal :is(.eyebrow,.book-section > small,.facts small,.formula th small) { color: var(--folio-rose); }
#modal :is(.status,.source,.facts,.umf-grid > span) { background: #f4e4c6; color: var(--folio-ink); border-color: var(--folio-line); }
#modal .facts > span { border-color: var(--folio-line); }
#modal a { color: #54203d; text-decoration: underline; text-underline-offset: .2em; }
#modal :is(button,.save-button,.save-button.on) { background: #55203d; color: #fff7e5; border: 2px solid #55203d; min-height: 48px; }
#modal button:hover { background: #371128; color: #fff7e5; }
#modal :is(input,select) { background: #fffdfa; color: #302517; border: 2px solid #735636; min-height: 48px; border-radius: 12px; font: inherit; padding: .6rem; max-width: 100%; }
#modal :is(input,select,button,a,summary):focus-visible { outline: 3px solid #102e69; outline-offset: 3px; box-shadow: 0 0 0 6px #fff5df; }
#modal #close { background: #fff5df; color: #302517; border-color: #59442e; width: 48px; z-index: 5; }
#modal .hero-image.without-photo { min-height: 160px; background: url('assets/artwork/recipe-manuscript.jpg') center / cover; }
#modal #recordType { background: #55203d; color: #fff7e5; max-width: calc(100% - 85px); font-size: .7rem; line-height: 1.5; }
#modal .hero-image.without-photo::after { content: 'Decorative manuscript illustration'; position: absolute; bottom: .5rem; right: .5rem; background: #fff5df; color: #302517; font-size: .65rem; padding: .3rem .5rem; border-radius: 4px; }
#modal .book-section { border-color: var(--folio-line); }
#modal .recipe-workbench { border: 2px solid #174c49; border-radius: 24px; padding: 1.5rem; margin: 2rem 0; background: #f8edcf; box-shadow: 5px 6px 0 #c6a973; }
.workbench-heading { display: flex; gap: 1rem; align-items: center; border-bottom: 2px solid #b78f52; padding-bottom: 1rem; }
#modal .workbench-heading > span { display: grid; place-items: center; background: #174c49; color: #fff7e5; border-radius: 50%; width: 52px; height: 52px; flex-shrink: 0; }
#modal .workbench-heading small { color: #174c49; font-weight: 700; }
#modal .workbench-heading h3 { margin: .3rem 0; }
#modal .batch { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr; gap: .8rem; align-items: end; margin-top: 1.25rem; }
#modal .batch label, #modal .water-log label { display: grid; gap: .5rem; font-weight: 600; font-size: .85rem; }
#modal .batch input { width: 100%; font-size: 1.4rem; }
#modal .batch select { width: 100%; }
.batch-presets { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
#modal .batch-presets button { padding: .5rem 1rem; border-radius: 24px; background: #174c49; border-color: #174c49; }
.weight-dashboard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-top: 1rem; }
#modal .weight-dashboard > div { padding: 1rem; border-radius: 16px; background: #174c49; color: #fff7e5; }
#modal .weight-dashboard > div:nth-child(2) { background: #682340; }
#modal .weight-dashboard > div:nth-child(3) { background: #383367; }
.weight-dashboard small { display: block; font-size: .65rem; line-height: 1.5; }
.weight-dashboard strong { display: block; font-size: clamp(1.1rem, 3vw, 1.75rem); margin-top: .5rem; overflow-wrap: anywhere; }
#modal #batchError, #modal .scale-warning { background: #f9d9c4; color: #5b220a; font-weight: 600; padding: .8rem; border-left: 4px solid #7c3412; }
#modal #batchError:empty { display: none; }
#modal .weigh-hint, #modal .formula-basis, #modal #scaleAdvice { font-size: .85rem; line-height: 1.6; }
#modal .weighing-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.weighing-table caption { text-align: left; font-weight: 600; padding: .75rem 0; }
#modal .weighing-table th:first-child, #modal .weighing-table td:first-child { width: 56px; }
#modal .weighing-table th:last-child { width: 29%; }
#modal .weighing-table :is(th,td) { padding: .7rem .35rem; border-color: #b79a70; overflow-wrap: anywhere; }
#modal .weighing-table th[scope="row"] { text-align: left; font-weight: 500; }
#modal .weighing-table th small { display: block; font-size: .7rem; margin-top: .35rem; }
#modal .weighed { width: 28px; height: 28px; min-height: 28px; accent-color: #174c49; cursor: pointer; margin: 8px; }
#modal .weighing-table output { display: block; background: #e0efcf; color: #243b15; border: 1px solid #446331; border-radius: 10px; padding: .6rem .35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
#modal .weighing-table .is-weighed { background: #dfebd4; }
.weigh-progress { margin-top: 1rem; display: grid; gap: .5rem; }
.weigh-progress progress { width: 100%; height: 16px; accent-color: #174c49; }
#modal .studio-safety { border: 2px solid #763613; border-radius: 20px; padding: 1.5rem; background: #f8e4c3; }
#modal .safety-banner { padding: 1rem; border-radius: 16px; background: #71320f; color: #fff8ea; }
#modal .safety-banner :is(p,a) { color: #fff8ea; }
#modal summary { cursor: pointer; min-height: 48px; padding: 1rem 0; font-weight: 700; color: #54203d; }
#modal .hazard-list { list-style: none; padding: 0; }
#modal .hazard-list li { border-top: 1px solid #aa8b61; padding: 1rem 0; }
#modal .hazard-list p { font-size: .9rem; }
#modal .mixing-guide ol { padding-left: 1.5rem; }
#modal .mixing-guide li { padding: .6rem 0 .6rem .5rem; }
#modal .mixing-guide li::marker { color: #174c49; font-weight: 700; }
#modal .water-log { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; padding: 1rem; background: #dcedeb; border: 1px solid #174c49; border-radius: 16px; }
.water-log p { grid-column: 1 / -1; margin: 0; font-size: .8rem; }
#modal .firing-card { padding: 1.5rem; border: 2px solid #683916; border-radius: 20px; background: #f5dfbf; }
.firing-card dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.firing-card dt { font-size: .8rem; font-weight: 700; }
.firing-card dd { margin: .5rem 0 0; }
#modal .kiln-link { display: inline-block; padding: .8rem 1rem; background: #55203d; color: #fff7e5; border-radius: 24px; }
#modal .related-books button { background: #f4e4c6; color: #302517; border-color: #735636; }
#modal .related-books button:hover { background: #e8d2ab; }
@media (max-width: 599px) {
  #modal .recipe-workbench, #modal .studio-safety, #modal .firing-card { padding: .8rem; }
  #modal .batch { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  #modal .batch label:last-child { grid-column: 1 / -1; }
  .weight-dashboard { grid-template-columns: minmax(0,1fr); }
  #modal .weight-dashboard > div { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .75rem; }
  .weight-dashboard strong { margin: 0; }
  #modal .water-log { grid-template-columns: minmax(0,1fr); }
  .firing-card dl { grid-template-columns: minmax(0,1fr); }
  #modal .weighing-table th:first-child, #modal .weighing-table td:first-child { width: 40px; padding-left: 0; padding-right: 0; }
  #modal .weighed { margin: 5px; width: 26px; }
  #modal .weighing-table th:last-child { width: 33%; }
}
#recipeJumps { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1.25rem 0; }
#recipeJumps button { padding: .6rem 1rem; border-radius: 24px; }
#modal :is(#recipeWeights,#recipeSafety,#recipeMixing,#recipeFiring) { scroll-margin-top: 72px; }
#modal .workbench-heading > .material-symbols-rounded { min-width: 52px; font-size: 28px; }
/* Safety is the first task in every formula; icons always have adjacent text. */
.studio-alert { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 1rem; padding: 1.2rem; margin: 1.5rem 0; border: 2px solid #67301b; border-radius: 24px; background: #ffe3a8; color: #28180f; }
.studio-alert > .material-symbols-rounded { font-size: 2.5rem; color: #612714; }
.studio-alert strong { display: block; font-size: 1.05rem; }
.studio-alert p { margin: .3rem 0 0; color: #28180f; }
.studio-alert a { color: #35102b; font-weight: 700; text-decoration: underline; }
.studio-alert-dark { background: #ffe3a8; color: #28180f; }
#modal .studio-safety { background: #fff0d2; color: #28180f; border: 3px solid #75300d; }
#modal .studio-safety :is(p,h3,h4,small,summary) { color: #28180f; }
#modal .safety-title { display: flex; gap: .85rem; align-items: flex-start; }
#modal .safety-title > .material-symbols-rounded { display: grid; place-items: center; width: 3.5rem; min-width: 3.5rem; height: 3.5rem; background: #74300d; color: #fff; border-radius: 18px; font-size: 2rem; }
#modal .safety-title h3 { margin: .2rem 0; }
#modal .safety-lead { font-size: 1.08rem; font-weight: 600; line-height: 1.55; }
#modal .safety-no-kit { display: flex; gap: .8rem; align-items: center; padding: 1rem; background: #4c1720; color: #fff; border-radius: 16px; line-height: 1.45; }
#modal .safety-no-kit .material-symbols-rounded { font-size: 2rem; flex: none; }
#modal .studio-safety h4 { margin: 1.6rem 0 .7rem; font-size: 1.1rem; }
#modal .safety-kit { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .7rem; list-style: none; margin: 0; padding: 0; }
#modal .safety-kit li { display: grid; grid-template-columns: auto 1fr; column-gap: .55rem; align-content: start; padding: .8rem; border: 1px solid #755123; border-radius: 16px; background: #fff8e9; color: #28180f; }
#modal .safety-kit .material-symbols-rounded { grid-row: span 2; color: #67301b; font-size: 1.8rem; }
#modal .safety-kit b { line-height: 1.2; }
#modal .safety-kit span:not(.material-symbols-rounded) { font-size: .84rem; line-height: 1.35; margin-top: .3rem; }
#modal .safety-priority { display: flex; gap: .7rem; align-items: flex-start; padding: 1rem; margin-top: 1rem; border-radius: 16px; background: #4c1720; color: #fff; }
#modal .safety-priority .material-symbols-rounded { font-size: 2rem; }
#modal .safety-priority p { margin: .2rem 0 0; color: #fff; }
#modal .safety-key, #modal .safety-fine { font-size: .9rem; }
#modal .hazard-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .6rem; }
#modal .hazard-list li { padding: .8rem; border: 1px solid #846140; border-radius: 14px; background: #fff8e9; }
#modal .hazard-list li.hazard-priority { border-width: 2px; border-color: #682333; background: #ffe1d4; }
#modal .hazard-item-head { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
#modal .hazard-item-head .material-symbols-rounded { color: #5c2031; }
#modal .hazard-item-head > span:last-child { padding: .15rem .45rem; border-radius: 100px; background: #4c1720; color: #fff; font-size: .72rem; font-weight: 700; }
#modal .hazard-list p { margin: .45rem 0; }
#modal .ingredient-cue { display: inline-flex; align-items: center; gap: .2rem; padding: .2rem .4rem; margin: .3rem 0 0; border-radius: 9px; background: #dcebd4; color: #1f351a; font-size: .7rem; font-weight: 700; line-height: 1.2; }
#modal .ingredient-cue.cue-priority { background: #f6c4af; color: #442018; }
#modal .ingredient-cue.cue-review { background: #f9dca4; color: #3b270b; }
#modal .ingredient-cue .material-symbols-rounded { font-size: 1rem; }
#modal .mix-steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; }
#modal .mix-steps li { display: flex; gap: .7rem; padding: 1rem; border: 1px solid #755123; border-radius: 16px; background: #fff2d8; color: #28180f; }
#modal .mix-steps li:nth-child(3n + 2) { background: #e4eed9; border-color: #496433; }
#modal .mix-steps li:nth-child(3n) { background: #e3e8f6; border-color: #495775; }
#modal .mix-steps .material-symbols-rounded { font-size: 2rem; color: #4c1720; flex: none; }
#modal .mix-steps b { display: block; }
#modal .mix-steps p { margin: .35rem 0 0; font-size: .88rem; line-height: 1.45; }
#recipeJumps button:first-child { background: #4c1720; color: #fff; border-color: #4c1720; font-weight: 700; }
@media (max-width: 720px) { .studio-alert { grid-template-columns: auto minmax(0,1fr); } .studio-alert a { grid-column: 2; } #modal .safety-kit { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 520px) { #modal .safety-kit, #modal .hazard-list, #modal .mix-steps { grid-template-columns: minmax(0,1fr); } .studio-alert { gap: .6rem; } }
/* One container gutter: legacy full-viewport padding must not compound with max-width. */
body[data-page] main > section:not(#rooms) { width: 100%; max-width: 88rem; margin-inline: auto; padding-inline: clamp(1rem, 3vw, 3rem); }
#exhibitions .exhibition-grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { #exhibitions .exhibition-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { #exhibitions .exhibition-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Task navigation and readable controls. Room destinations stay separate from utilities. */
button { color: var(--text); }
button[hidden] { display: none !important; }
body[data-page="glaze-families"] #glaze-families { display: block; }
body[data-page="glaze-families"] { --story-accent: #245394; --story-light: #b1ceff; }
.threshold nav:first-child { gap: .5rem; }
.threshold nav:first-child .appbar-utility { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-width: 44px; min-height: 44px; padding: .5rem .65rem; border: 0; border-radius: var(--radius-small); background: transparent; color: var(--text); font-size: .8125rem; text-decoration: none; }
.appbar-utility .material-symbols-rounded { font-size: 22px; }
.appbar-utility:hover { background: var(--surface-soft); }
.notebook-link i { font-style: normal; font-size: .75rem; }
.threshold .room-menu { display: none; position: fixed; inset: 72px 1rem auto auto; z-index: 40; width: min(24rem, calc(100vw - 2rem)); max-height: calc(100dvh - 170px); padding: .5rem; overflow-y: auto; border: 1px solid var(--outline-soft); border-radius: var(--radius-medium); box-shadow: var(--md-sys-elevation-level2); }
.threshold .room-menu.open { display: grid; grid-template-columns: minmax(0, 1fr); }
.threshold .room-menu a { min-height: 44px; display: flex; align-items: center; padding: .5rem .75rem; font-size: .875rem; }
.threshold .room-menu a[aria-current="page"] { font-weight: 700; text-decoration: underline; }
.mobile-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-width: 0; min-height: 64px; border: 0; padding: .25rem; background: transparent; color: var(--text-secondary); font: inherit; }
.mobile-nav button .material-symbols-rounded { display: grid; place-items: center; width: 48px; height: 32px; font-size: 24px; }
.mobile-nav button b { font-size: .75rem; font-weight: 600; }
.settings-dialog { position: fixed; inset: 0; width: min(28rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); margin: auto; padding: 1.5rem; overflow: auto; border: 1px solid var(--outline-soft); border-radius: var(--radius-large); background: var(--surface); color: var(--text); }
.settings-dialog::backdrop { background: var(--md-sys-color-scrim); }
.settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.settings-heading h2 { margin: 0; font-size: 1.5rem; }
.settings-heading button { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: .5rem; border: 0; border-radius: var(--radius-full); background: var(--surface-soft); color: var(--text); }
.settings-dialog fieldset { margin: 1.5rem 0 0; padding: 0; border: 0; }
.settings-dialog legend { font-size: 1rem; font-weight: 700; }
.settings-dialog p { font-size: .875rem; color: var(--text-secondary); }
.settings-dialog label { display: flex; align-items: center; gap: .75rem; min-height: 48px; padding: .5rem; border-radius: var(--radius-small); cursor: pointer; }
.settings-dialog label:hover { background: var(--surface-soft); }
.settings-dialog input { width: 20px; height: 20px; margin: 0; accent-color: var(--md-sys-color-primary); }
.settings-dialog small { margin-left: .5rem; color: var(--text-secondary); }
.atlas-navigation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.5rem 0; border-bottom: 1px solid var(--outline-soft); }
.atlas-navigation a { display: flex; align-items: flex-start; gap: .75rem; min-width: 0; padding: .9rem .25rem; border-bottom: 3px solid transparent; color: var(--text-secondary); text-decoration: none; }
.atlas-navigation a[aria-current="page"] { border-bottom-color: var(--md-sys-color-primary); color: var(--text); }
.atlas-navigation a:hover { background: var(--surface-soft); }
.atlas-navigation strong, .atlas-navigation small { display: block; }
.atlas-navigation strong { font-size: 1rem; }
.atlas-navigation small { margin-top: .25rem; font-size: .8125rem; line-height: 1.4; }
#atlas .filters { display: grid; gap: .75rem; }
#atlasFilterPanel { display: grid; gap: .65rem; }
#atlasFilterPanel .atlas-control-label { margin-top: .5rem; }
.catalogue-filter-row { margin-top: .5rem; }
#atlas .atlas-selects { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
#atlas .atlas-selects label { min-width: 0; font-size: .8125rem; font-weight: 600; }
#atlas .atlas-selects select { display: block; width: 100%; min-width: 0; min-height: 44px; margin-top: .4rem; padding: .5rem 1.5rem .5rem .6rem; font-size: .875rem; font-weight: 400; }
.filter-help { margin: .25rem 0; font-size: .8125rem; line-height: 1.5; color: var(--text-secondary); }
.filter-help a { color: var(--text); }
#hues { max-width: none; grid-template-columns: repeat(9, minmax(0, 1fr)); }
#hues button { min-height: 80px; box-shadow: none; }
#viewTabs { background: transparent; padding: 0; gap: .5rem; }
#viewTabs button { border-radius: var(--radius-small); min-height: 44px; }
#viewTabs button[aria-pressed="true"] { background: var(--surface-soft); box-shadow: none; outline: 1px solid var(--outline); }
#viewTabs button:focus-visible { outline: 3px solid var(--focus); }
.section-jumps { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.25rem 0 2rem; }
.section-jumps a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); }
#typeMap { border: 0; padding: 0; }
#typeMap .type-map-head { padding: 0; }
.type-card nav { display: flex; flex-wrap: wrap; gap: .35rem .85rem; }
.type-card nav a { display: inline-flex; align-items: center; min-height: 44px; padding: .25rem 0; color: var(--text); font-size: .8125rem; text-decoration: underline; }
#historicSurfaces { margin-top: 3rem; scroll-margin-top: 1rem; }
.task-navigation { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.task-navigation a { display: block; min-height: 64px; padding: .75rem 0; border-bottom: 2px solid var(--outline-soft); color: var(--text); text-decoration: none; }
.task-navigation a:hover { border-bottom-color: var(--md-sys-color-primary); }
.task-navigation strong, .task-navigation span { display: block; }
.task-navigation span { margin-top: .4rem; color: var(--text-secondary); font-size: .875rem; line-height: 1.4; }
#atlasMore, #recipeMore { display: block; width: fit-content; min-height: 44px; margin: 1.5rem auto; padding: .6rem 1.1rem; border: 1px solid var(--outline); border-radius: var(--radius-small); background: var(--surface); color: var(--text); }
.under { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
main :is(.concept-jump,.lab-save,.save-button,.shelf-actions a) { color: var(--text); background: var(--surface-soft); }
@media (min-width: 840px) {
  body { padding-left: 216px; }
  body.system-guide { padding-left: 0; }
  .mobile-nav { width: 216px; align-items: stretch; gap: .2rem; padding: 1rem .5rem; overflow-y: auto; }
  .mobile-nav a { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: .5rem; width: 100%; min-height: 48px; padding: .3rem .5rem; border-radius: var(--radius-small); }
  .mobile-nav a > span { flex: 0 0 36px; width: 36px; height: 36px; }
  .mobile-nav a b { font-size: .8125rem; text-align: left; }
  .mobile-nav a.active { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
  .mobile-nav a.active > span { background: transparent; color: inherit; }
  .mobile-nav #roomsButton { display: none; }
  .threshold nav:first-child { padding-inline: 1.5rem; }
}
@media (max-width: 839px) {
  .mobile-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .mobile-nav .room-destination { display: none; }
  .threshold nav:first-child .notebook-link { display: inline-flex; }
  .threshold nav:first-child .appbar-utility { flex: 0 0 auto; padding: .5rem; }
  .notebook-link i { display: none; }
  .task-navigation { gap: .75rem; }
}
@media (max-width: 599px) {
  .threshold nav:first-child { gap: .25rem; padding-inline: .75rem; }
  .threshold nav:first-child .appbar-utility { flex-direction: column; gap: .1rem; min-width: 48px; padding: .2rem; font-size: .75rem; }
  .threshold .room-menu { top: 64px; }
  #hues { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #atlas .atlas-selects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #atlas .atlas-selects label:last-child { grid-column: 1 / -1; }
  .atlas-navigation { gap: .75rem; }
  .atlas-navigation a { gap: .4rem; }
  .atlas-navigation strong { font-size: .9375rem; }
  .atlas-navigation small { font-size: .75rem; }
  .task-navigation { grid-template-columns: minmax(0, 1fr); gap: .25rem; }
  .task-navigation a { min-height: 60px; }
  .task-navigation span { margin-top: .2rem; }
  #viewTabs { display: flex; width: fit-content; }
  #viewTabs button { flex-direction: row; font-size: .75rem; padding-inline: .4rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; } }
@media (forced-colors: active) { .atlas-navigation a[aria-current="page"], .task-navigation a { border-color: Highlight; } }

/* Keep the room identity visible without placing a second full hero before the task. */
.room-frontispiece { display: grid; grid-template-columns: minmax(100px, 24%) minmax(0, 1fr); margin: 1rem; border-radius: var(--radius-medium); }
.room-frontispiece > img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; }
.frontispiece-caption { padding: 1rem 1.25rem; border-top: 0; border-left: 3px solid #bb9155; }
.frontispiece-caption h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
.frontispiece-caption .eyebrow { font-size: .7rem; }
.frontispiece-caption small { margin-top: .5rem; }
body[data-page] main > section > .head h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.2; margin: .5rem 0 0; }
@media (max-width: 599px) { .room-frontispiece { grid-template-columns: 80px minmax(0, 1fr); } .frontispiece-caption { padding: .75rem; } .frontispiece-caption p { font-size: .8125rem; } }

.skip-link { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }

.notebook-link[aria-current="page"] { font-weight: 700; text-decoration: underline; }
#glaze-families { --story-accent: #245394; --story-light: #b1ceff; }
