@font-face {
        font-family: "IBM Plex Sans";
        font-style: normal;
        font-weight: 300 800;
        font-display: swap;
        src:
          url("/fonts/ibm-plex-sans/IBMPlexSans-VariableFont_wdth,wght.woff2")
          format("woff2");
      }
      @font-face {
        font-family: "IBM Plex Sans";
        font-style: italic;
        font-weight: 300 800;
        font-display: swap;
        src:
          url("/fonts/ibm-plex-sans/IBMPlexSans-Italic-VariableFont_wdth,wght.woff2")
          format("woff2");
      }
      @font-face {
        font-family: "IBM Plex Mono";
        font-style: normal;
        font-weight: 400;
        font-display: swap;
        src:
          url("/fonts/ibm-plex-mono/IBMPlexMono-Regular.ttf")
          format("truetype");
      }
      @font-face {
        font-family: "IBM Plex Mono";
        font-style: normal;
        font-weight: 500;
        font-display: swap;
        src:
          url("/fonts/ibm-plex-mono/IBMPlexMono-Medium.ttf")
          format("truetype");
      }
      @font-face {
        font-family: "IBM Plex Mono";
        font-style: normal;
        font-weight: 600;
        font-display: swap;
        src:
          url("/fonts/ibm-plex-mono/IBMPlexMono-SemiBold.ttf")
          format("truetype");
      }

      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }

      /* ── Dark theme — follows the site theme (html.dark) ── */
      :root.dark {
        color-scheme: dark;
        --bg-page: #0a0c14;
        --bg-base: #111422;
        --bg-surface: #1a1d2e;
        --bg-elevated: #242739;
        --bg-hover: #2d3048;
        --bg-input: #131624;
        --border: #343854;
        --border-subtle: #262a3e;
        --border-focus: #4d80f0;
        --text-primary: #dde0e8;
        --text-secondary: #8890a8;
        --text-muted: #505770;
        --accent: #4d80f0;
        --accent-hover: #6a96ff;
        --accent-dim: rgba(77, 128, 240, 0.08);
        --accent-mid: rgba(77, 128, 240, 0.16);
        --accent-text: #ffffff;
        --success: #22c55e;
        --success-bg: rgba(34, 197, 94, 0.12);
        --error: #ef4444;
        --warning: #eab308;
        --chip-bg: rgba(255, 255, 255, 0.04);
        --store-bar-bg: rgba(10, 12, 20, 0.95);
        --store-badge-border: rgba(255, 255, 255, 0.08);
        --store-badge-bg: rgba(255, 255, 255, 0.03);
        --store-label: rgba(255, 255, 255, 0.35);
        --store-name: rgba(255, 255, 255, 0.9);
        --radius: 8px;
        --radius-sm: 6px;
        --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
      }

      /* ── Light theme (base) — matches the site's light-by-default palette ── */
      :root {
        color-scheme: light;
        --bg-page: #f6f7f9;
        --bg-base: #ffffff;
        --bg-surface: #f8f9fb;
        --bg-elevated: #ffffff;
        --bg-hover: #eef1f5;
        --bg-input: #ffffff;
        --border: #d5d9e2;
        --border-subtle: #e6e9ef;
        --border-focus: #4d80f0;
        --text-primary: #1f2532;
        --text-secondary: #555d70;
        --text-muted: #8a90a0;
        --accent: #4d80f0;
        --accent-hover: #3b6fe0;
        --accent-dim: rgba(77, 128, 240, 0.1);
        --accent-mid: rgba(77, 128, 240, 0.18);
        --accent-text: #ffffff;
        --success: #16a34a;
        --success-bg: rgba(22, 163, 74, 0.12);
        --error: #dc2626;
        --warning: #b45309;
        --chip-bg: rgba(15, 23, 42, 0.05);
        --store-bar-bg: rgba(246, 247, 249, 0.95);
        --store-badge-border: rgba(15, 23, 42, 0.1);
        --store-badge-bg: rgba(15, 23, 42, 0.03);
        --store-label: rgba(15, 23, 42, 0.4);
        --store-name: rgba(15, 23, 42, 0.85);
        --shadow-md: 0 8px 32px rgba(15, 23, 42, 0.12);
        --shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.16);
      }

      body {
        font-family: "IBM Plex Sans", system-ui, sans-serif;
        background: var(--bg-page);
        color: var(--text-primary);
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        overflow: hidden;
      }

      /* ══ Stage ══ */
      #stage {
        position: relative;
        width: 1200px;
        height: 750px;
        /* The demo renders at a fixed 1200x750 canvas; an inline script scales
           this down to fit smaller/laptop viewports so nothing (e.g. the store
           links) is clipped off-screen. */
        transform-origin: center center;
        transform: scale(var(--stage-scale, 1));
      }

      /* ══ Browser wireframe ══ */
      #browser {
        position: absolute;
        inset: 20px 40px;
        background: var(--bg-base);
        border-radius: 12px;
        border: 1px solid var(--border-subtle);
        overflow: hidden;
        display: flex;
        flex-direction: column;
        opacity: 0;
        transform: scale(0.92);
        will-change: transform, opacity;
      }

      #browser-chrome {
        background: var(--bg-elevated);
        padding: 10px 16px;
        display: flex;
        align-items: center;
        gap: 10px;
        flex-shrink: 0;
        border-bottom: 1px solid var(--border-subtle);
      }
      .dots {
        display: flex;
        gap: 6px;
      }
      .dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
      }
      .dot-r {
        background: #ff5f57;
      }
      .dot-y {
        background: #ffbd2e;
      }
      .dot-g {
        background: #28c940;
      }
      .toolbar-spacer {
        flex: 1;
      }

      #url-bar {
        flex: 1;
        background: var(--bg-input);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-sm);
        padding: 7px 12px;
        font:
          12px "IBM Plex Mono",
          monospace;
        color: var(--text-muted);
        overflow: hidden;
        white-space: nowrap;
        min-height: 28px;
      }

      #toolbar {
        display: flex;
        align-items: center;
        gap: 6px;
      }
      .tb-icon {
        width: 24px;
        height: 24px;
        border-radius: 4px;
        background: var(--chip-bg);
        display: flex;
        align-items: center;
        justify-content: center;
      }
      #hwt-icon {
        width: 28px;
        height: 28px;
        border-radius: var(--radius-sm);
        background: var(--accent-dim);
        border: 1.5px solid rgba(77, 128, 240, 0.25);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.15s;
      }
      #hwt-icon img {
        width: 16px;
        height: 16px;
        border-radius: 2px;
      }
      #hwt-icon.glow {
        background: var(--accent-mid);
        border-color: var(--accent);
        box-shadow: 0 0 12px rgba(77, 128, 240, 0.35);
      }

      /* ── Browser content ── */
      #browser-content {
        flex: 1;
        overflow: hidden;
        position: relative;
        background: var(--bg-base);
      }

      #article {
        padding: 36px 56px;
        position: absolute;
        inset: 0;
        overflow: hidden;
      }
      #article h1 {
        font-size: 24px;
        font-weight: 700;
        line-height: 1.3;
        margin-bottom: 10px;
        color: var(--text-primary);
      }
      .art-meta {
        font-size: 12px;
        color: var(--text-muted);
        margin-bottom: 16px;
      }
      .art-img {
        width: 100%;
        height: 180px;
        background: linear-gradient(
          135deg,
          var(--bg-elevated),
          var(--bg-surface)
        );
        border-radius: var(--radius);
        margin-bottom: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-muted);
        font-size: 11px;
      }
      .art-body {
        font-size: 13px;
        color: var(--text-secondary);
        line-height: 1.8;
      }
      .art-body p {
        margin-bottom: 14px;
      }

      /* ══ Popup (authentic extension dark mode) ══ */
      #popup-anchor {
        position: absolute;
        top: 62px;
        right: 52px;
        z-index: 10;
      }
      #popup {
        width: 400px;
        background: var(--bg-base);
        border-radius: 12px;
        border: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        overflow: hidden;
        opacity: 0;
        transform-origin: top right;
        transform: scaleY(0) scaleX(0.95);
      }

      /* ── Popup header ── */
      .pop-hdr {
        padding: 10px 16px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid var(--border-subtle);
        background: var(--bg-surface);
      }
      .pop-hdr-left {
        display: flex;
        align-items: center;
        gap: 10px;
      }
      .pop-logo {
        height: 22px;
      }

      /* Tab switcher (pill-style, authentic) */
      .tab-switcher {
        display: flex;
        gap: 2px;
        background: var(--bg-elevated);
        padding: 2px;
        border-radius: var(--radius-sm);
      }
      .tab-btn {
        padding: 2px 10px;
        border-radius: 4px;
        font:
          500 11px "IBM Plex Sans",
          sans-serif;
        color: var(--text-muted);
        transition: all 0.15s;
        cursor: pointer;
      }
      .tab-btn.active {
        background: var(--bg-base);
        color: var(--text-primary);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
      }

      /* Auth badge */
      .auth-badge {
        padding: 3px 10px;
        border-radius: var(--radius-sm);
        font:
          500 11px "IBM Plex Mono",
          monospace;
        background: var(--accent-dim);
        color: var(--accent);
      }

      /* ── Popup body ── */
      .pop-body {
        padding: 12px 16px;
        display: flex;
        flex-direction: column;
        gap: 10px;
      }

      /* Status message (slides in from top) */
      #status-msg {
        padding: 10px 14px;
        font:
          500 12px "IBM Plex Sans",
          sans-serif;
        border-bottom: 1px solid;
        display: none;
        align-items: center;
        gap: 6px;
      }
      #status-msg.is-visible {
        display: flex;
      }
      #status-msg.success {
        background: color-mix(in srgb, var(--bg-base) 85%, var(--success) 15%);
        border-color: color-mix(
          in srgb,
          var(--bg-base) 70%,
          var(--success) 30%
        );
        color: var(--success);
      }

      /* URL block */
      .url-block {
        padding: 10px 12px;
        background: var(--bg-surface);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius);
      }
      #src-url {
        font:
          11px "IBM Plex Mono",
          monospace;
        color: var(--accent);
        white-space: nowrap;
        overflow: hidden;
        min-height: 14px;
      }
      #src-title {
        font:
          500 12px "IBM Plex Sans",
          sans-serif;
        color: var(--text-primary);
        margin-top: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-height: 16px;
        opacity: 0;
      }
      #src-title.is-visible {
        opacity: 1;
      }

      /* Type toggle (segmented control, authentic) */
      .type-toggle {
        display: flex;
        gap: 0;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        overflow: hidden;
      }
      .type-toggle-narrow {
        max-width: 320px;
      }
      .type-toggle-spaced {
        margin-bottom: 6px;
      }
      .type-btn {
        flex: 1;
        padding: 5px 10px;
        text-align: center;
        font:
          500 11px "IBM Plex Sans",
          sans-serif;
        color: var(--text-secondary);
        border-right: 1px solid var(--border);
        transition: all 0.15s;
        cursor: pointer;
      }
      .type-btn:last-child {
        border-right: none;
      }
      .type-btn.active {
        background: var(--accent);
        color: var(--accent-text);
      }
      .type-btn:hover:not(.active) {
        background: var(--bg-hover);
      }

      /* Section label (with line extending right) */
      .section-lbl {
        display: flex;
        align-items: center;
        gap: 8px;
        font:
          600 9px "IBM Plex Sans",
          sans-serif;
        text-transform: uppercase;
        letter-spacing: 1.8px;
        color: var(--text-muted);
        margin-bottom: -4px;
      }
      .section-lbl-tight {
        margin-bottom: 4px;
      }
      .section-lbl-wide {
        margin-top: 14px;
        margin-bottom: 4px;
      }
      .section-lbl::after {
        content: "";
        flex: 1;
        height: 1px;
        background: var(--border-subtle);
      }

      /* Tag input (authentic) */
      .tag-input-wrap {
        display: flex;
        gap: 4px;
        flex-wrap: wrap;
        align-items: center;
        padding: 7px 10px;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        min-height: 32px;
        transition:
          border-color 0.15s,
          box-shadow 0.15s;
      }
      .tag-input-wrap.focus {
        border-color: var(--border-focus);
        box-shadow: 0 0 0 2px var(--accent-dim);
      }
      .tag-chip {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 3px 10px;
        border-radius: var(--radius-sm);
        font:
          500 11px "IBM Plex Sans",
          sans-serif;
        background: var(--accent-mid);
        color: var(--accent);
        border: 1px solid rgba(77, 128, 240, 0.25);
      }
      .tag-chip .tag-x {
        font-size: 10px;
        opacity: 0.6;
      }
      #tag-typing {
        font:
          13px "IBM Plex Sans",
          sans-serif;
        color: var(--text-primary);
        min-width: 2px;
      }
      #tag-ph {
        font:
          13px "IBM Plex Sans",
          sans-serif;
        color: var(--text-muted);
      }
      .tag-caret {
        display: inline-block;
        width: 1.5px;
        height: 14px;
        background: var(--accent);
        margin-left: 1px;
        animation: blink 0.7s step-end infinite;
      }
      @keyframes blink {
        50% {
          opacity: 0;
        }
      }

      /* ── Popup footer ── */
      .pop-foot {
        padding: 10px 16px 12px;
        border-top: 1px solid var(--border-subtle);
        display: flex;
        flex-direction: column;
        gap: 6px;
      }
      .foot-btns {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
      }
      .btn-cancel {
        padding: 8px 18px;
        border-radius: var(--radius-sm);
        font:
          600 13px "IBM Plex Sans",
          sans-serif;
        background: var(--bg-elevated);
        color: var(--text-secondary);
        border: 1px solid var(--border);
      }
      #btn-submit {
        padding: 8px 18px;
        border-radius: var(--radius-sm);
        font:
          600 13px "IBM Plex Sans",
          sans-serif;
        background: var(--accent);
        color: var(--accent-text);
        border: none;
        transition: all 0.15s;
      }
      #btn-submit.is-dimmed {
        opacity: 0.7;
      }
      #btn-submit.is-normal {
        opacity: 1;
      }
      /* article image — nature photo placeholder */
      .art-img-photo {
        width: 100%;
        height: 180px;
        border-radius: var(--radius);
        margin-bottom: 16px;
        object-fit: cover;
      }
      .notes-input {
        width: 100%;
        padding: 8px 10px;
        background: var(--bg-input);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        font:
          13px "IBM Plex Sans",
          sans-serif;
        color: var(--text-primary);
        resize: none;
        min-height: 40px;
      }
      .notes-input::placeholder {
        color: var(--text-muted);
      }

      .kbd-row {
        text-align: right;
        font:
          10px "IBM Plex Mono",
          monospace;
        color: var(--text-muted);
      }
      .kbd {
        background: var(--bg-elevated);
        padding: 1px 5px;
        border-radius: 3px;
        border: 1px solid var(--border-subtle);
      }

      /* ══ Bulk view ══ */
      #popup-bulk {
        display: none;
      }
      #popup-bulk.is-visible {
        display: block;
      }
      .bulk-body {
        padding: 12px 16px;
        display: flex;
        flex-direction: column;
        gap: 8px;
      }
      #bulk-ta {
        width: 100%;
        min-height: 130px;
        padding: 10px 12px;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        background: var(--bg-input);
        font:
          12px/1.6 "IBM Plex Mono",
          monospace;
        color: var(--text-primary);
        white-space: pre-wrap;
        word-break: break-all;
      }
      #bulk-info {
        font:
          12px "IBM Plex Sans",
          sans-serif;
        color: var(--text-secondary);
        min-height: 16px;
      }
      #bulk-start {
        width: 100%;
        padding: 10px;
        border-radius: var(--radius-sm);
        font:
          600 13px "IBM Plex Sans",
          sans-serif;
        text-align: center;
        background: var(--accent);
        color: var(--accent-text);
        border: none;
      }

      /* Bulk progress (in-popup, authentic) */
      #bulk-progress {
        display: none;
      }
      #bulk-progress.is-visible {
        display: block;
      }
      .prog-hdr {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 14px;
      }
      .prog-title {
        font:
          600 12px "IBM Plex Sans",
          sans-serif;
      }
      .prog-stop {
        padding: 3px 10px;
        border-radius: var(--radius-sm);
        font:
          500 11px "IBM Plex Sans",
          sans-serif;
        background: var(--bg-elevated);
        color: var(--text-secondary);
        border: 1px solid var(--border);
      }
      .prog-bar-wrap {
        margin: 0 14px 6px;
        height: 4px;
        background: var(--bg-elevated);
        border-radius: 2px;
        overflow: hidden;
      }
      #prog-bar {
        height: 100%;
        width: 0%;
        background: var(--accent);
        border-radius: 2px;
        transition: width 0.3s;
      }
      .prog-label {
        padding: 0 14px 8px;
        font:
          11px "IBM Plex Sans",
          sans-serif;
        color: var(--text-secondary);
      }
      .prog-label.is-success {
        color: var(--success);
      }
      .prog-label.is-default {
        color: var(--text-secondary);
      }
      .progress-fill-0 {
        width: 0%;
      }
      .progress-fill-1 {
        width: 12.5%;
      }
      .progress-fill-2 {
        width: 25%;
      }
      .progress-fill-3 {
        width: 37.5%;
      }
      .progress-fill-4 {
        width: 50%;
      }
      .progress-fill-5 {
        width: 62.5%;
      }
      .progress-fill-6 {
        width: 75%;
      }
      .progress-fill-7 {
        width: 87.5%;
      }
      .progress-fill-8 {
        width: 100%;
      }
      #prog-rows {
        max-height: 180px;
        overflow-y: auto;
      }
      .prog-row {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 3px 14px;
        font-size: 11px;
        border-bottom: 1px solid var(--border-subtle);
        color: var(--text-secondary);
      }
      .prog-row:last-child {
        border-bottom: none;
      }
      .prog-row .prog-ico,
      .prog-row .prog-url,
      .prog-row .prog-st {
        color: var(--text-secondary);
      }
      .prog-row.status-archived .prog-ico,
      .prog-row.status-archived .prog-st {
        color: var(--success);
      }
      .prog-row.status-duplicate .prog-ico,
      .prog-row.status-duplicate .prog-st {
        color: var(--warning);
      }
      .prog-row.status-archived .prog-url,
      .prog-row.status-duplicate .prog-url {
        color: var(--text-primary);
      }
      .prog-ico {
        width: 14px;
        text-align: center;
        font-weight: 700;
        flex-shrink: 0;
      }
      .prog-url {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font:
          10px "IBM Plex Mono",
          monospace;
        color: var(--text-secondary);
      }
      .prog-st {
        font:
          10px "IBM Plex Sans",
          sans-serif;
        flex-shrink: 0;
      }

      /* ══ News landing page (in browser) ══ */
      #news-landing {
        padding: 0;
        height: 100%;
        overflow: hidden;
      }
      .nl-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 40px;
        border-bottom: 1px solid var(--border-subtle);
      }
      .nl-logo {
        font:
          800 16px "IBM Plex Sans",
          sans-serif;
        color: var(--text-primary);
        letter-spacing: 1px;
      }
      .nl-nav {
        display: flex;
        gap: 20px;
        font:
          500 12px "IBM Plex Sans",
          sans-serif;
        color: var(--text-muted);
      }
      .nl-grid {
        display: grid;
        grid-template-columns: 1fr 300px;
        gap: 20px;
        padding: 20px 40px;
        height: calc(100% - 50px);
        overflow: hidden;
      }
      .nl-featured {
        background: var(--bg-surface);
        border-radius: var(--radius);
        border: 1px solid var(--border-subtle);
        overflow: hidden;
        cursor: pointer;
        transition: border-color 0.2s;
      }
      .nl-featured:hover {
        border-color: var(--accent);
      }
      .nl-featured-img {
        width: 100%;
        height: 180px;
        display: block;
      }
      .nl-featured-body {
        padding: 16px 20px;
      }
      .nl-cat {
        font:
          600 9px "IBM Plex Sans",
          sans-serif;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        color: var(--accent);
        margin-bottom: 6px;
      }
      .nl-featured h2 {
        font:
          700 20px/1.3 "IBM Plex Sans",
          sans-serif;
        color: var(--text-primary);
        margin-bottom: 8px;
      }
      .nl-featured p {
        font:
          13px/1.6 "IBM Plex Sans",
          sans-serif;
        color: var(--text-secondary);
        margin-bottom: 8px;
      }
      .nl-byline {
        font:
          11px "IBM Plex Sans",
          sans-serif;
        color: var(--text-muted);
      }
      .nl-sidebar {
        display: flex;
        flex-direction: column;
        gap: 12px;
      }
      .nl-card {
        background: var(--bg-surface);
        border-radius: var(--radius);
        border: 1px solid var(--border-subtle);
        padding: 14px 16px;
      }
      .nl-card-cat {
        font:
          600 8px "IBM Plex Sans",
          sans-serif;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: var(--text-muted);
        margin-bottom: 6px;
      }
      .nl-card-title {
        font:
          600 13px/1.4 "IBM Plex Sans",
          sans-serif;
        color: var(--text-primary);
        margin-bottom: 6px;
      }
      .nl-card-meta {
        font:
          11px "IBM Plex Sans",
          sans-serif;
        color: var(--text-muted);
      }

      /* ══ Bulk page (in browser tab) ══ */
      #bulk-page {
        padding: 30px 50px;
        max-width: 640px;
        margin: 0 auto;
      }
      .bp-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 14px;
        margin-bottom: 16px;
        border-bottom: 1px solid var(--border-subtle);
      }
      .bp-brand {
        display: flex;
        align-items: center;
        gap: 10px;
      }
      .bp-title {
        font:
          600 15px "IBM Plex Sans",
          sans-serif;
        color: var(--text-primary);
      }
      .bp-body {
        display: flex;
        flex-direction: column;
        gap: 8px;
      }
      .bp-textarea {
        width: 100%;
        min-height: 160px;
        padding: 10px 12px;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        background: var(--bg-input);
        font:
          12px/1.6 "IBM Plex Mono",
          monospace;
        color: var(--text-primary);
        white-space: pre-wrap;
        word-break: break-all;
      }
      .bp-info {
        font:
          12px "IBM Plex Sans",
          sans-serif;
        color: var(--text-secondary);
        min-height: 16px;
      }
      .bp-how {
        padding: 10px 12px;
        background: var(--bg-surface);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius);
      }
      .bp-how-title {
        font:
          600 12px "IBM Plex Sans",
          sans-serif;
        color: var(--text-primary);
        margin-bottom: 6px;
      }
      .bp-how-list {
        margin: 0;
        padding-left: 18px;
        font:
          12px "IBM Plex Sans",
          sans-serif;
        color: var(--text-secondary);
        line-height: 1.6;
      }
      .bp-how-list strong {
        color: var(--text-primary);
      }
      .bp-start-btn {
        width: 100%;
        padding: 10px;
        border-radius: var(--radius-sm);
        font:
          600 13px "IBM Plex Sans",
          sans-serif;
        text-align: center;
        background: var(--accent);
        color: var(--accent-text);
        border: none;
        margin-top: 4px;
      }

      /* ══ Info overlays ══ */

      /* Type explanation cards */
      #type-cards {
        position: absolute;
        display: flex;
        gap: 16px;
        z-index: 20;
        opacity: 0;
        pointer-events: none;
        right: 52px;
        top: 175px;
      }
      .xcard {
        width: 240px;
        background: var(--bg-surface);
        border-radius: 12px;
        padding: 18px;
        border: 1px solid var(--border);
        box-shadow: var(--shadow-md);
      }
      .xcard-active {
        border-color: var(--accent);
        box-shadow:
          0 0 20px var(--accent-dim),
          var(--shadow-md);
      }
      .xcard-icon {
        font-size: 20px;
        margin-bottom: 6px;
      }
      .xcard h4 {
        font-size: 14px;
        font-weight: 700;
        margin-bottom: 3px;
      }
      .xcard-sub {
        font-size: 8px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 6px;
      }
      .xcard-sub-accent {
        color: var(--accent);
      }
      .xcard-sub-muted {
        color: var(--text-muted);
      }
      .xcard p {
        font-size: 10px;
        color: var(--text-secondary);
        line-height: 1.5;
      }
      .xcard-pills {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        margin-top: 8px;
      }
      .xcard-pill {
        padding: 2px 8px;
        border-radius: 10px;
        font-size: 8px;
        font-weight: 500;
      }
      .xcard-pill-accent {
        background: var(--accent-dim);
        color: var(--accent);
      }
      .xcard-pill-subtle {
        background: var(--chip-bg);
        color: var(--text-secondary);
      }

      /* Tag info annotation */
      #tag-info {
        position: absolute;
        z-index: 6;
        opacity: 0;
        pointer-events: none;
        left: 440px;
        top: 272px;
      }
      .tag-info-card {
        width: 280px;
        padding: 14px 16px;
        background: var(--bg-surface);
        border: 1px solid var(--accent);
        border-radius: var(--radius);
        box-shadow:
          0 0 20px var(--accent-dim),
          var(--shadow-md);
      }
      .tag-info-card p {
        font:
          11px/1.5 "IBM Plex Sans",
          sans-serif;
        color: var(--text-secondary);
      }
      .tag-info-card strong {
        color: var(--accent);
        font-weight: 600;
      }

      /* Enter key indicator */
      #enter-key {
        display: inline-flex;
        align-items: center;
        margin-left: 8px;
        opacity: 0;
        pointer-events: none;
      }
      .enter-badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 4px 10px;
        border-radius: var(--radius-sm);
        background: var(--bg-elevated);
        border: 1px solid var(--border);
        font:
          500 11px "IBM Plex Mono",
          monospace;
        color: var(--text-primary);
        box-shadow: var(--shadow-md);
        transition: all 0.15s;
      }
      .enter-badge.flash {
        background: var(--accent-mid);
        border-color: var(--accent);
        color: var(--accent);
      }

      /* ══ Custom cursor ══ */
      #cursor-shell {
        position: absolute;
        left: 0;
        top: 0;
        width: 28px;
        height: 28px;
        z-index: 100;
        pointer-events: none;
        overflow: visible;
      }
      #cursor {
        opacity: 0;
      }
      #cursor-arrow {
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
      }
      #click-ring {
        stroke: var(--accent);
        stroke-width: 2;
        fill: none;
        transform-box: fill-box;
        transform-origin: center;
        transform: scale(0);
        opacity: 0;
      }

      /* ══ Theme control (mirrors the site header's sun/moon button) ══ */
      #theme-toggle {
        position: fixed;
        top: 12px;
        right: 12px;
        z-index: 60;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 9999px;
        border: 1px solid var(--border-subtle);
        background: var(--bg-elevated);
        color: var(--text-secondary);
        cursor: pointer;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
        transition:
          background 0.15s,
          color 0.15s,
          border-color 0.15s;
      }
      #theme-toggle:hover {
        color: var(--text-primary);
        background: var(--bg-hover);
      }
      #theme-toggle svg {
        width: 16px;
        height: 16px;
      }
      #theme-toggle .icon-sun {
        display: none;
      }
      #theme-toggle.is-dark .icon-sun {
        display: block;
      }
      #theme-toggle.is-dark .icon-moon {
        display: none;
      }

      /* ══ Bottom actions (outside the scaled stage, so real size) ══ */
      #demo-actions {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
        background: linear-gradient(transparent, var(--store-bar-bg) 55%);
      }

      /* ══ Replay ══ */
      #replay-btn {
        padding: 10px 28px;
        border-radius: var(--radius);
        font:
          600 13px "IBM Plex Sans",
          sans-serif;
        background: var(--accent);
        color: var(--accent-text);
        border: none;
        cursor: pointer;
        opacity: 0;
        transition: filter 0.15s;
      }
      #replay-btn:hover {
        filter: brightness(1.15);
      }

      /* ══ Store links bar ══ */
      #store-bar {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px 16px;
        width: 100%;
      }
      @media (max-width: 430px) {
        .store-badge {
          flex: 1 1 100%;
          justify-content: center;
        }
      }
      .store-badge {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 20px;
        border-radius: 12px;
        border: 1px solid var(--store-badge-border);
        background: var(--store-badge-bg);
        text-decoration: none;
        transition: all 0.2s;
      }
      .store-badge:hover {
        border-color: rgba(77, 128, 240, 0.3);
        background: rgba(77, 128, 240, 0.05);
      }
      .store-badge-ff:hover {
        border-color: rgba(255, 149, 0, 0.3);
        background: rgba(255, 149, 0, 0.05);
      }
      .store-icon {
        width: 28px;
        height: 28px;
        flex-shrink: 0;
      }
      .store-label {
        font:
          500 9px "IBM Plex Sans",
          sans-serif;
        letter-spacing: 0.5px;
        color: var(--store-label);
      }
      .store-name {
        font:
          600 13px "IBM Plex Sans",
          sans-serif;
        color: var(--store-name);
      }

      /* ══ Background ══ */
      .glow {
        position: absolute;
        border-radius: 50%;
        filter: blur(120px);
        pointer-events: none;
        z-index: -1;
      }
      .glow-primary {
        width: 500px;
        height: 500px;
        background: rgba(77, 128, 240, 0.05);
        top: -120px;
        right: -80px;
      }
      .glow-secondary {
        width: 400px;
        height: 400px;
        background: rgba(120, 80, 200, 0.03);
        bottom: -80px;
        left: -50px;
      }
      .is-hidden {
        display: none !important;
      }

      .bulk-popup-panel {
        padding: 10px 14px;
        border-bottom: 1px solid var(--border-subtle);
      }
      .bulk-popup-topline {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 8px;
      }
      .bulk-popup-title {
        font:
          600 12px "IBM Plex Sans",
          sans-serif;
        color: var(--text-primary);
      }
      .bulk-popup-stop {
        font:
          500 10px "IBM Plex Sans",
          sans-serif;
        padding: 3px 10px;
        border-radius: var(--radius-sm);
        background: var(--bg-elevated);
        color: var(--text-secondary);
        border: 1px solid var(--border);
      }
      .bulk-popup-bar-wrap {
        height: 4px;
        background: var(--bg-elevated);
        border-radius: 2px;
        overflow: hidden;
        margin-bottom: 6px;
      }
      .bulk-popup-bar {
        height: 100%;
        width: 0%;
        background: var(--accent);
        border-radius: 2px;
        transition: width 0.3s;
      }
      .bulk-popup-label {
        font:
          11px "IBM Plex Sans",
          sans-serif;
        color: var(--text-secondary);
      }
      .bulk-popup-rows {
        margin-top: 8px;
        max-height: 160px;
        overflow-y: auto;
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-sm);
      }
      .submit-form-dimmed {
        opacity: 0.35;
      }
