/* Layout: setting picker (centre-stone settings, then row and accent settings), 3D bench stage beside a facts
   column, then comparison, setter's glossary and sources. Palette follows the JewelLoop site. */
:root {
  --paper: #ffffff;
  --ink: #16161a;
  --ink-soft: #3d3d45;
  --muted: #6b6b75;
  --rule: #e4e2de;
  --mist: #f4f3f1;
  --ruby: #9b1b30;
  --gold: #b8892f;
  --good: #2f7d4f;
  --warn: #b7791f;
  --bad: #b42318;
  --stage-top: #e6e3dc;
  --stage-bottom: #c9c4b9;
  --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; --warn: #e3a948; --bad: #f0695c;
  --stage-top: #24242b; --stage-bottom: #0d0d11; 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: 1240px; margin: 0 auto; padding-inline: 16px; padding-block: 20px 48px; display: grid; gap: 24px; }
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(28px, 4.2vw, 44px); line-height: 1.05; 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: 58ch; 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: 66ch; }
.mini { font: 600 12px var(--font-body); letter-spacing: .14em; text-transform: uppercase; margin: 0; color: var(--ink-soft); }
.mini span { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); }

.picker { display: grid; gap: 10px; }
.types { display: flex; flex-wrap: wrap; gap: 8px; }
.type { font: 600 14px var(--font-body); border: 1px solid var(--ink); background: var(--paper); color: var(--ink); padding: 8px 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.type[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.type .fit { width: 9px; height: 9px; border-radius: 50%; background: var(--rule); flex: none; }
.fit.good { background: var(--good) !important; } .fit.care { background: var(--warn) !important; } .fit.no { background: var(--bad) !important; }

.main { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .main { grid-template-columns: 1fr; } }
.stage { position: relative; aspect-ratio: 4 / 3.3; max-width: 100%; background: radial-gradient(120% 90% at 50% 25%, 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; }
@media (max-width: 900px) { .stage { aspect-ratio: 1 / 1.05; } }
.stage canvas { display: block; width: 100%; height: 100%; }
.stage-bar { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 8px; pointer-events: none; }
.stage-bar > * { pointer-events: auto; }
.chip { font: 600 13px var(--font-body); border: 1px solid var(--ink); background: var(--paper); color: var(--ink); padding: 7px 12px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip:focus-visible, .type:focus-visible, .seg button:focus-visible { outline: 2px solid var(--ruby); outline-offset: 2px; }
.hint { position: absolute; top: 12px; left: 14px; font-size: 12px; color: var(--ink-soft); pointer-events: none; }
.caption { position: absolute; top: 12px; right: 14px; font: 600 12px var(--font-body); color: var(--ink); background: color-mix(in srgb, var(--paper) 85%, transparent); padding: 3px 8px; border: 1px solid var(--rule); }

aside.panel { display: grid; gap: 16px; min-width: 0; }
.block { border-top: 2px solid var(--ink); padding-top: 12px; display: grid; gap: 8px; min-width: 0; }
.type-name { font-family: var(--font-display); font-size: 30px; font-weight: 500; margin: 0; line-height: 1.05; }
.aka { font-size: 13px; color: var(--muted); margin: 0; }
.how { margin: 0; color: var(--ink-soft); }
.pc { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .pc { grid-template-columns: 1fr; } }
.pc ul { margin: 4px 0 0; padding-left: 18px; font-size: 14px; color: var(--ink-soft); display: grid; gap: 4px; }
.pc h4 { margin: 0; font: 600 13px var(--font-body); }
.pc .plus h4 { color: var(--good); } .pc .minus h4 { color: var(--bad); }
.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); }
.variant-note { font-size: 13px; color: var(--muted); margin: 0; }
.swatch { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--rule); }
.verdict { border-left: 3px solid var(--rule); padding: 8px 12px; background: var(--mist); margin: 0; font-size: 14px; }
.verdict.good { border-color: var(--good); } .verdict.care { border-color: var(--warn); } .verdict.no { border-color: var(--bad); }
.verdict strong { display: block; }

section.study { border-top: 1px solid var(--ink); padding-top: 18px; display: grid; gap: 14px; }
.tablewrap { overflow-x: auto; }
table.cmp { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 680px; }
table.cmp th { text-align: left; font: 600 12px var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--ink); }
table.cmp td { padding: 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.cmp tr.group td { font: 600 12px var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--ruby); border-bottom: 1px solid var(--ink); padding-top: 14px; }
table.cmp tr.current td { background: var(--mist); }
table.cmp td:first-child { font-weight: 600; white-space: nowrap; }
.pill { display: inline-block; font: 600 12px var(--font-body); padding: 2px 8px; border: 1px solid currentColor; white-space: nowrap; }
.pill.good { color: var(--good); } .pill.care { color: var(--warn); } .pill.no { color: var(--bad); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.cards div { border: 1px solid var(--rule); padding: 10px 12px; min-width: 0; }
.cards h4 { margin: 0 0 4px; font: 600 14px var(--font-body); }
.cards p { margin: 0; font-size: 13px; color: var(--ink-soft); }
.cards .warnbox { border-color: var(--warn); }
.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: var(--ink-soft); }
/* 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; }
