/* Layout: two polished bands under the same light, then the ISO colour cards, the a*b* tolerance chart with a
   measurement checker, the 14K/18K mixer and the white gold grades. Palette follows the JewelLoop site;
   the gold colours themselves come only from the standard's measured values. */
:root {
  --paper: #ffffff;
  --ink: #16161a;
  --ink-soft: #3d3d45;
  --muted: #6b6b75;
  --rule: #e4e2de;
  --mist: #f4f3f1;
  --ruby: #9b1b30;
  --gold: #b8892f;
  --good: #2f7d4f;
  --bad: #b42318;
  --stage-top: #3a3a42;
  --stage-bottom: #121216;
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-data: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

:root[data-theme="dark"] {
  --paper: #121216; --ink: #f1efe9; --ink-soft: #c9c6bf; --muted: #9a978f; --rule: #2c2c33; --mist: #1b1b21;
  --ruby: #e0566c; --gold: #e1b25a; --good: #5fbf86; --bad: #f0695c; color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; }
a { color: var(--ink); text-decoration-color: var(--ruby); text-underline-offset: 3px; }
.wrap { max-width: 1200px; margin: 0 auto; padding-inline: 16px; padding-block: 20px 48px; display: grid; gap: 28px; }
header.top { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--ink); padding-bottom: 14px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ruby); display: inline-flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; flex: none; width: 4px; height: 15px; background: var(--gold); clip-path: polygon(0 24%, 100% 0, 100% 76%, 0 100%); }
h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(30px, 4.6vw, 48px); line-height: 1.03; letter-spacing: -.01em; margin: 6px 0 0; text-wrap: balance; }
h2.sec { font-family: var(--font-display); font-weight: 500; font-size: 28px; margin: 0; line-height: 1.1; text-wrap: balance; }
.lede { max-width: 56ch; color: var(--ink-soft); margin: 0; }
.prototype { font-size: 12px; color: var(--muted); border: 1px solid var(--rule); padding: 4px 10px; white-space: nowrap; }
p.copy { margin: 0; color: var(--ink-soft); max-width: 68ch; }
.mini { font: 600 12px var(--font-body); letter-spacing: .14em; text-transform: uppercase; margin: 0; color: var(--ink-soft); }
section.study { border-top: 1px solid var(--ink); padding-top: 18px; display: grid; gap: 16px; }

.compare { display: grid; gap: 14px; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .compare { grid-template-columns: 1fr; } }
.stage { position: relative; aspect-ratio: 16 / 10; max-width: 100%; background: radial-gradient(120% 100% at 50% 20%, var(--stage-top), var(--stage-bottom)); clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px)); overflow: hidden; touch-action: none; }
.stage canvas { display: block; width: 100%; height: 100%; }
.stage .tag { position: absolute; bottom: 12px; font: 600 13px var(--font-body); color: #f1efe9; background: rgba(0,0,0,.45); padding: 4px 10px; }
.stage .tag.a { left: 14px; } .stage .tag.b { right: 14px; }
.stage .hint { position: absolute; top: 12px; left: 14px; font-size: 12px; color: #c9c6bf; pointer-events: none; }
.pickers { display: grid; gap: 14px; min-width: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { font: 500 13px var(--font-body); border: 1px solid var(--rule); background: var(--paper); color: var(--ink); padding: 6px 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.seg button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.seg button:focus-visible, input:focus-visible, .card:focus-visible { outline: 2px solid var(--ruby); outline-offset: 2px; }
select.pick { font: 500 14px var(--font-body); padding: 7px 8px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); width: 100%; border-radius: 0; }
.group-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--ink); padding-bottom: 4px; margin-top: 6px; }
.group-head h3 { font-family: var(--font-display); font-weight: 500; font-size: 22px; margin: 0; }
.group-head span { font-size: 13px; color: var(--muted); }
.src { font-size: 12px; color: var(--muted); }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); flex: none; }
.delta { background: var(--mist); padding: 10px 12px; font-size: 14px; }
.delta strong { font: 500 22px var(--font-data); display: block; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.card { border: 1px solid var(--rule); background: var(--paper); padding: 0; cursor: pointer; text-align: left; color: var(--ink); font: inherit; display: grid; }
.card .sw { height: 74px; position: relative; }
.card .sw::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255,255,255,.45) 0%, rgba(255,255,255,0) 35%, rgba(0,0,0,0) 60%, rgba(0,0,0,.18) 100%); }
.card .body { padding: 8px 10px 10px; display: grid; gap: 2px; }
.card .code { font: 600 18px var(--font-data); }
.card .name { font-size: 13px; color: var(--ink-soft); }
.card .lab { font: 500 12px var(--font-data); color: var(--muted); }
.card .comp { font-size: 12px; color: var(--muted); }
.card.active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.two { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }
#abChart { width: 100%; height: auto; display: block; background: var(--mist); }
.form { display: grid; gap: 10px; }
.labin { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.labin label { font-size: 12px; font-weight: 600; display: grid; gap: 3px; }
.labin input { font: 500 15px var(--font-data); padding: 7px 8px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); width: 100%; border-radius: 0; }
.verdict { margin: 0; border-left: 3px solid var(--rule); padding: 8px 12px; background: var(--mist); font-size: 14px; }
.verdict.ok { border-color: var(--good); } .verdict.no { border-color: var(--bad); }
.verdict strong { display: block; }
.mixer { display: grid; gap: 12px; }
.mixbar { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: center; }
.mixbar .big { width: 96px; height: 96px; position: relative; border-radius: 50%; }
.mixbar .big::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.65), rgba(255,255,255,0) 40%), radial-gradient(circle at 70% 75%, rgba(0,0,0,.22), rgba(0,0,0,0) 55%); }
input[type="range"] { width: 100%; accent-color: var(--ruby); }
.comp-row { display: flex; height: 18px; border: 1px solid var(--rule); }
.comp-row span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink-soft); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; display: inline-block; }
.white-grades { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 640px) { .white-grades { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.white-grades div { border: 1px solid var(--rule); min-width: 0; }
.white-grades .sw { height: 64px; }
.white-grades .body { padding: 8px 10px; font-size: 13px; display: grid; gap: 2px; }
.white-grades strong { font-size: 14px; }
.sources { font-size: 13px; color: var(--ink-soft); display: grid; gap: 4px; padding-left: 18px; margin: 0; }
footer.note { font-size: 12px; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 12px; max-width: 95ch; }
.fallback { padding: 24px; color: #c9c6bf; }
/* jewelloop.net: one column that never grows wider than the screen */
.wrap { grid-template-columns: minmax(0, 1fr); }
.jl-table-scroll { overflow-x: auto; max-width: 100%; }
/* shown once the page's script has run (static/visual/ready.js): no jump while loading */
html:not(.jl-ready) .wrap { visibility: hidden; }

/* On jewelloop.net the page around it shows the title and the introduction. */
header.top { display: none !important; }
