/* ==========================================================================
   Components (v2) — class names shared by every page
   ========================================================================== */

/* ---------- Buttons: rectangular, small-caps, arrow-led ---------- */
.btn {
  --btn-bg: var(--ink-3); --btn-fg: var(--bone); --btn-bd: var(--line-2);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.9em;
  min-height: 52px; padding: 0 1.4rem;
  border-radius: 14px;
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg); color: var(--btn-fg);
  font-family: var(--f-display); font-weight: 600;
  font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap; cursor: pointer; user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease);
}
.btn .i { width: 1.25em; height: 1.25em; transition: transform var(--t) var(--ease-out); }
.btn:hover { --btn-bg: var(--ink-4); --btn-bd: var(--line-3); }
.btn:hover .i:last-child:not(:first-child) { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn--primary { --btn-bg: var(--flare); --btn-fg: #fff; --btn-bd: var(--flare); }
.btn--primary:hover { --btn-bg: #c02820; --btn-bd: #c02820; }
.btn--light { --btn-bg: var(--bone); --btn-fg: #120d0c; --btn-bd: var(--bone); }
.btn--light:hover { --btn-bg: #fff; --btn-bd: #fff; }
.btn--wine { --btn-bg: var(--wine); --btn-fg: var(--bone); --btn-bd: var(--wine); }
.btn--wine:hover { --btn-bg: var(--crimson); --btn-bd: var(--crimson); }
.btn--outline { --btn-bg: transparent; --btn-bd: var(--line-3); }
.btn--outline:hover { --btn-bg: var(--bone); --btn-fg: #120d0c; --btn-bd: var(--bone); }
.btn--ghost { --btn-bg: transparent; --btn-bd: transparent; color: var(--bone-2); }
.btn--ghost:hover { --btn-bg: var(--hover); --btn-bd: transparent; color: var(--bone); }
.btn--danger { --btn-bg: transparent; --btn-bd: rgba(217, 47, 40, 0.5); --btn-fg: var(--flare-text); }
.btn--sm { min-height: 42px; padding: 0 1.05rem; font-size: 0.72rem; border-radius: 12px; }
.btn--lg { min-height: 60px; padding: 0 1.8rem; font-size: 0.85rem; }
.btn--block { width: 100%; justify-content: space-between; }
.btn--icon { width: 52px; padding: 0; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.link-arrow {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--f-display); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; color: var(--bone);
  padding-bottom: 4px; border-bottom: 1.5px solid var(--flare);
  width: fit-content; max-width: 100%;
}
.link-arrow .i { transition: transform var(--t) var(--ease-out); }
.link-arrow:hover .i { transform: translateX(4px); }
.link-caps { font-family: var(--f-display); font-weight: 500; font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; }

/* ---------- Surfaces ---------- */
.card {
  position: relative;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(1.2rem, 0.9rem + 1.2vw, 2rem);
}
.card--raised { background: var(--ink-3); }
.card--flat { background: transparent; }
.card--tight { padding: var(--s-4); }
.card--red { background: linear-gradient(160deg, var(--wine), var(--oxblood)); border-color: transparent; }
.card__title { font-size: var(--t-s); }
.card__title + * { margin-top: var(--s-2); }
.card__meta { color: var(--bone-3); font-size: var(--t-small); }
a.card { text-decoration: none; display: block; transition: border-color var(--t) var(--ease); }
a.card:hover { border-color: var(--line-3); }
.panel-title { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 600; font-size: var(--t-s); letter-spacing: -0.01em; margin-bottom: var(--s-4); }
.panel-title .i { color: var(--flare-text); }

/* ---------- Tiles: the reference's category blocks with a ghost word ---------- */
.tile {
  --tile-bg: var(--ink-3); --tile-fg: var(--bone); --tile-ghost: rgba(239, 230, 220, 0.06);
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; gap: var(--s-3);
  min-height: 15rem;
  padding: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  border-radius: var(--r-lg);
  background: var(--tile-bg); color: var(--tile-fg);
  text-decoration: none;
  transition: transform var(--t) var(--ease-out), background var(--t);
}
.tile::before {
  content: attr(data-ghost);
  position: absolute; z-index: -1; left: -0.04em; bottom: -0.16em;
  font-family: var(--f-display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(4rem, 2rem + 6vw, 7.5rem); line-height: 1; letter-spacing: -0.05em;
  color: var(--tile-ghost); white-space: nowrap; pointer-events: none;
}
.tile:hover { transform: translateY(-4px); }
.tile--wine { --tile-bg: var(--wine); --tile-ghost: rgba(0, 0, 0, 0.2); }
.tile--oxblood { --tile-bg: var(--oxblood); --tile-ghost: rgba(239, 230, 220, 0.06); }
.tile--flare { --tile-bg: var(--flare); --tile-fg: #fff; --tile-ghost: rgba(0, 0, 0, 0.18); }
.tile--bone { --tile-bg: var(--paper); --tile-fg: #140e0d; --tile-ghost: rgba(20, 14, 13, 0.07); }
.tile--char { --tile-bg: var(--ink-3); }
.tile__icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: rgba(0,0,0,0.28); color: currentColor; }
.tile--bone .tile__icon { background: rgba(20, 14, 13, 0.08); }
.tile__icon .i { width: 21px; height: 21px; }
.tile h3 { font-family: var(--f-display); font-weight: 600; text-transform: uppercase; font-size: clamp(1.15rem, 1rem + 0.6vw, 1.5rem); line-height: 1.02; letter-spacing: -0.01em; max-width: 13ch; }
.tile p { font-size: var(--t-small); line-height: 1.45; opacity: 0.82; max-width: 30ch; }
.tile__foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 500; font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.85; }
.tile__foot .i { width: 30px; height: 30px; stroke-width: 1.4; transition: transform var(--t) var(--ease-out); }
.tile:hover .tile__foot .i { transform: translateX(6px); }

/* ---------- Chips, tags, badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 0.45em;
  min-height: 32px; padding: 0.2rem 0.85rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: transparent; color: var(--bone-2);
  font-size: 0.8rem; font-weight: 500; line-height: 1.2;
  text-decoration: none; white-space: nowrap; max-width: 100%;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
a.chip:hover, button.chip:hover { border-color: var(--line-3); color: var(--bone); }
.chip--red { background: rgba(217, 47, 40, 0.14); border-color: rgba(217, 47, 40, 0.45); color: #ffc2bb; }
.chip--brass { background: var(--brass-soft); border-color: rgba(201, 162, 106, 0.4); color: #ebd2ad; }
.chip--ok { background: var(--ok-soft); border-color: rgba(92, 195, 143, 0.4); color: #aee6c8; }
.chip--warn { background: var(--warn-soft); border-color: rgba(232, 173, 75, 0.4); color: #f4d49c; }
.chip--ghost { border-style: dashed; }
.chip--solid { background: var(--bone); color: #120d0c; border-color: var(--bone); font-weight: 600; }
.chip[aria-pressed="true"], .chip.is-active { background: var(--bone); color: #120d0c; border-color: var(--bone); }
.chip .i { width: 14px; height: 14px; }
.chip--wrap, .pair-card .chip, .dec-result .chip, .idcard .chip { white-space: normal; text-align: left; }
.tag { display: inline-block; font-family: var(--f-display); font-size: var(--t-micro); font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--flare-text); }
.code-badge { white-space: nowrap; display: inline-flex; align-items: center; font-family: var(--f-display); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.16em; padding: 0.3rem 0.65rem; border-radius: var(--r-pill); background: var(--bone); color: #120d0c; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 8px; }
.field + .field { margin-top: var(--s-5); }
.label { font-family: var(--f-display); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bone-2); }
.hint { font-size: 0.84rem; color: var(--bone-3); text-transform: none; letter-spacing: 0; font-family: var(--f-ui); font-weight: 400; }
.input, .select, .textarea {
  width: 100%; min-height: 54px;
  padding: 0.8rem 1rem;
  background: var(--ink-1);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  color: var(--bone);
  font-size: 16px;
  transition: border-color var(--t-fast), background var(--t-fast);
  -webkit-appearance: none; appearance: none;
}
.textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--bone-4); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--bone); background: var(--ink-2); outline: none; }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--flare-hi); }
.select { padding-right: 2.8rem; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23efe6dc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; }
.select:disabled, .input:disabled { opacity: 0.45; cursor: not-allowed; }
.select option, .select optgroup { background: var(--ink-2); color: var(--bone); }
.field-error { color: var(--flare-text); font-size: 0.86rem; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.field-error:empty { display: none; }

.search { position: relative; display: flex; align-items: center; }
.search > .i { position: absolute; left: 1.1rem; color: var(--bone-3); pointer-events: none; width: 20px; height: 20px; }
.search .input { padding-left: 3.1rem; min-height: 58px; border-radius: var(--r-pill); font-size: 17px; }

.check { position: relative; display: flex; align-items: flex-start; gap: 12px; min-height: 48px; padding: 12px 14px; border-radius: 12px; cursor: pointer; line-height: 1.4; transition: background var(--t-fast); }
.check:hover { background: var(--hover); }
.check input { -webkit-appearance: none; appearance: none; flex: none; width: 22px; height: 22px; margin: 0; border: 1.5px solid var(--line-3); border-radius: 6px; background: var(--ink-1); display: grid; place-items: center; cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast); }
.check input[type="radio"] { border-radius: 50%; }
.check input::after { content: ""; width: 11px; height: 6px; border-left: 2.5px solid #120d0c; border-bottom: 2.5px solid #120d0c; transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform var(--t-fast) var(--ease-spring); }
.check input[type="radio"]::after { width: 8px; height: 8px; border: 0; border-radius: 50%; background: #120d0c; transform: scale(0); }
.check input:checked { background: var(--bone); border-color: var(--bone); }
.check input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.check input[type="radio"]:checked::after { transform: scale(1); }
.check input:focus-visible { box-shadow: var(--focus-ring); }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--ink-2); cursor: pointer; }
.switch input { -webkit-appearance: none; appearance: none; flex: none; width: 50px; height: 30px; border-radius: 999px; background: var(--ink-4); border: 1px solid var(--line-2); position: relative; cursor: pointer; transition: background var(--t) var(--ease); margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--bone); transition: transform var(--t) var(--ease-spring); }
.switch input:checked { background: var(--flare); border-color: var(--flare); }
.switch input:checked::after { transform: translateX(20px); background: #fff; }
.switch input:focus-visible { box-shadow: var(--focus-ring); }
.switch__text strong { display: block; font-weight: 600; }
.switch__text small { color: var(--bone-3); }

.options { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); }

/* ---------- Range ---------- */
.range { --pct: 50%; -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; cursor: pointer; margin: 0; touch-action: pan-y; }
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--flare) 0 var(--pct), var(--ink-4) var(--pct) 100%); }
.range::-moz-range-track { height: 4px; border-radius: 4px; background: var(--ink-4); }
.range::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--flare); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -13px; border-radius: 50%; background: var(--bone); border: 0; box-shadow: 0 0 0 6px rgba(217, 47, 40, 0.28), 0 4px 14px rgba(0,0,0,.6); transition: transform var(--t-fast) var(--ease-spring); }
.range::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--bone); border: 0; box-shadow: 0 0 0 6px rgba(217, 47, 40, 0.28); }
.range:active::-webkit-slider-thumb { transform: scale(1.12); }
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--ink), 0 0 0 6px var(--focus); }
.range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--ink), 0 0 0 6px var(--focus); }
.range:disabled { opacity: 0.35; cursor: not-allowed; }
.range--dual::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--wine), var(--ink-4) 50%, var(--brass)); }
.range--dual::-moz-range-progress { background: transparent; }

.slider { padding: var(--s-4) 0 var(--s-3); border-bottom: 1px solid var(--line); }
.slider__head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.slider__label { font-weight: 600; line-height: 1.35; }
.slider__value { font-family: var(--f-display); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 1.25rem; min-width: 3.2ch; text-align: right; }
.slider__ends { display: flex; justify-content: space-between; gap: 12px; font-size: 0.78rem; color: var(--bone-3); margin-top: -4px; }
.slider__ends span:last-child { text-align: right; }
.slider.is-touched .slider__value { color: var(--flare-text); }

/* ---------- Tabs: editorial underline ---------- */
.tabs { display: flex; gap: clamp(1rem, 0.5rem + 1.5vw, 2.25rem); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; flex: none;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 52px;
  font-family: var(--f-display); font-weight: 500; font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--bone-3); white-space: nowrap;
  transition: color var(--t-fast);
}
.tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--flare); transform: scaleX(0); transform-origin: left; transition: transform var(--t) var(--ease-out); }
.tab:hover { color: var(--bone); }
.tab[aria-selected="true"] { color: var(--bone); }
.tab[aria-selected="true"]::after { transform: scaleX(1); }
.tab .i { width: 16px; height: 16px; }

/* ---------- Accordion: hairline list ---------- */
.accordion { display: grid; border-top: 1px solid var(--line); }
.acc { border-bottom: 1px solid var(--line); }
.acc > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; padding: 16px 0; font-family: var(--f-display); font-weight: 500; font-size: clamp(1.05rem, 0.98rem + 0.3vw, 1.25rem); letter-spacing: -0.01em; line-height: 1.3; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary::after { content: "+"; flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); font-family: var(--f-ui); font-size: 1.2rem; font-weight: 300; transition: transform var(--t) var(--ease-out), background var(--t); }
.acc[open] > summary::after { transform: rotate(45deg); background: var(--bone); color: #120d0c; border-color: var(--bone); }
.acc > summary:hover { color: var(--bone); }
.acc__body { padding: 0 0 24px; color: var(--bone-2); max-width: 64ch; }
.acc__body > * + * { margin-top: 0.8em; }
.acc__body ul { padding-left: 1.2em; }
.acc__body li + li { margin-top: 0.35em; }

/* ---------- Notices ---------- */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--ink-2); color: var(--bone-2); font-size: 0.94rem; line-height: 1.45; }
.notice .i { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.notice strong { color: var(--bone); }
.notice--info { border-color: rgba(147, 179, 226, 0.35); } .notice--info .i { color: var(--info); }
.notice--ok { border-color: rgba(92, 195, 143, 0.35); } .notice--ok .i { color: var(--ok); }
.notice--warn { border-color: rgba(232, 173, 75, 0.35); } .notice--warn .i { color: var(--warn); }
.notice--danger { border-color: rgba(217, 47, 40, 0.5); background: rgba(46, 8, 12, 0.6); } .notice--danger .i { color: var(--flare-hi); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: var(--z-toast); left: 50%; bottom: calc(var(--safe-bottom) + 24px); transform: translateX(-50%); display: grid; gap: 8px; width: min(100% - 24px, 460px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 14px; background: var(--bone); color: #120d0c; font-weight: 600; font-size: 0.94rem; box-shadow: 0 20px 50px -12px rgba(0,0,0,.85); animation: toast-in var(--t-slow) var(--ease-out); }
.toast .i { flex: none; width: 20px; height: 20px; }
.toast--ok .i { color: #1c7a4d; }
.toast--error { background: var(--oxblood); color: #ffd7d2; }
.toast--error .i { color: var(--flare-hi); }
.toast.is-out { opacity: 0; transform: translateY(8px); transition: opacity var(--t), transform var(--t); }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Progress / stepper ---------- */
.progress { height: 3px; border-radius: 3px; background: var(--ink-4); overflow: hidden; }
.progress__bar { display: block; height: 100%; width: var(--value, 0%); background: var(--flare); transition: width var(--t-slow) var(--ease-out); }
.stepper { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; overflow-x: auto; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.stepper li { flex: 1 0 auto; }
.stepper button { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px 6px 0 0; text-align: left; font-family: var(--f-display); font-weight: 500; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bone-3); white-space: nowrap; }
.stepper button::before { content: ""; display: block; width: 100%; height: 3px; border-radius: 3px; background: var(--ink-4); transition: background var(--t); }
.stepper button[aria-current="step"] { color: var(--bone); }
.stepper button[aria-current="step"]::before { background: var(--flare); }
.stepper button.is-done::before { background: var(--wine); }
.stepper button.is-done { color: var(--bone-2); }

/* ---------- Stats / kv ---------- */
.stat { padding: var(--s-5) 0; border-top: 1px solid var(--line); }
.stat__value { font-family: var(--f-display); font-size: var(--t-l); font-weight: 600; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat__label { margin-top: 8px; font-family: var(--f-display); font-size: var(--t-micro); color: var(--bone-3); text-transform: uppercase; letter-spacing: 0.18em; font-weight: 500; }
.kv { display: grid; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--bone-3); font-size: 0.92rem; }
.kv dd { font-weight: 600; text-align: right; }

/* ---------- States ---------- */
.state { display: grid; justify-items: center; text-align: center; gap: var(--s-3); padding: clamp(2.5rem, 2rem + 3vw, 4rem) var(--s-5); border: 1px dashed var(--line-2); border-radius: var(--r-lg); color: var(--bone-2); }
.state__icon { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 50%; background: var(--ink-3); color: var(--bone-2); }
.state__icon .i { width: 26px; height: 26px; }
.state h1, .state h2, .state h3 { font-size: var(--t-m); color: var(--bone); }
.state p { max-width: 46ch; }
.spinner { width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--flare); animation: spin 0.8s linear infinite; }
.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--ink-2), var(--ink-3), var(--ink-2)); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Media ---------- */
.frame { display: block; position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--ink-2); }
.frame img, .frame video { width: 100%; height: 100%; object-fit: cover; }
.frame--4x3 { aspect-ratio: 4 / 3; } .frame--16x9 { aspect-ratio: 16 / 9; } .frame--3x4 { aspect-ratio: 3 / 4; } .frame--1x1 { aspect-ratio: 1; }
.frame--sharp { border-radius: 0; }
.media-hover img { transition: transform 1200ms var(--ease-out), filter 600ms var(--ease); }
a:hover .media-hover img, .media-hover:hover img { transform: scale(1.045); }
.badge-float { position: absolute; top: 14px; right: 14px; z-index: 2; }

/* ---------- Identity card: a poster, not a widget ---------- */
.idcard {
  --idc-accent: var(--wine);
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; gap: var(--s-4); align-content: start;
  padding: clamp(1.4rem, 1rem + 1.6vw, 2.4rem);
  border-radius: var(--r-xl);
  background: linear-gradient(165deg, var(--idc-accent), var(--oxblood) 70%, #1a0507);
  color: var(--bone);
}
.idcard::after { content: attr(data-ghost); position: absolute; z-index: -1; right: -0.05em; bottom: -0.2em; font-family: var(--f-display); font-weight: 700; font-size: clamp(6rem, 3rem + 8vw, 11rem); line-height: 1; letter-spacing: -0.06em; color: rgba(0, 0, 0, 0.22); pointer-events: none; }
.idcard--gay { --idc-accent: #8f1622; }
.idcard--queer { --idc-accent: #4a1a3a; }
.idcard--kink { --idc-accent: #5a2a18; }
.idcard--mbti { --idc-accent: #23262e; }
.idcard__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.idcard__label { font-family: var(--f-display); font-size: var(--t-micro); letter-spacing: 0.2em; text-transform: uppercase; font-weight: 600; color: rgba(239, 230, 220, 0.75); }
.idcard__code { font-family: var(--f-display); font-weight: 700; font-size: clamp(3.6rem, 2rem + 6vw, 7rem); line-height: 0.82; letter-spacing: -0.04em; }
.idcard__name { font-family: var(--f-display); font-size: var(--t-l); font-weight: 600; line-height: 0.98; letter-spacing: -0.03em; }
.idcard__title { font-family: var(--f-read); font-style: italic; font-size: var(--t-s); color: rgba(239, 230, 220, 0.82); }
.idcard__foot { display: flex; flex-wrap: wrap; gap: 8px; }
.idcard--compact { padding: var(--s-6); border-radius: var(--r-lg); min-height: 14rem; }
.idcard--compact .idcard__code { font-size: clamp(2.6rem, 2rem + 2vw, 3.6rem); }
.idcard--compact .idcard__name { font-size: var(--t-m); }
.idcard--compact .idcard__title { font-size: 1rem; }
.idcard--empty { background: var(--ink-2); border: 1px dashed var(--line-2); }
.idcard--empty .idcard__code { color: var(--ink-4); }

/* spectrum bars */
.spectrum { display: grid; gap: 8px; }
.spectrum__poles { display: flex; justify-content: space-between; gap: 10px; font-size: 0.86rem; font-weight: 500; color: var(--bone-3); }
.spectrum__poles .is-lead { color: var(--bone); font-weight: 600; }
.spectrum__track { position: relative; height: 6px; border-radius: 6px; background: var(--ink-4); overflow: hidden; }
.spectrum__fill { position: absolute; inset: 0 auto 0 0; width: var(--v, 50%); background: var(--flare); border-radius: inherit; transition: width var(--t-slow) var(--ease-out); }
.spectrum__mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--ink); }
.spectrum__val { font-family: var(--f-display); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bone-3); }

.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
.table th, .table td { padding: 14px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { font-family: var(--f-display); font-size: var(--t-micro); letter-spacing: 0.16em; text-transform: uppercase; color: var(--bone-3); font-weight: 600; }

kbd { font-family: var(--font-mono); font-size: 0.78em; padding: 0.1em 0.45em; border-radius: 5px; border: 1px solid var(--line-2); background: var(--ink-2); color: var(--bone-2); }

/* ---------- Utilities ---------- */
@media (max-width: 479px) { .hide-sm { display: none !important; } }
@media (min-width: 1100px) { .hide-lg { display: none !important; } }
@media (max-width: 1099.98px) { .show-lg { display: none !important; } }

/* seg (radio pills) — shared with the Decoder */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg__opt { position: relative; flex: 1 1 auto; }
.seg__opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg__opt span { display: flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line-2); font-family: var(--f-display); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--bone-2); text-align: center; transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast); }
.seg__opt input:hover + span { border-color: var(--bone-3); color: var(--bone); }
.seg__opt input:checked + span { background: var(--bone); border-color: var(--bone); color: #120d0c; }
.seg__opt input:focus-visible + span { box-shadow: var(--focus-ring); }

.chip[aria-pressed="true"] .muted, .chip.is-active .muted, .chip--solid .muted { color: #4d3f3b; }
