/* The shared chrome (tokens, reset, .wrap, header, nav, search, chips, dropdowns, footer) comes from
   /css/stack.css (uistack/site/css/stack.css), linked before this file. Only what differs here stays here: Colors overrides the tokens, the header, the search
   and the footer below with its own neutral values. */
/* Colors: neutral chrome. The content is colour, so the site's own colours are
   near-white, near-black and greys only. No accent anywhere in the chrome. */
:root {
  --ui: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --bg: #FAFAF9; --fg: #141413; --fg2: #57574F; --fg3: #8A8A82;
  --line: #E4E4E0; --line2: #CFCFCA; --panel: #FFFFFF; --panel2: #F1F1EE;
  --light: #FAFAF9; --dark: #141413;
  --radius: 14px; --gutter: 16px; --max: 1240px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141413; --fg: #FAFAF9; --fg2: #B4B4AC; --fg3: #7C7C75;
    --line: #2A2A28; --line2: #3A3A37; --panel: #1B1B1A; --panel2: #232322;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141413; --fg: #FAFAF9; --fg2: #B4B4AC; --fg3: #7C7C75;
  --line: #2A2A28; --line2: #3A3A37; --panel: #1B1B1A; --panel2: #232322;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--ui); font-feature-settings: "tnum" 1; }
a.u, .prose a, .note a { text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
a.u:hover, .prose a:hover, .note a:hover { text-decoration-color: var(--fg); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.num, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.top { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 54px; height: auto; }
.brand { font-weight: 700; letter-spacing: -0.01em; font-size: 17px; display: flex; align-items: center; gap: 8px; flex: none; }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a { padding: 6px 10px; border-radius: 8px; color: var(--fg2); font-weight: 500; font-size: 14px; white-space: nowrap; }
.hact { display: flex; gap: 6px; flex: none; }
.hbtn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--fg2); font: 500 13px var(--ui); cursor: pointer; }
.hbtn:hover { border-color: var(--line2); color: var(--fg); }
.hbtn svg { width: 16px; height: 16px; }
.hbtn .n { font-variant-numeric: tabular-nums; min-width: 1ch; }
.hbtn .dots { display: inline-flex; }
.hbtn .dots i { width: 10px; height: 10px; border-radius: 50%; margin-left: -3px; box-shadow: 0 0 0 1.5px var(--panel); }
.hbtn .dots i:first-child { margin-left: 0; }
@media (max-width: 480px) { .nav a { padding: 6px 7px; font-size: 13.5px; } .hbtn { padding: 0 8px; } }
@media (max-width: 860px) {
  .top .wrap { flex-wrap: wrap; gap: 0 12px; padding-top: 6px; }
  .hact { margin-left: auto; }
  .nav { order: 3; width: 100%; margin: 4px 0 6px -10px; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
}

/* Filters (the Typefaces pattern) */
.tools { padding: 22px 0 8px; display: flex; flex-direction: column; gap: 12px; }
.search input { flex: 1; min-width: 0; max-width: 560px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--fg); font: 15px var(--ui); }
.search input:focus { outline: 2px solid var(--fg); outline-offset: -1px; }
.suggest { position: absolute; top: calc(100% + 4px); left: 0; width: min(560px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); z-index: 30; overflow: hidden; }
.suggest button { display: flex; justify-content: normal; align-items: center; gap: 10px; width: 100%; padding: 9px 14px; border: 0; background: none; color: var(--fg); font: 14px var(--ui); text-align: left; cursor: pointer; }
.suggest button span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest button small { color: var(--fg3); white-space: nowrap; }
.suggest .dot { width: 16px; height: 16px; border-radius: 4px; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.suggest .mini { display: flex; flex: none; width: 48px; height: 14px; border-radius: 3px; overflow: hidden; }
.suggest .mini i { flex: 1; }
.themes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.themes__name { font: 600 11px/1 var(--ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg3); margin-right: 4px; }
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dd__pop { position: absolute; top: 40px; left: 0; min-width: 220px; max-height: 340px; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); z-index: 30; padding: 6px; }
.dd__pop .dot { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.sort { display: flex; align-items: center; gap: 6px; margin-left: auto; font-size: 13px; color: var(--fg3); }
.sort select, .sel { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--fg); font: 500 13px var(--ui); }
.active { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.active:empty { display: none; }
.active .chip { background: var(--fg); border-color: var(--fg); color: var(--bg); padding-right: 8px; }
.active .chip::after { content: " \00d7"; opacity: 0.7; }
.clear { background: none; border: 0; color: var(--fg2); text-decoration: underline; text-underline-offset: 3px; font: 500 13px var(--ui); cursor: pointer; padding: 4px 6px; }
@media (max-width: 560px) { .dd__pop { left: auto; right: 0; } .dd:first-child .dd__pop { left: 0; right: auto; } .sort { margin-left: 0; } }
.setnote { font-size: 13px; color: var(--fg2); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.setnote b { color: var(--fg); font-weight: 600; }
.setnote a { text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
.setnote + .setnote { margin-top: 6px; }

/* Swatch: hex on hover, copy on click, everywhere */
.sw { position: relative; display: block; background: var(--c); border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); min-height: 28px; cursor: copy; }
a.sw { cursor: pointer; }
.sw__hex { position: absolute; left: 6px; bottom: 6px; padding: 3px 6px; border: 0; border-radius: 5px; background: rgba(20, 20, 19, 0.72); color: #FAFAF9; font: 500 11px/1.2 var(--mono); letter-spacing: 0.02em; cursor: copy; opacity: 0; transition: opacity .12s; white-space: nowrap; }
.sw--ink .sw__hex { background: rgba(250, 250, 249, 0.8); color: #141413; }
.sw:hover .sw__hex, .sw:focus-within .sw__hex, .sw__hex:focus-visible { opacity: 1; }
.sw__hex[data-done]::after { content: " \2713"; }
@media (hover: none) { .sw--big .sw__hex { opacity: 1; } }
.sw--round { border-radius: 50%; }
.sw--round .sw__hex { left: 50%; bottom: 50%; transform: translate(-50%, 50%); }

/* Proportional strip */
.strip { display: flex; height: 64px; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); }
.strip .sw { border-radius: 0; box-shadow: none; min-height: 0; min-width: 6px; }
.strip .sw__hex { left: 50%; transform: translateX(-50%); bottom: 6px; }
.strip__role { position: absolute; top: 5px; left: 6px; max-width: calc(100% - 10px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 9.5px/1 var(--ui); letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.75; pointer-events: none; }

/* Colour grid (browser) */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px 12px; padding: 12px 0 24px; }
@media (max-width: 420px) { .cgrid { grid-template-columns: repeat(2, 1fr); } }
.ccard { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ccard .sw { aspect-ratio: 4 / 3; border-radius: 10px; }
.ccard__name { font-size: 13.5px; font-weight: 500; line-height: 1.25; overflow-wrap: anywhere; }
.ccard__meta { font-size: 11.5px; color: var(--fg3); line-height: 1.3; display: flex; gap: 6px; flex-wrap: wrap; }
.more { display: flex; justify-content: center; padding: 8px 0 48px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--line2); border-radius: 9px; background: var(--panel); color: var(--fg); font: 500 13.5px var(--ui); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--fg); }
.btn--solid { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn--small { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn svg { width: 14px; height: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Palette cards */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; padding: 12px 0 24px; }
@media (max-width: 420px) { .pgrid { grid-template-columns: 1fr; } }
.pcard { display: flex; flex-direction: column; gap: 10px; padding: 12px 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s, box-shadow .15s; }
.pcard:hover { border-color: var(--line2); box-shadow: var(--shadow); }
.pcard .strip { height: 88px; }
.pcard__name { font-weight: 600; font-size: 15px; line-height: 1.2; }
.pcard__meta { font-size: 12px; color: var(--fg3); display: flex; flex-wrap: wrap; gap: 4px 8px; }
.pcard__hexes { font: 11px/1.4 var(--mono); color: var(--fg3); overflow-wrap: anywhere; }

/* Detail pages */
.detail { padding-top: 22px; padding-bottom: 64px; }
.crumbs { font-size: 13px; color: var(--fg3); margin-bottom: 14px; }
.crumbs a { color: var(--fg2); }
.section { margin-top: 44px; }
.section__title { font: 600 11.5px/1 var(--ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg3); margin: 0 0 14px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.section__title span { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--fg3); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.panel h3 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--fg2); }
.note { color: var(--fg2); font-size: 13.5px; margin: 8px 0 0; }
.note--small { font-size: 12.5px; color: var(--fg3); }
.badge { display: inline-block; font: 500 11.5px/1 var(--ui); padding: 4px 8px; border-radius: 999px; background: var(--panel2); color: var(--fg2); }
.badge--line { background: transparent; border: 1px solid var(--line2); }
.prose { font-size: 16px; line-height: 1.6; max-width: 62ch; }
.prose p { margin: 0 0 12px; }
pre.snippet { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 16px; font: 12.5px/1.6 var(--mono); overflow: auto; position: relative; margin: 0; }
.copybtn { border: 1px solid var(--line); background: var(--panel); color: var(--fg2); border-radius: 7px; font: 500 11.5px var(--ui); padding: 3px 8px; cursor: pointer; white-space: nowrap; }
.copybtn:hover { color: var(--fg); border-color: var(--line2); }
.copybtn[data-done]::after { content: " \2713"; }
.stub { padding: 80px 0; color: var(--fg2); max-width: 36em; }
.stub h1 { font-size: 32px; letter-spacing: -0.02em; margin: 0 0 8px; color: var(--fg); }

/* Pass and fail marks: always a glyph, never hue alone */
.mark { display: inline-flex; align-items: center; gap: 3px; font: 600 11px/1 var(--ui); padding: 3px 6px; border-radius: 5px; white-space: nowrap; }
.mark--pass { background: var(--fg); color: var(--bg); }
.mark--pass::before { content: "\2713"; }
.mark--fail { border: 1px solid var(--line2); color: var(--fg3); }
.mark--fail::before { content: "\2715"; }

/* Colour page */
.hero { display: grid; grid-template-columns: 1fr 1fr; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.hero__side { padding: clamp(18px, 4vw, 36px); display: flex; flex-direction: column; gap: 14px; }
.hero__side--light { background: var(--light); color: var(--dark); }
.hero__side--dark { background: var(--dark); color: var(--light); }
.hero__field { background: var(--c); border-radius: 12px; min-height: clamp(160px, 26vw, 280px); }
.hero__label { font: 600 10.5px/1 var(--ui); letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.6; }
@media (max-width: 640px) { .hero { grid-template-columns: 1fr; } .hero__field { min-height: 120px; } }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; margin: 22px 0 0; }
.head h1 { margin: 0; font-size: clamp(32px, 5vw, 52px); line-height: 1.02; letter-spacing: -0.025em; font-weight: 650; }
.head__sub { color: var(--fg2); font-size: 14px; margin-top: 6px; }
.head__hex { font: 500 clamp(20px, 3vw, 28px)/1 var(--mono); }
.head .row { margin-left: auto; }
@media (max-width: 640px) { .head .row { margin-left: 0; } }
.numtab { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.numtab th { text-align: left; font-weight: 500; color: var(--fg3); padding: 7px 12px 7px 0; white-space: nowrap; vertical-align: top; width: 1%; }
.numtab td { padding: 7px 0; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.numtab tr:last-child td { border-bottom: 0; }
.numtab td .copybtn { float: right; margin-left: 8px; font-family: var(--ui); }
.numtab td small { font-family: var(--ui); color: var(--fg3); display: block; font-size: 11.5px; margin-top: 2px; }
.nlist { list-style: none; margin: 0; padding: 0; }
.nlist li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.nlist li:last-child { border-bottom: 0; }
.nlist .sw { width: 34px; height: 34px; min-height: 0; border-radius: 7px; }
.nlist .sw__hex { display: none; }
.nlist b { font-weight: 550; font-size: 14px; }
.nlist .sub { display: block; font-size: 12px; color: var(--fg3); }
.nlist .de { text-align: right; font-size: 12px; color: var(--fg2); font-variant-numeric: tabular-nums; }
.nlist .de small { display: block; color: var(--fg3); }
.tones { display: grid; grid-template-columns: repeat(var(--n, 14), minmax(0, 1fr)); gap: 3px; }
.tone { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tone .sw { height: 64px; border-radius: 6px; }
.tone .sw__hex { display: none; }
.tone__k { font-size: 11px; color: var(--fg3); text-align: center; font-variant-numeric: tabular-nums; }
.tone__k b { color: var(--fg); font-weight: 600; }
.tone--self .sw { outline: 2px solid var(--fg); outline-offset: 2px; }
@media (max-width: 640px) {
  .tones { grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 10px; }
  .tones--11 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.pairs { width: 100%; border-collapse: collapse; font-size: 13px; }
.pairs th { text-align: left; font: 600 10.5px/1 var(--ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg3); padding: 0 8px 8px 0; }
.pairs td { padding: 8px 8px 8px 0; border-top: 1px solid var(--line); vertical-align: middle; font-variant-numeric: tabular-nums; }
.pairs .sample { border-radius: 8px; padding: 8px 12px; line-height: 1.25; min-width: 180px; }
.pairs .sample span { display: block; }
.pairs .sample .s14 { font-size: 14px; } .pairs .sample .s18 { font-size: 18px; } .pairs .sample .s24 { font-size: 24px; font-weight: 600; }
.pairs .marks { display: flex; gap: 4px; flex-wrap: wrap; }
.scroll-x { overflow-x: auto; }
.harm { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.harm__set { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.harm__set h4 { margin: 0 0 8px; font-size: 12.5px; font-weight: 600; color: var(--fg2); text-transform: capitalize; }
.harm__row { display: flex; gap: 4px; }
.harm__row .sw { flex: 1; height: 52px; min-height: 0; }
.harm__row .sw__hex { left: 50%; transform: translateX(-50%); font-size: 10px; padding: 2px 4px; }
.harm__row .sw--self { flex: 0.6; }
.vis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.vis__it { display: flex; flex-direction: column; gap: 6px; }
.vis__it .sw { height: 96px; }
.vis__it b { font-size: 13px; font-weight: 600; }
.vis__it span { font-size: 12px; color: var(--fg3); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--fg3); }
.kv dd { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Home */
.home-hero { padding: clamp(36px, 7vw, 84px) 0 24px; }
.home-hero h1 { font-size: clamp(34px, 6vw, 64px); line-height: 1.02; letter-spacing: -0.03em; margin: 0 0 12px; font-weight: 650; }
.home-hero p { font-size: 17px; color: var(--fg2); margin: 0 0 22px; max-width: 40em; }
.home-hero .search input { font-size: 17px; padding: 14px 16px; max-width: 640px; }
.home-hero .suggest { width: min(640px, 100%); }
.eg { font-size: 13px; color: var(--fg3); margin-top: 10px; }
.eg button { background: none; border: 0; padding: 0 2px; color: var(--fg2); text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; cursor: pointer; font: inherit; }
.doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.door { display: flex; flex-direction: column; gap: 10px; padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s; }
.door:hover { border-color: var(--line2); }
.door h2 { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
.door p { margin: 0; color: var(--fg2); font-size: 14px; }
.door__art { display: flex; height: 44px; border-radius: 8px; overflow: hidden; }
.door__art i { flex: 1; }
.door ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.door ul a { font-size: 14px; text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
.cotd { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.cotd .sw { border-radius: 0; min-height: 220px; box-shadow: none; }
.cotd__body { padding: 22px; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.cotd__body h3 { margin: 0; font-size: 28px; letter-spacing: -0.015em; line-height: 1.1; }
@media (max-width: 640px) { .cotd { grid-template-columns: 1fr; } .cotd .sw { min-height: 140px; } }

/* Tray */
.tray { position: fixed; top: 62px; right: 12px; z-index: 50; width: min(360px, calc(100vw - 24px)); max-height: calc(100vh - 80px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius); box-shadow: var(--shadow); }
.tray[hidden] { display: none; }
.tray__head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.tray__head b { font-size: 14px; }
.tray__head small { color: var(--fg3); font-size: 12px; }
.tray__x { margin-left: auto; border: 0; background: none; font-size: 20px; line-height: 1; color: var(--fg2); cursor: pointer; padding: 2px 6px; }
.tray__list { list-style: none; margin: 0; padding: 6px 10px; overflow: auto; flex: 1; min-height: 40px; }
.tray__list li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 5px 4px; border-bottom: 1px solid var(--line); }
.tray__list li:last-child { border-bottom: 0; }
.tray__list .sw { width: 30px; height: 30px; min-height: 0; border-radius: 6px; }
.tray__list .sw__hex { display: none; }
.tray__list a { font-size: 13px; line-height: 1.2; min-width: 0; }
.tray__list a small { display: block; color: var(--fg3); font-family: var(--mono); font-size: 11px; }
.tray__list button { border: 0; background: none; color: var(--fg3); cursor: pointer; font-size: 16px; padding: 2px 6px; }
.tray__list button:hover { color: var(--fg); }
.tray__empty { color: var(--fg3); font-size: 13px; padding: 10px 4px; }
.tray__add { display: flex; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--line); }
.tray__add input { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); font: 13px var(--ui); }
.tray__acts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 14px; }
.tray__err { color: var(--fg2); font-size: 12px; padding: 0 14px 8px; }
.tray__err:empty { display: none; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--fg); color: var(--bg); padding: 8px 14px; border-radius: 9px; font: 500 13px var(--ui); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 60; }
.toast[data-on] { opacity: 1; transform: translate(-50%, 0); }

footer { border-top: 1px solid var(--line); padding: 20px 0 40px; color: var(--fg3); font-size: 13px; margin-top: 40px; }
footer a { text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
.empty { padding: 60px 0; color: var(--fg3); text-align: center; }
.loading { padding: 60px 0; color: var(--fg3); }

/* Front doors (colors.html and palettes.html with nothing chosen) and the set header. Added for phase 2. */
[hidden] { display: none !important; }
.front { padding: 18px 0 32px; }
.front__row { margin-top: 40px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
a.chip { display: inline-flex; align-items: center; gap: 7px; text-transform: none; }
.chip--sw .dot { width: 12px; height: 12px; border-radius: 3px; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.setdoors { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.setdoor { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.setdoor__head { display: flex; align-items: flex-start; gap: 8px; justify-content: space-between; }
.setdoor__head h2 { margin: 0; font-size: 16px; line-height: 1.25; font-weight: 600; letter-spacing: -0.005em; }
.setdoor__head h2 a:hover { text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
.setdoor__head .badge { flex: none; }
.setdoor__desc { margin: 0; font-size: 13.5px; color: var(--fg2); line-height: 1.45; }
.setdoor .strip { height: 52px; margin-top: auto; }
.setdoor__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.setdoor__n { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.setdoor__lic { margin: 0; font-size: 11.5px; line-height: 1.4; color: var(--fg3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sethead { padding: 4px 0 6px; }
.sethead .crumbs { margin-bottom: 6px; }
.sethead h1 { margin: 0; font-size: clamp(24px, 3.4vw, 34px); line-height: 1.1; letter-spacing: -0.02em; font-weight: 650; }
.sethead h1 .badge { vertical-align: middle; font-size: 12px; letter-spacing: 0; }
.sethead__desc { margin: 8px 0 0; font-size: 16px; color: var(--fg2); max-width: 56em; }
.sethead__meta { margin: 8px 0 0; font-size: 13px; color: var(--fg3); max-width: 70em; overflow-wrap: anywhere; }
.sethead__meta b { color: var(--fg); font-weight: 600; }
.sethead--compact h1 { font-size: 18px; }
.sethead--compact .crumbs { display: none; }
.sethead--compact + .sethead--compact { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.drow + .drow { margin-top: 28px; }
.drow__title { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; font-size: 17px; font-weight: 600; letter-spacing: -0.005em; }
.drow__title small { font-size: 13px; font-weight: 400; color: var(--fg3); font-variant-numeric: tabular-nums; }
.drow__title a { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--fg2); white-space: nowrap; }
.drow__cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.drow__cards .pcard { padding: 10px 10px 12px; gap: 8px; min-width: 0; }
.drow__cards .pcard .strip { height: 64px; }
.drow__cards .pcard__name { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drow__cards .pcard__meta { font-size: 11.5px; }
.drow__cards .pcard__meta span:nth-child(n+3) { display: none; }
@media (max-width: 1080px) { .drow__cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .drow__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Tools landing (tools.html) */
.tlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.tlist .door code { font: 12px var(--mono); color: var(--fg3); overflow-wrap: anywhere; }
.tlist .door .door__go { margin-top: auto; font-size: 13.5px; font-weight: 500; }
.setdoor .strip .sw__hex, .drow__cards .strip .sw__hex { font-size: 10px; padding: 2px 4px; z-index: 1; }
/* Home: four doors in one row on a wide screen, two by two below */
@media (min-width: 1000px) { .doors { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 560px) and (max-width: 999px) { .doors { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.door h2 a:hover { text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }

/* Collections layer (SPEC-COLLECTIONS.md): shared marks. Scorecard word, check marks and the notes glyph carry a
   glyph and a word, never hue alone; the chrome stays neutral. */
.pcard__marks { display: inline-flex; gap: 5px; margin-left: 8px; vertical-align: 2px; }
.sword { display: inline-flex; align-items: center; gap: 4px; font: 600 11px/1 var(--ui); padding: 3px 7px 3px 5px; border-radius: 999px; white-space: nowrap; letter-spacing: 0.01em; }
.sword i { font-style: normal; display: inline-flex; align-items: center; justify-content: center; width: 13px; height: 13px; border-radius: 50%; font-size: 9px; }
.sword--sound { background: var(--fg); color: var(--bg); }
.sword--sound i { background: var(--bg); color: var(--fg); }
.sword--watch { border: 1px solid var(--fg2); color: var(--fg); }
.sword--watch i { background: var(--fg); color: var(--bg); font-weight: 800; }
.sword--rework { border: 1px dashed var(--fg3); color: var(--fg2); }
.sword--rework i { border: 1px solid var(--fg3); }
.nmark { display: inline-flex; align-items: center; gap: 3px; font: 500 11px/1 var(--ui); color: var(--fg3); padding: 3px 6px; border: 1px solid var(--line); border-radius: 999px; }
.nmark i { font-style: normal; }
.smark { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; flex: none; font: 700 12px/1 var(--ui); }
.smark--pass { background: var(--fg); color: var(--bg); }
.smark--pass::before { content: "\2713"; }
.smark--warn { border: 1.5px solid var(--fg); color: var(--fg); }
.smark--warn::before { content: "!"; }
.smark--fail { border: 1.5px dashed var(--fg3); color: var(--fg2); }
.smark--fail::before { content: "\2715"; }
.smark--na { color: var(--fg3); }
.smark--na::before { content: "\00b7"; font-size: 18px; }
.score__head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.score__head .sword { font-size: 17px; padding: 6px 14px 6px 8px; gap: 7px; }
.score__head .sword i { width: 20px; height: 20px; font-size: 12px; }
.score__sum { font-size: 13px; color: var(--fg2); line-height: 1.4; }
.score__auto { margin: 0 0 12px; font-size: 13px; color: var(--fg2); }
.score__rows { list-style: none; margin: 0; padding: 0; }
.score__row { display: grid; grid-template-columns: 20px 92px minmax(0, 1fr); gap: 4px 12px; align-items: start; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; line-height: 1.45; }
.score__row:last-child { border-bottom: 0; padding-bottom: 0; }
.score__row b { font-weight: 600; padding-top: 1px; }
.score__row--na { color: var(--fg3); }
@media (max-width: 520px) { .score__row { grid-template-columns: 20px minmax(0, 1fr); } .score__row > span:last-child { grid-column: 2; } }
.chip--coll { gap: 6px; }
.chip__kind { font: 600 9.5px/1 var(--ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg3); }
/* Home: five doors (Colours, Palettes, Collections, Gradients, Tools) */
@media (min-width: 1000px) { .doors { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* working palettes: the light set above, the dark set in a thinner band below (CS.splitStripHTML) */
.wstrip { display: flex; flex-direction: column; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); }
.wstrip .strip { border-radius: 0; box-shadow: none; }
.pcard .wstrip .strip:first-child { height: 60px; }
.pcard .wstrip .strip + .strip, .wstrip .strip + .strip { height: 28px; }
.drow__cards .pcard .wstrip .strip:first-child { height: 44px; }
.drow__cards .pcard .wstrip .strip + .strip { height: 20px; }
.nmark--work { text-transform: none; }
