/* ── 60-modals.css — Rack-edit / friend / account / login / alert modals ── */
  /* ═══════════════════════════════════════════════════════════════════
     Rack create/edit — RIGHT SIDE-CARD (was a centred modal). Inherits the
     slide/position/shadow from `.detail-panel`; only the width and the
     header / scrolling-body / pinned-footer layout are set here.
     ═══════════════════════════════════════════════════════════════════ */
  /* Side padding lives in ONE token, and every selector below is 3-class deep on
     purpose: the global `.panel-body { padding: 0 0 24px }` in 70-detail-misc.css
     loads AFTER this file, so a plain `.rec-body` loses the cascade race and the
     content ends up glued to the panel edges. Same trick the Add-product panel uses. */
  /* No scrim behind these side-cards — they are editors, not blocking dialogs, and
     the inventory they act on should stay readable underneath. Both overlays stay
     in the DOM (and keep pointer-events) so click-outside still closes. */
  #rackEditOverlay,
  #addProductOverlay { background: transparent; }

  .rec-panel { --rec-side-padding: 20px; }
  .rec-panel.detail-panel {
    width: min(400px, calc(100vw - 32px));
    display: flex; flex-direction: column;
  }
  .rec-panel .panel-header.rec-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px var(--rec-side-padding); flex: 0 0 auto;
    /* No rule under the title — the numbered sections already structure the panel,
       so the generic `.panel-header` divider (70-detail-misc.css) is dropped here. */
    border-bottom: 0;
  }
  .rec-header-text { flex: 1; min-width: 0; }
  .rec-title { font-size: 17px; font-weight: 700; color: var(--text); }

  /* Body scrolls on its own so the footer actions stay reachable on short screens. */
  .rec-panel .panel-body.rec-body {
    display: flex; flex-direction: column; gap: 16px;
    padding: 8px var(--rec-side-padding) 18px;
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
    scrollbar-width: none;
  }
  .rec-panel .panel-body.rec-body::-webkit-scrollbar { width: 0; height: 0; }
  .rec-field { display: flex; flex-direction: column; gap: 6px; }
  .rec-field-label {
    font-size: 12px; font-weight: 600; letter-spacing: 0;
    color: var(--muted);
  }
  .rec-field input {
    padding: 10px 12px;
    background: var(--surface-2); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text); font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s, background .15s;
  }
  .rec-field input:focus { border-color: var(--primary); background: var(--surface); }

  /* Field-level validation — red border + small bubble below/over the input */
  .rec-field { position: relative; }
  .rec-field.is-invalid input {
    border-color: var(--danger) !important;
    background: var(--danger-soft) !important;
  }
  .rec-field.is-invalid input:focus {
    box-shadow: 0 0 0 3px rgba(220,38,38,.18);
  }
  .rec-field-err {
    position: absolute;
    left: 0; top: calc(100% + 6px);
    background: var(--danger);
    color: var(--on-accent);
    font-size: 11.5px; font-weight: 600;
    padding: 5px 9px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(220,38,38,.28);
    z-index: 10;
    white-space: nowrap;
    animation: recFieldErrIn .18s ease-out;
  }
  /* Speech-bubble pointer */
  .rec-field-err::before {
    content: "";
    position: absolute;
    top: -4px; left: 12px;
    width: 8px; height: 8px;
    background: var(--danger);
    transform: rotate(45deg);
  }
  @keyframes recFieldErrIn {
    from { opacity: 0; transform: translateY(-3px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Dimension stepper — ONE grouped control [− | value | +], not three floating
     boxes: the buttons share the field's border so it reads as a single input,
     which is how the rest of the app renders segmented controls. */
  .rec-stepper {
    display: flex; align-items: stretch;
    background: var(--surface-2);
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color .15s, background .15s;
  }
  .rec-stepper:focus-within { border-color: var(--primary); background: var(--surface); }
  .rec-step {
    flex: 0 0 44px;
    /* Same reason as the calibration stepper: the global `button { height: 40px }`
       would fix these at 40px instead of following the wrapper's height, so the
       hover fill would stop short of the top and bottom edges. */
    height: auto; align-self: stretch;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: 0;
    /* Square the button off: the wrapper's own radius + overflow:hidden already
       shape the two outer corners, so any radius here just carves the hover fill. */
    border-radius: 0;
    color: var(--muted); font-family: inherit; font-size: 18px; font-weight: 600;
    line-height: 1; cursor: pointer; user-select: none;
    transition: background .12s, color .12s;
  }
  .rec-step:hover  { background: var(--border); color: var(--primary-text); }
  .rec-step:active { background: var(--primary-soft); }
  /* Value sits flush between the buttons — the field's own border/background are
     dropped (the wrapper carries them) and the native spinners are hidden. */
  .rec-stepper input {
    flex: 1; min-width: 0; text-align: center;
    /* White value well between the two buttons, kept flush inside the wrapper's
       border via side rules instead of its own box. */
    background: var(--surface) !important;
    border: 0 !important;
    border-left: 1.5px solid var(--border) !important;
    border-right: 1.5px solid var(--border) !important;
    border-radius: 0 !important;
    font-size: 15px; font-weight: 700; font-family: var(--mono);
    -moz-appearance: textfield;
  }
  .rec-stepper input::-webkit-outer-spin-button,
  .rec-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  /* Total slots — prominent rounded card to emphasise the headline number
     (the actual capacity of the rack the user is about to create). */
  .rec-dim-total {
    margin: 12px auto 0;
    padding: 14px 24px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: var(--primary-soft);
    border: 1.5px solid var(--primary);
    border-radius: 16px;
    min-width: 180px;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 18%, transparent);
    /* Center the inline-flex element inside its block parent */
    align-self: center;
  }
  /* Wrap the row so the inline-flex card centers in the column */
  .rec-body > .rec-dim-total { align-self: center; }
  .rec-dim-total-num {
    font-size: 38px;
    font-weight: 800;
    line-height: 1;
    color: var(--primary-text);
    font-family: var(--mono);
    letter-spacing: -.02em;
  }
  .rec-dim-total-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-text);
    text-transform: uppercase;
    letter-spacing: .1em;
    opacity: .85;
  }
  .rec-field--dim { flex: 1; }
  .rec-field--dim input { text-align: center; font-family: var(--mono); font-weight: 700; font-size: 16px; }

  /* Numbered sections — the panel walks the user through three steps
     (identity → layout → preview) instead of one flat list of fields. */
  .rec-sec { display: flex; flex-direction: column; gap: 12px; }
  .rec-sec-head { display: flex; align-items: center; gap: 9px; }
  /* Geometry + skin only — centring comes from .circle-center (00-base.css). */
  .rec-sec-num {
    flex: 0 0 22px;
    background: var(--primary); color: var(--on-accent);
    font-size: 11.5px; font-weight: 800;
  }
  .rec-sec-title {
    font-size: 14px; font-weight: 700; letter-spacing: 0;
    color: var(--text);
  }

  /* Icon-prefixed text field: the icon lives inside the input's padding box. */
  .rec-input-wrap { position: relative; display: block; }
  /* Doubled class (0,2,0) to outrank the global `input[type="text"]` rule (0,1,1)
     further down this file, whose `padding: 0 12px` would sit the text under the icon. */
  .rec-input-wrap.rec-input-wrap input { width: 100%; padding-left: 40px; }
  .rec-input-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    background-color: var(--muted);
    pointer-events: none;
  }
  .rec-input-wrap input:focus + .rec-input-icon,
  .rec-input-wrap:focus-within .rec-input-icon { background-color: var(--primary); }

  /* The two dimensions sit side by side — they're read as one setting. */
  /* Two up, then the third on its own line. Three steppers abreast do not fit
     the panel's width — the values were being clipped — and the split is not
     arbitrary: levels and slots-per-level describe the FACE of the rack, depth
     describes what sits behind it. It keeps the SAME width as the other two
     rather than spanning the row: a stepper stretched to twice the width of its
     neighbours reads as a different kind of control. */
  .rec-dims { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .rec-dims .rec-field { min-width: 0; }

  .rec-dims .rec-step { flex: 0 0 34px; }

  /* Live preview — dashed slot grid + the headline capacity badge floating on it. */
  .rec-preview {
    position: relative;
    padding: 14px 16px 16px;
    background: var(--surface-2);
    border-radius: 14px;
    display: flex; flex-direction: column; gap: 8px;
  }
  /* Capacity reads as its own white card pinned to the preview's top-right corner,
     overlapping the edge — it's the headline figure, not part of the grid. */
  .rec-preview .rec-dim-total {
    position: absolute;
    top: -14px; right: 8px;
    margin: 0;
    padding: 8px 14px;
    min-width: 0;
    gap: 0;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .10);
  }
  .rec-preview .rec-dim-total-num { font-size: 24px; }
  .rec-preview .rec-dim-total-label { font-size: 9.5px; }
  /* Rack header echoed live — same name/subtitle pair the Storage view will show. */
  .rec-preview-head {
    display: flex; flex-direction: column; gap: 2px;
    min-width: 0; padding-right: 92px;
  }
  .rec-preview-name {
    font-size: 15px; font-weight: 700; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .rec-preview-name.is-placeholder { color: var(--muted); font-weight: 600; }
  .rec-preview-sub {
    font-size: 12px; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .rec-preview-caption {
    font-size: 12px; font-weight: 600; color: var(--muted);
    /* Left-aligned under the section title, clear of the corner card */
    align-self: flex-start; padding-right: 92px;
  }
  /* Same spacing as the Storage grid: 4px between slots, 6px between rows. */
  .rec-preview-grid { display: flex; flex-direction: column; gap: 6px; width: 100%; }
  .rec-prev-level { display: flex; gap: 4px; }
  .rec-prev-slot {
    flex: 1 1 0; min-width: 0; aspect-ratio: 1;
    border: 1.5px dashed var(--border);
    /* Matches the Storage grid's 5px corner, but falls back to a proportional
       radius on dense racks where a fixed 5px would round ~12px slots into dots. */
    border-radius: min(5px, 22%);
    /* White wells on the grey board — without a fill the dashed outlines wash out */
    background: var(--surface);
    /* Host for the borrowed `.rp-fill` / `.rp-photo` children, which position absolutely */
    position: relative; overflow: hidden;
  }
  /* Occupied slot when editing an existing rack. The markup borrows `.rp-slot` for
     its inner fill/photo styling, so re-assert the preview's own square geometry —
     `.rp-slot` is a 3/5 vertical rectangle. */
  .rec-prev-slot.rp-slot { aspect-ratio: 1; border-radius: min(5px, 22%); }
  .rec-prev-slot--filled { border-style: solid; }
  /* The "0g" depleted tag is sized for the full Storage grid — it overflows a
     preview slot, and the coloured strip alone already reads as "occupied". */
  .rec-prev-slot .rp-fill-empty-tag { display: none; }

  .rec-result {
    min-height: 16px; font-size: 12px; color: var(--danger-text);
    text-align: center; line-height: 1.4;
  }

  /* Pinned to the bottom of the side-card, above the scrolling body. 2-class deep
     for the same cascade reason as the header/body above. */
  .rec-panel .rec-footer {
    display: flex; gap: 8px; align-items: center;
    flex: 0 0 auto; padding: 12px var(--rec-side-padding) 18px;
    border-top: 1px solid var(--border); background: var(--surface);
  }
  /* All buttons keep their natural width; the <span flex:1> pushes
     primary action (Save/Create) to the right, Cancel stays to the left. */
  .rec-footer .adf-btn { flex: 0 0 auto; }
  /* Make sure the primary CTA still has comfortable width */
  .rec-footer .adf-btn--primary { min-width: 120px; }
  /* Icon-only variant — square button, no label */
  .adf-btn--icon {
    width: 38px; height: 38px;
    padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 auto !important;
    position: relative;
    overflow: hidden;
  }
  /* Hold-to-confirm progress fill — fills left-to-right while the user
     holds the button, completes after 1.5s to trigger the action.
     Default color = danger (red) for irreversible actions like Delete.
     Variant `--primary` = orange for recoverable actions like Clear all. */
  .hold-progress {
    position: absolute;
    inset: 0;
    width: 0;
    background: var(--danger);
    opacity: .35;
    pointer-events: none;
    transition: width 0s;
    z-index: 0;
  }
  .hold-progress--primary { background: var(--primary); }

  /* Make sure the button content sits above the progress fill */
  .adf-btn--icon > .icon,
  .adf-btn--secondary > .icon,
  .adf-btn--secondary > [data-i18n] { position: relative; z-index: 1; }

  /* Secondary button needs the same overflow trick to clip the fill */
  .adf-btn--secondary { position: relative; overflow: hidden; }

  /* Holding state — soft tint matching the variant color */
  .adf-btn--icon.is-holding {
    background: var(--danger-soft);
    border-color: var(--danger);
  }
  .adf-btn--icon.is-confirming { background: var(--danger); }
  .adf-btn--icon.is-confirming > .icon { background: var(--on-accent); }

  .adf-btn--secondary.is-holding {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary-text);
  }
  .adf-btn--secondary.is-holding > .icon { background: var(--primary); }
  .adf-btn--secondary.is-confirming { background: var(--primary); color: var(--on-accent); }
  .adf-btn--secondary.is-confirming > .icon { background: var(--on-accent); }

  /* Mark-as-deleted button inside the spool detail panel — full width,
     same hold-to-confirm pattern as the rack delete (red fill). */
  .panel-section--delete { padding-top: 18px; padding-bottom: 18px; }
  .panel-delete-btn {
    width: 100%;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 14px;
    background: transparent;
    border: 1.5px solid var(--danger);
    color: var(--danger-text);
    border-radius: 10px;
    font-size: 13px; font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    position: relative; overflow: hidden;
    transition: background .15s, color .15s;
  }
  .panel-delete-btn:hover { background: var(--danger-soft); }
  .panel-delete-btn > .icon { background: var(--danger); position: relative; z-index: 1; }
  .panel-delete-btn > [data-i18n] { position: relative; z-index: 1; }
  .panel-delete-btn.is-holding { background: var(--danger-soft); }
  .panel-delete-btn.is-confirming { background: var(--danger); color: var(--on-accent); }
  .panel-delete-btn.is-confirming > .icon { background: var(--on-accent); }
  /* Secondary action — neutral grey, less loud than primary */
  .adf-btn--secondary {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 14px;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s;
  }
  .adf-btn--secondary:hover { background: var(--surface); border-color: var(--primary); }
  .adf-btn--secondary:disabled { opacity: .5; cursor: not-allowed; }
  .adf-btn--danger {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 12px;
    background: transparent;
    border: 1.5px solid transparent;
    color: var(--danger-text);
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
  }
  .adf-btn--danger:hover {
    background: var(--danger-soft);
    border-color: var(--danger);
  }
  .adf-btn--danger .icon { background: var(--danger); }
  .adf-btn--danger:hover .icon { background: var(--danger); }

  /* ── Friend inventory panel ────────────────────────────────────────────── */
  #friendInvPanel { width: min(460px, 92vw); }
  .fi-avatar {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: var(--on-accent);
  }
  .dp-header-identity { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
  .fi-name { font-size: 15px; font-weight: 700; color: var(--text); }
  .fi-sub  { font-size: 11px; color: var(--muted); margin-top: 1px; }
  .fi-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
  .fi-loading { font-size: 13px; color: var(--muted); text-align: center; padding: 32px 0; }
  .fi-empty   { font-size: 13px; color: var(--muted); text-align: center; padding: 32px 0; }
  #friendInvGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .fi-spool-card {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 10px; padding: 10px; overflow: hidden;
  }
  .fi-spool-swatch {
    width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
  }
  .fi-spool-info    { min-width: 0; flex: 1; }
  .fi-spool-name    { font-size: 11px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fi-spool-meta    { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fi-spool-weight  { font-size: 11px; font-weight: 600; color: var(--primary-text); margin-top: 2px; }
  .stg-friends-actions { display: flex; gap: 8px; margin-top: 10px; }
  .stg-friends-actions .primary { flex: 1; }
  .stg-regen-btn { flex-shrink: 0; color: var(--muted); font-size: 11px; }

  /* ── Friend requests badge on settings button ── */
  .friends-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    margin-left: 5px;
    background: var(--primary);
    color: var(--on-accent);
    font-size: 10px;
    font-weight: 700;
    border-radius: 8px;
    line-height: 1;
    vertical-align: middle;
  }
  .friends-badge.hidden { display: none; }
  /* Friend-count variant (neutral) — distinct from the orange alert badge used
     for the notification bell. */
  .friends-badge--count {
    background: var(--surface-2);
    color: var(--muted);
    border: 1px solid var(--border);
  }

  /* ── Friend request incoming modal ──────────────────────────────────── */
  #friendRequestOverlay .frq-card {
    position: relative;
    width: min(320px, calc(100vw - 32px));
    display: flex; flex-direction: column; align-items: center;
    gap: 10px; padding: 32px 24px 24px; text-align: center;
  }
  .frq-close { position: absolute; top: 12px; right: 12px; }
  .frq-avatar {
    position: relative; overflow: hidden;
    width: 56px; height: 56px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 700; color: var(--on-accent);
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
  }
  /* Requester's real avatar photo, overlaid on top of the initials circle. */
  .frq-avatar-photo {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
  }
  .frq-name   { font-size: 18px; font-weight: 700; color: var(--text); }
  .frq-sub    { font-size: 13px; color: var(--muted); margin-top: -4px; }
  .frq-actions { display: flex; gap: 8px; margin-top: 8px; width: 100%; }
  .frq-btn-block  { flex: 1; color: var(--danger-text) !important; font-size: 11px; }
  .frq-btn-refuse { flex: 1; }
  .frq-btn-accept { flex: 2; }

  /* ── Add friend modal ────────────────────────────────────────────────── */
  /* ═══════════════════════════════════════════════════════════════════
     Add Friend modal — uses .modal-close (standard pattern, like other modals)
     ═══════════════════════════════════════════════════════════════════ */
  #addFriendOverlay .adf-card {
    width: min(360px, calc(100vw - 32px));
    padding: 22px 22px 20px;
    display: flex; flex-direction: column; gap: 14px;
  }

  /* Header — title text on the left, .modal-close button on the right */
  .adf-header {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  }
  .adf-header-text { flex: 1; min-width: 0; }
  .adf-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
  .adf-sub   { font-size: 12px; color: var(--muted); line-height: 1.4; }
  /* .modal-close already styled globally — no override needed */

  /* Body — code group + preview + result */
  .adf-body { display: flex; flex-direction: column; gap: 14px; }

  /* Code input */
  .adf-code-group {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 4px 0 2px;
  }
  .adf-seg {
    width: 100px; box-sizing: border-box;
    padding: 12px 0; font-size: 22px; font-weight: 700; letter-spacing: .14em;
    font-family: var(--mono);
    text-transform: uppercase; text-align: center;
    background: var(--surface-2); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text); outline: none;
    caret-color: var(--primary);
    transition: border-color .15s, background .15s;
  }
  .adf-seg::placeholder { color: var(--border); font-weight: 600; letter-spacing: .14em; }
  .adf-seg:focus { border-color: var(--primary); background: var(--surface); }
  .adf-sep {
    font-size: 22px; font-weight: 700; color: var(--muted); user-select: none;
    line-height: 1;
  }

  /* Preview card (live lookup result) */
  .adf-preview {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; background: var(--surface-2);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
  }
  .adf-preview.hidden { display: none; }
  .adf-preview-avatar {
    position: relative; overflow: hidden;   /* anchor + clip the .frq-avatar-photo overlay */
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: var(--on-accent);
  }
  .adf-preview-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .adf-preview-name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .adf-preview-status { font-size: 11px; color: var(--success-text); font-weight: 600; }
  /* Social proof — the person's friend count, shown while adding them. */
  .adf-preview-count { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start;
    font-size: 11px; font-weight: 600; color: var(--muted); }
  .adf-preview-count[hidden] { display: none; }
  .adf-preview-count .icon { background-color: var(--muted); }
  .adf-preview-check {
    width: 22px; height: 22px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--success); border-radius: 50%; color: var(--on-accent);
  }

  /* Result line (errors, hints) */
  .adf-result {
    min-height: 16px; font-size: 12px; color: var(--muted);
    text-align: center; line-height: 1.4;
  }
  .adf-result.adf-result--error   { color: var(--danger-text); }
  .adf-result.adf-result--success { color: var(--success-text); }

  /* Footer — same pattern as other modals (.ghost / .primary buttons) */
  .adf-footer { display: flex; gap: 8px; }
  .adf-footer .adf-btn { flex: 1; }
  .adf-btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px;          /* spinner + label spacing when loading; no-op otherwise */
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: background .15s, border-color .15s, color .15s;
  }
  .adf-btn:disabled { opacity: .5; cursor: not-allowed; }
  .adf-btn--ghost {
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  }
  .adf-btn--ghost:hover { background: var(--surface); border-color: var(--muted); }
  .adf-btn--primary {
    background: var(--primary); border: 1px solid var(--primary); color: var(--on-accent);
    flex: 1.5 !important;
  }
  .adf-btn--primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }

  /* settings panel — light-theme overrides for dark sidebar components */
  #settingsPanel .sb-field-label { color: var(--muted); }
  #settingsPanel .sb-field-input {
    background: var(--surface-2); border-color: var(--border); color: var(--text);
  }
  #settingsPanel .sb-field-input:focus { border-color: var(--primary); background: var(--primary-soft); }
  #settingsPanel .sb-eye {
    background: var(--surface-2); border-color: var(--border); color: var(--muted);
  }
  #settingsPanel .sb-eye:hover { background: var(--border) !important; color: var(--text) !important; }
  #settingsPanel .sb-config-save { height: 32px; }

  /* add account button */
  .stg-add-btn {
    width: 100%; height: 32px; margin-top: 12px; border-radius: 8px;
    border: 1.5px dashed var(--border); background: none;
    color: var(--muted); font-size: 12px; font-weight: 600;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: border-color .15s, color .15s, background .15s;
  }
  .stg-add-btn:hover { border-color: var(--primary); color: var(--primary-text); background: var(--primary-soft); }

  /* ── modals ── */
  .modal-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(10,12,24,.55); backdrop-filter: blur(7px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    /* Closed = hidden, not just transparent. An `opacity: 0` overlay is still
       composited, and with `backdrop-filter` each one is a full-window blurred
       surface at Retina scale: ~40 closed overlays blew the compositor's tile
       budget ("tile memory limits exceeded") and the app flickered. Visibility
       flips after the fade-out, and at once on opening. */
    visibility: hidden; transition: opacity .2s, visibility 0s linear .2s;
  }
  /* No blur AND no dim backdrop for these — the view behind stays fully visible. */
  #whatsNewOverlay, #colorEditModalOverlay, #td1sConnectModalOverlay {
    background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  /* Manage profiles + edit profile: keep the dim, drop the background blur. */
  #profilesModalOverlay,
  #editAccountModalOverlay { backdrop-filter: none; -webkit-backdrop-filter: none; }

  /* ── "Add an avatar" fun nudge ───────────────────────────────────────── */
  .avp-card {
    width: min(380px, 92vw); text-align: center;
    padding: 28px 26px 24px; overflow: hidden; position: relative;
  }
  .avp-burst {
    position: relative; height: 96px; margin: 4px 0 18px;
    display: flex; align-items: center; justify-content: center;
  }
  .avp-avatar-ph {
    width: 84px; height: 84px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-hi));
    box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 35%, transparent);
    animation: avp-pop .5s cubic-bezier(.34,1.56,.64,1) both;
  }
  .avp-avatar-ph .icon { background: var(--on-accent); }
  /* Concentric pulsing rings — a clean "spotlight on you" beat, no emoji. */
  .avp-ring {
    position: absolute; top: 50%; left: 50%;
    width: 84px; height: 84px; border-radius: 50%;
    border: 2px solid var(--primary);
    transform: translate(-50%, -50%); opacity: 0;
    animation: avp-ring 2.2s ease-out infinite;
  }
  .avp-ring--2 { animation-delay: 1.1s; }
  @keyframes avp-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
  @keyframes avp-ring {
    0%   { opacity: .45; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0;   transform: translate(-50%, -50%) scale(2); }
  }
  .avp-title { margin: 0 0 8px; font-size: 19px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
  .avp-body  { margin: 0 0 20px; font-size: 13px; line-height: 1.5; color: var(--muted); }
  .avp-actions { display: flex; gap: 10px; }
  .avp-skip {
    flex: 0 0 auto; padding: 0 16px; height: 42px; border-radius: 11px;
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer;
    font-family: inherit; transition: background .15s, color .15s;
  }
  .avp-skip:hover { background: var(--surface); color: var(--text); }
  .avp-cta {
    flex: 1; height: 42px; border-radius: 11px; border: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-hi));
    color: var(--on-accent); font-size: 14px; font-weight: 700; cursor: pointer;
    font-family: inherit; box-shadow: 0 4px 16px color-mix(in srgb, var(--primary) 40%, transparent);
    transition: filter .15s, transform .1s;
  }
  .avp-cta:hover { filter: brightness(1.07); }
  .avp-cta:active { transform: translateY(1px); }
  @media (prefers-reduced-motion: reduce) {
    .avp-avatar-ph { animation: none; }
    .avp-ring { display: none; }
  }
  .modal-overlay.open { opacity: 1; pointer-events: auto; visibility: visible; transition-delay: 0s; }
  .modal-card {
    background: var(--surface); border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: 0 32px 80px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.08);
    padding: 28px 24px 22px; width: 340px; max-width: calc(100vw - 32px);
    transform: scale(.92) translateY(14px);
    transition: transform .22s cubic-bezier(.34,1.3,.64,1);
  }
  .modal-overlay.open .modal-card { transform: scale(1) translateY(0); }
  /* ── Edit account — a LEFT side card, not a centred modal ──────────────────
     The account lives in the left sidebar, so the editor unfolds from the side
     you clicked instead of jumping to the middle of the screen. It reuses the
     `.detail-panel` idiom (fixed, inset 8px top/bottom, rounded on the inner
     edge only, slide on transform) mirrored horizontally: anchored left,
     rounded on the RIGHT, entering from translateX(-100%).

     The overlay keeps its id and its `.open` class, so openEditAccountModal /
     closeEditAccountModal need no changes — only the geometry moved. */
  #editAccountModalOverlay { align-items: stretch; justify-content: flex-start; }
  #editAccountModalOverlay .modal-card {
    padding: 0; overflow: hidden;
    width: 380px; max-width: 95vw;
    margin: 8px 0; border-radius: 0 16px 16px 0; border-left: none;
    display: flex; flex-direction: column;
    /* Overrides .modal-card's scale/translateY pop — a side panel slides. */
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .25s;
    box-shadow: none;
  }
  #editAccountModalOverlay.open .modal-card {
    transform: translateX(0);
    box-shadow: 8px 0 32px var(--glass-lo);
  }

  /* Title bar — matches the other side panels' header. */
  .eac-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 13px 14px 13px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex: 0 0 auto;
  }
  .eac-panel-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 700; color: var(--text);
  }
  .eac-panel-title .icon { background-color: var(--muted); }
  .eac-close { position: static; flex-shrink: 0; }

  .eac-hero {
    position: relative; display: flex; flex-direction: column; align-items: stretch;
    padding: 18px 20px 18px;
    background: linear-gradient(170deg, var(--surface-2) 0%, var(--surface) 100%);
    border-bottom: 1px solid var(--border);
    flex: 0 0 auto;
  }
  .eac-ident { display: flex; flex-direction: row; align-items: center; gap: 14px; }
  .eac-ident-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  .eac-avatar {
    position: relative;       /* anchor for the .sb-avatar-photo overlay
                                 and the absolutely-positioned avatar menu */
    width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hi) 100%);
    color: var(--on-accent); display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700; letter-spacing: -.02em;
    box-shadow: 0 6px 22px color-mix(in srgb, var(--primary) 32%, transparent);
    /* overflow: visible so the popover menu can extend below the avatar.
       The avatar's circle look is preserved because (a) border-radius
       still clips the background gradient, and (b) the .sb-avatar-photo
       <img> child carries its own border-radius: 50%. */
  }
  /* The hover overlay needs its own circular clip since the parent
     doesn't have overflow:hidden anymore. */
  .eac-avatar .eac-avatar-hover-overlay { border-radius: 50%; }
  /* Discord-style hover overlay on the edit-account avatar — pure CSS
     show/hide on :hover, no JS. A click opens the identity window
     (openIdentityModal). */
  .eac-avatar-editable { cursor: pointer; }
  .eac-avatar-hover-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--scrim);
    opacity: 0; transition: opacity .15s;
    pointer-events: none;        /* clicks reach the parent .eac-avatar */
    z-index: 2;                  /* on top of any <img class="sb-avatar-photo"> */
  }
  .eac-avatar-hover-overlay .icon { background: var(--on-accent); }
  .eac-avatar-editable:hover .eac-avatar-hover-overlay { opacity: 1; }

  /* ─── Avatar cropper modal (Discord-style) ────────────────────── */
  /* The cropper is a TOOL modal opened from other modals (edit-account,
     first-connection onboarding) — it must always stack above them. All
     .modal-overlay share z-index 9999 and DOM order was burying it under
     the onboarding overlay (which sits later in the HTML). */
  #avatarCropOverlay { z-index: 10000; }
  .avatar-crop-card {
    width: 360px; max-width: 92vw;
    padding: 0;
    display: flex; flex-direction: column;
    overflow: hidden;
  }
  .avatar-crop-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px 4px;
  }
  .avatar-crop-title {
    margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em;
  }
  .avatar-crop-body { padding: 10px 18px 14px; }
  .avatar-crop-canvas-wrap {
    position: relative;
    width: 280px; height: 280px;
    margin: 0 auto 18px;
    border-radius: 10px;
    background: var(--dark-surface);
    overflow: hidden;
  }
  .avatar-crop-canvas {
    display: block;
    width: 280px; height: 280px;
    cursor: grab;
    touch-action: none;
  }
  .avatar-crop-canvas:active { cursor: grabbing; }
  /* Circular mask outline — visualises the final crop area. The actual
     output is clipped to the same circle inside the export canvas. */
  .avatar-crop-circle {
    position: absolute; inset: 0;
    pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(18,22,36,.66);   /* darker scrim — crop area reads instantly */
    border-radius: 50%;
    border: 2px solid var(--on-dark);
  }
  .avatar-crop-controls {
    display: flex; align-items: center; gap: 10px;
    padding: 0 4px;
  }
  /* Fully custom range (appearance:none) — kills ALL native chrome: no orange
     accent fill, no focus halo/ring, no default thumb. Neutral grey track +
     grey thumb, nothing else. */
  .avatar-crop-zoom {
    flex: 1; height: 4px; cursor: pointer;
    -webkit-appearance: none; appearance: none;
    background: var(--border); border-radius: 3px;
    outline: none; box-shadow: none;
  }
  .avatar-crop-zoom:focus, .avatar-crop-zoom:focus-visible { outline: none; box-shadow: none; }
  .avatar-crop-zoom::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 15px; height: 15px; border-radius: 50%;
    background: var(--muted); border: 2px solid var(--surface);
    box-shadow: 0 1px 3px rgba(0,0,0,.25); cursor: grab;
  }
  .avatar-crop-zoom:active::-webkit-slider-thumb { cursor: grabbing; }
  .avatar-crop-zoom::-moz-range-track { height: 4px; background: var(--border); border-radius: 3px; }
  .avatar-crop-zoom::-moz-range-thumb {
    width: 15px; height: 15px; border: 2px solid var(--surface); border-radius: 50%;
    background: var(--muted); box-shadow: 0 1px 3px rgba(0,0,0,.25); cursor: grab;
  }
  /* second controls row: free-rotation slider (−180…180°, detent at 0) + the +90° button */
  .avatar-crop-rot-row { margin-top: 12px; }
  .avatar-crop-rotate {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: border-color .15s, color .15s;
    flex-shrink: 0;
  }
  .avatar-crop-rotate .icon { background: currentColor; }
  .avatar-crop-rotate { transition: border-color .15s, color .15s, background .15s, transform .1s; }
  .avatar-crop-rotate:hover { border-color: var(--primary); color: var(--primary-text); background: var(--surface-2); }
  .avatar-crop-rotate:active { transform: scale(.94); }
  /* instant custom tooltip — no native `title` delay, appears on hover/focus */
  .crop-tip { position: relative; }
  .crop-tip::after {
    content: attr(data-tip);
    position: absolute; bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%) translateY(3px);
    padding: 5px 9px; border-radius: 7px;
    background: var(--dark-surface); color: var(--on-dark); font-size: 11px; font-weight: 600; white-space: nowrap;
    box-shadow: 0 6px 18px rgba(0,0,0,.28);
    opacity: 0; pointer-events: none; z-index: 5;
    transition: opacity .12s ease, transform .12s ease;
  }
  .crop-tip:hover::after, .crop-tip:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
  .avatar-crop-footer {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px;
    padding: 14px 18px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
  }
  .avatar-crop-reset {
    border: none; background: transparent;
    color: var(--primary-text); font-weight: 600; font-size: 13px;
    cursor: pointer; padding: 6px 4px;
    font-family: inherit;
  }
  .avatar-crop-reset:hover { text-decoration: underline; }
  .avatar-crop-actions { display: flex; gap: 8px; }
  .avatar-crop-actions .ghost { padding: 8px 16px; }
  .avatar-crop-actions .primary { padding: 8px 20px; font-weight: 600; }
  /* premium interaction: subtle hover lift, press scale, dimmed disabled */
  .avatar-crop-actions .ghost, .avatar-crop-actions .primary {
    transition: transform .12s ease, background .15s ease, box-shadow .15s ease, opacity .15s ease;
  }
  .avatar-crop-actions .primary:hover { box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 30%, transparent); }
  .avatar-crop-actions .ghost:active, .avatar-crop-actions .primary:active { transform: scale(.98); }
  .avatar-crop-actions .ghost:disabled, .avatar-crop-actions .primary:disabled { opacity: .5; pointer-events: none; }
  /* visible focus rings for keyboard users */
  .avatar-crop-rotate:focus-visible, .avatar-crop-reset:focus-visible,
  .avatar-crop-actions button:focus-visible, #avatarCropClose:focus-visible {
    outline: 2px solid var(--primary); outline-offset: 2px;
  }
  .eac-name { font-size: 15px; font-weight: 700; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .eac-email { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* The body is the only scrolling part — header and hero stay pinned, so the
     avatar and name remain visible while you work down the sections. */
  .eac-body {
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
    padding: 4px 20px 20px;
    display: flex; flex-direction: column;
    scrollbar-width: none;
  }
  .eac-body::-webkit-scrollbar { width: 0; height: 0; display: none; }

  /* ── Grouped sections ──────────────────────────────────────────────────
     One concern per group, separated by a hairline instead of stacked
     margins, so the card scans as four blocks rather than eleven fields. */
  .eac-group { padding: 16px 0; border-top: 1px solid var(--border-soft); }
  .eac-group:first-of-type { border-top: none; padding-top: 12px; }
  /* Sentence case, not shouted caps: four section headers in uppercase read as
     four competing labels. At this size they only need to be quiet dividers. */
  .eac-group-title {
    margin: 0 0 10px; font-size: 11px; font-weight: 500;
    text-transform: none; letter-spacing: 0; color: var(--faint);
  }
  .eac-group .eac-field-label {
    text-transform: none; letter-spacing: 0; font-size: 11px; font-weight: 500;
    color: var(--faint);
  }
  /* Label on the left, control on the right — for single-control rows. */
  .eac-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .eac-row-label { font-size: 13px; font-weight: 500; color: var(--text); }
  /* Field labels inside a group no longer need their own top margin — the
     group's padding does that job. Only stacked fields need separating. */
  .eac-group .eac-field-label { margin-top: 0; }
  .eac-group .eac-field-label + * + .eac-field-label,
  .eac-group .eac-field-hint + .eac-field-label,
  .eac-group .eac-inline-result + .eac-field-label,
  .eac-group .eac-socials + .eac-field-label,
  .eac-group select + .eac-field-label { margin-top: 14px; }

  /* ── Identity: the avatar colour strip ───────────────────────────────────
     These swatches paint the AVATAR's background, so they belong with it, not
     in a settings section. One row of 14 instead of two rows of 7: same reach,
     half the height, and it reads as "a property of the avatar above" rather
     than as a palette of its own. */
  .eac-hero .eac-swatches {
    display: flex; gap: 6px; margin-top: 14px; width: 100%;
    justify-content: space-between;
  }
  /* Explicit width AND height, not aspect-ratio: inside a flex row the ratio
     loses to the flex sizing and the circles stretch into ellipses. */
  .eac-hero .eac-swatch {
    flex: 0 0 auto; width: 19px; height: 19px; aspect-ratio: auto;
    border-width: 2px;
  }

  /* ── Social links — one card per link ────────────────────────────────────
     The rows are built in JS (`_renderSocialsEditor`), so this is styling only:
     icon + field + delete become a bordered card, which makes the empty
     trailing row read as an empty SLOT rather than a stray input. */
  .eac-socials { display: flex; flex-direction: column; gap: 6px; }
  .eac-social-row {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 9px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 9px;
    transition: border-color .15s, background .15s;
  }
  .eac-social-row:focus-within { border-color: var(--primary); background: var(--surface); }
  /* The trailing add-row is the only one whose field is empty — dashed and
     transparent so it reads as the slot waiting to be filled. */
  .eac-social-row:last-child:not(:focus-within) {
    background: transparent; border-style: dashed;
  }
  .eac-social-ic { display: flex; flex-shrink: 0; }
  .eac-social-ic .icon { background-color: var(--muted); }
  .eac-social-row:focus-within .eac-social-ic .icon { background-color: var(--primary); }
  .eac-social-input {
    flex: 1; min-width: 0;
    background: transparent !important; border: none !important;
    padding: 3px 0; font-size: 12px; color: var(--text);
    outline: none;
  }
  .eac-social-del {
    flex-shrink: 0; border: none; background: none; cursor: pointer;
    padding: 2px; display: flex; border-radius: 5px;
  }
  .eac-social-del .icon { background-color: var(--faint); }
  .eac-social-del:hover .icon { background-color: var(--danger); }
  /* Says out loud what the code already does: these links are mirrored to the
     public profile. */
  .eac-socials-note {
    display: flex; align-items: center; gap: 6px;
    margin-top: 9px; font-size: 11px; color: var(--faint);
  }
  .eac-socials-note .icon { background-color: var(--faint); flex-shrink: 0; }

  /* ── Pinned footer ── */
  .eac-footer {
    flex: 0 0 auto;
    padding: 10px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
  }
  .eac-footer .eac-disconnect { margin-top: 0; }

  /* ── The card's dropdowns ────────────────────────────────────────────────
     `_enhanceSelect()` hides the native <select> behind a styled button + a
     themed popup, because an OS option list is unreachable from CSS and would
     stay light-on-light (or dark-on-dark) whatever the card is wearing. The
     wrapper is inline-flex by default; here it has to fill the field width. */
  .eac-body .csel { display: block; width: 100%; }
  .eac-body .csel-btn { width: 100%; height: 38px; }
  .eac-body .csel-pop { width: 100%; }
  /* Inside a label-left/control-right row the dropdown sizes to its content
     instead of stretching, but never past half the card — a long country label
     would otherwise crush its own label. */
  /* Custom VAT — a PANEL, not three fields squeezed into the row: each value
     needs its own label and an example, since "10" means nothing until you are
     told it is ten percent. The accent rail on the left ties it to the Country
     row above rather than making it look like a section of its own. The input
     class is DOUBLED (0,2,0) to outrank the global `input[type=...]` rule
     (0,1,1) further down this file, which would force 40px tall on all four. */
  .eac-vatc {
    display: flex; flex-direction: column; gap: 12px;
    margin: 2px 0 2px 10px; padding: 12px 14px;
    background: var(--surface-2); border-radius: 10px;
    border-left: 3px solid var(--primary);
  }
  .eac-vatc-title { font-size: 13px; font-weight: 600; color: var(--text); }
  /* min-width:0 so the two side-by-side fields can shrink instead of overflowing
     the panel — flex items default to min-width:auto. */
  .eac-vatc-field { display: flex; flex-direction: column; gap: 5px; flex: 1 1 0; min-width: 0; }
  .eac-vatc-label { font-size: 12px; color: var(--muted); }
  .eac-vatc-hint  { font-size: 11px; color: var(--muted); opacity: .7; }
  .eac-vatc-pair  { display: flex; gap: 10px; }
  .eac-vatc-inputwrap { display: flex; align-items: stretch; }
  .eac-vatc-inp.eac-vatc-inp {
    width: 100%; height: 36px; padding: 0 10px; font-size: 13px;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: 8px;
  }
  /* The % cell is welded to the field: shared edge, no double border. */
  .eac-vatc-inputwrap .eac-vatc-inp.eac-vatc-inp {
    border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: none;
  }
  .eac-vatc-suffix {
    display: flex; align-items: center; padding: 0 13px;
    font-size: 13px; color: var(--muted);
    background: var(--surface); border: 1px solid var(--border);
    border-top-right-radius: 8px; border-bottom-right-radius: 8px;
  }
  /* The spinner would eat a third of the field for a value typed, not stepped. */
  .eac-vatc-inp::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

  /* Sign-in card: the address and method, the two change forms (the custom-VAT
     panel's look), a message line that turns red on an error. */
  .eac-signin-value { min-width: 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .eac-signin-note { margin: 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
  .eac-signin-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
  .eac-signin-form { display: flex; flex-direction: column; gap: 10px; margin-left: 0; }
  .eac-signin-msg { margin: 0; font-size: 12px; line-height: 1.45; color: var(--success, var(--text)); }
  .eac-signin-msg.is-error { color: var(--danger-text); }
  /* Delete my account: a quiet red button at the bottom of Sign-in, its window
     (openDialog notice) with the password field and the status line. */
  .eac-delete-row { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
  .eac-delete-btn.eac-delete-btn { color: var(--danger-text); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
  .eac-delete-dlg .eac-delete-email { margin: -4px 0 12px; font-size: 13px; color: var(--muted); text-align: center; }
  .eac-delete-dlg .eac-delete-lost { padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2, var(--surface)); text-align: left; }
  .eac-delete-dlg .eac-delete-lost b { display: block; margin-bottom: 8px; font-size: 13px; color: var(--text); }
  .eac-delete-dlg .eac-delete-lost ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
  .eac-delete-dlg .eac-delete-lost li { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text); }
  .eac-delete-dlg .eac-delete-lost .icon { flex: none; background: var(--muted); }
  .eac-delete-dlg .eac-delete-note { margin: 8px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
  .eac-delete-dlg .eac-delete-step { display: grid; gap: 6px; margin: 14px 0 0; text-align: left; }
  .eac-delete-dlg .eac-delete-step-h { font-size: 13px; color: var(--text); }
  .eac-delete-dlg .eac-delete-passrow { display: flex; gap: 8px; }
  .eac-delete-dlg .eac-delete-passrow input { flex: 1; min-width: 0; }
  .eac-delete-dlg .eac-delete-google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 40px; font-weight: 600; }
  .eac-delete-dlg .eac-delete-google img { width: 18px; aspect-ratio: 1; }
  .eac-delete-dlg .eac-delete-ok { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 600; color: var(--success-text, var(--success)); }
  .eac-delete-dlg .eac-delete-ok .icon { background: currentColor; }
  .eac-delete-dlg .eac-delete-ok.hidden { display: none; }
  .eac-delete-dlg .eac-delete-word { text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
  .eac-delete-dlg .eac-signin-msg { margin-top: 8px; text-align: center; }
  .eac-delete-dlg .sqn-leave:disabled { opacity: .45; cursor: not-allowed; }   /* until the word is typed */
  .eac-row .csel { width: auto; max-width: 62%; margin-left: auto; }
  .eac-row .csel-btn { height: 34px; }
  .eac-body .csel-btn:disabled { opacity: .55; cursor: not-allowed; }   /* the League flag while locked */
  .eac-row .csel-pop { min-width: 100%; width: max-content; max-width: 260px; right: 0; left: auto; }
  /* The dropdown here is a plain field, not an inventory filter — the orange
     "is-active" treatment those inherit signals a live filter, which means
     nothing in a settings row and just shouts. */
  .eac-body .csel-btn.is-active {
    background-color: var(--surface-2); border-color: var(--border); color: var(--text);
  }
  .eac-body .csel-btn.is-active:hover,
  .eac-body .csel--open .csel-btn.is-active { background-color: var(--surface-3); }

  /* Inline status lines — collapse to nothing until they carry a message, so
     an empty result never reserves a visible gap. */
  .eac-avatar-result, .eac-inline-result {
    font-size: 11px; text-align: center; color: var(--muted);
    min-height: 0; margin: 0;
  }
  .eac-avatar-result:not(:empty) { margin: 10px 0 0; }
  .eac-inline-result:not(:empty) { margin: 5px 0 0; text-align: left; }
  .eac-field-label {
    font-size: 10px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .07em; margin-bottom: 7px;
  }
  .eac-field-hint {
    font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.4;
  }
  /* HT / TTC segmented control (price-entry mode). */
  .eac-seg {
    display: inline-flex; padding: 3px; gap: 2px;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  }
  .eac-seg-btn {
    border: none; background: transparent; cursor: pointer;
    padding: 6px 16px; border-radius: 7px; font-size: 12px; font-weight: 700;
    color: var(--muted); transition: background .15s, color .15s;
  }
  .eac-seg-btn.active { background: var(--primary); color: var(--on-accent); }
  .eac-input { background: var(--surface-2) !important; border-color: var(--border) !important; color: var(--text) !important; }
  .eac-input:focus { border-color: var(--primary) !important; background: var(--primary-soft) !important; }
  .eac-eye { background: var(--surface-2) !important; border-color: var(--border) !important; color: var(--muted) !important; }
  .eac-eye:hover { background: var(--border) !important; color: var(--text) !important; }
  .eac-save { width: 100%; height: 40px; border-radius: 10px; font-size: 14px; font-weight: 600; margin-top: 14px; justify-content: center; }
  /* admin badge */
  .eac-admin-badge {
    font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    padding: 2px 6px; border-radius: 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hi));
    color: var(--on-accent); flex-shrink: 0; align-self: center;
  }
  /* debug toggle row */
  /* Now a full `.eac-group` section (it carries its own title + hairline), so
     it only needs the hidden-state behaviour — the flex row moved to .eac-row. */
  .eac-debug-row.hidden { display: none; }
  .eac-debug-label {
    display: flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 500; color: var(--text);
  }
  /* toggle switch */
  .eac-toggle { position: relative; display: inline-flex; cursor: pointer; }
  .eac-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
  .eac-toggle-track {
    width: 38px; height: 22px; border-radius: 11px;
    background: var(--border); transition: background .2s;
    display: flex; align-items: center; padding: 0 3px;
  }
  .eac-toggle input:checked ~ .eac-toggle-track { background: var(--primary); }
  .eac-toggle-thumb {
    width: 16px; height: 16px; border-radius: 50%; background: var(--surface);
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    transition: transform .2s; flex-shrink: 0;
  }
  .eac-toggle input:checked ~ .eac-toggle-track .eac-toggle-thumb { transform: translateX(16px); }
  .eac-name-row { display: flex; gap: 6px; }
  .eac-name-input {
    flex: 1; padding: 7px 10px; font-size: 13px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); outline: none;
    transition: border-color .15s;
  }
  .eac-name-input:focus { border-color: var(--primary); }
  /* Social-links editor rows (icon inferred from the URL host). */
  .eac-socials { display: flex; flex-direction: column; gap: 6px; }
  .eac-social-row { display: flex; align-items: center; gap: 8px; }
  .eac-social-ic { flex-shrink: 0; width: 26px; height: 26px; border-radius: 7px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface-2); border: 1px solid var(--border); }
  .eac-social-ic .icon { background-color: var(--muted); }
  .eac-social-input {
    flex: 1; min-width: 0; padding: 6px 10px; font-size: 12.5px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); outline: none; transition: border-color .15s;
  }
  .eac-social-input:focus { border-color: var(--primary); }
  .eac-social-del {
    width: 28px; height: 28px; flex-shrink: 0; padding: 0; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid var(--border); border-radius: 7px;
    transition: border-color .12s, background-color .12s;
  }
  .eac-social-del[hidden] { display: none; }
  .eac-social-del:hover { border-color: var(--danger); }
  .eac-social-del .icon { background-color: var(--muted); }
  .eac-name-save {
    width: 32px; height: 32px; flex-shrink: 0; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
  }

/* ══ PROFILE SIDE CARD — the card's own look ═══════════════════════════════
   Everything above this line is inherited from when this was a centred modal.
   Rather than fight those rules one property at a time, this block owns the
   card's appearance end to end; it is scoped to the overlay so it outranks
   them, and it is the only place to edit the card's visual design.

   Three ideas carry it:
     • one row per setting — label left, control right, so the eye runs down a
       single column of values instead of zig-zagging past full-width fields;
     • quiet dividers — sections are separated by hairlines and sentence-case
       headers, not by four competing blocks of shouted uppercase;
     • weight where it means something — 500 is the heaviest weight here, so
       the only truly bold things are the accents that carry state. */

  #editAccountModalOverlay .eac-panel-head { padding: 15px 16px 15px 18px; border-bottom: none; }
  #editAccountModalOverlay .eac-panel-title { font-size: 14px; font-weight: 600; gap: 9px; }

  #editAccountModalOverlay .eac-hero { padding: 6px 18px 20px; background: none; border-bottom: none; }
  #editAccountModalOverlay .eac-ident { gap: 14px; }
  #editAccountModalOverlay .eac-name { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
  #editAccountModalOverlay .eac-email { font-size: 13px; }
  /* A tinted pill rather than a filled gradient: it is a status, not a button. */
  #editAccountModalOverlay .eac-admin-badge {
    font-size: 10px; font-weight: 600; letter-spacing: 0; text-transform: none;
    padding: 2px 8px; border-radius: 999px;
    background: var(--primary-soft); color: var(--primary-text);
  }

  #editAccountModalOverlay .eac-body { padding: 0; }
  /* Every section keeps its top hairline, including the first — that is what
     separates the identity block from the settings now that the header and hero
     carry no border of their own. */
  #editAccountModalOverlay .eac-group { padding: 16px 18px; border-top: 1px solid var(--border-soft); }
  #editAccountModalOverlay .eac-group-title {
    margin: 0 0 6px; font-size: 12px; font-weight: 400;
    text-transform: none; letter-spacing: 0; color: var(--faint);
  }
  #editAccountModalOverlay .eac-field-label {
    margin: 0 0 7px; font-size: 12px; font-weight: 400;
    text-transform: none; letter-spacing: 0; color: var(--faint);
  }
  #editAccountModalOverlay .eac-field-hint { font-size: 12px; color: var(--faint); margin-top: 2px; line-height: 1.5; }
  /* 38px min-height rather than padding: rows keep a steady rhythm whether they
     hold a 22px toggle, a 30px segmented control or a plain line of text. */
  #editAccountModalOverlay .eac-row { padding: 0; min-height: 38px; }
  /* Rows holding a select or a segmented control are as tall as the row: keep air between them. */
  #editAccountModalOverlay .eac-row + .eac-row, #editAccountModalOverlay .eac-row + .hidden + .eac-row { margin-top: 8px; }
  #editAccountModalOverlay .eac-row-label {
    font-size: 14px; font-weight: 400; color: var(--text);
    display: inline-flex; align-items: center; gap: 6px;
  }
  /* ⓘ next to a label — same behaviour and same bubble as the rack view's
     `.rp-info`: the explanation appears when asked instead of living under the
     control as a permanent paragraph. */
  .eac-info {
    display: inline-flex; align-items: center; cursor: help;
    flex-shrink: 0; border: none; background: none; padding: 0;
  }
  .eac-info .icon { background: var(--faint); transition: background .15s; }
  .eac-info:hover .icon,
  .eac-info:focus-visible .icon { background: var(--primary); }

  /* Assistant logos, each in its brand colour (the AI assistant window's tiles
     and chips, renderer/ai/assistant.js). */
  .eac-mcp-logo {
    height: 26px; aspect-ratio: 1 / 1;   /* all three SVGs are viewBox 0 0 24 24 */
    -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center;
  }
  .eac-mcp-logo--claude { background-color: #D97757; -webkit-mask-image: url('../../assets/svg/brands/claude.svg'); }
  .eac-mcp-logo--cursor { background-color: var(--text); -webkit-mask-image: url('../../assets/svg/brands/cursor.svg'); }
  .eac-mcp-logo--vscode { background-color: #007ACC; -webkit-mask-image: url('../../assets/svg/brands/vscode.svg'); }
  .eac-mcp-logo--chatgpt { background-color: var(--text); -webkit-mask-image: url('../../assets/svg/brands/chatgpt.svg'); }
  .eac-mcp-logo--grok { background-color: var(--text); -webkit-mask-image: url('../../assets/svg/brands/grok.svg'); }
  /* Gemini's star is a blue → violet gradient: the gradient painted through the mask. */
  .eac-mcp-logo--gemini { background: linear-gradient(135deg, #3186FF 15%, #7B6CF0 60%, #B46FE0 90%); -webkit-mask-image: url('../../assets/svg/brands/gemini.svg'); }
  /* Mistral's logo is multicoloured: drawn as an image, not a tinted mask. */
  .eac-mcp-logo--mistral { background: url('../../assets/svg/brands/mistral.svg') center / contain no-repeat; }
  /* Ligue des pays: the current flag, then "Change" (opens the country window). */
  #editAccountModalOverlay .eac-country { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
  #editAccountModalOverlay .eac-country-cur { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* The country window (openDialog, notice): the mascot on top, the current country, a
     search, the countries as flag tiles in two columns (no visible scrollbar), the lock. */
  /* The mascot holding the globe (squad-notice/tiger-globe, the notice's art slot), a bit taller. */
  .eac-cpick .sqn-art { height: 132px; margin-top: 6px; }
  .eac-cpick-cur {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; text-align: left;
    background: var(--surface-2); border: 1px solid var(--border);
  }
  .eac-cpick-cur > span:not(.sqr-flagav) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .eac-cpick-cur small { font-size: 11.5px; color: var(--muted); }
  .eac-cpick-cur b { font-size: 16px; color: var(--text); }
  .eac-cpick-cur em { font-style: normal; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
    color: var(--primary-text); background: color-mix(in srgb, var(--primary) 14%, transparent); border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent); }
  .eac-cpick-q { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--surface-2); }
  .eac-cpick-q:focus-within { border-color: var(--primary); }
  .eac-cpick-q .icon { background: var(--muted); flex-shrink: 0; }
  /* The field draws the frame and the focus (orange border): the input inside has none,
     not even the app's focus ring (doubled class beats the global input:focus rule). */
  .eac-cpick-q.eac-cpick-q input, .eac-cpick-q.eac-cpick-q input:focus { flex: 1; min-width: 0; height: 100%; padding: 0;
    border: 0; outline: none; box-shadow: none; background: none; color: var(--text); font: inherit; font-size: 13px; }
  .eac-cpick-q:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
  .eac-cpick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 236px; overflow-y: auto;
    scrollbar-width: none; overscroll-behavior: contain; padding: 2px;
    /* No scrollbar: a fade at the bottom says the list goes on. */
    -webkit-mask-image: linear-gradient(#000 calc(100% - 28px), transparent); mask-image: linear-gradient(#000 calc(100% - 28px), transparent); }
  .eac-cpick-grid::-webkit-scrollbar { width: 0; height: 0; }
  .eac-cpick-tile {
    display: flex; align-items: center; gap: 10px; min-width: 0; height: 48px; padding: 0 12px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600;
    text-align: left; cursor: pointer; transition: border-color .12s, background .12s, transform .1s;
  }
  .eac-cpick-tile[hidden] { display: none; }
  .eac-cpick-tile > span:not(.sqr-flagav):not(.icon) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .eac-cpick-tile:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: var(--surface-2); }
  .eac-cpick-tile:active { transform: scale(.98); }
  .eac-cpick-tile .icon-check { background: var(--primary); opacity: 0; transition: opacity .12s; flex-shrink: 0; }
  .eac-cpick-tile.is-on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, var(--surface)); }
  .eac-cpick-tile.is-on .icon-check { opacity: 1; }
  .eac-cpick-lock { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; text-align: left;
    background: color-mix(in srgb, var(--primary) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); }
  .eac-cpick-lock .icon { background: var(--primary); flex-shrink: 0; }
  .eac-cpick-lock > span:not(.icon) { display: flex; flex-direction: column; gap: 1px; }
  .eac-cpick-lock b { font-size: 13px; color: var(--text); }
  .eac-cpick-lock small { font-size: 12px; color: var(--muted); }
  .eac-cpick .dlg-act:disabled { opacity: .45; cursor: not-allowed; }
  /* The name field spans the section under its own caption — a text input needs
     room to show what you typed, which a right-hand column cannot give it. */
  #editAccountModalOverlay .eac-name-row { gap: 6px; }
  #editAccountModalOverlay .eac-name-input {
    flex: 1; min-width: 0; padding: 8px 11px; font-size: 13px; border-radius: 9px;
  }
  /* The save button IS the feedback — it flashes green on success and shakes on
     a refusal, so nothing appears and disappears under the field to shift the
     layout. Only errors still print words, because only they have something to
     say beyond "done". */
  #editAccountModalOverlay .eac-name-save {
    width: 34px; height: 34px; border-radius: 9px;
    transition: background .18s, border-color .18s, color .18s;
  }
  #editAccountModalOverlay .eac-name-save.is-ok {
    background: var(--success); border-color: var(--success);
    animation: eacSavePop .45s cubic-bezier(.34, 1.56, .64, 1);
  }
  #editAccountModalOverlay .eac-name-save.is-ok .icon { background-color: var(--on-accent); }
  #editAccountModalOverlay .eac-name-save.is-err {
    border-color: var(--danger); animation: eacSaveShake .38s;
  }
  #editAccountModalOverlay .eac-name-save.is-err .icon { background-color: var(--danger); }
  /* Inert while the write is in flight so a double-click cannot fire it twice. */
  #editAccountModalOverlay .eac-name-save.is-busy { opacity: .5; pointer-events: none; }
  @keyframes eacSavePop {
    0%   { transform: scale(1); }
    38%  { transform: scale(1.22); }
    100% { transform: scale(1); }
  }
  @keyframes eacSaveShake {
    0%, 100% { transform: translateX(0); }
    22%      { transform: translateX(-3px); }
    62%      { transform: translateX(3px); }
  }

  /* Persistent camera badge on the avatar. The hover overlay alone only tells
     you the avatar is editable once the pointer is already on it — this says so
     while you are still looking for it. Purely decorative: the click target is
     the avatar itself, which already opens the menu. */
  /* Two pseudo-elements, because one cannot be both a filled circle and a
     masked glyph: ::before draws the disc, ::after masks the pencil on top.
     A background-image would ignore the theme — masks take --muted like every
     other icon in the app. The avatar is overflow:visible, so a badge hanging
     2px past its edge is not clipped. */
  #editAccountModalOverlay .eac-avatar-editable::before,
  #editAccountModalOverlay .eac-avatar-editable::after {
    content: ""; position: absolute; pointer-events: none;
  }
  #editAccountModalOverlay .eac-avatar-editable::before {
    right: -2px; bottom: -2px; width: 20px; height: 20px; border-radius: 50%;
    background: var(--surface-2); border: 1px solid var(--border-strong); z-index: 2;
  }
  #editAccountModalOverlay .eac-avatar-editable::after {
    right: 3px; bottom: 3px; width: 11px; height: 11px; z-index: 3;
    background-color: var(--muted);
    -webkit-mask: url('../../assets/svg/icons/icon_edit.svg') center / contain no-repeat;
    mask: url('../../assets/svg/icons/icon_edit.svg') center / contain no-repeat;
  }

  /* Segmented controls — the one place accent fill is allowed, because it is
     the only thing on the row carrying the current choice. */
  /* Two-state segmented control — wide and flat rather than tall and chunky,
     with a pill that SLIDES between the two options instead of the fill
     teleporting (also `.eac-seg--slide` anywhere else, e.g. the AI access choice). The moving pill is a single ::before positioned by :has(),
     so nothing in the markup or the JS has to know about it: the buttons keep
     toggling `.active` exactly as before.

     Both halves are equal width (flex: 1) so the pill's 50% travel is exact
     whatever the labels say — "Sombre"/"Clair" and "HT"/"TTC" both work. */
  #editAccountModalOverlay .eac-seg, .eac-seg.eac-seg--slide {
    position: relative; padding: 2px; gap: 0; border-radius: 9px;
    min-width: 172px; isolation: isolate;
    background: var(--surface-2); border: 1px solid var(--border);
  }
  #editAccountModalOverlay .eac-seg::before, .eac-seg.eac-seg--slide::before {
    content: ""; position: absolute; z-index: -1;
    top: 2px; bottom: 2px; left: 2px; width: calc(50% - 2px);
    border-radius: 7px; background: var(--primary);
    transition: transform .22s cubic-bezier(.4, 0, .2, 1);
  }
  /* Second option active → the pill travels one full slot to the right. */
  #editAccountModalOverlay .eac-seg:has(.eac-seg-btn:last-child.active)::before, .eac-seg.eac-seg--slide:has(.eac-seg-btn:last-child.active)::before {
    transform: translateX(100%);
  }
  /* Nothing lit up → no pill (it would otherwise sit under the first option
     and claim a choice the user has not made). */
  #editAccountModalOverlay .eac-seg:not(:has(.eac-seg-btn.active))::before, .eac-seg.eac-seg--slide:not(:has(.eac-seg-btn.active))::before { opacity: 0; }
  /* Explicit height: the global `button { height: 40px }` in 70-detail-misc.css
     applies here too and made the control 46px tall — chunky rather than the
     flat, wide switch this wants to be. 28px + 2px padding + 2px border = 34. */
  #editAccountModalOverlay .eac-seg-btn, .eac-seg.eac-seg--slide .eac-seg-btn {
    flex: 1 1 0; height: 28px; padding: 0 10px; border-radius: 7px;
    font-size: 12.5px; font-weight: 400; background: transparent;
    line-height: 1; transition: color .18s;
  }
  /* The pill paints the fill now — a background here would cover it mid-slide. */
  #editAccountModalOverlay .eac-seg-btn.active, .eac-seg.eac-seg--slide .eac-seg-btn.active {
    background: transparent; color: var(--on-accent); font-weight: 600;
  }

  /* Links: the existing ones are listed under the row rather than hidden behind
     an "add" affordance — you cannot manage what you cannot see. Rows are built
     by `_renderSocialsEditor`, so this is styling only. */
  #editAccountModalOverlay .eac-socials { gap: 6px; margin-top: 4px; }
  #editAccountModalOverlay .eac-social-row { padding: 7px 10px; border-radius: 9px; gap: 9px; }
  #editAccountModalOverlay .eac-social-input { font-size: 12.5px; }
  #editAccountModalOverlay .eac-socials-note { margin-top: 9px; font-size: 12px; }

  #editAccountModalOverlay .eac-footer { padding: 12px 18px; background: none; }
  #editAccountModalOverlay .eac-disconnect { font-size: 14px; padding: 10px; border-radius: 10px; }

  .eac-sep {
    display: flex; align-items: center; gap: 10px; margin: 20px 0 12px;
    font-size: 10px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .07em;
  }
  .eac-sep::before, .eac-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
  .eac-lang { width: 100%; }
  .eac-disconnect {
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center; gap: 7px;
    width: 100%; margin-top: 14px; padding: 9px; font-family: inherit;
    border-radius: 9px; border: 1px solid transparent; background: none;
    color: var(--muted); font-size: 12px; font-weight: 500; cursor: pointer;
    transition: color .15s, background .15s, border-color .15s;
    user-select: none; -webkit-user-select: none;
  }
  .eac-disconnect:hover { color: var(--danger-text); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 15%, transparent); }
  /* long-press fill */
  .eac-disconnect::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 0%;
    background: color-mix(in srgb, var(--danger) 18%, transparent); pointer-events: none;
    transition: none; border-radius: 8px;
  }
  .eac-disconnect.holding { color: var(--danger-text); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
  .eac-disconnect.holding::before { width: 100%; transition: width 1.5s linear; }

  /* ── account dropdown ── */
  .sb-avatar-wrap { position: relative; }
  .acct-dropdown {
    position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%);
    width: 224px; z-index: 500;
    background: var(--surface-raised); border: 1px solid var(--ink-08);
    border-radius: 14px; padding: 6px;
    box-shadow: 0 12px 40px rgba(0,0,0,.55);
    backdrop-filter: blur(16px);
    opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(-6px) scale(.97);
    transition: opacity .18s, transform .18s cubic-bezier(.34,1.3,.64,1);
  }
  .acct-dropdown.open {
    opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0) scale(1);
  }
  /* sidebar collapsed → dropdown pops to the right via position:fixed set by JS */
  .acct-dropdown.dropdown-fixed {
    position: fixed !important;
    left: auto; top: auto;           /* JS sets exact left/top via inline style */
    transform: translateY(-6px) scale(.97) !important;
  }
  .acct-dropdown.dropdown-fixed.open {
    transform: translateY(0) scale(1) !important;
  }
  .acct-drop-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 8px 10px; border-radius: 9px; border: none; background: transparent;
    color: var(--ink-70); font-size: 12px; font-weight: 500;
    cursor: pointer; font-family: inherit; text-align: left; justify-content: flex-start;
    transition: background .13s, color .13s;
  }
  .acct-drop-item:hover { background: var(--ink-08); color: var(--text); }
  .acct-drop-item.active { color: var(--text); }
  .acct-drop-avatar {
    position: relative;       /* anchor for the .sb-avatar-photo overlay */
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: var(--on-accent); letter-spacing: -0.5px;
    overflow: hidden;
  }
  .acct-drop-name { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
  .acct-drop-check { margin-left: auto; color: var(--primary-text); font-size: 13px; flex-shrink: 0; }
  .acct-drop-sep { height: 1px; background: var(--ink-08); margin: 5px 4px; }
  .acct-drop-action {
    display: flex; align-items: center; justify-content: flex-start; text-align: left;
    gap: 9px; width: 100%;
    padding: 8px 10px; border-radius: 9px; border: none; background: transparent;
    color: var(--ink-60); font-size: 12px; font-weight: 500;
    cursor: pointer; font-family: inherit;
    transition: background .13s, color .13s;
  }
  .acct-drop-action:hover { background: var(--ink-08); color: var(--ink-85); }
  /* "Join the TigerSquad" stands out: an orange-tinted pill, bold label with a light sweeping across it. */
  .acct-drop-action.acct-drop-squad {
    margin-top: 4px; background: linear-gradient(90deg, rgba(255, 138, 46, .16), rgba(255, 170, 97, .08));
    box-shadow: inset 0 0 0 1px rgba(255, 146, 63, .45); font-weight: 800; font-size: 12.5px;
  }
  .acct-drop-action.acct-drop-squad:hover { background: linear-gradient(90deg, rgba(255, 138, 46, .28), rgba(255, 170, 97, .14)); box-shadow: inset 0 0 0 1px rgba(255, 146, 63, .8), 0 0 14px rgba(255, 146, 63, .3); }
  .acct-drop-squad .icon { background: #FF923F; width: 15px; height: 15px; }
  .acct-drop-squad-txt {
    background: linear-gradient(100deg, #FF8A2E 0%, #FFB463 38%, #FFF3DC 50%, #FFB463 62%, #FF8A2E 100%) 0 0 / 250% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: acct-squad-shine 3.2s ease-in-out infinite;
  }
  @keyframes acct-squad-shine { 0% { background-position: 100% 0; } 60%, 100% { background-position: 0% 0; } }
  @media (prefers-reduced-motion: reduce) { .acct-drop-squad-txt { animation: none; } }
  .acct-drop-badge {
    margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 9px; background: var(--primary); color: var(--on-accent);
    font-size: 10px; font-weight: 700; line-height: 1;
  }
  /* Logged-in account header at the top of the menu (display only). */
  .acct-drop-current {
    display: flex; align-items: center; gap: 9px; width: 100%;
    padding: 8px 10px; border-radius: 9px; color: var(--text);
  }
  .acct-drop-current .acct-drop-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
  .acct-drop-current .acct-drop-check { margin-left: auto; color: var(--primary-text); font-size: 13px; flex-shrink: 0; }

  /* "Switch account ›" — chevron at the right; the account list opens as a hover
     fly-out to the RIGHT (it does NOT replace the main menu). */
  .acct-drop-chevron { margin-left: auto; display: inline-flex; align-items: center; }
  .acct-drop-chevron .icon { background: var(--ink-40); }
  .acct-drop-haschild:hover .acct-drop-chevron .icon { background: var(--ink-70); }
  .acct-drop-haschild { position: relative; }
  .acct-drop-submenu {
    position: absolute; left: 100%; top: -6px;
    min-width: 200px; padding: 6px;
    background: var(--surface-raised); border: 1px solid var(--ink-08);
    border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.55);
    backdrop-filter: blur(16px);
    opacity: 0; pointer-events: none; transform: translateX(-4px);
    transition: opacity .14s, transform .14s; z-index: 2;
  }
  .acct-drop-haschild:hover .acct-drop-submenu { opacity: 1; pointer-events: auto; transform: translateX(0); }
  .acct-drop-section-label {
    font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em;
    color: var(--ink-30); padding: 4px 10px 2px;
  }
  .acct-drop-friend-active { color: var(--text) !important; }
  .acct-drop-eye {
    margin-left: auto; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    width: 20px; height: 20px;
    opacity: .35; transition: opacity .13s;
  }
  .acct-drop-eye .icon { background: var(--ink-85); }
  .acct-drop-item:hover .acct-drop-eye { opacity: .85; }

  /* ── profiles modal ── */
  /* ── Manage-accounts modal — DARK, matching the account dropdown ── */
  .prf-card {
    width: min(420px, 92vw); padding: 0; overflow: visible;
    background: var(--surface-raised); border: 1px solid var(--ink-08);
    color: var(--text);
  }
  .prf-header {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 22px 22px 12px;
  }
  .prf-head-text { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
  .prf-title { font-size: 19px; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
  .prf-sub { font-size: 12.5px; color: var(--ink-50); line-height: 1.35; }
  .prf-card .modal-close {
    flex-shrink: 0; color: var(--ink-40); background: var(--ink-06);
    border: none; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 15px;
  }
  .prf-card .modal-close:hover { color: var(--text); background: var(--ink-12); }
  .prf-body { padding: 6px 16px 18px; display: flex; flex-direction: column; gap: 14px; }

  .prf-acct-list {
    display: flex; flex-direction: column; gap: 2px;
    background: var(--ink-04); border: 1px solid var(--ink-06);
    border-radius: 14px; padding: 6px;
  }
  .prf-acct {
    position: relative; display: flex; align-items: center; gap: 11px;
    padding: 9px 10px; border-radius: 10px;
  }
  .prf-acct:hover { background: var(--ink-04); }
  .prf-acct-avatar {
    position: relative; width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 700; color: var(--on-accent); letter-spacing: -.5px; overflow: hidden;
  }
  .prf-acct-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
  .prf-acct-name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .prf-acct-email { font-size: 12px; color: var(--ink-40); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .prf-acct-active { font-size: 12px; font-weight: 600; color: var(--success-text); }
  .prf-acct-switch {
    flex-shrink: 0; height: 32px; padding: 0 15px; border-radius: 8px; border: none;
    background: var(--ink-10); color: var(--text); font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: inherit;
  }
  .prf-acct-switch:hover { background: var(--ink-20); }
  .prf-acct-menu-btn {
    flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px; border: none;
    background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center;
  }
  .prf-acct-menu-btn .icon { background: var(--ink-50); }
  .prf-acct-menu-btn:hover { background: var(--ink-08); }
  .prf-acct-menu-btn:hover .icon { background: var(--on-accent); }
  .prf-acct-menu {
    position: absolute; right: 8px; top: calc(100% - 4px); z-index: 3;
    min-width: 160px; padding: 5px;
    background: rgba(28,30,40,.99); border: 1px solid var(--ink-10);
    border-radius: 11px; box-shadow: 0 12px 34px rgba(0,0,0,.55);
  }
  :root:not([data-theme="dark"]) .prf-acct-menu { background: var(--surface-raised); border-color: var(--border); box-shadow: var(--shadow-lg); }
  .prf-acct-menu[hidden] { display: none; }
  .prf-acct-menu-item {
    display: flex; align-items: center; gap: 9px; width: 100%;
    padding: 8px 10px; border-radius: 7px; border: none; background: transparent;
    color: var(--ink-85); font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit;
  }
  .prf-acct-menu-item:hover { background: var(--ink-08); color: var(--text); }
  .prf-acct-menu-item .icon { background: currentColor; }
  .prf-acct-menu-item--danger { color: var(--danger-text); }
  .prf-acct-menu-item--danger:hover { background: rgba(255,107,107,.14); color: var(--danger-hover); }

  .prf-add-btn {
    width: 100%; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--ink-06); border: 1px solid var(--ink-10);
    color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
  }
  .prf-add-btn:hover { background: var(--ink-10); }
  .prf-add-btn .icon { background: var(--on-accent); }
  .prf-empty-msg { padding: 18px; text-align: center; color: var(--ink-40); font-size: 13px; }

  /* ── Dark confirmation modal (remove friend) — Discord-style + avatar ── */
  .confirm-card {
    width: min(380px, 92vw); padding: 26px 24px 22px; position: relative; text-align: center;
    background: var(--surface-raised); border: 1px solid var(--ink-08); color: var(--text);
  }
  .confirm-card .modal-close {
    position: absolute; top: 14px; right: 14px;
    width: 30px; height: 30px; border-radius: 8px; border: none;
    background: var(--ink-06); color: var(--ink-40); cursor: pointer; font-size: 15px;
  }
  .confirm-card .modal-close:hover { color: var(--text); background: var(--ink-12); }
  .confirm-avatar { display: flex; justify-content: center; margin: 2px 0 14px; }
  .confirm-avatar-img {
    position: relative; width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 700; color: var(--on-accent); letter-spacing: -.5px;
    box-shadow: 0 6px 20px rgba(0,0,0,.4);
  }
  .confirm-title { margin: 0 0 8px; font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
  .confirm-body  { margin: 0 0 20px; font-size: 13.5px; line-height: 1.5; color: var(--ink-60); }
  .confirm-actions { display: flex; gap: 10px; }
  .confirm-cancel, .confirm-danger {
    flex: 1; height: 42px; border-radius: 11px; border: none;
    font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
  }
  .confirm-cancel { background: var(--ink-08); color: var(--text); }
  .confirm-cancel:hover { background: var(--ink-15); }
  .confirm-danger { background: var(--danger); color: var(--text); }
  .confirm-danger:hover { background: var(--danger-hover); }

  /* ── friend view banner ── */
  /* User chip in the top header row — to the LEFT of the KPI stats.
     Two variants share the same frame:
       • Own user (.fvb--own) → avatar + name + random welcome greeting
       • Friend view          → avatar + name + READ-ONLY badge (or error)
     Layout: avatar on the left, then a vertical stack (name on top, sub-line
     below). Height aligns to the stat tiles so the toolbar reads as one row. */
  /* No surrounding pill — the chip is now just an avatar + stacked text,
     blending into the header row. The READ-ONLY badge / welcome greeting
     give it enough visual identity without an extra frame. */
  .fvb {
    display: flex; align-items: center;
    gap: 10px; padding: 0;
    background: transparent; border: 0;
    border-radius: 0;
    flex-shrink: 0;
    margin-bottom: 0;
  }
  .fvb.hidden { display: none; }
  .fvb-inner {
    display: flex; flex-direction: column;
    gap: 1px;
    align-items: flex-start;
    min-width: 0;
  }
  /* Avatar size matched to the height of the KPI stat tiles next to it
     so the chip + stats row reads as one visually-balanced strip. */
  .fvb-avatar {
    position: relative;       /* anchor for the .sb-avatar-photo overlay */
    width: 50px; height: 50px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700; color: var(--on-accent);
    letter-spacing: -.7px;
    overflow: hidden;
  }
  /* Own-view header avatar is editable — wrapper button (no clipping) holds the
     avatar + a hover overlay; the avatar inside keeps its own overflow:hidden. */
  .fvb-avatar-edit {
    position: relative; width: 50px; height: 50px; flex-shrink: 0;
    padding: 0; border: 0; background: transparent; cursor: pointer;
    border-radius: 50%;
  }
  .fvb-avatar-edit .fvb-avatar { width: 100%; height: 100%; }
  .fvb-avatar-ovl {
    position: absolute; inset: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--scrim); opacity: 0; transition: opacity .15s;
    pointer-events: none;
  }
  .fvb-avatar-edit:hover .fvb-avatar-ovl { opacity: 1; }
  .fvb-avatar-ovl .icon { background: var(--on-accent); }
  .fvb-name {
    font-size: 13px; font-weight: 600; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 160px;
    line-height: 1.2;
  }
  /* Clean pill "tags" — same family as the TigerTag+ / TigerCloud stat tags. */
  /* Line 1: name + "Public" badge · Line 2: "Read-only" + "Share" badges. */
  .fvb-name-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
  .fvb-badges { display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
  .fvb-badge {
    box-sizing: border-box; display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
    height: 20px; padding: 0 8px; border-radius: 999px;
    font-size: 10px; font-weight: 700; letter-spacing: .03em; line-height: 1; font-family: inherit;
    color: var(--muted); background: var(--surface-2); border: 1px solid var(--border);
  }
  .fvb-badge .icon { background-color: currentColor; }
  /* Public → green gradient pill (white). Transparent border keeps the same box height. */
  .fvb-badge--public { color: var(--on-dark); border-color: transparent; background: linear-gradient(90deg, #22a06b, #35c489); }
  .fvb-badge--public .icon { background-color: var(--on-accent); }
  /* "Partager" → blue "link" gradient pill, clickable (copies the invite link) — same slim box. */
  .fvb-badge--share { position: relative; cursor: pointer; color: var(--on-accent); border-color: transparent;
    background: linear-gradient(90deg, var(--info), var(--info)); transition: filter .12s; }
  .fvb-badge--share .icon { background-color: var(--on-accent); }
  .fvb-badge--share:hover { filter: brightness(1.06); }
  /* "X friends" — plain muted count (not a pill). */
  .fvb-count { display: inline-flex; align-items: center; gap: 3px;
    font-size: 10px; font-weight: 600; color: var(--muted); }
  .fvb-count .icon { background-color: var(--muted); }
  /* Social-profile links — a row of brand-coloured icons. */
  .fvb-socials { display: flex; align-items: center; gap: 9px; margin-top: 6px; flex-wrap: wrap; }
  .fvb-social { display: inline-flex; align-items: center; justify-content: center; }
  .fvb-social .icon { width: 15px; height: 15px; background-color: var(--sc, var(--muted)); transition: transform .12s, opacity .12s; opacity: .9; }
  .fvb-social:hover .icon { transform: scale(1.15); opacity: 1; }

  /* read-only weight bar (no slider) */
  .wb-track--ro { pointer-events: none; }

  /* Friend view — error variant. The wrapping pill is gone now, so the
     red `.fvb-badge--error` chip in the inner stack carries the whole
     error signal on its own. */
  .fvb-badge--error {
    background: var(--danger) !important; color: var(--on-accent) !important;
  }

  /* ── UID format migration overlay ─────────────────────────────────────
     Lock-screen modal shown while Tiger Studio is migrating legacy
     decimal-format inventory ids to the new hex canonical form. Z-index
     above everything so the user CAN'T interact with the rest of the UI
     and CAN'T dismiss the modal until the queue drains. The message
     explicitly warns the user not to close the app. */
  .uid-migr-overlay {
    z-index: 10000;
  }
  .uid-migr-card {
    max-width: 480px;
    text-align: center;
    padding: 32px 28px 28px;
  }
  .uid-migr-icon {
    width: 64px; height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--primary-soft);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary-text);
    animation: uidMigrSpin 1.6s linear infinite;
  }
  .uid-migr-icon .icon {
    background: var(--primary);
    width: 28px; height: 28px;
  }
  .uid-migr-card.uid-migr--done .uid-migr-icon {
    background: rgba(16,185,129,.14);
    color: var(--success-text);
    animation: none;
  }
  .uid-migr-card.uid-migr--done .uid-migr-icon .icon {
    background: var(--success);
    /* Switch from refresh-arrow to check via mask swap */
    -webkit-mask-image: url('../../assets/svg/icons/icon_check.svg');
            mask-image: url('../../assets/svg/icons/icon_check.svg');
  }
  @keyframes uidMigrSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
  }
  .uid-migr-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 12px;
    letter-spacing: -.01em;
  }
  .uid-migr-msg {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
    margin: 0 0 22px;
  }
  .uid-migr-msg strong {
    color: var(--text);
    font-weight: 700;
  }
  .uid-migr-progress {
    margin-bottom: 16px;
  }
  .uid-migr-progress-track {
    height: 8px;
    background: var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
  }
  .uid-migr-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-hi));
    width: 0%;
    transition: width .25s ease;
    border-radius: 8px;
  }
  .uid-migr-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
  }
  .uid-migr-warn {
    font-size: 12px;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    line-height: 1.4;
  }
  .uid-migr-card.uid-migr--done .uid-migr-warn {
    display: none;
  }
  .uid-migr-card.uid-migr--done .uid-migr-msg {
    /* In success state, simplify to a one-liner */
    display: none;
  }
  .uid-migr-card.uid-migr--done .uid-migr-title::after {
    content: " — done";
    color: var(--success-text);
  }

  /* ── Confirm modal (phase 1) — user consent before migration starts ──
     Same visual base as the progress modal but DISMISSIBLE, with three
     action buttons. The icon doesn't spin (no operation in progress yet). */
  .uid-migr-confirm-card {
    max-width: 480px;
    text-align: center;
    padding: 32px 28px 24px;
  }
  .uid-migr-confirm-icon {
    animation: none;          /* override the spinning animation from .uid-migr-icon */
  }
  #uidMigrationConfirmCount {
    font-weight: 700;
    color: var(--text);
  }
  /* Mobile-app prerequisite warning — appears between the message and the
     action buttons. Soft amber container so it stands out without alarming. */
  .uid-migr-mobile-warn {
    display: flex; align-items: flex-start; gap: 10px;
    margin: 16px auto 0;
    max-width: 380px;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--warning-soft);
    color: var(--warning-text);
    text-align: left;
  }
  .uid-migr-mobile-warn-icon {
    flex: 0 0 14px;
    margin-top: 2px;
    background: var(--warning);
  }
  .uid-migr-mobile-warn-text {
    font-size: 13px; line-height: 1.45;
    color: var(--warning-text);
    font-weight: 500;
  }

  .uid-migr-confirm-actions {
    display: flex; flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
  }
  .uid-migr-confirm-btn {
    flex: 1 1 auto;
    min-width: 110px;
    height: 38px;
    padding: 0 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s, border-color .15s, color .15s;
  }
  .uid-migr-confirm-btn.ghost {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
  }
  .uid-migr-confirm-btn.ghost:hover {
    border-color: var(--primary);
    color: var(--primary-text);
    background: var(--primary-soft);
  }
  .uid-migr-confirm-btn.primary {
    background: var(--primary);
    border: 1.5px solid var(--primary);
    color: var(--text);
    box-shadow: 0 2px 10px color-mix(in srgb, var(--primary) 25%, transparent);
  }
  .uid-migr-confirm-btn.primary:hover {
    background: var(--primary-hover);
  }

  /* Friend view — full error state inside card-inv */
  .friend-inv-error {
    text-align: center;
    padding: 48px 24px;
    background: var(--danger-soft);
    border: 1.5px dashed var(--danger);
    border-radius: 14px;
    margin-top: 16px;
  }
  .friend-inv-error-icon {
    font-size: 36px; margin-bottom: 12px;
  }
  .friend-inv-error-title {
    font-size: 16px; font-weight: 700; color: var(--danger-text);
    margin-bottom: 6px;
  }
  .friend-inv-error-msg {
    font-size: 13px; color: var(--text); margin-bottom: 16px;
    font-family: var(--mono);
  }
  .friend-inv-error-hint {
    font-size: 12px; color: var(--muted); line-height: 1.5;
    max-width: 480px; margin: 0 auto 18px;
  }
  .friend-inv-error-actions {
    display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  }
  .fie-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px; border-radius: 9px;
    background: var(--surface); border: 1.5px solid var(--border);
    color: var(--text); font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: inherit;
    transition: background .15s, border-color .15s, color .15s;
  }
  .fie-btn:hover { background: var(--surface-2); border-color: var(--primary); color: var(--primary-text); }
  .fie-btn:hover .icon { background: var(--primary); }
  .fie-btn .icon { background: var(--text); }
  .fie-btn:disabled { opacity: .5; cursor: not-allowed; }
  .fie-btn--danger { color: var(--danger-text); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
  .fie-btn--danger .icon { background: var(--danger); }
  .fie-btn--danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger-text); }
  .fie-btn--danger:hover .icon { background: var(--danger); }

  /* ── color swatches ── */
  .eac-swatches {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; width: 100%; margin-top: 18px;
  }
  .eac-swatch {
    aspect-ratio: 1; border-radius: 50%; border: 2.5px solid transparent;
    cursor: pointer; padding: 0; width: 100%;
    transition: transform .15s, border-color .15s, box-shadow .15s;
  }
  .eac-swatch:hover { transform: scale(1.18); }
  .eac-swatch.active { border-color: var(--text); box-shadow: 0 0 0 2.5px var(--ink-30); transform: scale(1.12); }
  /* custom color swatch (label element, light context in hero) */
  .eac-swatch-custom {
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-2) !important;
    border: 2px dashed var(--border) !important;
    color: var(--muted); position: relative; overflow: hidden; cursor: pointer;
  }
  .eac-swatch-custom input[type="color"] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer;
    width: 100%; height: 100%; border: none; padding: 0;
  }
  .eac-swatch-custom:hover { color: var(--text) !important; }
  .eac-swatch-custom.active {
    border-style: solid !important; border-color: var(--primary) !important;
    box-shadow: 0 0 0 2.5px var(--primary-soft) !important;
  }
  /* hero: preset swatches keep white borders on dark-ish gradient bg */
  .eac-hero .eac-swatches { margin-top: 16px; }
  .eac-hero .eac-swatch[data-color] { border-color: var(--ink-10); }
  .eac-hero .eac-swatch[data-color].active { border-color: var(--on-dark); box-shadow: 0 0 0 2.5px rgba(255,255,255,.28); }

  /* add account modal */
  .modal-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px;
  }
  .modal-header .modal-title { text-align: left; font-size: 17px; margin: 0; }
  .modal-close {
    width: 28px; height: 28px; border-radius: 8px; border: none;
    background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
  }
  .modal-close:hover { background: var(--border); color: var(--text); }
  #addAccountModalOverlay .sb-field-label { color: var(--muted); }
  #addAccountModalOverlay .sb-field-input { background: var(--surface-2); border-color: var(--border); color: var(--text); }
  #addAccountModalOverlay .sb-field-input:focus { border-color: var(--primary); background: var(--primary-soft); }
  #addAccountModalOverlay .sb-eye { background: var(--surface-2); border-color: var(--border); color: var(--muted); }
  #addAccountModalOverlay .sb-eye:hover { background: var(--border) !important; color: var(--text) !important; }

  /* ── login modal (Firebase) ── */
  .login-card { width: 360px; }
  .login-google-btn {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-top: 14px; height: 42px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--surface-2);
    color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer;
    transition: background .15s, border-color .15s;
  }
  .login-google-btn:hover { background: var(--border); border-color: var(--muted); }
  .login-google-btn:disabled { opacity: .5; pointer-events: none; }
  .login-or {
    display: flex; align-items: center; gap: 10px;
    margin: 14px 0 4px; color: var(--muted); font-size: 12px;
  }
  .login-or::before, .login-or::after {
    content: ""; flex: 1; height: 1px; background: var(--border);
  }

  /* ── login modal 2026 redesign (lm-*) ── */
  #addAccountModalOverlay .lm-card {
    width: 400px; padding: 32px 32px 24px;
    border-radius: 22px; position: relative;
    display: flex; flex-direction: column;
  }
  #addAccountModalOverlay .lm-close {
    position: absolute; top: 16px; right: 16px; z-index: 2;
  }
  /* Ecosystem hero — opens the card, same artwork as the signed-out screen and the
     onboarding. Capped by viewport height too so the modal keeps the sign-in form
     reachable on a short window. */
  #addAccountModalOverlay .lm-hero-art {
    max-width: calc(26vh * 1120 / 580);
    /* The card's own 32px top padding already clears the top edge; the close
       button sits above on z-index 2. */
    margin: 0 auto 18px;
  }
  #addAccountModalOverlay .lm-google-btn {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
    height: 46px; border-radius: 12px;
    border: 1.5px solid var(--border); background: var(--surface);
    color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    transition: background .15s, border-color .15s, box-shadow .15s;
  }
  #addAccountModalOverlay .lm-google-btn:hover {
    background: var(--surface-2); border-color: rgba(0,0,0,.15);
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
  }
  #addAccountModalOverlay .lm-google-btn:disabled { opacity: .5; pointer-events: none; }
  /* "or" divider */
  #addAccountModalOverlay .lm-or {
    display: flex; align-items: center; gap: 10px;
    margin: 16px 0 4px; color: var(--muted); font-size: 12px;
  }
  #addAccountModalOverlay .lm-or::before, #addAccountModalOverlay .lm-or::after {
    content: ""; flex: 1; height: 1px; background: var(--border);
  }
  /* floating label fields */
  #addAccountModalOverlay .lm-field { position: relative; margin-top: 14px; }
  #addAccountModalOverlay .lm-input {
    width: 100%; height: 54px; padding: 0 14px;
    border: 1.5px solid var(--border); border-radius: 12px;
    font-size: 14px; background: var(--surface); color: var(--text); outline: none;
    transition: border-color .2s, box-shadow .2s;
  }
  #addAccountModalOverlay .lm-input:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
  }
  #addAccountModalOverlay .lm-input.lm-pass-input { padding-right: 44px; }
  #addAccountModalOverlay .lm-label {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%);
    font-size: 14px; color: var(--muted);
    pointer-events: none; line-height: 1;
    background: var(--surface); padding: 0 2px;
    transition: top .15s ease, font-size .15s ease, color .15s ease, transform .15s ease;
  }
  #addAccountModalOverlay .lm-input:focus ~ .lm-label,
  #addAccountModalOverlay .lm-input:not(:placeholder-shown) ~ .lm-label {
    top: 0; transform: translateY(-50%) scale(0.82);
    transform-origin: left center; color: var(--primary-text);
  }
  /* eye toggle */
  #addAccountModalOverlay .lm-eye {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px; border: none; background: transparent;
    color: var(--muted); cursor: pointer; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px; transition: color .15s;
  }
  #addAccountModalOverlay .lm-eye:hover { color: var(--text); }
  /* No :active transform hack needed — global press feedback is now
     `filter: brightness` (70-detail-misc.css); the eye stays centered. */
  /* "Check your inbox" step (after sign-up): the form steps aside */
  #addAccountModalOverlay .lm-card.is-check > :not(.lm-close):not(.lm-hero-art):not(.lm-check):not(.lm-report-link) { display: none; }
  #addAccountModalOverlay .lm-check[hidden] { display: none; }
  #addAccountModalOverlay .lm-check { text-align: center; animation: lm-check-in .35s ease both; }
  #addAccountModalOverlay .lm-check-env {
    position: relative; width: 72px; aspect-ratio: 1; margin: 4px auto 16px; border-radius: 50%;
    display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 16%, transparent);
    animation: lm-env-hop 2.4s ease-in-out infinite;
  }
  #addAccountModalOverlay .lm-check-env::after {
    content: ""; position: absolute; inset: -6px; border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--primary) 45%, transparent); animation: lm-env-ring 2.4s ease-out infinite;
  }
  #addAccountModalOverlay .lm-check-env .icon { background: var(--primary); }
  #addAccountModalOverlay .lm-check-title { margin: 0 0 8px; font-size: 22px; font-weight: 700; color: var(--text); }
  #addAccountModalOverlay .lm-check-sent { margin: 0; font-size: 14px; color: var(--muted); }
  #addAccountModalOverlay .lm-check-sent b { display: block; margin-top: 4px; font-size: 15px; color: var(--text); word-break: break-all; }
  #addAccountModalOverlay .lm-check-hint { margin: 14px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
  #addAccountModalOverlay .lm-check .lm-submit-btn { margin-top: 20px; }
  #addAccountModalOverlay .lm-check-links { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 14px; color: var(--muted); font-size: 13px; }
  #addAccountModalOverlay .lm-check-note { min-height: 18px; margin: 10px 0 0; font-size: 13px; color: var(--success-text); }
  @keyframes lm-check-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  @keyframes lm-env-hop { 0%, 100% { transform: translateY(0); } 12% { transform: translateY(-6px) rotate(-6deg); } 24% { transform: translateY(0) rotate(0); } }
  @keyframes lm-env-ring { 0% { opacity: .9; transform: scale(.9); } 70%, 100% { opacity: 0; transform: scale(1.25); } }
  @media (prefers-reduced-motion: reduce) { #addAccountModalOverlay .lm-check, #addAccountModalOverlay .lm-check-env, #addAccountModalOverlay .lm-check-env::after { animation: none; } }
  /* remember me + forgot password */
  #addAccountModalOverlay .lm-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 12px;
  }
  #addAccountModalOverlay .lm-check-wrap {
    display: flex; align-items: center; gap: 7px;
    font-size: 12.5px; color: var(--muted); cursor: pointer; user-select: none;
  }
  #addAccountModalOverlay .lm-check-wrap input[type="checkbox"] {
    position: absolute; opacity: 0; width: 0; height: 0;
  }
  #addAccountModalOverlay .lm-check-box {
    width: 16px; height: 16px; flex-shrink: 0;
    border: 1.5px solid var(--border); border-radius: 4px; background: var(--surface);
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, border-color .15s;
  }
  #addAccountModalOverlay .lm-check-wrap input[type="checkbox"]:checked ~ .lm-check-box {
    background: var(--primary); border-color: var(--primary);
  }
  #addAccountModalOverlay .lm-check-wrap input[type="checkbox"]:checked ~ .lm-check-box::after {
    content: ""; display: block; width: 9px; height: 5px;
    border-left: 2px solid var(--on-accent); border-bottom: 2px solid var(--on-accent);
    transform: rotate(-45deg) translateY(-1px);
  }
  #addAccountModalOverlay .lm-forgot-btn {
    background: none; border: none; padding: 0;
    font-size: 12.5px; color: var(--primary-text); cursor: pointer;
    transition: opacity .15s;
  }
  #addAccountModalOverlay .lm-forgot-btn:hover { opacity: .7; }
  /* result feedback */
  #addAccountModalOverlay #addModalResult { min-height: 0; }
  /* submit */
  #addAccountModalOverlay .lm-submit-btn {
    width: 100%; height: 46px; margin-top: 16px;
    border-radius: 12px; font-size: 14px; font-weight: 600;
    justify-content: center;
  }
  /* mode toggle footer */
  #addAccountModalOverlay .lm-mode-toggle {
    text-align: center; margin-top: 16px;
    font-size: 12.5px; color: var(--muted);
  }
  #addAccountModalOverlay .lm-mode-btn {
    background: none; border: none; padding: 0 0 0 4px;
    font-size: 12.5px; font-weight: 600; color: var(--primary-text);
    cursor: pointer; transition: opacity .15s;
  }
  #addAccountModalOverlay .lm-mode-btn:hover { opacity: .7; }

  /* "Report a problem" link inside the login modal */
  #addAccountModalOverlay .lm-report-link {
    display: block; margin: 14px auto 0;
    background: none; border: none; padding: 4px 8px;
    font-size: 11.5px; color: var(--muted);
    cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
    opacity: .8; transition: opacity .15s;
  }
  #addAccountModalOverlay .lm-report-link:hover { opacity: 1; color: var(--text); }

  /* Inline "Details" link inside an alert toast */
  .alert .alert-link {
    background: none; border: none; padding: 0;
    font: inherit; color: inherit;
    text-decoration: underline; text-underline-offset: 2px;
    cursor: pointer;
  }
  .alert .alert-link:hover { opacity: .75; }

  /* Badge on the report-problem button when errors are queued */
  .diag-badge {
    display: inline-block; margin-left: 6px;
    min-width: 16px; height: 16px; padding: 0 5px;
    border-radius: 8px;
    background: var(--danger); color: var(--on-accent);
    font-size: 10px; font-weight: 700; line-height: 16px;
    text-align: center; vertical-align: middle;
  }

  /* Diagnostic modal */
  #diagModalOverlay .modal-card.diag-card {
    width: min(640px, 92vw); padding: 20px 22px;
    display: flex; flex-direction: column; gap: 12px;
  }
  #diagModalOverlay .diag-header {
    display: flex; align-items: center; justify-content: space-between;
  }
  #diagModalOverlay .diag-title { font-size: 16px; font-weight: 600; }
  #diagModalOverlay .diag-sub { font-size: 12.5px; color: var(--muted); margin-top: -4px; }
  #diagModalOverlay .diag-body {
    width: 100%; min-height: 280px; max-height: 50vh;
    padding: 12px 14px; resize: vertical;
    background: var(--surface-2); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px; line-height: 1.5;
    white-space: pre; overflow: auto;
  }
  #diagModalOverlay .diag-actions {
    display: flex; justify-content: flex-end; gap: 8px;
  }

  /* main column */
  .main-col {
    flex: 1; min-width: 0;
    padding: 16px 20px 12px;
    display: flex; flex-direction: column; overflow: hidden;
  }

  header.top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
    position: relative; isolation: isolate;
  }
  /* Theme colour glow behind the header (--theme-tint, set from the account's
     — or the visited friend's — avatar colour): bleeds into the page padding,
     stays present across the width, fades out at the bottom. */
  header.top::before {
    content: ""; position: absolute; inset: -16px -20px -10px; z-index: -1; pointer-events: none;
    background: var(--theme-tint, none);
    -webkit-mask: linear-gradient(180deg, #000 70%, transparent); mask: linear-gradient(180deg, #000 70%, transparent);
    transition: background .4s;
  }
  /* Platinum "aurora" style: the theme's colours drift slowly across the header
     glow and the identity preview (_applyThemeColor sets has-theme-aurora). */
  :root.has-theme-aurora header.top::before { animation: theme-aurora 9s ease-in-out infinite alternate; }
  /* The wall is four layers (_auroraBg): three lights drifting their own way, the sky still. */
  @keyframes theme-aurora {
    0%   { background-size: 60% 140%, 60% 140%, 60% 140%, 100% 100%; background-position: 0% 0%, 100% 10%, 50% 100%, 0 0; }
    50%  { background-size: 70% 160%, 55% 130%, 65% 150%, 100% 100%; background-position: 60% 60%, 10% 80%, 90% 0%, 0 0; }
    100% { background-size: 55% 130%, 70% 160%, 60% 140%, 100% 100%; background-position: 25% 100%, 85% 30%, 40% 30%, 0 0; }
  }
  @media (prefers-reduced-motion: reduce) {
    :root.has-theme-aurora header.top::before { animation: none; }
  }
  /* TD1S / Scale / Cloud (and the optional RFID pill) — always pinned to
     the right edge of the header. `margin-left: auto` makes this work even
     when the stats wrap (`#sbStats`) is `.hidden` (display:none) and is
     therefore not contributing flex space, which would otherwise leave
     `justify-content: space-between` aligning the icons to the left. */
  .top-status-icons {
    display: flex; align-items: center; gap: 12px;
    margin-left: auto;
  }
  /* The device icons in a card like the stat cards beside them (.sb-stat), so a
     vivid theme colour never swallows them; a row, not the stat's column. */
  .sb-stat.top-devices { flex-direction: row; align-items: center; gap: 12px; padding: 8px 14px;
    /* the header cards' own look and height (.top-stats .sb-stat, 00-base.css) */
    box-sizing: border-box; height: var(--top-card-h, 68px); background: var(--surface-2); border: 1px solid var(--border); }
  /* In a friend's view the header shows THEIR counts only: my TigerCoins, RFID
     readers, scales, TigerSpool and Tiger Touch step aside (the app's own
     network / update icons stay). */
  body.is-friend-view #topCoins.top-coins,
  body.is-friend-view #rfidReadersBar,
  body.is-friend-view .top-status-icons .scale-health { display: none; }
  /* ...and the card that held them goes with them: left on its own it was an empty
     dark box at the right end of the header. It stays only while one of the icons
     that still show there (network problem, update ready) is up. */
  body.is-friend-view .sb-stat.top-devices:not(:has(#health:not(.hidden), #updateStatusIcon:not(.hidden))) { display: none; }
  header.top h1 { margin: 0; font-size: 24px; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
  header.top h1 .dot { width: 12px; height: 12px; border-radius: 4px; background: linear-gradient(135deg, var(--primary), var(--primary-hi)); display: inline-block; }
  header.top .subtitle { color: var(--muted); font-size: 13px; margin-top: 2px; }
  .health { display: flex; align-items: center; cursor: default; position: relative; }
  .health .icon { color: var(--neutral-text); transition: color .25s, filter .25s; }
  .health.ok  .icon { color: var(--success-text); filter: drop-shadow(0 0 6px var(--success)); }
  .health.bad .icon { color: var(--danger-text);  filter: drop-shadow(0 0 6px var(--danger)); }
  /* header cloud icon: 2× the shared .icon-20 size */
  #health .icon { width: 40px; height: 40px; }

  /* ── update status icon ── */
  .update-health-icon {
    display: block; height: 18px; aspect-ratio: 1;
    background-color: var(--neutral);
    -webkit-mask-image: url('../../assets/svg/icons/icon_download.svg');
    -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center;
    transition: background-color .25s, filter .25s;
  }
  /* downloading: orange + spinning refresh */
  .update-health.downloading .update-health-icon {
    background-color: var(--primary);
    -webkit-mask-image: url('../../assets/svg/icons/icon_refresh.svg');
    animation: updateSpin .9s linear infinite;
  }
  /* ready: green glow + download arrow */
  .update-health.ready { cursor: pointer; }
  .update-health.ready .update-health-icon {
    background-color: var(--success);
    filter: drop-shadow(0 0 5px var(--success));
  }
  @keyframes updateSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

  /* ── RFID readers (topbar) — single TigerPod icon + hover popover ──
        One Icon_tigerpod_3d.svg in the header (red = no reader · green =
        connected). Hovering reveals one row per reader (RFID #1 / #2) plus the
        UID of any chip currently presented in front of it. */
  .rfid-readers-bar { display: inline-flex; align-items: center; }
  .rfid-pod { position: relative; display: inline-flex; align-items: center; }
  .rfid-pod.disconnected { cursor: pointer; }
  .rfid-pod-icon {
    display: inline-block; height: 44px; aspect-ratio: 900.45 / 911.76; /* Icon_tigerpod_3d.svg viewBox cropped to its own bounding box */
    background-color: var(--neutral);
    -webkit-mask-image: url('../../assets/svg/icons/Icon_tigerpod_3d.svg');
    /* 34px of ink — matches the TigerScale neighbour (see tigerscale.css .scale-health-icon) */
    -webkit-mask-size: auto 34px; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center;
    transition: background-color .3s, filter .3s;
  }
  .rfid-pod.connected    .rfid-pod-icon { background-color: var(--success); filter: drop-shadow(0 0 4px color-mix(in srgb, var(--success) 45%, transparent)); }
  .rfid-pod.card-present .rfid-pod-icon { filter: drop-shadow(0 0 7px var(--success)); }
  .rfid-pod.disconnected .rfid-pod-icon { background-color: var(--danger); }
  /* Live "ready to scan" indicator — a small green dot with an expanding ping
     ring, shown only while a reader is connected (real-time / active). The pod
     icon itself stays static; a tag present makes the ping pulse faster. */
  .rfid-pod-live {
    position: absolute; top: 1px; right: -1px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--success); display: none; pointer-events: none;
    box-shadow: 0 0 0 2px var(--surface);
  }
  .rfid-pod.connected .rfid-pod-live,
  .rfid-pod.card-present .rfid-pod-live { display: block; }
  .rfid-pod-live::before {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    background: var(--success); opacity: 0;
  }
  .rfid-pod.connected .rfid-pod-live::before,
  .rfid-pod.card-present .rfid-pod-live::before { animation: rfid-live-ping 1.4s ease-out infinite; }
  .rfid-pod.card-present .rfid-pod-live::before { animation-duration: .8s; }
  @keyframes rfid-live-ping {
    0%   { transform: scale(1);   opacity: .55; }
    100% { transform: scale(2.6); opacity: 0; }
  }
  @media (prefers-reduced-motion: reduce) {
    .rfid-pod-live::before { animation: none; }
  }

  /* hover popover */
  /* Same chrome/position as the .health tooltip above (right-anchored, 7px
     radius, 11px text) so the four header hovers read as one family — this pod
     one just carries one row per reader (dot + full name + UID). */
  .rfid-pod-pop {
    position: absolute; top: calc(100% + 7px); right: 0; left: auto;
    transform: translateY(-4px);
    background: var(--dark-surface); border: 1px solid var(--dark-border); border-radius: 7px;
    padding: 5px 10px; display: flex; flex-direction: column; gap: 5px;
    opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s;
    box-shadow: 0 4px 12px rgba(0,0,0,.3); z-index: 60;
  }
  .rfid-pod:hover .rfid-pod-pop { opacity: 1; transform: translateY(0); }
  .rfid-pod-row { display: flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 11px; font-weight: 600; color: var(--on-dark); }
  .rfid-pod-row .rrd-dot {
    width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
    background: var(--success);
  }
  .rfid-pod-row.card-present .rrd-dot { background: var(--surface); }
  .rfid-pod.disconnected .rfid-pod-row .rrd-dot { background: var(--danger); }
  .rfid-pod-row .rrd-name { overflow: hidden; text-overflow: ellipsis; }   /* full text — no fixed max-width */
  .rfid-pod-uid { margin-left: auto; padding-left: 10px; font-family: ui-monospace, monospace; font-size: 10px; color: var(--success-text); letter-spacing: .03em; }

  /* Unified header status tooltip — a state-coloured dot + the full text, same
     chrome/position/font as the TigerPod popup below. `--tip-dot` is set per
     device state (green connected · red disconnected · muted idle). */
  .health { --tip-dot: var(--muted); }
  .td1s-health.td1s-connected,
  .scale-health.scale-connected,
  #health.ok { --tip-dot: var(--success); }
  .td1s-health:not(.td1s-connected),
  .scale-health:not(.scale-connected),
  #health.bad { --tip-dot: var(--danger); }
  .health::after {
    content: attr(data-tooltip);
    position: absolute; top: calc(100% + 7px); right: 0;
    padding: 5px 10px 5px 21px;   /* left room for the dot */
    background: radial-gradient(circle at 11px 50%, var(--tip-dot) 0 3px, transparent 3px) no-repeat, var(--dark-surface);
    color: var(--on-dark); border: 1px solid var(--ink-10);
    border-radius: 7px; font-size: 11px; font-weight: 600; white-space: nowrap;
    opacity: 0; pointer-events: none; transition: opacity .15s;
    box-shadow: 0 4px 12px rgba(0,0,0,.3); z-index: 50;
  }
  .health:hover::after { opacity: 1; }

  .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
  .card h2 { font-size: 15px; margin: 0 0 12px; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
  .card h2 .num { width: 22px; height: 22px; border-radius: 6px; background: var(--surface-2); color: var(--text); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
  .card .desc { color: var(--muted); font-size: 13px; margin: -6px 0 14px; }

  .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .row.between { justify-content: space-between; }

  label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); flex: 1 1 180px; }
  input[type="text"], input[type="email"], input[type="number"] {
    height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); font-size: 14px;
    transition: border-color .15s, box-shadow .15s; font-family: inherit; width: 100%;
  }
  input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
  input.mono { font-family: var(--mono); letter-spacing: .04em; }

  /* ── Add product side panel ────────────────────────────────────────
     Slide-in side card matching the spool detail panel exactly (no
     width override — inherits `.detail-panel { width: 300px }`). The
     JS open path reads the user-persisted width from
     `tigertag.panelWidth.detail` so the add panel always matches the
     spool detail panel width the user is comfortable with.

     Dark theme — mirrors the mobile companion app's TigerTag creator
     screen: pure-black canvas, white labels, dark-grey input wells.
     Local `--surface*` overrides scope the dark palette to this panel
     only so the rest of the app's light theme stays untouched. */
  .adp-panel {
    --adp-bg:        #000;
    /* Anthracite — slightly bluer than pure grey, mirrors the Flutter
       "Create TigerTag maker" screen. Inputs sit on this fill, the
       panel canvas is pure black behind. */
    --adp-surface:   #1f242e;
    --adp-surface-2: #2a313e;
    /* Visible white border on every input/select — user feedback
       called for inputs that read clearly against the black canvas. */
    /* Literal white alphas, NOT the ink ladder: this panel is deliberately
       dark in both themes (it mirrors the Flutter app's product screen), so
       themed ink would flip to black-on-black the moment Light is picked. */
    --adp-border:    rgba(255,255,255,.60);
    --adp-border-soft: rgba(255,255,255,.10);
    --adp-text:      var(--on-dark);
    --adp-muted:     rgba(255,255,255,.85);
    color: var(--adp-text);
    /* Match the Flutter app's typography — Material 3 ships with
       Roboto on Android, falls back to SF on iOS, both are inherited
       through `system-ui` on the matching desktop OS. The explicit
       Roboto / Inter fallbacks pick up on Linux distros that don't
       map system-ui to Roboto by default. */
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text",
                 "Roboto", "Inter", "Segoe UI", system-ui, sans-serif;
    /* Default weight bumped to 700 — every label, value, and section
       title in this panel reads as bold per user request. Specific
       overrides (e.g. the byte counter mono digits at 600) sit
       below this rule and win on element specificity. */
    font-weight: 700;
    -webkit-font-smoothing: antialiased;
  }
  /* Cascade — every text-bearing descendant of the panel inherits the
     bold weight unless it specifies otherwise. */
  .adp-panel,
  .adp-panel input,
  .adp-panel select,
  .adp-panel button,
  .adp-panel option,
  .adp-panel label,
  .adp-panel .panel-title,
  .adp-panel .adp-label,
  .adp-panel .adp-section-title,
  .adp-panel .adp-stat-title,
  .adp-panel .adp-stat-label,
  .adp-panel .adp-banner-tag {
    font-weight: 700;
  }
  /* The big stat value (190 / 240 / 50 / 8) — extra heavy so the
     numbers dominate visually like in the Flutter screen. */
  .adp-panel .adp-stat-input {
    font-weight: 800;
    letter-spacing: -.01em;
  }
  /* Use the doubled selector to outrank `.detail-panel { background:
     var(--surface) }` from 70-detail-misc.css — the loose `.adp-panel`
     selector loses the cascade race because 70-* loads after 60-*.
     Two classes + the same file order is enough specificity to pin
     the background to pure black like the Flutter creator screen. */
  .adp-panel.detail-panel {
    background: var(--adp-bg);
    border-color: var(--ink-06);
    width: 400px; /* wider than the spool detail panel (300px) — more breathing room */
  }
  .adp-panel.detail-panel .panel-body { background: var(--adp-bg); }
  .adp-panel .panel-header { border-bottom: 0; }   /* no rule above the colour picker */
  .adp-panel .panel-title { color: var(--adp-text); }
  .adp-panel .modal-close {
    color: var(--adp-muted);
    background: transparent;
  }
  .adp-panel .modal-close:hover { color: var(--adp-text); }

  .adp-head {
    /* Override the default flex-center alignment so the multi-line
       title + sub stack correctly to the left of the close button. */
    align-items: flex-start !important;
  }
  .adp-head-text { flex: 1; min-width: 0; }
  /* TD1S sensor button — sits between the title and the close button.
     The mask-image reuses the same icon_td1s.svg asset as the sidebar
     health icon. Green glow when the sensor is connected. */
  .adp-td1s-btn {
    align-self: center;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: 0; border-radius: 8px;
    cursor: pointer; padding: 4px 6px;
    transition: background .12s;
  }
  .adp-td1s-btn:hover { background: var(--ink-08); }
  .adp-td1s-btn::before {
    content: "";
    display: block;
    /* Only height is forced — width derives from the SVG viewBox ratio
       (52 × 22) so the icon is never distorted regardless of future
       SVG edits. Same visual size as the sidebar td1s-health-icon. */
    height: 18px;
    aspect-ratio: 52 / 22;
    background-color: var(--ink-30);
    -webkit-mask-image: url('../../assets/svg/icons/icon_td1s.svg');
    -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center;
    transition: background-color .3s, filter .3s;
  }
  .adp-td1s-btn.td1s-connected::before {
    background-color: var(--success);
    filter: drop-shadow(0 0 5px var(--success));
  }
  .adp-head-sub {
    margin-top: 3px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
  }
  /* Side padding token — change `--adp-side-padding` in one place to
     tighten / loosen ALL of header, body, footer at once. Doubled
     class selectors (`.adp-panel .panel-body.adp-body`) outrank the
     global `.panel-body { padding: 0 0 24px }` in 70-detail-misc.css
     which used to win the cascade race and zero out the side padding. */
  .adp-panel { --adp-side-padding: 22px; }

  .adp-panel .panel-body.adp-body {
    padding: 8px var(--adp-side-padding) 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: none;           /* Firefox — hide the scrollbar (still scrolls) */
  }
  .adp-panel .panel-body.adp-body::-webkit-scrollbar { width: 0; height: 0; }   /* Chromium */
  /* The body scrolls — its sections must keep their natural height, not be
     squeezed by the column flex (the preview card overflowed its section). */
  .adp-panel .panel-body.adp-body > * { flex-shrink: 0; }
  .adp-panel .panel-header {
    padding: 14px var(--adp-side-padding);
  }
  .adp-panel .adp-foot {
    padding: 12px var(--adp-side-padding) 18px;
  }


  /* Color row — the preview card column ("Select Color" label above it)
     beside the identity stack. */
  .adp-color-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  .adp-label--centered { text-align: center; }

  /* Pill toggle — same visual as the mobile cupertino-style switch. */
  .adp-toggle {
    width: 40px; height: 22px;
    border-radius: 999px;
    background: var(--ink-20);
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
    transition: background .15s;
  }
  .adp-toggle[data-on="true"] { background: var(--success); }
  .adp-toggle-knob {
    position: absolute;
    top: 2px; left: 2px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(0,0,0,.4);
    transition: left .15s;
  }
  .adp-toggle[data-on="true"] .adp-toggle-knob { left: 20px; }
  .adp-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .adp-section-title {
    margin: 0;
    /* Same size / weight / colour as the stat-card titles ("Nozzle
       Temp." / "Drying") so every visible LABEL across the panel
       has one consistent visual rank. No uppercase — match the
       title-case of the stat titles exactly. */
    font-size: 13px;
    font-weight: 700;
    color: var(--adp-text);
  }
  .adp-grid-2 {
    display: grid;
    /* auto-fit collapses to a single column at narrow widths so the
       form stays readable when the panel inherits the default 300px
       spool-detail width. Falls back to 2-col cleanly past ~340px. */
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px 12px;
  }
  .adp-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }
  .adp-row--full { grid-column: 1 / -1; }
  .adp-label {
    /* Aligned to "Nozzle Temp." style: 13px / 700 / white, no
       uppercase. All field labels (Brand / Material / Aspect 1 /
       Type / Diameter / Weight / TD / Min / Max / Temp / Time /
       Select Color / Dual Link) share this single visual rank. */
    font-size: 13px;
    font-weight: 700;
    color: var(--adp-text);
    text-transform: none;
    letter-spacing: 0;
  }
  /* Dark-theme inputs — scoped to .adp-panel via parent selector so
     the global form styling stays untouched. Pure-white 1.5 px
     contour — every identity picker (Brand / Material / Aspect 1 /
     Type / Diameter selects + the colour-name input) shares the
     exact same stroke weight, matching the mobile creator screen. */
  .adp-panel .adp-select,
  .adp-panel .adp-input {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border: 1.5px solid var(--on-dark);
    border-radius: 10px;
    background: var(--adp-surface);
    color: var(--adp-text);
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color .12s, box-shadow .12s, background .12s;
  }
  .adp-panel .adp-select:focus,
  .adp-panel .adp-input:focus {
    outline: none;
    border-color: var(--text);
    background: var(--adp-surface-2);
    box-shadow: 0 0 0 3px rgba(255,255,255,.12);
  }
  /* Native <select> dropdown arrow — replaced with the SAME solid
     downward triangle the Brand trigger button uses, so every
     identity picker (Brand button + Material/Type/Aspect/Diameter
     selects) shares one visual chrome. Inline SVG via data-URI keeps
     the hit count zero. */
  .adp-panel .adp-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 5'><path d='M0 0l4 5 4-5z' fill='var(--ink-60)'/></svg>");
    background-position: right 12px center;
    background-size: 8px 5px;
    background-repeat: no-repeat;
    padding-right: 28px;
  }
  /* Drop-down options keep the OS theme — but force readable colours
     for browsers that respect `option { color }` (Chromium does). */
  .adp-panel .adp-select option {
    background: var(--adp-surface);
    color: var(--adp-text);
  }

  /* ── App-styled dropdown (.csel via _enhanceSelect) inside the panel ────────
     The plain <select>s (Type / Aspect / Diameter / Unit) swap their unstylable
     OS option list for a dark, on-theme popup. The .csel button is restyled to
     the EXACT .adp-select field look, so the panel chrome is unchanged — only
     the open menu is now app-styled (and consistent with the toolbar filters). */
  .adp-panel .csel { display: block; width: 100%; }
  /* Type row keeps its content-width sizing next to the cog / advanced toggle. */
  .adp-type-row .csel { flex: 0 0 auto; width: auto; min-width: 130px; max-width: 60%; }
  .adp-panel .csel-btn {
    width: 100%; height: 36px; max-width: none; box-sizing: border-box;
    display: flex; align-items: center; justify-content: flex-start; text-align: left;
    padding: 0 28px 0 10px;
    border: 1.5px solid var(--on-dark); border-radius: 10px;
    background-color: var(--adp-surface); color: var(--adp-text);
    font-size: 13px; font-family: inherit; cursor: pointer;   /* weight inherits the panel's 700, like the Brand/Material triggers */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 5'><path d='M0 0l4 5 4-5z' fill='var(--ink-60)'/></svg>");
    background-position: right 12px center; background-size: 8px 5px; background-repeat: no-repeat;
    transition: border-color .12s, box-shadow .12s, background-color .12s;
  }
  /* Label fills the button and stays left-aligned, exactly like .adp-trigger-label
     on Brand / Material — same 13px, same normal weight, same ellipsis. */
  .adp-panel .csel-label { flex: 1; min-width: 0; text-align: left; font-size: 13px; color: var(--adp-text); }
  .adp-panel .csel-btn:hover,
  .adp-panel .csel--open .csel-btn { background-color: var(--adp-surface-2); }
  .adp-panel .csel--open .csel-btn { box-shadow: 0 0 0 3px rgba(255,255,255,.12); }
  /* Neutralise the filter's orange "is-active" look — a panel field always holds
     a value, it is not a filter. */
  .adp-panel .csel-btn.is-active {
    color: var(--adp-text); background-color: var(--adp-surface);
    border-color: #fff;   /* keep the panel's bold weight — don't reset it here */
  }
  .adp-panel .csel-btn.is-active:hover,
  .adp-panel .csel--open .csel-btn.is-active { background-color: var(--adp-surface-2); }
  .adp-panel .csel-pop {
    max-width: none; background: var(--adp-surface);
    border: 1.5px solid var(--ink-85); border-radius: 10px;
    box-shadow: 0 16px 40px rgba(0,0,0,.45);
  }
  .adp-panel .csel-opt { color: var(--adp-text); font-size: 13px; font-weight: 400; }
  .adp-panel .csel-opt:hover { background: var(--adp-surface-2); }
  /* Selected option: highlighted by the background only — NO bold, so it stays
     iso with every other panel field. */
  .adp-panel .csel-opt.is-sel { color: var(--text); font-weight: 400; background: var(--ink-10); }

  /* Top row — round swatch on left, identity stack on right.
     `align-items: stretch` so the stack fills the row's vertical
     extent; the swatch stays centred via its own `align-self: center`. */
  .adp-color-row {
    display: flex;
    align-items: stretch;
    gap: 14px;
  }
  .adp-color-row > .adp-color-circle { align-self: center; }
  .adp-identity-stack {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  /* The colour preview IS a grid card (`.spool-card` + _gridCardInnerHTML),
     so what you pick is what the grid will show. The button is only the
     click target round it: no chrome of its own, the card brings its
     rounded corners, border and body. Width = a grid card's (163 px) scaled
     down to sit beside the three identity selects. */
  .adp-color-circle {
    width: 140px;
    /* The global `button { height: 40px; display: inline-flex }` would clip
       the card to 40 px and let it spill over its neighbours. */
    height: auto; display: block;
    padding: 0; border: none; background: none;
    cursor: pointer; flex-shrink: 0; text-align: left;
    transition: transform .1s;
  }
  .adp-color-circle:hover { transform: translateY(-1px); }
  .adp-color-circle:active { transform: translateY(0); }
  .adp-color-circle .adp-card-preview { pointer-events: none; cursor: inherit; }
  .adp-color-circle:hover .adp-card-preview { box-shadow: 0 4px 16px rgba(0,0,0,.25); }
  /* A preview is never selected / tickable. */
  .adp-card-preview .sel-check { display: none; }
  /* Colour-name row — full width below the colour/identity row.
     The 28-byte counter sits to the right of the input, vertically
     centred on the input itself (so it reads as part of the field). */
  .adp-color-name-row {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .adp-color-name-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
  }
  .adp-color-name-row .adp-input { flex: 1; min-width: 0; }
  /* Reserve room for the inline ✕ clear button on the right. */
  .adp-input--with-clear { padding-right: 38px !important; }
  /* Doubled selector to outrank the global `input[type="text"]`
     specificity (0,1,1). Height bumped to ~46 px so the field has
     the same visual weight as the mobile creator screen (was 36 px
     and looked squashed). Border width matches the identity selects
     above (1.5 px white) so every "input you can type / pick into"
     reads as one consistent surface family. */
  .adp-panel .adp-color-name-wrap .adp-input--with-clear {
    border: 1.5px solid var(--on-dark);
    border-radius: 16px;
    height: 46px;
    font-size: 14px;
  }
  .adp-panel .adp-color-name-wrap .adp-input--with-clear:focus {
    border-color: var(--text);
    box-shadow: 0 0 0 3px rgba(255,255,255,.12);
  }
  /* Re-position the inline ✕ clear button so it stays vertically
     centred inside the now-taller field. */
  .adp-color-name-wrap .adp-input-clear {
    width: 28px;
    height: 28px;
  }
  .adp-input-clear {
    position: absolute;
    right: 6px; top: 50%;
    transform: translateY(-50%);
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--ink-10);
    border: none;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .12s;
  }
  .adp-input-clear:hover { background: var(--ink-20); }
  .adp-input-clear .icon { background: var(--on-accent); }
  .adp-input-clear[hidden] { display: none; }
  /* Press feedback: re-apply the centering transform so the button stays
     vertically centered on click — the global `button:active` would otherwise
     overwrite this absolute-positioned button's centering transform.
     Matches the pattern of `.inv-search-clear:active` / `.adp-brand-search-clear:active`. */
  .adp-input-clear:active { transform: translateY(-50%) scale(.92); }

  /* Byte counter — visually hidden per user request. The 28-byte
     truncation logic in the input handler still runs, so paste /
     typing past the cap is silently capped without showing the pill.
     Kept in the markup so re-enabling is just `display: flex` here. */
  .adp-byte-counter {
    display: none;
    flex-shrink: 0;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--adp-muted);
    letter-spacing: .04em;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--adp-surface);
    border: 1px solid var(--adp-border);
    transition: color .12s, border-color .12s, background .12s;
  }
  .adp-byte-counter[data-byte-state="warn"] {
    color: #ffb45b;
    border-color: rgba(255,180,91,.35);
    background: rgba(255,180,91,.08);
  }
  .adp-byte-counter[data-byte-state="full"] {
    color: var(--danger-text);
    border-color: color-mix(in srgb, var(--danger) 45%, transparent);
    background: color-mix(in srgb, var(--danger) 10%, transparent);
  }
  :root:not([data-theme="dark"]) .adp-byte-counter[data-byte-state="warn"] { color: var(--warning-text); }
  .adp-byte-counter-sep { opacity: .5; margin: 0 1px; }
  .adp-byte-counter-max { opacity: .65; }

  .adp-color-hex {
    margin-top: 6px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--adp-muted);
    letter-spacing: .04em;
  }
  /* Native <input type="color"> kept off-screen — we drive it from
     the swatch click handler so users see only the styled circle. */
  .adp-color-native {
    position: absolute;
    width: 1px; height: 1px;
    opacity: 0; pointer-events: none;
  }

  /* Mono palette grid — 24 presets plus a custom slot at the end
     (eyedropper icon → opens native colour picker). 5 columns wide,
     responsive cell size. */
  .adp-color-presets {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
  }
  .adp-color-swatch {
    aspect-ratio: 1 / 1;
    border-radius: 999px;
    border: 1px solid var(--border);
    cursor: pointer;
    padding: 0;
    transition: transform .1s, box-shadow .1s;
    position: relative;
  }
  .adp-color-swatch:hover  { transform: scale(1.08); }
  .adp-color-swatch.is-selected {
    box-shadow: 0 0 0 2px var(--primary), 0 0 0 4px var(--surface);
    border-color: var(--primary);
  }
  .adp-color-swatch--custom {
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .adp-color-swatch--custom .icon {
    background: var(--muted);
    width: 14px; height: 14px;
  }

  /* Advanced toggle — collapsible block bridging the basic form and
     the RFID data preview. Header is a button row with chevron that
     rotates 90° when open (same pattern as .pp-section--collapsible). */
  .adp-advanced-section {
    border-top: 1px solid var(--adp-border-soft);
    padding-top: 14px;
  }
  .adp-advanced-head {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 0;
    background: transparent;
    border: none;
    color: var(--adp-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
  }
  .adp-advanced-head .icon { background: var(--adp-muted); }
  .adp-advanced-title { flex: 1; }
  .adp-advanced-chev {
    transition: transform .15s;
    background: var(--adp-muted);
  }
  .adp-advanced-head[data-collapsed="false"] .adp-advanced-chev {
    transform: rotate(90deg);
  }
  .adp-advanced-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 10px;
  }

  /* RFID Data preview — DEBUG ONLY. Now uses the canonical
     `<details class="debug">` pattern from the spool detail panel
     (cf. inventory.js → `state.debugEnabled` block + 70-detail-misc.css
     `details.debug summary`). The container `.adp-rfid-section`
     gets `[hidden]` toggled at panel-open time so the whole block
     vanishes for non-debug users.
     The copy-JSON button is rendered as a SIBLING of the <details>
     (not inside the <summary>) and absolutely positioned in the
     top-right corner — that way clicking it can never bubble up to
     toggle the <details> open/closed. */
  .adp-rfid-section {
    position: relative;
    margin-top: 12px;
  }
  .adp-rfid-section .adp-rfid-copy {
    position: absolute;
    top: -2px;
    right: 0;
    z-index: 2;
    appearance: none;
    background: transparent;
    border: 0;
    padding: 4px;
    border-radius: 6px;
    color: #fff;                      /* propagates to .icon via currentColor */
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .12s, transform .12s;
  }
  .adp-rfid-section .adp-rfid-copy:hover  { background: var(--ink-10); }
  .adp-rfid-section .adp-rfid-copy:active { background: var(--ink-20); transform: scale(.96); }
  /* `.copied` flash — JS toggles this for ~1.8 s after a successful
     clipboard write. Tints the icon green to confirm without needing
     a toast. */
  .adp-rfid-section .adp-rfid-copy.copied { color: #4ade80; }
  :root:not([data-theme="dark"]) .adp-rfid-section .adp-rfid-copy.copied { color: var(--success-text); }

  /* Add-product colour sheets — width syncs to the parent side panel
     so the two surfaces feel like one. Backdrop click closes them
     (no ✕ button) and there's no grip handle either — same minimal
     look as the mobile creator screen.

     Width is set inline at open time via JS (matches the same value
     used for `#addProductPanel`), so nothing is hardcoded here. The
     width override below is a safety floor in case JS doesn't run. */
  .sfe-sheet.adp-color-sheet {
    width: 400px;          /* matches .adp-panel.detail-panel default */
    max-width: 95vw;
    /* Round all 4 corners since the sheet now has more room around
       it on the right edge of the screen — looks like a card, not
       a wedge. */
    border-radius: 18px 18px 14px 14px;
  }
  .sfe-sheet.adp-color-sheet .sfe-grip { display: none; }
  .sfe-sheet.adp-color-sheet .sfe-body { padding: 16px; }

  /* Anthracite canvas for the colour PRESET + CUSTOM sheets only —
     scoped via `.sfe-sheet--color.adp-color-sheet` so it never bleeds
     into the Snapmaker / FlashForge filament-edit colour sheets that
     also use `.sfe-sheet--color`. The brand / material sheets carry
     `.adp-brand-sheet` instead, so they keep their own background. */
  .sfe-sheet--color.adp-color-sheet {
    background: #1f242e;            /* matches the brand sheet + adp inputs */
    color: var(--on-dark);
    border-color: var(--ink-08);
  }
  /* Preset swatches — solid 1 px black ring so every colour reads
     crisply against the anthracite canvas (the 8 % inset ring used
     elsewhere disappears on dark backgrounds). The selected ring
     keeps its primary-coloured outer halo on top of the black border. */
  .sfe-sheet--color.adp-color-sheet .sfe-color-cell {
    box-shadow: 0 0 0 1px #000;
  }
  .sfe-sheet--color.adp-color-sheet .sfe-color-cell.is-selected {
    box-shadow: 0 0 0 1px #000, 0 0 0 3px var(--primary);
  }
  /* Custom slot — last cell of the grid. JS paints its background to
     the currently-selected hex so the user can see at a glance which
     colour the picker will open on. The edit pencil sits on top. Its
     colour is set inline from readableTextOn(swatch) in _adpRenderColorPresets, so
     it flips to black on a pale swatch — the `background` here is only the fallback
     for a swatch we could not read. The drop-shadow halo that used to force a white
     pencil to stay visible is gone: it was compensating for the missing flip, and
     on a light colour it read as a smudge. */
  .sfe-sheet--color.adp-color-sheet .sfe-color-cell--custom .icon {
    background: var(--surface);
    width: 18px; height: 18px;
  }

  /* ── Mono / Dual / Tri colour-count selector ────────────────────── */
  .adp-color-count-row {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
  }
  .adp-color-count-btn {
    flex: 1;
    padding: 6px 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .03em;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
  }
  .adp-color-count-btn.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-accent);
  }
  .adp-color-count-btn:not(.is-active):hover {
    background: var(--surface-3);
    color: var(--text);
  }

  /* ── Slot indicator row (Dual / Tri) ───────────────────────────── */
  .adp-color-slots-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 12px;
  }
  .adp-color-slot-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color .15s, transform .1s;
  }
  .adp-color-slot-btn.is-active {
    border-color: var(--primary);
    transform: scale(1.1);
    box-shadow: 0 0 0 2px var(--primary-20);
  }

  /* Add-product sheet backdrops — limited to the panel area (right
     slice), NOT the full screen. The "outside the panel" region keeps
     the panel-overlay's normal dim, and a click there cascades both
     the sheet AND the panel close. Width is set inline by JS to
     match the panel; the CSS values below are the fallback. */
  #adpColorBackdrop,
  #adpColorCustomBackdrop,
  #adpBrandBackdrop,
  #adpMaterialBackdrop {
    /* Anchor to the right edge — same docking as the sheet itself. */
    left: auto;
    right: 0;
    width: 400px;
    max-width: 95vw;
    /* Slightly lighter dim than the global .sfe-backdrop (.4) since
       it's already on top of the panel-overlay's .3 — stacking the
       two at full opacity is too dark. */
    background: rgba(0,0,0,.25);
    /* No blur: the colour preview behind must stay sharp while it is edited. */
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  /* The colour sheets don't dim either — the live preview is what you judge. */
  #adpColorBackdrop,
  #adpColorCustomBackdrop { background: transparent; }

  /* Trigger buttons — visually iso to .adp-select but click opens a
     bottom sheet instead of the OS native dropdown. The hidden
     <select> beside each trigger still owns the canonical value so
     the save path keeps working unchanged. */
  .adp-panel .adp-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-align: left;
    cursor: pointer;
    /* Strip the native button defaults that compete with the styled
       look inherited from .adp-select. */
    appearance: none;
    -webkit-appearance: none;
    background-image: none;
  }
  .adp-trigger-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .adp-trigger-chev {
    width: 0; height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--ink-60);
    flex-shrink: 0;
  }

  /* Brand bottom-sheet — anthracite canvas, 90 vh tall, search at
     the top, scrollable list of rows below. Inherits the
     .adp-color-sheet rule for width (synced to panel) + corners. */
  .adp-brand-sheet {
    height: 90vh;
    max-height: 90vh;
    background: #1f242e;          /* anthracite, matches input wells */
    color: var(--on-dark);
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text",
                 "Roboto", "Inter", "Segoe UI", system-ui, sans-serif;
  }
  /* Search row — pinned at top, anchored above the scroll container. */
  .adp-brand-search-row {
    flex-shrink: 0;
    padding: 14px 16px;
    border-bottom: 1px solid var(--ink-08);
  }
  .adp-brand-search-wrap {
    position: relative;
    width: 100%;
  }
  /* Doubled selector (`.adp-brand-sheet .adp-brand-search-input`)
     bumps specificity to (0,2,0) so we outrank the global
     `input[type="text"]` rule (0,1,1) at the bottom of this file
     which was forcing the input back to the light theme on blur
     (white bg + dark text). */
  .adp-brand-sheet .adp-brand-search-input {
    width: 100%;
    height: 36px;
    border: 1px solid var(--ink-20);
    border-radius: 10px;
    /* Lighter grey than the anthracite sheet so the field reads as
       a distinct surface — pops out against the #1f242e canvas. */
    background: #3a4051;
    color: var(--text);
    /* Same rank as "Nozzle Temp." — 13 px / 700, white when typed.
       Placeholder stays at the lighter `var(--ink-40)` set
       just below so the empty-state hint remains soft. */
    font-size: 13px;
    font-weight: 700;
    /* Right padding accommodates the clear ✕ + the loupe inside the
       input, matching the main inventory search pattern. */
    padding: 0 64px 0 12px;
    box-sizing: border-box;
    font-family: inherit;
  }
  .adp-brand-sheet .adp-brand-search-input:focus {
    outline: none;
    border-color: var(--ink-60);
    background: #444a5c;
    color: var(--text);
    box-shadow: 0 0 0 3px rgba(255,255,255,.08);
  }
  .adp-brand-sheet .adp-brand-search-input::placeholder {
    color: var(--ink-40);
  }
  /* Loupe icon — anchored at the right edge inside the input. */
  .adp-brand-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--ink-60);
    pointer-events: none;
  }
  /* Clear ✕ — sits to the LEFT of the loupe, visible only when the
     input has a value (renderer toggles `hidden` attr). Mirrors the
     main inventory search bar's UX. */
  .adp-brand-search-clear {
    position: absolute;
    right: 36px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--ink-20);
    color: var(--ink-85);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .12s, color .12s, transform .1s;
  }
  .adp-brand-search-clear:hover { background: var(--ink-30); color: var(--text); }
  .adp-brand-search-clear:active { transform: translateY(-50%) scale(.92); }
  .adp-brand-search-clear[hidden] { display: none; }
  .adp-brand-search-clear .icon { background: currentColor; }

  /* Scrollable brand list — extra left padding so rows don't hug the
     edge. Each row reads as a "card" on the anthracite sheet via the
     grey fill (matches the search input above for visual continuity). */
  .adp-brand-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 6px 14px 12px;          /* + horizontal breathing room */
    display: flex;
    flex-direction: column;
    gap: 4px;
    scrollbar-width: none;           /* Firefox — hide the scrollbar (still scrolls) */
  }
  .adp-brand-list::-webkit-scrollbar { width: 0; height: 0; }   /* Chromium */
  .adp-brand-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px 10px 18px;     /* extra left for breathing */
    /* Grey fill iso to the search input — rows feel like part of the
       same surface family rather than floating on the dark sheet. */
    background: #3a4051;
    border: none;
    border-radius: 10px;
    color: #fff;                      /* always white text */
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: background .12s, transform .08s;
  }
  .adp-brand-row:hover {
    background: #444a5c;              /* same focus tone as the input */
  }
  .adp-brand-row:active { transform: scale(.99); }
  /* Selected (current) brand — primary stripe on the left + slightly
     brighter fill so it pops out of the otherwise uniform list. */
  .adp-brand-row.is-active {
    background: #4a5165;
  }
  .adp-brand-row.is-active::before {
    content: "";
    width: 3px; height: 20px;
    background: var(--primary);
    border-radius: 2px;
    margin-left: -8px;
    margin-right: 8px;
    flex-shrink: 0;
  }
  .adp-brand-row-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;                      /* explicit — defeats any inheritance */
  }
  /* Star toggle — outline by default, filled gold when favourited.
     Click is a no-op for the row selection (event.stopPropagation in JS).
     Sized to ~2× the original so the star reads as a real interactive
     anchor on the right side of each row. */
  .adp-brand-star {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-30);
    transition: background .12s, color .12s, transform .08s;
    flex-shrink: 0;
  }
  .adp-brand-star:hover { background: var(--ink-10); color: var(--ink-60); }
  .adp-brand-star:active { transform: scale(.92); }
  .adp-brand-star .icon { background: currentColor; }
  /* Force the icon up to ~24-26px regardless of which `.icon-NN` size
     class the JS rendered (we ship `icon-14` on the inner span — the
     containing star is now bigger so we override the size). */
  .adp-brand-star .icon {
    width: 26px;
    height: 26px;
  }
  .adp-brand-star.is-fav { color: #ffc400; }
  :root:not([data-theme="dark"]) .adp-brand-star.is-fav { color: var(--favorite-text); }
  .adp-brand-star.is-fav:hover { background: rgba(255,196,0,.12); }

  /* Section divider between favourites and the rest of the list. */
  .adp-brand-section-label {
    padding: 8px 16px 4px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--ink-40);
  }
  .adp-brand-empty {
    padding: 20px 16px;
    text-align: center;
    color: var(--ink-50);
    font-size: 13px;
  }

  /* ── Custom-colour bottom-sheet (HSV picker) ──
     Mirrors the mobile app's create-TigerTag color picker:
       1. Hex input row with a "#" prefix glyph and a paste icon
       2. Big saturation × value rectangle with a circular thumb
       3. Bottom row — current-colour circle on the left, horizontal
          rainbow hue slider on the right
       4. White pill OK button
     Everything sits on the anthracite canvas (#1f242e) inherited from
     `.sfe-sheet--color.adp-color-sheet` (cf. block above). */
  .adp-cc-body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 14px 16px 18px;
  }

  /* Hex input row — bare on the anthracite canvas (no card / border /
     radius). Half-width and centered so it reads as a compact display
     rather than a form field. The `#` glyph and paste icon sit
     ABSOLUTELY inside the input's padding zone (left and right
     respectively), so the hex digits float centered between them. */
  .adp-cc-hex-row {
    position: relative;
    width: 50%;
    align-self: center;
    padding: 4px 0;
    background: transparent;
    border: 0;
  }
  .adp-cc-hex-row .adp-cc-hex-prefix {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
  }
  .adp-cc-hex-row .adp-cc-hex-paste {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
  }
  .adp-cc-hex-prefix {
    /* Fully transparent — the anthracite painted by the input behind
       us is contiguous, so adding our own background here would
       create visible seams from sub-pixel mis-alignment. Only the
       glyph itself (white on the input's anthracite) reads. */
    background: transparent;
    color: var(--on-dark);
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    user-select: none;
    /* Slight optical adjustment so the # baseline aligns with the
       hex value, which is rendered in a heavier weight. */
    margin-top: 1px;
    padding: 0;
  }
  /* Doubled selector (`.adp-cc-sheet .adp-cc-hex-input`, specificity
     0,2,0) so we outrank the global `input[type="text"]` rule
     (0,1,1) at the top of this file that otherwise paints a white
     fill, a border, a 40 px height, and a rounded corner — which
     made the field render as a white pill with the # / copy icons
     invisible against it. Same trick used for `.adp-color-name-wrap
     .adp-input--with-clear` further down — see CLAUDE.md "Class-only
     selectors losing to global element+attribute selectors". */
  .adp-cc-sheet .adp-cc-hex-input {
    width: 100%;
    min-width: 0;
    /* Anthracite — matches the bottom-sheet canvas. Setting it
       explicitly (rather than relying on `transparent`) defends
       against the browser's default white fill and Chromium's
       yellow autofill tint. */
    background: transparent;
    border: 0;
    outline: 0;
    border-radius: 0;
    height: auto;
    /* Symmetric padding (matches the absolute-positioned `#` and paste
       icon widths) so the centered hex text floats visually between
       them rather than colliding with either side. */
    padding: 0 26px;
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-align: center;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    /* Caret colour — matches the white text. Without this Chromium
       defaults to a black caret that disappears against the dark fill. */
    caret-color: var(--text);
    box-shadow: none;
  }
  /* Focus override — kills the global `input:focus` rule (primary
     border + glow halo) so the field keeps its borderless look when
     the caret lands inside. */
  .adp-cc-sheet .adp-cc-hex-input:focus {
    border: 0;
    outline: 0;
    box-shadow: none;
  }
  /* Autofill override — Chromium forces a pale-yellow background on
     auto-completed fields. Push it back to anthracite + white text by
     freezing a thick inset shadow and `-webkit-text-fill-color`. */
  .adp-cc-sheet .adp-cc-hex-input:-webkit-autofill,
  .adp-cc-sheet .adp-cc-hex-input:-webkit-autofill:hover,
  .adp-cc-sheet .adp-cc-hex-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px #1f242e inset;
    box-shadow: 0 0 0 1000px #1f242e inset;
    caret-color: var(--text);
  }
  .adp-cc-hex-input::placeholder { color: var(--ink-30); }
  .adp-cc-hex-paste {
    appearance: none;
    /* Fully transparent — same logic as the # prefix: the input
       behind us paints anthracite contiguously across the row, so
       any explicit background here creates visible seams. Hover /
       active use a translucent white overlay to advertise
       interactivity without introducing hard fill edges. */
    background: transparent;
    border: 0;
    color: var(--on-dark);
    cursor: pointer;
    padding: 2px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .12s;
  }
  .adp-cc-hex-paste:hover  { background: var(--ink-10); }
  .adp-cc-hex-paste:active { background: var(--ink-20); }

  /* Saturation × value rectangle. Two stacked gradients: horizontal
     white→hue (the hue is set inline via JS as `--cc-hue`) and
     vertical transparent→black on top. The circular thumb sits at
     normalised (S, 1-V), styled white with a 2 px ring so it stays
     visible on any underlying colour. */
  .adp-cc-sv {
    position: relative;
    width: 100%;
    aspect-ratio: 5 / 4;
    border-radius: 8px;
    overflow: hidden;
    background:
      linear-gradient(to top,    #000, transparent),
      linear-gradient(to right,  #fff, hsl(var(--cc-hue, 0), 100%, 50%));
    cursor: crosshair;
    touch-action: none;             /* let pointermove drive drag on mobile */
    user-select: none;
  }
  .adp-cc-sv-thumb {
    position: absolute;
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,.55), 0 1px 4px rgba(0,0,0,.4);
    background: transparent;
    transform: translate(-50%, -50%);
    pointer-events: none;          /* the parent owns drag events */
    top: 0; left: 100%;             /* JS overrides at open time */
  }

  /* Bottom row — current-colour circle (purely a preview) and the
     horizontal hue slider that drives the SV rectangle's base hue. */
  .adp-cc-bottom {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 2px;
  }
  .adp-cc-preview {
    flex-shrink: 0;
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 0;
    background: var(--primary);
    cursor: default;
    padding: 0;
    box-shadow: 0 0 0 1px rgba(255,255,255,.25) inset,
                0 2px 6px rgba(0,0,0,.4);
  }
  .adp-cc-hue {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(to right,
      #ff0000 0%, #ffff00 16.66%, #00ff00 33.33%,
      #00ffff 50%,  #0000ff 66.66%, #ff00ff 83.33%, #ff0000 100%);
    cursor: pointer;
    touch-action: none;
    user-select: none;
  }
  .adp-cc-hue-thumb {
    position: absolute;
    top: 50%;
    left: 0;                        /* JS overrides at open time */
    transform: translate(-50%, -50%);
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,.55), 0 1px 4px rgba(0,0,0,.4);
    background: var(--cc-hue-thumb, #f00);
    pointer-events: none;
  }

  /* OK pill — white background, dark text, centered in the sheet.
     Matches the screenshot's CTA. */
  .adp-cc-ok {
    align-self: center;
    appearance: none;
    background: var(--surface);
    color: #2c2540;
    border: 0;
    border-radius: 999px;
    padding: 12px 44px;
    margin-top: 6px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .04em;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,.35);
    transition: transform .12s, box-shadow .12s;
  }
  .adp-cc-ok:hover  { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.45); background: var(--surface); }
  .adp-cc-ok:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(0,0,0,.35); }

  .adp-error {
    margin: 4px 0 0;
    padding: 8px 12px;
    background: color-mix(in srgb, var(--danger) 12%, transparent);
    color: var(--danger-text);
    border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
  }

  /* Footer — pinned at the bottom of the panel, the Make button
     sits centered and stretches comfortably so it reads as the
     primary CTA of the whole panel. */
  .adp-foot {
    padding: 12px 20px 16px;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
    background: var(--adp-bg);
  }
  /* The held Link / Burn banner (_adpRenderFoot): under Make when a reader waits
     with no chip (both ways stacked, create only on top), alone with a chip on it. */
  .adp-foot-banner { min-width: 0; }
  .adp-foot-banner:empty { display: none; }
  .adp-foot-banner .chip-update-banner { width: 100%; margin: 0; }
  .adp-foot .adp-btn--make[hidden] { display: none; }
  /* With the banner, no side gutter under Make: the banner spans the panel. */
  .adp-panel .adp-foot:has(.adp-foot-banner:not(:empty)) {
    flex-direction: column; align-items: stretch; gap: 0; padding: 0;
  }
  .adp-foot:has(.adp-foot-banner:not(:empty)) .adp-btn--make { order: -1; align-self: center; margin: 12px 0; }
  .adp-foot-banner .chip-update-banner.chip-update-banner { border-radius: 0; }
  .adp-btn {
    height: 36px;
    padding: 0 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .12s, color .12s, border-color .12s, filter .12s;
  }
  .adp-btn--ghost {
    background: transparent;
    color: var(--adp-muted);
    border-color: var(--adp-border-soft);
  }
  .adp-btn--ghost:hover {
    background: var(--adp-surface);
    color: var(--adp-text);
    border-color: var(--adp-border);
  }
  .adp-btn--primary {
    background: var(--primary);
    color: var(--on-dark);
  }
  .adp-btn--primary:hover { filter: brightness(1.07); }
  .adp-btn--primary:disabled {
    opacity: .55;
    cursor: not-allowed;
    filter: none;
  }

  /* Make button — primary CTA matching the red gradient pill from the
     mobile creator screen. Wider + centered so it dominates the
     footer like the mobile "Make" CTA does. */
  .adp-btn--make {
    background: linear-gradient(180deg, #c93442 0%, #9b1f2c 100%);
    color: var(--on-dark);
    padding: 0 36px;
    height: 44px;
    min-width: 180px;
    font-size: 15px;
    font-weight: 700;
    text-transform: capitalize;
    border-radius: 999px;
    box-shadow: 0 6px 14px rgba(155,31,44,.45);
    border: none;
  }
  /* Re-assert the gradient on :hover — without it the global
     `button:hover { background: var(--surface-2) }` (specificity
     0,1,1) wins for the background property since this rule below
     only declared `filter`, leaving the background unset and
     inherited from the global → button went white-on-white. */
  .adp-btn--make:hover {
    background: linear-gradient(180deg, #c93442 0%, #9b1f2c 100%);
    filter: brightness(1.07);
  }
  .adp-btn--make:active { transform: translateY(1px); }
  .adp-btn--make:disabled {
    opacity: .55;
    cursor: not-allowed;
    filter: none;
    box-shadow: none;
  }

  /* Stat-card pair — Nozzle Temp / Drying / (advanced) Bed Temp. Two
     cards live side by side via .adp-stats-row, each with a header
     (title + thermal icon) and a 2-cell grid (label + input + unit). */
  .adp-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .adp-stat-card {
    background: var(--adp-surface);
    border: 1px solid var(--adp-border-soft);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .adp-stat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .adp-stat-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--adp-text);
  }
  /* Doubled selector (`.adp-stat-card .adp-stat-icon`) — bumps
     specificity to (0,2,0) so we outrank the global `.icon
     { background-color: currentColor }` rule (0,1,0) defined later
     in 70-detail-misc.css. Without this override the icons would
     inherit the panel's white text colour and ignore the per-card
     accent. */
  .adp-stat-card .adp-stat-icon { background: var(--adp-muted); }
  /* Flutter `Colors.red` = #F44336 (Material Red 500). */
  .adp-stat-card .adp-stat-icon--hot  { background: #F44336; }
  /* Flutter `Colors.lightBlue` = #03A9F4 (Material Light Blue 500). */
  .adp-stat-card .adp-stat-icon--cool { background: #03A9F4; }
  .adp-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
  }
  /* Stat cell — flex column with the label on top, then a flex-row
     for value + unit pinned tight to each other ("190°C", not
     "190 ........ °C"). Used both for read-only readouts (basic
     view) and editable inputs (advanced view). */
  .adp-stat-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
  }
  /* Read-only readout — pure text "190°C" sitting under its label.
     Used in the basic view's display-only stat cards. */
  .adp-stat-readout {
    font-size: 15px;
    font-weight: 800;
    color: var(--adp-text);
    letter-spacing: -.01em;
    line-height: 1.1;
  }
  .adp-stat-label {
    grid-column: 1 / -1;
    /* Min / Max / Temp / Time — same rank as every other label
       (13 px / 700 / white). */
    font-size: 13px;
    color: var(--adp-text);
    font-weight: 700;
  }
  /* Editable stat input (advanced view). Doubled selector
     `.adp-panel .adp-stat-card .adp-stat-input` bumps specificity
     to (0,3,0) so we outrank the global `input[type="number"]
     { background: var(--surface); border: 1px solid var(--border) }`
     rule (0,1,1) — without this override the temp inputs were
     rendering as bordered white "mini cards" inside the parent
     stat card. With this rule the input is a pure value with no
     chrome, sized to fit ~4 chars. */
  .adp-panel .adp-stat-card .adp-stat-input {
    width: 4.2ch;
    min-width: 0;
    padding: 0;
    height: auto;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    color: var(--adp-text);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -.01em;
    box-sizing: content-box;
    -moz-appearance: textfield;
  }
  .adp-panel .adp-stat-card .adp-stat-input::-webkit-outer-spin-button,
  .adp-panel .adp-stat-card .adp-stat-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
  .adp-panel .adp-stat-card .adp-stat-input:focus {
    outline: none;
    border: none;
    background: transparent;
    box-shadow: none;
  }
  /* Unit suffix — sits IMMEDIATELY after the input/readout in the
     same flex row, no spacer between. "190" + "°C" reads as one
     continuous label like "190°C". */
  .adp-stat-cell .adp-stat-unit {
    color: var(--adp-muted);
    font-size: 13px;
    font-weight: 700;
    pointer-events: none;
  }
  /* Wrap the (input | unit) and (readout | unit) pairs in a flex row.
     Flexbox via `display: contents` doesn't work for input/span
     siblings, so we use the cell itself as a column and let label
     sit on its own row. The value+unit row is implicit via order. */
  .adp-stat-cell .adp-stat-input,
  .adp-stat-cell .adp-stat-readout {
    align-self: flex-start;
  }
  /* Make the value+unit a tight inline pair — wrap them in a
     flex container by treating the cell as `display: grid` with the
     label on row 1 and a sub-flex on row 2 holding both. We achieve
     this without extra HTML by using `:has()` + flex on the cell
     once the readout/input + unit are siblings. CSS-only solution
     via a 2nd pseudo-row inside the column flex. */
  .adp-stat-cell {
    /* Override the column flex above for the value/unit pair: turn
       the cell into a grid where the readout+unit share a row. */
    display: grid;
    grid-template-columns: auto auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 4px;
    row-gap: 2px;
    align-items: end;
  }
  .adp-stat-cell .adp-stat-label {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .adp-stat-cell .adp-stat-input,
  .adp-stat-cell .adp-stat-readout {
    grid-column: 1;
    grid-row: 2;
  }
  .adp-stat-cell .adp-stat-unit {
    grid-column: 2;
    grid-row: 2;
    /* baseline-align to the big number on the left */
    align-self: end;
    padding-bottom: 4px;
  }

  /* Type + cog row — Filament/Resin selector on the LEFT (width
     adapts to its content, just like the Material picker above), cog
     + advanced toggle on the RIGHT — all on the SAME line.
     `flex-direction: row` is set explicitly because the parent
     `.adp-section` rule sets `column` and we'd inherit that flow
     otherwise (causing Type to stack above the cog instead of
     sitting beside it). */
  .adp-type-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  /* Label of the Advanced-toggle row (left), cog + switch sit on the right. */
  .adp-advanced-lbl { font-size: 13px; color: var(--adp-text); }
  /* Type select — same chrome as Brand / Material / Aspect 1 (1.5 px
     white border, anthracite fill, custom triangle caret). Width
     adapts to its content with a sensible min so the label
     "Filament" gets a comfortable hit target without forcing the
     row to wrap. */
  .adp-select--type {
    flex: 0 0 auto;
    width: auto;
    min-width: 130px;
    max-width: 60%;
    padding-right: 32px;     /* room for the custom dropdown caret */
  }
  /* Read-only stat inputs — basic view shows preset values that
     can't be edited unless the user flips the Advanced toggle. The
     `readonly` attribute is added on the inputs in HTML; this rule
     softens them visually so the user can tell they're not editable. */
  .adp-panel .adp-stat-input[readonly] {
    cursor: not-allowed;
    opacity: .85;
  }
  .adp-panel .adp-stat-input[readonly]:focus {
    outline: none;
    box-shadow: none;
  }
  .adp-type-aside {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  .adp-type-cog { background: var(--adp-muted); }

  /* Advanced body — shown when the cog toggle flips on. Stacks the
     Bed Temp stat card + the rest of the advanced fields below. */
  .adp-advanced-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .adp-advanced-body[hidden] { display: none; }

/* RFID Tag Tester Modal → renderer/rfid_protocol/tigertag/modal.css */

/* ── Tutorial image bottom-sheet ────────────────────────────────────────── */
.tuto-sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
  border-radius: inherit;
}
.tuto-sheet-backdrop.open { opacity: 1; pointer-events: auto; }

.tuto-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 90%;
  background: var(--surface);
  border-top-left-radius: 18px; border-top-right-radius: 18px;
  box-shadow: 0 -4px 32px rgba(0,0,0,.18);
  z-index: 201;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.tuto-sheet.open { transform: translateY(0); }

.tuto-sheet-handle {
  width: 40px; height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 10px auto 0;
  flex-shrink: 0;
}
.tuto-sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px 10px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.tuto-sheet-title {
  font-size: 13px; font-weight: 600; color: var(--text);
}
.tuto-sheet-body {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 16px 18px 24px;
}
.tuto-sheet-img {
  display: block;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* ── Ecosystem window (#ecoModalOverlay) ───────────────────────────────────
   A fixed grid: every zone keeps its size from one device to the next, so the
   window never jumps. 840 × 760 on a tall screen; 840 × 552 below 800 px of
   height (900 × 600 window), where the bay goes left and the words right. */
.eco-card.eco-card {   /* doubled: wins over the generic .modal-card box */
  width: min(840px, calc(100vw - 32px)); height: min(760px, calc(100vh - 32px)); max-height: none;
  padding: 24px; box-sizing: border-box; overflow: hidden; position: relative;
  display: grid; grid-template-rows: 48px minmax(0, 1fr) 76px; gap: 12px;
}
.eco-card * { box-sizing: border-box; }
.eco-nav { display: grid; grid-template-columns: minmax(0, 1fr) 32px; align-items: center; gap: 12px; }
.eco-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; min-width: 0; }
.eco-tab {
  height: 40px; padding: 0 6px; border-radius: 10px; min-width: 0;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
  font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .15s, border-color .15s, background .15s;
}
.eco-tab:hover { color: var(--text); }
.eco-tab.is-on { color: var(--text); border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }
/* Autoplay progress: a thin bar fills the open tab; when it ends the next
   device comes in (animationend). Frozen while the card is held. */
.eco-tab { position: relative; }
.eco-tab-prog { position: absolute; left: 10px; right: 10px; bottom: 5px; height: 2px; border-radius: 2px; overflow: hidden;
  background: color-mix(in srgb, var(--primary) 18%, transparent); }
.eco-tab-prog::after { content: ""; position: absolute; inset: 0; transform-origin: left; background: var(--primary);
  animation: ecoProg 4.5s linear forwards; }
.eco-tab-prog { animation: ecoProgEnd 4.5s linear forwards; }   /* the element whose end advances the carousel */
@keyframes ecoProg { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ecoProgEnd { from { opacity: 1; } to { opacity: 1; } }
.eco-card.is-held .eco-tab-prog, .eco-card.is-held .eco-tab-prog::after { animation-play-state: paused; }
.eco-card:focus { outline: none; }
.eco-card .eco-close.eco-close { position: static; width: 32px; height: 32px; }
.eco-panel { min-height: 0; display: grid; grid-template-rows: 374px 64px 100px; gap: 12px; }
.eco-overview { display: grid; grid-template-rows: 210px 152px; gap: 12px; min-width: 0; }
.eco-info { display: grid; grid-template-rows: 88px 32px 32px; min-width: 0; justify-items: center; text-align: center; }

/* Scan bay — the device glowing on a faint tech grid. It is a scanner and never
   moves, so the light does: NFC waves leave its reader (--x/--y, % of the
   picture) and a scan beam sweeps it, like data being read and written. */
.eco-bay {
  position: relative; border-radius: 16px; overflow: hidden; display: grid; place-items: center; min-width: 0;
  border: 1px solid color-mix(in srgb, var(--primary) 26%, var(--border));
  background:
    radial-gradient(ellipse 55% 70% at 50% 62%, color-mix(in srgb, var(--primary) 24%, transparent), transparent 70%),
    linear-gradient(color-mix(in srgb, var(--primary) 9%, transparent) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, color-mix(in srgb, var(--primary) 9%, transparent) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--surface-2);
}
.eco-cat {
  position: absolute; top: 12px; left: 50%; translate: -50% 0; z-index: 2; white-space: nowrap; max-width: calc(100% - 100px);
  overflow: hidden; text-overflow: ellipsis; padding: 4px 11px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--primary-text); background: color-mix(in srgb, var(--surface) 85%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 40%, var(--border));
}
.eco-shot { position: relative; height: 160px; margin-top: 24px; }
.eco-shot img { height: 100%; width: auto; display: block; -webkit-user-drag: none; filter: drop-shadow(0 14px 22px rgba(0,0,0,.45)); }
.eco-card[data-eco="touch"] .eco-shot { height: 124px; margin-top: 34px; }   /* a wide device: as big as the others */
.eco-waves { position: absolute; left: var(--x); top: var(--y); width: 0; height: 0; pointer-events: none; }
.eco-waves i {
  position: absolute; left: -40px; top: -40px; width: 80px; height: 80px; border-radius: 50%;
  border: 2px solid var(--primary); box-shadow: 0 0 14px var(--primary), inset 0 0 10px color-mix(in srgb, var(--primary) 50%, transparent);
  opacity: 0; animation: ecoWave 2.4s cubic-bezier(.2, .6, .3, 1) infinite;
}
.eco-waves i:nth-child(2) { animation-delay: .8s; }
.eco-waves i:nth-child(3) { animation-delay: 1.6s; }
@keyframes ecoWave { 0% { transform: scale(.15); opacity: .95; } 100% { transform: scale(1.9); opacity: 0; } }
.eco-beam {
  position: absolute; left: 0; right: 0; height: 18%; top: 0; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--primary) 40%, transparent) 50%, transparent);
  animation: ecoBeam 3.6s ease-in-out infinite;
}
@keyframes ecoBeam { 0%, 100% { top: -18%; opacity: 0; } 15% { opacity: 1; } 50% { top: 100%; opacity: .9; } 60% { opacity: 0; } }
.eco-step {
  position: absolute; top: 50%; translate: 0 -50%; z-index: 3; width: 34px; height: 34px; padding: 0;
  display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--muted); transition: color .15s, border-color .15s;
}
.eco-step:hover { color: var(--text); border-color: var(--muted); }
.eco-step .icon { background-color: currentColor; }
.eco-step--prev { left: 12px; }
.eco-step--next { right: 12px; }
.tigerpod-debug.tigerpod-debug { position: absolute; left: 12px; bottom: 12px; z-index: 4; max-width: 260px; margin: 0; }

/* Name + promise (two lines max), live state (reserved, filled only once the
   device is there), three benefits on one line. */
.eco-promise { min-height: 0; overflow: hidden; }
.eco-name { margin: 0 0 8px; font-size: 12px; line-height: 16px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--primary-text); }
.eco-promise h2 { margin: 0; font-size: 25px; line-height: 30px; max-height: 60px; overflow: hidden; font-weight: 800; letter-spacing: -.02em; color: var(--text); text-wrap: balance; }
.eco-status { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.eco-status b { color: var(--success-text); font-weight: 700; }
.eco-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 22%, transparent); }
.eco-benefits { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: center; min-width: 0; width: 100%; }
.eco-benefits li { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; font-size: 13px; font-weight: 600; color: var(--text); }
.eco-benefits li span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eco-benefits .icon { flex: none; background-color: var(--primary); }

/* Data path: the spool's chip → the device → what you get. Light packets run
   along each wire, the device in the middle glows as they arrive. */
.eco-flow { display: grid; grid-template-columns: 170px minmax(0, 1fr) 46px minmax(0, 1fr) 170px; align-items: center; gap: 10px; min-height: 0; }
.eco-node { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0;
  font-size: 11.5px; font-weight: 600; line-height: 14px; color: var(--muted); }
.eco-node > span:last-child { max-height: 28px; overflow: hidden; }
.eco-tile, .eco-node > img {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; object-fit: contain;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border)); background: var(--surface-2);
}
.eco-tile .icon { background-color: var(--primary); }
.eco-node--hub > img { width: 46px; height: 46px; padding: 3px; border-color: var(--primary); animation: ecoHub 1.8s ease-out .9s infinite; }
@keyframes ecoHub { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 60%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
.eco-wire { position: relative; height: 2px; border-radius: 2px; background: color-mix(in srgb, var(--primary) 22%, var(--border)); }
.eco-wire i { position: absolute; top: -3px; left: 0; width: 18px; height: 8px; border-radius: 6px; opacity: 0;
  background: linear-gradient(90deg, transparent, var(--primary)); box-shadow: 0 0 10px var(--primary);
  animation: ecoPacket 1.8s linear infinite; }
.eco-wire i:nth-child(2) { animation-delay: .9s; }
.eco-flow .eco-wire:nth-of-type(4) i { animation-delay: .9s; }
.eco-flow .eco-wire:nth-of-type(4) i:nth-child(2) { animation-delay: 1.8s; }
@keyframes ecoPacket { 0% { left: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: calc(100% - 18px); opacity: 0; } }

/* How to get one: three short steps, side by side. */
.eco-acq { display: grid; grid-template-rows: 16px minmax(0, 1fr); gap: 8px; min-height: 0; }
.eco-sec-title { margin: 0; font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.eco-get { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; min-height: 0; }
.eco-get li { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border);
  font-size: 13px; line-height: 18px; color: var(--text); overflow: hidden; min-height: 0; }
.eco-num { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: var(--on-accent); background: var(--primary); }

/* Footer — always the same places: the main action, the guide, other links. */
.eco-foot { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--border); padding-top: 12px; min-width: 0; }
.eco-foot .eco-btn { height: 44px; padding: 0 22px; border-radius: 12px; font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.eco-foot .eco-btn2, .eco-foot .eco-btn3 { height: 44px; padding: 0 16px; border-radius: 12px; font-size: 14px; font-weight: 600; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.eco-foot .eco-btn3 { display: inline-flex; align-items: center; gap: 6px; border-color: transparent; color: var(--muted); }
.eco-foot .eco-btn3 .icon { background-color: currentColor; transform: rotate(-90deg); }
.eco-foot .eco-btn2:hover, .eco-foot .eco-btn3:hover { border-color: var(--muted); color: var(--text); }
.eco-more { position: relative; margin-left: auto; }
.eco-menu { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 5; min-width: 230px; padding: 6px;
  display: flex; flex-direction: column; gap: 2px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow-lg); }
.eco-menu[hidden] { display: none; }
.eco-menu button { height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text);
  text-align: left; font-size: 13.5px; font-weight: 600; justify-content: flex-start; }
.eco-menu button:hover { background: var(--surface-2); }

/* Moving from one device to the next, in two soft beats: the sheet fades out
   towards the far side (160 ms), then the next eases in — the picture first
   (32 px, 380 ms), the words a beat later (8 px). Nothing resizes. */
@keyframes ecoShotL { from { opacity: 0; transform: translateX(32px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ecoShotR { from { opacity: 0; transform: translateX(-32px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ecoFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.eco-shot, .eco-fade, .eco-foot > * { transition: opacity .16s ease-in, transform .16s ease-in; }
.eco-card.eco-out-l .eco-shot { opacity: 0; transform: translateX(-24px); }
.eco-card.eco-out-r .eco-shot { opacity: 0; transform: translateX(24px); }
.eco-card.eco-out-l .eco-fade, .eco-card.eco-out-r .eco-fade, .eco-card.eco-out-l .eco-foot > *, .eco-card.eco-out-r .eco-foot > * { opacity: 0; transform: translateY(-4px); }
.eco-card.eco-in-l .eco-shot { animation: ecoShotL .38s cubic-bezier(.22, .61, .36, 1) both; }
.eco-card.eco-in-r .eco-shot { animation: ecoShotR .38s cubic-bezier(.22, .61, .36, 1) both; }
.eco-card.eco-in .eco-fade, .eco-card.eco-in .eco-foot > * { animation: ecoFadeIn .34s cubic-bezier(.22, .61, .36, 1) .06s both; }

/* Short window (900 × 600): 840 × 552, the bay left, the words right. */
@media (max-height: 799px), (max-width: 959px) {
  .eco-card.eco-card { height: min(552px, calc(100vh - 32px)); padding: 16px; grid-template-rows: 44px minmax(0, 1fr) 70px; }
  .eco-tab { height: 36px; font-size: 12.5px; }
  .eco-panel { grid-template-rows: 200px 44px 104px; }
  .eco-overview { grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: 200px; gap: 20px; }
  .eco-info { grid-template-rows: 88px 32px 72px; gap: 4px; justify-items: start; text-align: left; align-content: center; }
  .eco-promise h2 { font-size: 22px; line-height: 28px; max-height: 56px; }
  .eco-status { justify-content: flex-start; }
  .eco-benefits { grid-template-columns: 1fr; grid-template-rows: repeat(3, 24px); gap: 0; }
  .eco-benefits li { justify-content: flex-start; }
  .eco-cat { font-size: 10px; max-width: calc(100% - 24px); }
  .eco-shot { height: 128px; margin-top: 28px; }
  .eco-card[data-eco="touch"] .eco-shot { height: 98px; margin-top: 36px; }
  .eco-step { top: auto; bottom: 10px; translate: none; width: 30px; height: 30px; }
  .eco-flow { grid-template-columns: 200px minmax(0, 1fr) 40px minmax(0, 1fr) 200px; }
  .eco-node { flex-direction: row; text-align: left; gap: 8px; }
  .eco-node > span:last-child { max-height: 28px; }
  .eco-tile { width: 32px; height: 32px; flex: none; }
  .eco-node--hub > img { width: 40px; height: 40px; }
  .eco-get li { font-size: 12.5px; line-height: 17px; padding: 9px 10px; }
  .eco-foot { padding-top: 10px; }
  .eco-foot .eco-btn, .eco-foot .eco-btn2, .eco-foot .eco-btn3 { height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .eco-tab-prog { display: none; }
  .eco-waves i, .eco-beam, .eco-wire i, .eco-node--hub > img,
  .eco-card.eco-in-l .eco-shot, .eco-card.eco-in-r .eco-shot, .eco-card.eco-in .eco-fade, .eco-card.eco-in .eco-foot > * { animation: none; }
  .eco-shot, .eco-fade, .eco-foot > * { transition: none; }
  .eco-waves i:first-child { opacity: .6; transform: scale(1); }
}
body.anim-paused #ecoModalOverlay * { animation-play-state: paused; }
.tigerpod-debug {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}
.tigerpod-debug .tpd-title { font-weight: 700; color: var(--text); margin-bottom: 4px; }
.tigerpod-debug .tpd-row { display: flex; justify-content: space-between; gap: 10px; }
.tigerpod-debug .tpd-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tigerpod-debug .tpd-chip { flex: none; }
.tigerpod-debug .tpd-empty { opacity: .7; }
.tigerpod-debug .tpd-meta { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--border); }

/* ── Cloud → chip encode modal (guided dual-chip burn) ───────────────────── */
#cloudEncodeOverlay .cem-card {
  width: min(440px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden;
}
/* header: centred migration title + close button pinned (slightly inset).
   Symmetric vertical padding keeps the ✕ (top:50%) aligned with the title. */
.cem-card .cem-header { position: relative; justify-content: center; text-align: center; padding: 16px 22px; }
.cem-card .cem-close {
  position: absolute; top: 50%; right: 14px; transform: translateY(-50%);
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--muted); cursor: pointer;
  font-size: 15px; line-height: 1; transition: background .15s ease, color .15s ease;
}
.cem-card .cem-close:hover { background: var(--surface-2); color: var(--text); }
/* title as a migration: TigerCloud → TigerTag */
.cem-title-migrate { display: inline-flex; align-items: center; gap: 8px; }
.cem-tag { font-size: 14px; font-weight: 700; padding: 3px 10px; border-radius: 999px; line-height: 1; }
.cem-tag--cloud { color: #7c3aed; background: rgba(124,58,237,.12); }
.cem-tag--phys  { color: var(--text); background: var(--surface-2); }
.cem-arrow { background: var(--muted); flex-shrink: 0; }

.cem-body { padding: 8px 22px 6px; display: flex; flex-direction: column; gap: 16px; }

.cem-chips { display: flex; gap: 16px; justify-content: center; }
/* Each card mimics the physical reader: a dark device plate carrying the white
   TigerTag logo, with a corner status LED (red = no chip · green = chip present),
   exactly like the ACR122U's red/green indicator. The plate base stays constant;
   state is conveyed by the LED colour plus a coloured glow. */
.cem-chip {
  position: relative;
  flex: 1 1 184px;
  display: flex; align-items: center; justify-content: center;
  padding: 22px 24px; border-radius: 16px;
  background: linear-gradient(160deg, #4b5468, #363d4e);
  border: 1.5px solid var(--ink-06);
  box-shadow: 0 4px 14px rgba(20,24,40,.16);
  transition: box-shadow .25s ease, transform .2s ease;
}
.cem-chip-logo {
  width: 76px; aspect-ratio: 340 / 289.1; /* viewBox of logo_tigertag.svg */
  /* The plate above is a FIXED dark gradient in both themes (it mimics the
     physical reader), so its logo needs a fixed-polarity foreground. It was
     `--surface`, which only ever read as white back when --surface was white —
     in dark it resolves to #171a22 and the logo sank into the plate. */
  background-color: var(--on-dark);
  -webkit-mask: url('../../assets/svg/logos/logo_tigertag.svg') center / contain no-repeat;
          mask: url('../../assets/svg/logos/logo_tigertag.svg') center / contain no-repeat;
  transition: transform .2s ease;
}
/* corner status LED — also shows the slot number when 2 readers are present */
.cem-chip-num {
  position: absolute; top: 9px; left: 9px;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; line-height: 1; color: var(--on-accent);
  background: var(--danger);
  box-shadow: 0 0 0 2px rgba(255,255,255,.2), 0 0 7px color-mix(in srgb, var(--danger) 65%, transparent);
  transition: background .2s ease, box-shadow .2s ease;
}

/* ── per-state: LED colour + plate glow ── */
.cem-chip--waiting .cem-chip-logo { animation: cemPulse 1.6s ease-in-out infinite; }

.cem-chip--ready .cem-chip-num,
.cem-chip--writing .cem-chip-num,
.cem-chip--ok .cem-chip-num {
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(255,255,255,.22), 0 0 8px color-mix(in srgb, var(--success) 70%, transparent);
}

.cem-chip--writing { box-shadow: 0 5px 18px color-mix(in srgb, var(--success) 32%, transparent); }
.cem-chip--writing .cem-chip-logo { animation: cemPulse 1s ease-in-out infinite; }

.cem-chip--ok { box-shadow: 0 5px 18px color-mix(in srgb, var(--success) 42%, transparent); }

.cem-chip--fail { box-shadow: 0 5px 18px color-mix(in srgb, var(--danger) 36%, transparent); animation: cemShake .4s ease; }
.cem-chip--fail .cem-chip-num {
  background: var(--danger);
  box-shadow: 0 0 0 2px rgba(255,255,255,.22), 0 0 8px color-mix(in srgb, var(--danger) 70%, transparent);
}

/* Update flow: a present chip whose UID isn't this spool's — clearly wrong. */
.cem-chip--mismatch {
  border-color: color-mix(in srgb, var(--danger) 55%, transparent);
  box-shadow: 0 5px 18px color-mix(in srgb, var(--danger) 30%, transparent);
}
.cem-chip--mismatch .cem-chip-logo { background-color: rgba(255,150,150,.9); }
.cem-chip--mismatch .cem-chip-num {
  background: var(--danger);
  box-shadow: 0 0 0 2px rgba(255,255,255,.22), 0 0 8px color-mix(in srgb, var(--danger) 70%, transparent);
}

/* A MIFARE Classic (maker's chip) on a reader: not an NTAG, nothing can be
   burned onto it — orange, with a short note, never the green "ready". */
.cem-chip--incompatible {
  border-color: color-mix(in srgb, var(--warning) 60%, transparent);
  box-shadow: 0 5px 18px color-mix(in srgb, var(--warning) 30%, transparent);
}
.cem-chip--incompatible .cem-chip-logo { opacity: .45; }
.cem-chip--incompatible .cem-chip-num {
  background: var(--warning);
  box-shadow: 0 0 0 2px rgba(255,255,255,.22), 0 0 8px color-mix(in srgb, var(--warning) 70%, transparent);
}
.cem-chip-note {
  position: absolute; left: 8px; right: 8px; bottom: 8px;
  font-size: 11.5px; font-weight: 700; line-height: 1.2; text-align: center;
  color: var(--warning-text);
}

.cem-chip--none { opacity: .5; }

/* ── global progress bar (sequence-wide) ── */
.cem-progress { width: 100%; height: 6px; border-radius: 4px; background: var(--border); overflow: hidden; }
.cem-progress-fill { display: block; height: 100%; width: 0%; border-radius: 4px; background: var(--info); transition: width .3s ease, background .2s ease; }
.cem-progress--writing .cem-progress-fill { background-image: linear-gradient(90deg, var(--ink-04) 0%, var(--ink-40) 50%, var(--ink-04) 100%); background-size: 40% 100%; background-repeat: no-repeat; animation: cemSheen 1.1s linear infinite; }
.cem-progress--done .cem-progress-fill { background-color: var(--success); }
.cem-progress--fail .cem-progress-fill { background-color: var(--danger); }

@keyframes cemPulse { 0%,100% { transform: scale(1); opacity: .8; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes cemShake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes cemSheen { 0% { background-position: -40% 0; } 100% { background-position: 140% 0; } }

.cem-hint { font-size: 13px; color: var(--muted); line-height: 1.4; text-align: center; }
.cem-hint.hidden { display: none; }
.cem-overwrite { display: flex; flex-direction: column; gap: 9px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--warning) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warning) 28%, transparent); }
.cem-overwrite.hidden { display: none; }
.cem-ow-warn { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; color: #92660b; }
.cem-ow-warn .icon { background: var(--warning-hover); flex-shrink: 0; }
.cem-ow-toggle { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text); cursor: pointer; }
.cem-ow-toggle input { width: 16px; height: 16px; accent-color: var(--warning-hover); cursor: pointer; }
.cem-hint--fail { color: var(--danger-text); font-weight: 600; }
.cem-hint--warn { color: var(--warning-text); font-weight: 600; }
.cem-actions { display: flex; gap: 10px; padding: 14px 22px 20px; }
/* Hidden but still taking its space — the action row makes way for the
   progress bar during a write without resizing the window. */
.cem-invisible { visibility: hidden; }
.cem-actions .btn { flex: 1; height: 46px; font-size: 14px; font-weight: 600; }
.cem-actions .btn.hidden { display: none; }
.cem-actions .primary:disabled { background: var(--border); border-color: var(--border); color: var(--muted); box-shadow: none; opacity: 1; }
/* Erase / Recycle — destructive, so the enabled button is red, not blue. */
.cem-actions .btn.cem-btn--danger:not(:disabled) { background: var(--danger); border-color: var(--danger); color: var(--on-accent); }
.cem-actions .btn.cem-btn--danger:not(:disabled):hover { filter: brightness(1.06); }
.cem-actions .btn.cem-btn--danger { position: relative; overflow: hidden; }
.cem-actions .btn.cem-btn--danger .cem-btn-label { position: relative; z-index: 1; }
/* The default red sweep would vanish on a red button — dark sweep instead. */
.cem-actions .btn.cem-btn--danger .hold-progress { background: rgba(0,0,0,.34); opacity: 1; }

/* ─────────────────────────────────────────────────────────────────────────
   Printer connection tutorial — multi-step walkthrough modal
   Loaded from renderer/printers/<brand>/tutorial.json
   ───────────────────────────────────────────────────────────────────────── */
/* Override defaults from .modal-card (width: 340px; padding: 28px 24px 22px).
   Selectors are doubled to outrank specificity from any later .modal-card rules. */
.printer-tuto-card.printer-tuto-card {
  width: 92vw; max-width: 720px;
  height: 78vh; min-height: 480px; max-height: 88vh;
  padding: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.printer-tuto-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 8px 18px;
  border-bottom: 1px solid var(--border);
}
.printer-tuto-title-wrap {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.printer-tuto-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.printer-tuto-step-counter {
  font-size: 11px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}
.printer-tuto-card .modal-close {
  background: none; border: none; color: var(--muted);
  font-size: 18px; cursor: pointer; padding: 4px 8px;
  border-radius: 6px; transition: background .15s, color .15s;
}
.printer-tuto-card .modal-close:hover { background: var(--surface-2); color: var(--text); }

/* Model picker — claims remaining flex space inside the card so the modal
   doesn't collapse to its content height. min-height:0 lets the inner grid
   scroll when there are many models. */
.printer-tuto-models {
  flex: 1; min-height: 0;
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  overflow-y: auto;
}
.printer-tuto-models-label {
  font-size: 13px; color: var(--muted); font-weight: 600;
}
.printer-tuto-models-grid {
  /* Explicit 4-column grid — stable layout, fits 11 Bambu models in 3 rows
     (3 full rows of 4 cards = 12 cells, 11 used). Earlier auto-fill produced
     unpredictable column counts and overflow at the modal width. */
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: stretch;        /* cards in same row share height */
}
/* Each model card — printer photo on top, label + step count below.
   Fixed min-height so the grid auto-rows can't collapse the card to just the
   image and clip the name/step-count spans. */
.printer-tuto-model-btn {
  min-width: 0;
  min-height: 130px;
  padding: 10px 8px 10px;
  border: 1.5px solid transparent; border-radius: 12px;
  background: transparent; color: var(--text);
  font-size: 12px; font-weight: 600; text-align: center;
  cursor: pointer; transition: border-color .15s, background .15s, transform .1s;
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  overflow: hidden;
}
.printer-tuto-model-btn:hover { border-color: var(--primary); background: var(--primary-soft); }
.printer-tuto-model-btn:active { transform: scale(.98); }
.printer-tuto-model-btn .pt-model-img {
  width: 100%; height: 80px;
  object-fit: contain; object-position: center;
  flex-shrink: 0;
  display: block;
}
.printer-tuto-model-btn .pt-model-name {
  font-size: 13px; font-weight: 700; line-height: 1.2;
  width: 100%; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* (.pt-model-steps removed — the step count is shown only in the step view,
   not in the picker; printing "8 · sur 8" under each model added clutter.) */

/* Step body — image + caption */
.printer-tuto-step {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px;
  overflow-y: auto;
}
.printer-tuto-img-wrap {
  width: 100%; max-height: 50vh;
  border-radius: 12px; overflow: hidden;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.printer-tuto-img {
  width: 100%; height: auto; max-height: 50vh;
  object-fit: contain; display: block;
}
.printer-tuto-body {
  font-size: 14px; line-height: 1.5; color: var(--text);
  font-weight: 500;
}

/* Empty state */
.printer-tuto-empty {
  padding: 48px 18px; text-align: center;
  font-size: 14px; color: var(--muted);
}

/* Footer — prev / dots / next */
.printer-tuto-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  gap: 12px;
  flex-shrink: 0;
}
.printer-tuto-dots {
  display: flex; gap: 6px; align-items: center;
  flex: 1; justify-content: center;
}
.printer-tuto-dots .pt-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--border); transition: background .15s, transform .15s;
  cursor: pointer;
}
.printer-tuto-dots .pt-dot.active {
  background: var(--primary); transform: scale(1.4);
}
.printer-tuto-foot .adf-btn {
  min-width: 96px;
}
.printer-tuto-foot .adf-btn:disabled {
  opacity: .4; cursor: not-allowed;
}
.printer-tuto-card .hidden { display: none !important; }

/* "Connection tutorial" pill rendered INSIDE .pba-brand, between the
   labels (.pba-brand-text) and the chevron (.pba-brand-chev). margin-left:auto
   pushes the pill to the right edge of the available space, snug against the
   chevron. Rendered as <span role="button"> (not <button>) to avoid nesting
   buttons in HTML; click handler is wired directly with stopPropagation so
   the pill click doesn't fall through to the parent brand-select action. */
.pba-brand-tuto-link {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px;
  background: var(--primary); color: var(--on-accent);
  border: none; border-radius: 999px;
  font-size: 11px; font-weight: 700; line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: filter .15s, background .15s, color .15s;
}
.pba-brand-tuto-link:hover,
.pba-brand-tuto-link:focus-visible {
  filter: brightness(1.08); outline: none;
}
/* Brands without a connection tutorial (Anycubic / Creality / Snapmaker) still
   show the pill in the header bar, just greyed + non-clickable (a title tooltip
   explains why). pointer-events stay on so the tooltip still appears on hover. */
.pba-brand-tuto-link:disabled {
  background: var(--border); color: var(--muted);
  cursor: not-allowed; opacity: .55;
}
.pba-brand-tuto-link:disabled:hover,
.pba-brand-tuto-link:disabled:focus-visible {
  background: var(--border); color: var(--muted); filter: none;
}

/* ─── What's New — a floating, draggable, resizable "window" ─────────────── */
/* The overlay is just the dimmed backdrop; the window is position:fixed and
   placed/dragged via JS, so no flex-centering here. */
.whatsnew-window {
  position: fixed;
  left: 50%; top: 50%; transform: translate(-50%, -50%);  /* default; JS sets px */
  width: 480px; height: min(620px, 86vh);
  min-width: 360px; min-height: 340px; max-width: 94vw; max-height: 92vh;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;     /* needed for resize + rounded corners */
  resize: both;                              /* native resize grip (bottom-right) */
  box-shadow: 0 24px 64px rgba(0,0,0,.34), 0 2px 10px rgba(0,0,0,.20);
  z-index: 1001;
}
.whatsnew-window.dragging { transition: none; user-select: none; }
/* Title bar — the drag handle. Browser-window feel. */
.whatsnew-titlebar {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  padding: 11px 12px 11px 14px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  cursor: move; user-select: none;
}
.whatsnew-title { font-size: 19px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.whatsnew-version-select {
  appearance: none; -webkit-appearance: none; margin-left: auto;
  height: 28px; padding: 0 26px 0 10px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--muted);
  font-size: 11.5px; font-variant-numeric: tabular-nums; letter-spacing: .02em;
  cursor: pointer; max-width: 220px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path fill='none' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M2.5 4l2.5 2.5L7.5 4'/></svg>");
  background-repeat: no-repeat; background-position: right 9px center;
  transition: border-color .12s, color .12s;
}
.whatsnew-version-select:hover { border-color: var(--primary); color: var(--text); }
.whatsnew-version-select:focus { outline: none; border-color: var(--primary); }
/* The version picker is upgraded to the app's custom dropdown (_enhanceSelect):
   the native <select> is hidden, a .csel-btn mirrors it + an app-styled option
   list opens. Keep the compact titlebar pill look; push it to the right. */
.whatsnew-titlebar .csel { margin-left: auto; }
.whatsnew-titlebar .csel-btn {
  height: 28px; min-width: 0; padding: 0 24px 0 11px; border-radius: 999px;
  background-color: var(--surface); color: var(--muted);
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  background-position: right 9px center; max-width: 230px;
}
.whatsnew-titlebar .csel-btn:hover,
.whatsnew-titlebar .csel--open .csel-btn { border-color: var(--primary); color: var(--text); }
.whatsnew-titlebar .csel-btn .csel-label { font-variant-numeric: tabular-nums; }
/* Picker sits on the right of the titlebar; the window clips overflow, so open the
   option list aligned to the right edge (extends left, stays inside the window). */
.whatsnew-titlebar .csel-pop { left: auto; right: 0; }
.whatsnew-close {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  border: none; background: transparent; color: var(--muted);
  font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.whatsnew-close:hover { background: var(--surface); color: var(--text); }
/* Body — scrolls; the window resizes around it. */
.whatsnew-body {
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px;
  padding: 20px;
}
/* Still scrolls (wheel, trackpad), without a visible scrollbar. */
.whatsnew-body { scrollbar-width: none; }
.whatsnew-body::-webkit-scrollbar { width: 0; height: 0; display: none; }
.whatsnew-release-title {
  font-size: 16px; font-weight: 700; color: var(--text);
  letter-spacing: -.01em; line-height: 1.3;
  padding-bottom: 12px; margin-bottom: 2px;
  border-bottom: 1px solid var(--border);
}
.whatsnew-item { display: flex; gap: 14px; align-items: flex-start; }
/* Just the icon, no tile behind it — larger, so it still leads the line. */
.whatsnew-item-icon {
  flex-shrink: 0; width: 30px; height: 30px; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
}
.whatsnew-item-icon .icon { width: 22px; height: 22px; background-color: var(--primary); }
.whatsnew-item-text { flex: 1; min-width: 0; }
.whatsnew-item-title { font-size: 14.5px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.whatsnew-item-body { font-size: 13px; line-height: 1.55; color: var(--muted); }
.whatsnew-empty { font-size: 13px; color: var(--muted); text-align: center; padding: 28px 0; }
.whatsnew-actions {
  display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0;
  padding: 13px 16px; border-top: 1px solid var(--border); background: var(--surface);
}
.whatsnew-btn {
  height: 36px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .12s, border-color .12s, filter .12s;
}
.whatsnew-btn:hover { border-color: var(--primary); }
.whatsnew-btn--primary {
  background: var(--primary); color: var(--on-accent); border-color: var(--primary);
}
.whatsnew-btn--primary:hover { filter: brightness(1.05); }
/* Support block in the What's New footer — a short caption + the
   "Support the project" button (.support-btn), pushed to the left (margin-right:auto)
   so the Later / Got it actions stay on the right. */
.whatsnew-coffee-wrap { margin-right: auto; display: inline-flex; align-items: center; gap: 9px; }
.whatsnew-coffee-cap { font-size: 12.5px; font-weight: 600; color: var(--faint); }
@media (max-width: 440px) { .whatsnew-coffee-cap { display: none; } }

/* Version page-control — Apple-style dots (one per version, current filled), in the
   footer gap left of Later / Got it. With many versions a centred window of dots is
   shown; the outermost dots shrink (`.is-edge`) to hint there's more, exactly like iOS.
   Jump anywhere via the title-bar picker. */
/* Version page-control — a carousel: the active dot stays CENTRED in a fixed
   viewport and the whole track slides under it (unlimited back-and-forth, the pill
   never drifts to an edge). Viewport width = 7 slots × 20px; edges fade out.
   Keep _WN_VIEW / _WN_SLOT in inventory.js in sync with these values. */
.whatsnew-dots {
  margin-right: auto; position: relative; overflow: hidden;
  width: 140px; height: 30px; flex: 0 0 auto;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
}
.wn-track {
  position: absolute; top: 0; left: 0; height: 100%; display: flex; align-items: center;
  transition: transform .34s cubic-bezier(.34,1.05,.5,1);
}
/* Fixed-width slot = big invisible hit target; the visible dot is a `::before`
   circle (stays round). The slot width is constant so the active capsule growing
   never shifts the track's centring. */
.wn-dot {
  flex: 0 0 20px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: 0; background: transparent; cursor: pointer;
}
.wn-dot::before {
  content: ""; display: block; width: 9px; height: 9px; border-radius: 999px;
  background: var(--muted); opacity: .35;
  transition: width .3s cubic-bezier(.34,1.2,.5,1), opacity .22s, background-color .22s;
}
.wn-dot:hover:not(.is-active)::before { opacity: .6; }
.wn-dot.is-active { cursor: default; }
.wn-dot.is-active::before { width: 22px; opacity: 1; background-color: var(--primary); }

/* ── Create-list modal (name required + optional occasion) ── */
.clm-card { width: 380px; padding: 22px 22px 18px; }
.clm-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.clm-title { font-size: 17px; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.clm-body { display: flex; flex-direction: column; gap: 14px; }
.clm-field { display: flex; flex-direction: column; gap: 6px; }
.clm-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.clm-input {
  height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font-size: 14px; font-family: inherit; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.clm-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.clm-textarea { height: auto; min-height: 74px; padding: 10px 12px; line-height: 1.45; resize: vertical; }
.clm-help { font-size: 12px; line-height: 1.5; color: var(--muted); margin-top: -4px; }
/* A field can be conditionally hidden (message field on a private list). Beats
   the `.clm-field { display: flex }` rule without !important. */
.clm-field[hidden] { display: none; }
/* List-type segmented selector — 3 cards (Private / Friends / Public), replacing
   the privacy dropdown. Icon + title + one-line description; active = primary. */
.clm-vis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.clm-vis-opt {
  /* height:auto/min-height:0 beat the global `button { height: 40px }` rule that
     would otherwise squash this column card and overflow its content upward. */
  height: auto; min-height: 0;
  display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center;
  padding: 12px 6px 11px; border-radius: 12px; border: 1.5px solid var(--border);
  background: var(--surface-2); color: var(--text); cursor: pointer; font-family: inherit;
  transition: border-color .12s, background-color .12s, transform .06s;
}
/* Per-type accent colour (matches the sidebar / Details badge): purple / blue / green. */
.clm-vis-opt[data-vis="private"] { --vc: var(--violet); }
.clm-vis-opt[data-vis="friends"] { --vc: var(--info); }
.clm-vis-opt[data-vis="public"]  { --vc: var(--success); }
.clm-vis-opt:hover { border-color: color-mix(in srgb, var(--vc) 40%, var(--border)); }
.clm-vis-opt:active { transform: scale(.98); }
.clm-vis-ic { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--vc) 10%, var(--surface)); }
.clm-vis-ic .icon { background-color: var(--vc); }
.clm-vis-t { font-size: 12.5px; font-weight: 700; }
.clm-vis-d { font-size: 10px; color: var(--muted); line-height: 1.2; }
.clm-vis-opt.is-active { border-color: var(--vc); background: color-mix(in srgb, var(--vc) 10%, transparent); }
.clm-vis-opt.is-active .clm-vis-ic { background: color-mix(in srgb, var(--vc) 20%, transparent); }
.clm-vis-opt.is-active .clm-vis-ic .icon { background-color: var(--vc); }
.clm-vis-opt.is-active .clm-vis-t { color: var(--vc); }
.clm-footer { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
/* Right-aligned action group; keeps Cancel/Save on the right even when the
   left-edge Delete button is hidden (create mode). */
.clm-footer-right { margin-left: auto; display: flex; gap: 10px; }
/* Privacy dropdown (enhanced <select>) fills the field like the text inputs. */
.clm-field .csel { width: 100%; }
.clm-field .csel .csel-btn { width: 100%; height: 40px; justify-content: space-between; border-radius: 10px; }
.clm-btn {
  height: 40px; padding: 0 18px; border-radius: 10px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; border: 1px solid transparent;
  transition: filter .15s, background .15s, color .15s;
}
.clm-btn--ghost { background: var(--surface-2); border-color: var(--border); color: var(--muted); }
.clm-btn--ghost:hover { background: var(--surface); color: var(--text); }
.clm-btn--primary { background: var(--primary); color: var(--on-accent); }
.clm-btn--primary:hover { filter: brightness(1.07); }
.clm-btn--primary:disabled { opacity: .5; cursor: not-allowed; filter: none; }
/* Delete list — compact icon button, bottom-left of the footer. Hold-to-confirm
   (edit mode only). Light bg so the red hold fill shows. */
.clm-delete-btn {
  position: relative; overflow: hidden; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  cursor: pointer; font-family: inherit;
  transition: border-color .15s, background .15s;
}
.clm-delete-btn[hidden] { display: none; }
.clm-delete-btn:hover { border-color: var(--danger); }
.clm-delete-btn .icon { background-color: var(--danger); position: relative; z-index: 1; }

/* ── Add-a-custom-link modal (product attachments) ── */
.attach-modal-card { width: min(440px, calc(100vw - 32px)); }
.attach-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; }
.attach-modal-title { font-size: 16px; font-weight: 700; }
.attach-modal-body { padding: 4px 18px 8px; display: flex; flex-direction: column; gap: 12px; }
.attach-modal-field { display: flex; flex-direction: column; gap: 5px; }
.attach-modal-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.attach-modal-field input {
  width: 100%; padding: 9px 11px; font: inherit; box-sizing: border-box;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; color: var(--text);
}
.attach-modal-field input:focus { outline: none; border-color: var(--primary); background: var(--primary-soft); }
.attach-modal-hint { font-size: 12px; color: var(--muted); line-height: 1.4; }
.attach-modal-err { font-size: 12.5px; color: var(--danger-text); font-weight: 600; }
.attach-modal-err[hidden] { display: none; }
.attach-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; }

  /* ── Container weight calibration ───────────────────────────────────────
     Framed as a calibration, not a form: the container is shown large, the value
     is a stepper, and a catalogue-vs-yours comparison makes the delta explicit
     before saving. Two footers swap in place so the card never resizes mid-flow. */
  #cwModalOverlay .cw-card {
    width: 560px; max-width: 92vw; padding: 0;
    border-radius: 22px; overflow: hidden;
    display: flex; flex-direction: column;
  }
  #cwModalOverlay .cw-header {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 22px 24px 0;
  }
  #cwModalOverlay .cw-head-text { flex: 1; min-width: 0; }
  #cwModalOverlay .cw-title { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -.015em; }
  #cwModalOverlay .cw-sub { margin-top: 3px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
  #cwModalOverlay .cw-close { position: static; flex: none; }

  #cwModalOverlay .cw-body { padding: 20px 24px 0; }
  #cwModalOverlay .cw-body[hidden] { display: none; }

  /* Photo left, identity + value right. */
  #cwModalOverlay .cw-main { display: flex; gap: 20px; align-items: flex-start; }
  #cwModalOverlay .cw-shot {
    flex: none; width: 190px; aspect-ratio: 1; object-fit: contain;
    background: var(--surface-2); border-radius: 16px; padding: 12px;
  }
  #cwModalOverlay .cw-side { flex: 1; min-width: 0; }
  #cwModalOverlay .cw-name {
    font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -.02em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  #cwModalOverlay .cw-meta {
    font-size: 12.5px; color: var(--muted); margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  #cwModalOverlay .cw-weight-label {
    margin-top: 20px; margin-bottom: 8px;
    font-size: 12px; font-weight: 600; color: var(--muted);
  }

  /* Grouped [− value +] control — the value carries the frame, the buttons ride
     inside it (same construction as the rack side-card's steppers). */
  #cwModalOverlay .cw-stepper {
    display: flex; align-items: stretch;
    background: var(--surface-2);
    border: 1.5px solid var(--border); border-radius: 14px;
    overflow: hidden;
    transition: border-color .18s, box-shadow .18s, background .18s;
  }
  /* Focus shows on the FRAME only — border + ring. The wrapper keeps its grey:
     the − / + buttons are transparent, so turning it white flattened them into
     the white value well and the control lost its three-part reading. */
  #cwModalOverlay .cw-stepper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
  }
  /* height:auto + align-self:stretch are REQUIRED: the global `button` rule sets a
     fixed 40px height, which left these sitting top-aligned in a 66px stepper with
     a hover fill that only covered part of it. */
  #cwModalOverlay .cw-step {
    flex: none; width: 52px; padding: 0;
    height: auto; align-self: stretch;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; border-radius: 0;
    color: var(--muted); font-size: 22px; font-weight: 500; font-family: inherit;
    line-height: 1; cursor: pointer; user-select: none;
    transition: background .12s, color .12s;
  }
  #cwModalOverlay .cw-step:hover  { background: var(--border); color: var(--primary-text); }
  #cwModalOverlay .cw-step:active { background: var(--primary-soft); }
  /* White value well between the two buttons — the wrapper keeps the outer frame,
     side rules separate the number from − / + without giving it its own box. */
  #cwModalOverlay .cw-dial {
    position: relative; flex: 1; min-width: 0;
    display: flex; align-items: center;
    background: var(--surface);
    border-left: 1.5px solid var(--border);
    border-right: 1.5px solid var(--border);
  }
  /* Doubled class to outrank the global `input[type="number"]` rule. */
  #cwModalOverlay .cw-input.cw-input {
    width: 100%; height: 66px; padding: 0 34px 0 12px;
    font-size: 34px; font-weight: 800; font-family: var(--mono);
    text-align: center; letter-spacing: -.03em;
    color: var(--text);
    background: transparent !important; border: none !important; border-radius: 0 !important;
    outline: none; box-shadow: none !important;
    -moz-appearance: textfield;
  }
  #cwModalOverlay .cw-input::-webkit-outer-spin-button,
  #cwModalOverlay .cw-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  #cwModalOverlay .cw-unit {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    font-size: 15px; font-weight: 700; color: var(--muted); pointer-events: none;
  }
  #cwModalOverlay .cw-scale-hint {
    margin-top: 9px; font-size: 11.5px; color: var(--muted);
  }

  /* Visual recipe: what goes on the scale. Reads left to right as an equation,
     the middle term dropping out for containers that have no cardboard core. */
  /* No card around it: boxing the steps put a frame inside a framed dialog. The
     three step tiles carry the surface instead. */
  #cwModalOverlay .cw-how { margin-top: 18px; }
  #cwModalOverlay .cw-how-title {
    font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 12px;
  }
  #cwModalOverlay .cw-how-steps {
    --how-gap: 26px;      /* visual gap left between two cards */
    --op-size: 44px;      /* diameter of the + / = discs */
    display: flex; align-items: stretch; gap: var(--how-gap);
  }
  #cwModalOverlay .cw-how-step {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 10px 10px 12px;
    background: var(--surface-2); border-radius: 14px;
  }
  #cwModalOverlay .cw-how-step[hidden] { display: none; }
  /* Number and label share the top line — the caption names the step where the
     eye already is, instead of hanging under the picture. */
  #cwModalOverlay .cw-how-head {
    display: flex; align-items: flex-start; gap: 7px;
    align-self: stretch; min-width: 0;
  }
  #cwModalOverlay .cw-how-num {
    flex: none; width: 18px;
    background: var(--primary); color: var(--on-accent);
    font-size: 10.5px; font-weight: 800;
    /* The head is flex-start so the badge pins to the top line whether the
       caption is one line or three (it used to centre on the whole block, so a
       two-line caption dropped the badge to the middle). The 18px badge is
       taller than the 14.3px caption line, so top-align leaves its centre ~2px
       below the first line's optical centre — this nudge brings them level. */
    margin-top: -2px;
  }
  #cwModalOverlay .cw-how-cap {
    flex: 1; min-width: 0;
    font-size: 11px; line-height: 1.3; color: var(--text); font-weight: 600;
  }
  /* One uniform height, width follows the aspect — no `aspect-ratio: 1`.
     A square box was reserving vertical space no subject used: the scale is
     landscape, so a 112px box held a 65px subject and left 47px of dead air under
     it. The two assets we control are now exported CROPPED to their subject (no
     square padding), so their box hugs them exactly. The spool comes from the
     catalogue on a square canvas with its own margin — its subject renders a little
     smaller, which is inherent to the source and not worth distorting. */
  #cwModalOverlay .cw-how-img {
    height: var(--img-h, 72px); width: auto; max-width: 100%;
    object-fit: contain;
  }
  /* Per-image heights so the three SUBJECTS render at the same ~67px, which is
     what the eye compares. The boxes differ because the sources fill their frame
     differently: our two assets are cropped to their subject (91-95 %), while the
     spool is a catalogue photo on a square canvas with its own margin (77 %) —
     it needs a taller box to reach the same visible size, and we do not re-crop
     catalogue art that is shared with every other view. */
  #cwModalOverlay .cw-how-img--spool { --img-h: 87px; }
  #cwModalOverlay .cw-how-img--core  { --img-h: 70px; }
  #cwModalOverlay .cw-how-img--scale { --img-h: 74px; }
  #cwModalOverlay .cw-how-fallback {
    width: 42px; height: 42px; margin: 12px 0 4px;
    background-color: var(--muted);
  }
  #cwModalOverlay .cw-how-fallback[hidden] { display: none; }

  /* The + / = joints. They are FLEX ITEMS BETWEEN two cards, not elements
     positioned against one of them — so they are centred in the gap by
     construction, with no offset to keep in sync.
       margin = -(diameter + gap) / 2
     makes the disc's net flow width exactly -gap, so the two cards keep their
     intended visual gap while the disc's centre lands on that gap's midpoint
     (verified: 0.0000px offset). Everything about the shape is stated here —
     no shared utility, no inherited sizing, no border, no shadow. */
  #cwModalOverlay .cw-how-op {
    flex: none; align-self: center; z-index: 2;
    box-sizing: border-box;
    width: var(--op-size); height: var(--op-size);
    margin: 0 calc(-1 * (var(--op-size) + var(--how-gap)) / 2);
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--surface);
    display: grid; place-items: center;
    line-height: 1;
    font-size: 20px; font-weight: 700; font-family: inherit;
    color: var(--muted);
    user-select: none;
  }
  #cwModalOverlay .cw-how-op[hidden] { display: none; }

  /* How much stock rides on this number — amber, because getting it wrong is
     silently wrong: every spool in this container inherits the value. */
  #cwModalOverlay .cw-linked {
    display: flex; align-items: center; gap: 9px;
    margin-top: 12px; padding: 11px 14px;
    background: #fdf1e3;
    border-radius: 12px;
    font-size: 12px; line-height: 1.4; color: #6b4a1e;
  }
  #cwModalOverlay .cw-linked[hidden] { display: none; }
  #cwModalOverlay .cw-linked .icon { flex: none; background-color: #e08c1a; }

  /* Save mode — what happens to the spools already using this container. Sits last,
     right above the footer: one decision, taken after the delta is visible. */
  #cwModalOverlay .cw-mode {
    display: flex; align-items: center; gap: 18px;
    margin-top: 12px; padding: 13px 16px;
    background: var(--surface-2); border-radius: 14px;
  }
  #cwModalOverlay .cw-mode[hidden] { display: none; }
  #cwModalOverlay .cw-mode-text { flex: 1; min-width: 0; }
  #cwModalOverlay .cw-mode-title { font-size: 12.5px; font-weight: 700; color: var(--text); }
  #cwModalOverlay .cw-mode-sub { margin-top: 2px; font-size: 11px; line-height: 1.4; color: var(--muted); }
  #cwModalOverlay .cw-mode-opts { flex: none; display: flex; flex-direction: column; gap: 7px; }
  #cwModalOverlay .cw-mode-opt {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; color: var(--text); cursor: pointer;
  }
  /* Native input hidden but kept focusable — the visible dot is .cw-radio. */
  #cwModalOverlay .cw-mode-opt input {
    position: absolute; opacity: 0; width: 0; height: 0; margin: 0;
  }
  #cwModalOverlay .cw-radio {
    flex: none; width: 15px; height: 15px;
    border: 1.5px solid var(--border); border-radius: 50%;
    background: var(--surface);
    display: inline-flex; align-items: center; justify-content: center;
    transition: border-color .15s;
  }
  #cwModalOverlay .cw-radio::after {
    content: ""; width: 7px; height: 7px; border-radius: 50%;
    background: var(--primary);
    transform: scale(0); transition: transform .15s;
  }
  #cwModalOverlay .cw-mode-opt input:checked + .cw-radio { border-color: var(--primary); }
  #cwModalOverlay .cw-mode-opt input:checked + .cw-radio::after { transform: scale(1); }
  #cwModalOverlay .cw-mode-opt input:focus-visible + .cw-radio {
    box-shadow: 0 0 0 3px var(--primary-soft);
  }
  #cwModalOverlay .cw-mode-opt:hover .cw-radio { border-color: var(--primary); }

  /* Catalogue vs yours — the delta is the whole point of calibrating. */
  #cwModalOverlay .cw-compare {
    /* stretch, not center: the two columns must be the same height so their values
       sit on one line even when one subtitle wraps and the other doesn't. */
    display: flex; align-items: stretch; gap: 14px;
    margin-top: 16px; padding: 16px 20px;
    background: var(--surface-2); border-radius: 16px;
  }
  #cwModalOverlay .cw-cmp {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column;
  }
  #cwModalOverlay .cw-cmp-label { font-size: 13px; font-weight: 700; color: var(--text); }
  #cwModalOverlay .cw-cmp-sub { margin-top: 2px; font-size: 11px; line-height: 1.4; color: var(--muted); }
  #cwModalOverlay .cw-cmp-val {
    /* Pushed to the bottom of its column — that is what keeps the two figures
       aligned regardless of how many lines the subtitle above them takes. */
    margin-top: auto; padding-top: 14px;
    display: flex; align-items: baseline; justify-content: center; gap: 9px;
    font-size: 26px; font-weight: 800; font-family: var(--mono);
    letter-spacing: -.02em; color: var(--muted);
  }
  #cwModalOverlay .cw-cmp-val--mine { color: var(--primary-text); }
  /* The arrow rides in a white disc, centred between the two columns. */
  #cwModalOverlay .cw-cmp-arrow {
    flex: none; align-self: center;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface); border-radius: 50%;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .10);
  }
  #cwModalOverlay .cw-cmp-arrow .icon { background-color: var(--text); }
  #cwModalOverlay .cw-badge {
    align-self: center;
    font-size: 9.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    font-family: inherit;
    color: var(--primary-text); background: var(--surface);
    border: 1px solid var(--primary);
    padding: 3px 8px; border-radius: 999px;
  }
  #cwModalOverlay .cw-badge[hidden] { display: none; }

  #cwModalOverlay .cw-footer {
    display: flex; align-items: center; gap: 8px;
    padding: 20px 24px 22px;
  }
  #cwModalOverlay .cw-footer[hidden] { display: none; }
  #cwModalOverlay .cw-reset[hidden] { display: none; }
  /* Reset is a quiet escape hatch — never competing with Save. */
  #cwModalOverlay .cw-reset { font-size: 12px; color: var(--muted); }
  #cwModalOverlay .cw-reset .icon { background-color: currentColor; }

/* ═══ .ttag import modal ═══════════════════════════════════════════════════
   Reuses the add-friend card chrome (.adf-*); body + footer are rendered by JS
   (source picker → preview). Uses ONLY real design tokens (--surface,
   --surface-2, --border, --text, --muted, --primary, --danger, --radius…). */

/* Card + header/footer polish — scoped, so the shared .adf-* chrome is untouched. */
#ttagImportOverlay .ttag-card { max-width: 560px; width: min(560px, 92vw); }
/* No header/footer hairlines — a cleaner, more minimal card. */
#ttagImportOverlay .adf-header { padding: 20px 22px 12px; border-bottom: 0; }
#ttagImportOverlay .adf-title { font-size: 17px; font-weight: 700; }
#ttagImportOverlay .adf-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
#ttagImportOverlay .ttag-import-body { display: flex; flex-direction: column; gap: 16px; padding: 6px 22px 22px; }
#ttagImportOverlay .adf-footer { padding: 6px 22px 20px; border-top: 0; display: flex; justify-content: flex-end; gap: 10px; }
#ttagImportOverlay .adf-footer .adf-btn { padding: 9px 20px; }

/* ── Source screen — big dashed drop zone, two source buttons, web link ────── */
#ttagImportOverlay .ttag-dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; min-height: 210px; padding: 32px 24px;
  border: 2px dashed var(--border); border-radius: var(--radius);
  background: var(--surface-2); text-align: center;
  transition: border-color .15s ease, background .15s ease;
}
#ttagImportOverlay .ttag-dropzone.is-over {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface-2));
}
/* No shield icon. The "drop here" hint shows ONLY while a file hovers. */
#ttagImportOverlay .ttag-dropzone-title { display: none; font-size: 14px; color: var(--muted); }
#ttagImportOverlay .ttag-dropzone.is-over .ttag-dropzone-title { display: block; color: var(--primary-text); }
/* During a hover-drag the zone reads purely as a drop target — the source
   buttons, the web-link row and any staged chips step aside, leaving only the
   centred hint (even in the staged, top-anchored layout). */
#ttagImportOverlay .ttag-dropzone.is-over .ttag-src-actions,
#ttagImportOverlay .ttag-dropzone.is-over .ttag-url-row,
#ttagImportOverlay .ttag-dropzone.is-over .ttag-chips { display: none; }
/* While dragging over the zone, children (incl. the hint text) can't be drag
   targets — otherwise moving onto a child fires dragleave→dragover on the
   parent and the highlight flickers. */
#ttagImportOverlay .ttag-dropzone.is-over * { pointer-events: none; }
#ttagImportOverlay .ttag-dropzone--staged.is-over { justify-content: center; }

/* With files staged, the buttons stay put at the top and the chips grow
   DOWNWARD below them (never pushing the buttons down). */
#ttagImportOverlay .ttag-dropzone--staged { justify-content: flex-start; }

#ttagImportOverlay .ttag-src-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
#ttagImportOverlay .ttag-src-actions .adf-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; }
#ttagImportOverlay .ttag-src-actions .adf-btn.is-active { border-color: var(--primary); color: var(--primary-text); }
#ttagImportOverlay .ttag-src-actions .icon { background-color: currentColor; }

/* Web-link row — space RESERVED from the start (visibility, not display), so
   revealing it on "Upload from URL" never shifts the buttons above it. */
#ttagImportOverlay .ttag-url-row {
  display: flex; gap: 8px; width: 100%; max-width: 360px; margin-top: 2px; visibility: hidden;
}
#ttagImportOverlay .ttag-url-row.is-shown { visibility: visible; }
#ttagImportOverlay .ttag-url-input {
  flex: 1 1 auto; min-width: 0; height: 40px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px;
}
#ttagImportOverlay .ttag-url-input::placeholder { color: var(--muted); }
#ttagImportOverlay .ttag-url-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
#ttagImportOverlay .ttag-url-row .adf-btn { flex: 0 0 auto; padding: 9px 18px; }

/* Staged sources — removable chips filling the zone. */
#ttagImportOverlay .ttag-chips { display: flex; flex-direction: column; gap: 8px; width: 100%; max-height: 220px; overflow-y: auto; }
#ttagImportOverlay .ttag-chip {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
}
#ttagImportOverlay .ttag-chip .icon { background-color: var(--success); flex: 0 0 auto; }
#ttagImportOverlay .ttag-chip-name { flex: 1 1 auto; min-width: 0; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ttagImportOverlay .ttag-chip-x { flex: 0 0 auto; width: 24px; height: 24px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; }
#ttagImportOverlay .ttag-chip-x:hover { background: var(--surface-2); color: var(--text); }

/* ── Preview screen — mode banner, count, per-material rows ────────────────── */
#ttagImportOverlay .ttag-mode {
  font-size: 12.5px; line-height: 1.4; padding: 9px 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
}
#ttagImportOverlay .ttag-mode--restore { border-color: color-mix(in srgb, var(--primary) 40%, transparent); color: var(--text); }
#ttagImportOverlay .ttag-mode--mixed { border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); color: var(--text); }
#ttagImportOverlay .ttag-summary { font-size: 12px; color: var(--muted); padding: 0 2px; }
#ttagImportOverlay .ttag-summary--warn { color: var(--danger-text); }
#ttagImportOverlay .ttag-list { max-height: 46vh; overflow-y: auto; scrollbar-width: none; }
#ttagImportOverlay .ttag-list::-webkit-scrollbar { width: 0; height: 0; display: none; }
/* Frame the whole table like the inventory data table (outer grey border +
   rounded corners), with a bottom scroll-fade (the sticky header covers the top). */
#ttagImportOverlay .ttag-list-wrap { position: relative; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
#ttagImportOverlay .ttag-list-wrap::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30px; pointer-events: none;
  opacity: 0; transition: opacity .15s ease; z-index: 2;
  background: linear-gradient(to top, var(--surface), transparent);
}
#ttagImportOverlay .ttag-list-wrap.can-down::after { opacity: 1; }

/* ── Preview table — column headers + sticky head + a "select all" checkbox ── */
#ttagImportOverlay .ttag-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
/* Header band styled like the inventory table's thead: light-grey fill + grey
   border, uppercase muted labels, sticky at the top of the scroll area. */
#ttagImportOverlay .ttag-table thead th {
  /* z-index must sit ABOVE the row checkboxes (`.sel-check` is z-index:4) so a
     row scrolling under the sticky header hides behind it — matches the
     inventory table's own thead z-index. */
  position: sticky; top: 0; z-index: 20; background: var(--surface-2); vertical-align: middle;
  text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
  color: var(--muted); padding: 9px 8px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
#ttagImportOverlay .ttag-th-thumb  { width: 52px; }
#ttagImportOverlay .ttag-th-weight { width: 88px; }
#ttagImportOverlay .ttag-th-badge  { width: 92px; text-align: right; }
/* The check column reuses the inventory table's own `.sel-th` / `.sel-cell`
   classes (see 70-detail-misc.css) — same 40px width, padding and always-on
   `.sel-check` rendering, so the checkbox aligns exactly like the inventory
   table and needs no bespoke CSS here. */

/* Rows + cells. */
#ttagImportOverlay .ttag-prev-row { cursor: pointer; }
#ttagImportOverlay .ttag-prev-row:hover td { background: var(--surface-2); }
#ttagImportOverlay .ttag-prev-row td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
#ttagImportOverlay .ttag-prev-row:last-child td { border-bottom: none; }
#ttagImportOverlay .ttag-td-badge { text-align: right; }

/* Cell content. */
#ttagImportOverlay .ttag-prev-thumb-wrap { position: relative; display: inline-flex; }
/* Uniform thumb: the global `.thumb` forces 50px on images, colour spools use 40 — pin both. */
#ttagImportOverlay .ttag-prev-thumb-wrap .thumb,
#ttagImportOverlay .ttag-prev-thumb-wrap .thumb-color { width: 40px; height: 40px; }
#ttagImportOverlay .ttag-td-mat { overflow: hidden; }
#ttagImportOverlay .ttag-prev-name { display: block; font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ttagImportOverlay .ttag-prev-sub { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ttagImportOverlay .ttag-prev-weight { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
#ttagImportOverlay .ttag-prev-w-val { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; }
#ttagImportOverlay .ttag-prev-weight .bar { width: 100%; margin-left: 0; margin-top: 0; }
#ttagImportOverlay .ttag-error { font-size: 13px; color: var(--danger-text); line-height: 1.5; margin: 6px 2px; }
#ttagImportOverlay .ttag-success { font-size: 13.5px; color: var(--text); line-height: 1.5; margin: 10px 2px; text-align: center; }

/* ── Full-window drag-drop hint (drop anywhere while the modal is closed) ──── */
.ttag-drop-hint {
  position: fixed; inset: 0; z-index: 9999; display: none;
  align-items: center; justify-content: center; pointer-events: none;
  background: color-mix(in srgb, var(--bg) 68%, transparent);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
body.ttag-dragging .ttag-drop-hint { display: flex; }
.ttag-drop-hint-inner {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 30px 46px; border-radius: 18px;
  border: 2px dashed var(--primary); background: var(--surface);
  color: var(--text); font-size: 15px; font-weight: 600; box-shadow: var(--shadow);
}
.ttag-drop-hint-inner .icon { height: 40px; aspect-ratio: 1 / 1; background-color: var(--primary); }

/* ── .ttag import: Restore/Import mode chooser (user decides, pre-hinted) ──── */
#ttagImportOverlay .ttag-choose { font-size: 12.5px; font-weight: 600; color: var(--text); margin-top: 2px; }
#ttagImportOverlay .ttag-modes { display: flex; flex-direction: row; gap: 8px; }
#ttagImportOverlay .ttag-mode-opt {
  flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center;
  padding: 13px 10px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface); cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
#ttagImportOverlay .ttag-mode-opt .tool-info { flex: 0 0 auto; display: inline-flex; }
#ttagImportOverlay .ttag-mode-opt:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
#ttagImportOverlay .ttag-mode-opt.is-selected { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
#ttagImportOverlay .ttag-mode-opt-title { font-size: 13px; font-weight: 700; color: var(--text); }
#ttagImportOverlay .ttag-mode-opt-desc { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
  /* The "Share" badge sits at the end of the socials row, a little apart from the icons. */
  .fvb-socials .fvb-badge--share { margin-left: 4px; }

/* ── My profile, two columns (redesign) ─────────────────────────────────────
   Double width, cards in two columns: profile / community / preferences on
   the left, the AI assistant card on the right. One
   column when the window is narrow. The colour strip sits beside the identity
   in the hero. Explanations moved to ⓘ bubbles (.eac-info). */
#editAccountModalOverlay .modal-card { width: 780px; max-width: calc(100vw - 16px); }
#editAccountModalOverlay .eac-hero { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
#editAccountModalOverlay .eac-hero .eac-swatches { width: auto; margin-top: 0; gap: 7px; justify-content: flex-end; }
#editAccountModalOverlay .eac-body { padding: 0 14px 14px; }
#editAccountModalOverlay .eac-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
#editAccountModalOverlay .eac-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
#editAccountModalOverlay .eac-col .eac-group.eac-group {
  padding: 12px 16px; border: 1px solid var(--border-soft); border-radius: 14px;
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
}
#editAccountModalOverlay .eac-card-title {
  display: flex; align-items: center; gap: 8px; margin: 0 0 8px;
  font-size: 14px; font-weight: 600; color: var(--text);
}
#editAccountModalOverlay .eac-card-title > .icon { background-color: var(--muted); }
#editAccountModalOverlay .eac-sub-label { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-soft); }
/* Tighter rows inside the cards: the two columns should fit a 1000 px tall window. */
#editAccountModalOverlay .eac-col .eac-row.eac-row { min-height: 34px; }
#editAccountModalOverlay .eac-socials-label { margin-top: 12px; }
#editAccountModalOverlay .eac-socials-count { color: var(--faint); }
/* ⓘ bubbles outside the account section (the base .eac-info rule only sized them). */
#editAccountModalOverlay .eac-card-title .eac-info .icon { background: var(--faint); }
@media (max-width: 820px) {
  #editAccountModalOverlay .eac-cols { grid-template-columns: 1fr; }
}
/* Member: the TigerSquad badge takes the avatar's corner (like the header
   avatar); the pen badge steps aside, the hover overlay still shows the pen. */
#editAccountModalOverlay .eac-avatar-editable.eac-avatar--squad::before,
#editAccountModalOverlay .eac-avatar-editable.eac-avatar--squad::after { display: none; }
#editAccountModalOverlay .eac-avatar .av-squad-heart { z-index: 3; }
/* TigerSquad row: the toggle stays on the title's line, the stats run below
   it on two planned lines (XP · certified / world rank). */
#editAccountModalOverlay .eac-row:has(.eac-squad-label) { align-items: flex-start; }
#editAccountModalOverlay .eac-row:has(.eac-squad-label) .eac-toggle { margin-top: 2px; }
#editAccountModalOverlay .eac-squad-label.eac-squad-label { flex-direction: column; align-items: flex-start; gap: 3px; }
/* Colour strip a touch quieter: 16 px dots, the custom picker a little larger. */
#editAccountModalOverlay .eac-hero .eac-swatch { width: 16px; height: 16px; }
#editAccountModalOverlay .eac-hero .eac-swatch-custom { width: 22px; height: 22px; }
/* Edit my profile (#identityOverlay) — layout from a ChatGPT review: four
   cards (photo, display name, theme colour, live preview) and a footer.
   480 px wide; the body scrolls when the window is short. */
#identityOverlay .idm-card { width: 480px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); padding: 0; display: flex; flex-direction: column; overflow: hidden; }
#identityOverlay .idm-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 14px; }
#identityOverlay .idm-head h3 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text); }
#identityOverlay .idm-head .modal-close { position: static; }
#identityOverlay .idm-body { display: flex; flex-direction: column; gap: 12px; padding: 0 24px 18px; overflow-y: auto; min-height: 0; }
#identityOverlay .idm-sec { padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
#identityOverlay .idm-sec-title { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
#identityOverlay .idm-sec-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#identityOverlay .idm-hint { font-size: 11.5px; color: var(--muted); }
/* Photo: avatar left, the name and its two actions on the right. */
#identityOverlay .idm-photo { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 18px; align-items: center; }
#identityOverlay .idm-avatar { width: 88px; height: 88px; font-size: 30px; cursor: default; box-shadow: 0 0 0 3px var(--surface-2), 0 0 0 5px var(--idm-c, var(--primary)), 0 0 22px color-mix(in srgb, var(--idm-c, var(--primary)) 45%, transparent); }
#identityOverlay .idm-photo-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
#identityOverlay .idm-name { font-size: 16px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#identityOverlay .idm-photo-btns { display: flex; align-items: center; gap: 8px; }
#identityOverlay .idm-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; border-radius: 9px; }
#identityOverlay .idm-btn--change { padding: 0 12px; border: 1px solid color-mix(in srgb, var(--primary) 70%, transparent); color: var(--text); }
#identityOverlay .idm-btn--change .icon { background: var(--text); }
#identityOverlay .idm-btn--change:hover { background: color-mix(in srgb, var(--primary) 14%, transparent); }
#identityOverlay .idm-btn--danger { color: var(--danger-text); } #identityOverlay .idm-btn--danger .icon { background: var(--danger); }
/* Remove photo: the trash icon alone, square, held 1.5 s (hold fill inside). */
#identityOverlay .idm-btn--icon { position: relative; overflow: hidden; justify-content: center; width: 34px; padding: 0; border: 1px solid var(--border); }
#identityOverlay .idm-btn--icon .icon { position: relative; z-index: 1; }
#identityOverlay .eac-avatar-result:empty { display: none; }
/* Display name: field and check as one control. */
#identityOverlay .idm-name-group { display: flex; gap: 0; height: 40px; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: var(--bg); }
#identityOverlay .eac-name-input { flex: 1; min-width: 0; padding: 0 12px; font-size: 13.5px; border: 0; border-radius: 0; background: transparent; }
#identityOverlay .eac-name-input:focus { outline: none; box-shadow: none; }
#identityOverlay .eac-name-save { flex: 0 0 44px; height: 100%; border: 0; border-left: 1px solid var(--border); border-radius: 0; cursor: pointer; display: grid; place-items: center; background: transparent; transition: background .18s, filter .18s; }
#identityOverlay .eac-name-save .icon { background: var(--muted); }
#identityOverlay .eac-name-save:hover .icon { background: var(--text); }
/* Read-only until the pen is pressed: no caret, plain text look. Editing →
   orange frame and the orange check. */
#identityOverlay .eac-name-input[readonly] { cursor: default; color: var(--text); }
#identityOverlay .idm-name-group.is-editing { border-color: var(--primary); }
#identityOverlay .idm-name-group.is-editing .eac-name-save { background: var(--primary); border-left-color: var(--primary); }
#identityOverlay .idm-name-group.is-editing .eac-name-save .icon { background: var(--on-accent); }
#identityOverlay .eac-name-save:hover { filter: brightness(1.1); }
#identityOverlay .eac-name-save.is-ok { background: var(--success); }
#identityOverlay .eac-name-save.is-err { background: var(--danger); animation: eacSaveShake .38s; }
#identityOverlay .eac-name-save.is-busy { opacity: .5; pointer-events: none; }
#identityOverlay .eac-inline-result:empty { display: none; }
/* Theme colour: the chosen colour's name top right, 7 × 2 tiles. */
#identityOverlay .idm-color-name { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
#identityOverlay .idm-color-name i { width: 12px; height: 12px; border-radius: 50%; background: var(--idm-c, var(--primary)); }
#identityOverlay .idm-swatches { margin: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px 8px; justify-items: center; }
/* The profile photo card wears the theme (founder): the same wall as the hero
   banners (--hero-wall, _applyThemeColor), so the chosen style shows at once;
   the text on it reads in white, the theme being a dark navy mix. */
#identityOverlay .idm-photo-sec { background: var(--hero-wall, var(--surface-2)); background-origin: border-box; border-color: transparent; }
/* Its top row: the title, then the TigerSquad title and the XP chip on the right. */
#identityOverlay .idm-photo-top { display: flex; align-items: center; gap: 10px; }
#identityOverlay .idm-photo-top .idm-mini-title { margin-left: auto; font-size: 16px; }
#identityOverlay .idm-photo-top .idm-mini-chip { margin-left: 0; }
/* The display name, editable in place, reads as the card's name on the theme. */
#identityOverlay .idm-photo-sec .idm-name-group { height: 36px; background: rgba(0, 0, 0, .28); border-color: rgba(255, 255, 255, .18); }
#identityOverlay .idm-photo-sec .eac-name-input, #identityOverlay .idm-photo-sec .eac-name-input[readonly] { color: #fff; font-weight: 700; font-size: 15px; }
#identityOverlay .idm-photo-sec .eac-name-save { border-left-color: rgba(255, 255, 255, .18); }
#identityOverlay .idm-photo-sec .eac-name-save .icon { background: rgba(255, 255, 255, .85); }
/* The avatar buttons keep a dark backing too: a red trash on a red theme vanished. */
#identityOverlay .idm-photo-sec .idm-btn.idm-btn { background: rgba(0, 0, 0, .32); color: #fff; }
/* border-box: under the transparent border the gradient would otherwise repeat, each
   edge showing the OPPOSITE edge's colour — the thin bands seen down the sides. */
#identityOverlay .idm-photo-sec .idm-sec-title, #identityOverlay .idm-photo-sec #idmName { color: #fff; }
:root.has-theme-aurora #identityOverlay .idm-photo-sec { animation: theme-aurora 9s ease-in-out infinite alternate; }
@media (prefers-reduced-motion: reduce) { :root.has-theme-aurora #identityOverlay .idm-photo-sec { animation: none; } }
/* Colour style (inventory.js _renderStylePicker): the aspect dots with their
   name (no tile), the TigerSquad badge each one needs on the dot's corner —
   the chosen one ringed, a locked one dimmed — then the colour slots the palette below paints. */
#identityOverlay .idm-style { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
#identityOverlay .idm-aspects { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
#identityOverlay .idm-aspect.idm-aspect { height: auto; min-height: 0; }   /* doubled: the global button height squeezed it */
/* No tile around a mode (founder): the dot and its name; the chosen one gets the
   palette's white ring, a locked one is dimmed; the level badge sits on the dot's corner. */
#identityOverlay .idm-aspect { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0; border: 0; background: none; color: var(--text); cursor: pointer; }
#identityOverlay .idm-aspect-dot { position: relative; display: block; }
#identityOverlay .idm-aspect-sw { display: block; width: 32px; aspect-ratio: 1; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); transition: transform .15s, box-shadow .15s; }
#identityOverlay .idm-aspect:hover .idm-aspect-sw { transform: scale(1.1); }
#identityOverlay .idm-aspect.is-on .idm-aspect-sw { transform: none; box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 4px #fff; }
#identityOverlay .idm-aspect-name { font-size: 11px; font-weight: 600; line-height: 1.1; text-align: center; color: var(--muted); }
#identityOverlay .idm-aspect.is-on .idm-aspect-name { color: var(--text); }
#identityOverlay .idm-aspect.is-locked .idm-aspect-sw, #identityOverlay .idm-aspect.is-locked .idm-aspect-name { opacity: .45; }
#identityOverlay .idm-aspect-tier { position: absolute; top: -9px; right: -13px; width: 24px; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
/* Intensity: how vivid the theme glow is (inventory.js STYLE_INTENSITY), a TigerSquad perk: greyed for anyone else. */
#identityOverlay .idm-intensity { display: flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 600; color: var(--muted); }
#identityOverlay .idm-intensity input { flex: 1; accent-color: var(--primary); cursor: pointer; }
#identityOverlay .idm-intensity.is-off { opacity: .4; }   /* Smoothness in Solid / Aurora: greyed, kept in place */
#identityOverlay .idm-intensity.is-off input { cursor: default; pointer-events: none; }
#identityOverlay .idm-intensity > span { min-width: 82px; }   /* Smoothness and Intensity sliders start aligned */
#identityOverlay .idm-intensity.is-locked { opacity: .45; cursor: not-allowed; }
#identityOverlay .idm-intensity.is-locked input { cursor: not-allowed; pointer-events: none; }
#identityOverlay .idm-slots { display: flex; align-items: center; justify-content: center; gap: 10px; }
#identityOverlay .idm-slots:empty { display: none; }
#identityOverlay .idm-slot.idm-slot { height: auto; min-height: 0; }
#identityOverlay .idm-slot { position: relative; display: grid; place-items: center; width: 30px; aspect-ratio: 1; padding: 0; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); transition: box-shadow .15s; }
#identityOverlay .idm-slot.is-on { box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 4px #fff; }
#identityOverlay .idm-slot-n { font-size: 11px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
/* Plain colour dots (no tile around them); the chosen one gets a white ring and a check. */
#identityOverlay .idm-swatches .eac-swatch { position: relative; width: 32px; height: 32px; aspect-ratio: auto; border-radius: 50%; border: 0; padding: 0; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); transform: none; transition: transform .15s, box-shadow .15s; }
#identityOverlay .idm-swatches .eac-swatch:hover { transform: scale(1.12); }
#identityOverlay .idm-swatches .eac-swatch[data-color].active { transform: none; box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 4px #fff; }
#identityOverlay .idm-swatches .eac-swatch[data-color].active::after { content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; background: #fff;
  -webkit-mask: url('../../assets/svg/icons/icon_check.svg') center / contain no-repeat; mask: url('../../assets/svg/icons/icon_check.svg') center / contain no-repeat; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
/* Custom colour: a full colour wheel the size of the other dots (a dashed
   outline read smaller), the palette icon on it; chosen → the white ring. */
#identityOverlay .idm-swatches .eac-swatch-custom { display: grid; place-items: center; border: 0 !important; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15) !important;
  background: conic-gradient(#ef4444, #f59e0b, #eab308, #22c55e, #14b8a6, #3b82f6, #8b5cf6, #d946ef, #ef4444) !important; }
#identityOverlay .idm-swatches .eac-swatch-custom .icon { width: 16px; height: 16px; background: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .7)); }
#identityOverlay .idm-swatches .eac-swatch-custom.active { box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 4px #fff !important; }
/* The profile card's XP chip and TigerSquad title (it is the live preview now). */
#identityOverlay .idm-mini-chip { margin-left: auto; padding: 2px 8px; border-radius: 99px; font-size: 10px; font-weight: 700; color: #ffb347; background: rgba(0, 0, 0, .3); }
#identityOverlay .idm-mini-title { position: relative; z-index: 1; font: 800 20px/1 "Avenir Next Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif; color: #fff; text-shadow: 0 2px 4px #000; letter-spacing: .02em; }
#identityOverlay .idm-mini-orange { color: var(--primary-text); }
#identityOverlay .idm-foot { display: flex; justify-content: flex-end; padding: 14px 24px; border-top: 1px solid var(--border); }
#identityOverlay .idm-done { min-width: 104px; height: 36px; }
/* The pen beside the name in My profile. */
.eac-ident-edit { display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: none; cursor: pointer; }
.eac-ident-edit .icon { background: var(--muted); }
.eac-ident-edit:hover { background: var(--surface-2); } .eac-ident-edit:hover .icon { background: var(--primary); }

/* ── openDialog() (renderer/dialog.js, .agents/rules/dialogs.md) ─────────────
   The two looks reuse the Tiger Squad window (.squad-invite.squad-notice, 10-settings.css)
   and the TigerCoins window (.tc-reveal + .tcx, quests.css); only the shared bits are here. */
.dlg-acts { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.dlg-act-txt { position: relative; z-index: 1; }
/* No picture yet: the icon in a tinted tile (the old notice look). */
.dlg-ico { align-self: center; width: 64px; aspect-ratio: 1; border-radius: 20px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--tsq-orange) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tsq-orange) 40%, transparent); }
.dlg-ico .icon { width: 28px; height: 28px; background: var(--tsq-orange); }
/* The ceremony's cross, top right of the framed card. */
.dlg--ceremony .qfs-card { position: relative; }
.dlg-x.dlg-x { position: absolute; top: 12px; right: 12px; z-index: 2; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 70%, transparent); cursor: pointer; }
.dlg-x .icon { background-color: var(--on-dark); }
/* Cards inside a notice (a list of items): the "what you lose" card of the leave window, any tint. */
.dlg .sqn-lost-ic.dlg-tile { background: linear-gradient(135deg, var(--kc), color-mix(in srgb, var(--kc) 62%, #000)); }
.dlg .sqn-lost-ic.dlg-tile .icon { background: #fff; }
.dlg .sqn-lost li small.dlg-accent { color: var(--tsq-orange); font-weight: 700; }

/* ── In-app colour picker (renderer/color-pop.js) ─────────────────────────────
   Opens beside what was clicked (a theme colour slot, the palette swatch) instead
   of macOS's colour panel: saturation / brightness area, hue strip, HEX field. */
.color-pop {
  position: fixed; z-index: 10050; width: 220px; padding: 12px; display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.color-pop-sv {
  position: relative; height: 140px; border-radius: 8px; cursor: crosshair; touch-action: none;
  background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, var(--hue, red));
}
.color-pop-thumb {
  position: absolute; width: 14px; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none;
  border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .45), 0 1px 4px rgba(0, 0, 0, .4);
}
.color-pop-hue {
  -webkit-appearance: none; appearance: none; width: 100%; height: 12px; margin: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}
.color-pop-hue::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .45), 0 1px 4px rgba(0, 0, 0, .4);
}
.color-pop-row { display: flex; align-items: center; gap: 8px; }
.color-pop-swatch { width: 28px; aspect-ratio: 1; border-radius: 50%; flex-shrink: 0; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 18%, transparent); }
.color-pop-hex {
  flex: 1; min-width: 0; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: 600 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase;
}
.color-pop-hex:focus { outline: none; border-color: var(--primary); }
