/* Jump Rings - a jeweller's counter: ivory card, berry ribbon, a velvet-lined tray for the bracelet. */
:root { --bg: #f8f3ee; --panel: #fffdfa; --ink: #2d2430; --sub: #685c6b; --line: #e4d8ce; --accent: #962b55; --accent-ink: #ffffff; --good: #2c6a4c; --good-ink: #ffffff;
  --field: #ffffff; --chip: #f3e9e1; --focus: #e7a33e; --velvet1: #7a2f4f; --velvet2: #3e1426; --velvet-ink: #f7ebe4;
  --warn-bg: #f8e1dc; --warn-ink: #8a2a1a; --info-bg: #ebe5f3; --info-ink: #43306b; --shadow: 0 2px 10px rgba(80, 40, 50, .07); color-scheme: light; }
:root[data-theme="dark"] { --bg: #151117; --panel: #1f1922; --ink: #f2e9ee; --sub: #bcaebd; --line: #3a2f3e; --accent: #ec8fb4; --accent-ink: #1b0f15; --good: #7fd3a6; --good-ink: #0e1c14;
  --field: #29222d; --chip: #2b2330; --focus: #f0b75c; --velvet1: #4d1c32; --velvet2: #22091a; --velvet-ink: #f7ebe4;
  --warn-bg: #3d211d; --warn-ink: #ffb9ab; --info-bg: #272038; --info-ink: #cdbcf2; --shadow: 0 2px 10px rgba(0, 0, 0, .35); color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-x: hidden; }
a { color: var(--accent); }
h1, h2, h3, h4, .ph, .rtitle, .kicker, .brand strong { font-family: Georgia, "Times New Roman", serif; }
.hidden { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: .88rem; } .muted { color: var(--sub); } .mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.bar { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.back { text-decoration: none; font-weight: 700; white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.brand strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.1rem; }
.logo { width: 26px; height: 26px; flex: none; }
.lg-a { fill: none; stroke: var(--sub); stroke-width: 1.6; stroke-dasharray: 2.2 1.4; } .lg-b { fill: none; stroke: var(--accent); stroke-width: 1.3; } .lg-c { fill: var(--accent); }
.session { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.pill:hover:not(:disabled) { border-color: var(--accent); }
.pill.solid { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pill.solid:hover:not(:disabled) { filter: brightness(1.08); }
.pill.ghost { cursor: default; } .pill.tiny { padding: 3px 10px; font-size: .8rem; } .pill.big { padding: 10px 22px; font-size: 1.05rem; }
.pill:disabled { opacity: .45; cursor: not-allowed; }
main { max-width: 1080px; margin: 0 auto; padding: 8px 16px 32px; }
.hero { padding: 24px 0 8px; }
.kicker { margin: 0; color: var(--accent); font-style: italic; font-size: 1.02rem; }
h1 { font-size: clamp(2.3rem, 7vw, 3.6rem); line-height: 1; margin: 6px 0 10px; font-weight: 400; letter-spacing: -.01em; }
.h1b { display: block; line-height: 1.25; font-size: clamp(1rem, 2.6vw, 1.3rem); color: var(--sub); font-style: italic; margin-top: 8px; }
.lede { max-width: 64ch; margin: 0 0 12px; }
.samples { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.chip { border: 1.5px dashed var(--sub); background: transparent; color: var(--ink); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .88rem; cursor: pointer; }
.chip.on { border-style: solid; border-color: var(--accent); color: var(--accent); font-weight: 700; background: var(--panel); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin: 18px 0; box-shadow: var(--shadow); }
.ph { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 1.3rem; font-weight: 400; margin: 0 0 12px; }
.step-no { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent); font: 700 .9rem system-ui, sans-serif; }
.free { font: 700 .7rem system-ui, sans-serif; text-transform: uppercase; letter-spacing: .08em; color: var(--good); border: 1.5px solid var(--good); border-radius: 999px; padding: 1px 8px; }
.fld { margin: 0 0 12px; } .lab { display: block; font-weight: 700; margin-bottom: 4px; } .lab.inl { display: inline; margin: 0; }
.lenshint { display: block; font-weight: 400; font-size: .84rem; color: var(--sub); }
.inp { width: 100%; font: inherit; color: var(--ink); background: var(--field); border: 1.5px solid var(--line); border-radius: 8px; padding: 9px 12px; }
.inp.short { width: 12em; max-width: 100%; padding: 5px 10px; font-family: Georgia, serif; letter-spacing: .06em; text-transform: uppercase; }
.inp.drop { border-color: var(--good); border-style: dashed; }
textarea.inp { resize: vertical; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; flex-wrap: nowrap; }
.segb { border: 0; background: var(--field); color: var(--ink); font: inherit; font-size: .9rem; font-weight: 600; padding: 6px 13px; cursor: pointer; white-space: nowrap; }
.segb + .segb { border-left: 1.5px solid var(--line); }
.segb.on { background: var(--accent); color: var(--accent-ink); }
.cardrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.filebtn { cursor: pointer; }
.note { background: var(--info-bg); color: var(--info-ink); border-radius: 8px; padding: 8px 10px; }
.srcbadge { font: 700 .72rem system-ui, sans-serif; text-transform: uppercase; letter-spacing: .06em; border-radius: 999px; padding: 2px 9px; background: var(--chip); color: var(--ink); }
.srcbadge.on { background: var(--accent); color: var(--accent-ink); }
/* The velvet tray and the bracelet on it. */
.velvet { border-radius: 16px; padding: 10px 6px 4px; background: radial-gradient(120% 140% at 50% 0%, var(--velvet1), var(--velvet2)); box-shadow: inset 0 2px 14px rgba(0, 0, 0, .45); }
.stage svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.stage .charm { cursor: grab; outline: none; }
.stage .charm.dragging { cursor: grabbing; }
.stage .charm:focus-visible .selring, .stage .charm.sel .selring { stroke: var(--focus); }
.stage .charm:focus-visible rect { stroke: var(--focus); stroke-width: 2; stroke-dasharray: 4 3; rx: 8; }
.stage .swing { transform-box: view-box; transform-origin: 0 0; }
.stage.shake .swing { animation: sway 1.6s ease-in-out 2; }
@keyframes sway { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(9deg); } 75% { transform: rotate(-9deg); } }
.editor { border: 1.5px solid var(--accent); border-radius: 12px; padding: 12px; margin-top: 12px; background: var(--bg); }
.edhead { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 8px; } .edhead span { overflow-wrap: anywhere; }
.charmgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.cbtn { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font: inherit; font-size: .72rem; padding: 6px 2px; cursor: pointer; }
.cbtn.on { border-color: var(--accent); background: var(--chip); font-weight: 700; } .cbtn.taken { opacity: .6; }
.crow .charmicon, .rc .charmicon { flex: none; width: 34px; height: 34px; }
.charmlist { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.crow { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; background: var(--bg); cursor: pointer; min-width: 0; }
.crow:hover, .crow.on { border-color: var(--accent); }
.crow .ctext { display: flex; flex-direction: column; min-width: 0; } .crow .ctext b { font-family: Georgia, serif; letter-spacing: .06em; text-transform: uppercase; font-weight: 400; font-size: .86rem; }
.crow .ctext span { font-size: .82rem; color: var(--sub); overflow-wrap: anywhere; }
.by { font: 700 .62rem system-ui, sans-serif; text-transform: uppercase; letter-spacing: .06em; border-radius: 999px; padding: 0 6px; border: 1px solid var(--line); color: var(--sub); white-space: nowrap; margin-left: auto; align-self: flex-start; }
.by.run { border-color: var(--accent); color: var(--accent); } .by.you { border-color: var(--good); color: var(--good); }
.runrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gate { background: var(--warn-bg); color: var(--warn-ink); border-radius: 8px; padding: 8px 10px; }
.steps { list-style: none; padding: 0; margin: 8px 0; } .step { padding: 3px 0; color: var(--sub); } .step.done { color: var(--good); } .step.active { color: var(--ink); font-weight: 700; }
.step-ic { display: inline-block; width: 1.2em; font-family: ui-monospace, Menlo, monospace; }
.raw { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); padding: 10px; border-radius: 8px; max-height: 300px; overflow: auto; }
.res-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.res-kick { margin: 0; font-weight: 700; color: var(--sub); }
.badge { font: 700 .72rem system-ui, sans-serif; letter-spacing: .06em; border-radius: 999px; padding: 3px 10px; background: var(--chip); color: var(--ink); }
.badge.on { background: var(--good); color: var(--good-ink); }
.rtitle { font-size: 1.6rem; font-weight: 400; margin: 12px 0 8px; overflow-wrap: anywhere; }
.rcharms, .recon, .saved { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.rc { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: start; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--bg); }
.rc p { margin: 2px 0 0; overflow-wrap: anywhere; } .rchead { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rchead b { font-family: Georgia, serif; font-weight: 400; letter-spacing: .07em; text-transform: uppercase; }
.result h4 { margin: 16px 0 6px; font-weight: 400; }
.recon li { border-radius: 8px; padding: 6px 10px; } .recon .warn { background: var(--warn-bg); color: var(--warn-ink); } .recon .info { background: var(--info-bg); color: var(--info-ink); }
li.none { color: var(--sub); font-style: italic; list-style: none; }
.exports { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hrow { display: flex; justify-content: space-between; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; flex-wrap: wrap; }
.hinfo { display: flex; flex-direction: column; min-width: 0; } .hinfo b { overflow-wrap: anywhere; } .hbtns { display: flex; gap: 6px; }
.foot { max-width: 1080px; margin: 0 auto; padding: 16px 16px 40px; color: var(--sub); font-size: .88rem; border-top: 1px solid var(--line); }
.toasts { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); display: grid; gap: 6px; z-index: 20; width: min(92vw, 440px); }
.toast { background: var(--ink); color: var(--bg); padding: 9px 14px; border-radius: 10px; transition: opacity .5s; font-size: .92rem; }
.toast.err { background: var(--warn-ink); color: var(--bg); } .toast.ok { background: var(--good); color: var(--good-ink); } .toast a { color: inherit; font-weight: 700; } .toast.gone { opacity: 0; }
.printsheet { display: none; }
@media (max-width: 480px) { .back-t { display: none; } .bar { gap: 6px; padding: 8px 10px; } .session { gap: 4px; } .session .pill { padding: 5px 9px; font-size: .82rem; }
  .brand strong { font-size: 1rem; } .panel { padding: 14px; } .segb { padding: 6px 10px; font-size: .84rem; } .velvet { padding: 6px 2px 2px; margin: 0 -6px; } }
.swipehint { display: none; }
@media (max-width: 640px) { .velvet { overflow-x: auto; overscroll-behavior-x: contain; } .stage svg { min-width: 600px; } .swipehint { display: block; margin: 6px 0 0; } }
.stage .charm { touch-action: none; }
@media (prefers-reduced-motion: reduce) { .stage.shake .swing { animation: none; } }
@media print {
  @page { margin: 14mm; }
  html, body { background: #fff; color: #000; }
  body > *:not(.printsheet) { display: none !important; }
  .printsheet { display: block; font-family: Georgia, "Times New Roman", serif; color: #000; }
  .printsheet h1 { font-size: 24pt; font-weight: 400; text-align: center; margin: 0 0 8pt; }
  .part svg { width: 100%; height: auto; display: block; margin: 0 auto 12pt; }
  .printsheet ol { font-size: 11pt; padding-left: 18pt; } .printsheet li { margin: 0 0 6pt; break-inside: avoid; } .printsheet li i { display: block; color: #333; }
  .pfoot { text-align: center; font-size: 9pt; color: #555; margin-top: 14pt; }
}
