  :root {
    --bg: #F4F6FB;
    --bg-glow: #E9EDFB;
    --panel: #FFFFFF;
    --ink: #18203A;
    --muted: #5C6680;
    --faint: #9098AE;
    --line: #EBEEF5;
    --line-strong: #DCE1EC;
    --accent: #4F46E5;
    --accent-hover: #4338CA;
    --accent-soft: #EEF0FE;
    --accent-ink: #4338CA;
    --field: #F7F8FC;
    --good: #0E9F6E;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(24,32,58,.06), 0 1px 3px rgba(24,32,58,.04);
    --shadow-md: 0 8px 30px rgba(24,32,58,.08);
    --shadow-lg: 0 24px 64px rgba(24,32,58,.16);
    --mono: 'IBM Plex Mono', ui-monospace, monospace;
    --sans: 'Inter', system-ui, -apple-system, sans-serif;
    --display: 'Plus Jakarta Sans', system-ui, sans-serif;
  }
  html.dark {
    --bg: #0F1320;
    --bg-glow: #161B30;
    --panel: #181D2E;
    --ink: #ECEEF6;
    --muted: #98A0B8;
    --faint: #646D88;
    --line: #232A3D;
    --line-strong: #2E364C;
    --accent: #7C82F8;
    --accent-hover: #9499FB;
    --accent-soft: #1E2440;
    --accent-ink: #B6BAFB;
    --field: #11162400;
    --field: #131829;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow-md: 0 8px 30px rgba(0,0,0,.35);
    --shadow-lg: 0 24px 64px rgba(0,0,0,.5);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { height: 100%; }
  body {
    font-family: var(--sans);
    color: var(--ink);
    background-color: var(--bg);
    background-image:
      radial-gradient(1100px 520px at 50% -8%, var(--bg-glow), transparent 70%);
    background-repeat: no-repeat;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    transition: background-color .22s ease, color .22s ease;
  }

  .shell { max-width: 1120px; margin: 0 auto; padding: 22px 22px 56px; }

  /* Top bar */
  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 8px;
  }
  .brand { display: flex; align-items: center; gap: 11px; }
  .brand-mark {
    width: 30px; height: 30px; flex: none; display: block; color: var(--ink);
  }
  .brand-mark svg { width: 100%; height: 100%; display: block; fill: currentColor; }
  .brand-name {
    font-family: var(--display); font-weight: 800; font-size: 22px;
    letter-spacing: -0.02em; color: var(--ink);
  }
  .topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

  .icon-btn {
    width: 38px; height: 38px; border-radius: 11px; flex: none;
    border: 1px solid var(--line-strong); background: var(--panel);
    color: var(--muted); cursor: pointer; display: grid; place-items: center;
    box-shadow: var(--shadow-sm);
    font-family: var(--display); font-size: 16px; font-weight: 700; line-height: 1;
    transition: border-color .14s ease, color .14s ease, background .14s ease, transform .14s ease;
  }
  .icon-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
  .icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .icon-sun { display: none; }
  .icon-moon { display: block; }
  html.dark .icon-sun { display: block; }
  html.dark .icon-moon { display: none; }

  /* Hero */
  .hero { text-align: center; padding: 38px 12px 30px; }
  .hero h1 {
    font-family: var(--display); font-weight: 800;
    font-size: clamp(32px, 5.5vw, 52px); letter-spacing: -0.035em;
    line-height: 1.05; color: var(--ink);
  }
  .hero-sub {
    max-width: 620px; margin: 16px auto 0;
    font-size: clamp(15px, 2vw, 18px); color: var(--muted); line-height: 1.55;
  }
  .hero-feats {
    list-style: none; display: flex; flex-wrap: wrap; justify-content: center;
    gap: 9px; margin-top: 22px;
  }
  .hero-feats li {
    font-size: 13px; font-weight: 600; color: var(--accent-ink);
    background: var(--accent-soft); border: 1px solid var(--line-strong);
    border-radius: 999px; padding: 7px 14px 7px 28px; position: relative;
  }
  .hero-feats li::before {
    content: ""; position: absolute; left: 12px; top: 50%;
    width: 9px; height: 5px; margin-top: -4px;
    border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
    transform: rotate(-45deg);
  }
  .hero-feats li.opt {
    border-style: dashed;
  }
  .opt-tag {
    display: inline-block; margin-left: 6px;
    font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--accent-ink); background: var(--panel); border: 1px solid var(--accent); border-radius: 4px; padding: 1px 5px;
    vertical-align: middle; position: relative; top: -1px;
  }

  /* Workspace grid */
  .workspace { display: grid; grid-template-columns: 1fr 392px; gap: 20px; align-items: start; }
  @media (max-width: 880px) { .workspace { grid-template-columns: 1fr; } }

  .panel {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-md);
  }
  .panel + .panel { margin-top: 18px; }

  .seclabel {
    font-family: var(--display); font-size: 13px; font-weight: 700;
    letter-spacing: -0.01em; color: var(--ink);
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    margin-bottom: 16px;
  }
  .status { font-family: var(--mono); font-size: 11px; color: var(--faint); font-weight: 400; letter-spacing: 0; }
  .status b { color: var(--muted); font-weight: 500; }

  /* Type tabs */
  .types { display: flex; flex-wrap: wrap; gap: 8px; }
  .type-tab {
    font-family: var(--sans); font-size: 13px; font-weight: 600;
    padding: 9px 15px; border: 1px solid var(--line-strong); border-radius: 999px;
    background: var(--panel); color: var(--muted); cursor: pointer;
    transition: all .14s ease;
  }
  .type-tab:hover { border-color: var(--accent); color: var(--accent); }
  .type-tab[aria-selected="true"] {
    background: var(--accent); border-color: var(--accent); color: #fff;
    box-shadow: var(--shadow-sm);
  }

  /* Fields */
  .fields { margin-top: 18px; display: flex; flex-direction: column; gap: 15px; }
  .field { display: flex; flex-direction: column; gap: 7px; }
  .field.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .field label, .sublabel {
    font-family: var(--sans); font-size: 12.5px; font-weight: 600;
    letter-spacing: 0; color: var(--muted);
  }
  /* info tooltip */
  .label-row { display: flex; align-items: center; gap: 6px; }
  .info {
    position: relative; width: 15px; height: 15px; flex: none; padding: 0;
    border: 1px solid var(--line-strong); border-radius: 50%;
    background: var(--panel); color: var(--faint); cursor: help;
    font-family: var(--mono); font-size: 9px; font-weight: 500; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    text-transform: none; letter-spacing: 0; transition: border-color .14s ease, color .14s ease;
  }
  .info:hover, .info:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
  .tip {
    position: absolute; left: calc(100% + 9px); top: 50%;
    transform: translateY(-50%) translateX(-4px);
    width: 224px; background: #14182A; color: #ECEEF6;
    border-radius: 11px; padding: 12px 14px; z-index: 30;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
    box-shadow: var(--shadow-lg);
    font-family: var(--sans); text-transform: none; letter-spacing: 0;
  }
  .info:hover .tip, .info:focus .tip, .info:focus-within .tip {
    opacity: 1; visibility: visible; pointer-events: auto;
    transform: translateY(-50%) translateX(0);
  }
  .tip::before {
    content: ""; position: absolute; right: 100%; top: 50%; transform: translateY(-50%);
    border: 6px solid transparent; border-right-color: #14182A;
  }
  .tip-h {
    display: block; font-family: var(--sans); font-size: 10.5px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--faint); margin-bottom: 9px;
  }
  .tip dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; margin: 0; }
  .tip dt { font-family: var(--mono); font-size: 11px; font-weight: 500; color: #6FE0A8; }
  .tip dd { margin: 0; font-size: 12px; line-height: 1.4; }
  @media (max-width: 560px) {
    .tip { left: auto; right: 0; top: calc(100% + 9px); transform: translateY(-4px); width: 210px; }
    .info:hover .tip, .info:focus .tip, .info:focus-within .tip { transform: translateY(0); }
    .tip::before { right: 8px; top: auto; bottom: 100%; transform: none; border-right-color: transparent; border-bottom-color: #14182A; }
  }
  input[type="text"], input[type="url"], input[type="tel"], input[type="email"],
  input[type="password"], input[type="number"], textarea, select {
    font-family: var(--sans); font-size: 14px; color: var(--ink);
    background: var(--field); border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm); padding: 11px 13px; width: 100%;
    transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
  }
  textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
  input:focus, textarea:focus, select:focus {
    outline: none; border-color: var(--accent); background: var(--panel);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%235C6680' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
  }
  .inline { display: flex; align-items: center; gap: 9px; }
  .inline input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
  .inline label { text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: 13px; color: var(--ink); }
  .logo-note { font-family: var(--sans); font-size: 12px; color: var(--muted); }

  /* Style controls */
  .ctrl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .swatches { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .swatch {
    width: 26px; height: 26px; border-radius: 8px; cursor: pointer;
    border: 1px solid rgba(24,32,58,.14);
  }
  .swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent); }
  input[type="color"] {
    -webkit-appearance: none; appearance: none; width: 26px; height: 26px;
    border: 1px solid var(--line-strong); border-radius: 8px; padding: 0; cursor: pointer; background: none;
  }
  input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
  input[type="color"]::-webkit-color-swatch { border: none; border-radius: 6px; }
  .color-picker-wrap { position: relative; width: 26px; height: 26px; }
  .color-picker-wrap input[type="color"] { width: 100%; height: 100%; }
  .color-picker-plus {
    position: absolute; right: -4px; bottom: -4px; width: 14px; height: 14px; border-radius: 50%;
    background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; line-height: 14px;
    text-align: center; pointer-events: none; border: 1.5px solid var(--panel);
  }

  .seg { display: flex; gap: 6px; flex-wrap: wrap; }
  .seg button {
    font-family: var(--sans); font-size: 12.5px; font-weight: 500;
    padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 9px;
    background: var(--panel); color: var(--muted); cursor: pointer; transition: all .14s ease;
  }
  .seg button:hover { border-color: var(--accent); color: var(--accent); }
  .seg button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }

  .range-row { display: flex; align-items: center; gap: 12px; }
  input[type="range"] { -webkit-appearance: none; appearance: none; height: 5px; background: var(--line-strong); border-radius: 3px; flex: 1; }
  input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 3px solid var(--panel); box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm); }
  input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 3px solid var(--panel); box-shadow: 0 0 0 1px var(--accent); }
  .range-val { font-family: var(--mono); font-size: 11px; color: var(--muted); min-width: 56px; text-align: right; }

  .logo-drop {
    border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 16px;
    text-align: center; cursor: pointer; transition: all .14s ease;
    font-family: var(--sans); font-size: 13px; color: var(--muted);
  }
  .logo-drop:hover, .logo-drop.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
  .logo-active { display: none; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
  .logo-active.show { display: flex; }
  .logo-active img { width: 32px; height: 32px; object-fit: contain; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
  .logo-active button { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--accent); background: none; border: none; cursor: pointer; }

  .full { grid-column: 1 / -1; }

  /* Preview surface */
  .stage-wrap { position: sticky; top: 22px; }
  .stage {
    position: relative; aspect-ratio: 1; display: grid; place-items: center;
    background:
      radial-gradient(120% 120% at 50% 0%, var(--accent-soft), var(--field) 60%);
    border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  }
  .qr-holder {
    position: relative; z-index: 2; width: 66%; max-width: 288px;
    background: #fff; padding: 16px; border-radius: 14px; line-height: 0;
    box-shadow: var(--shadow-lg);
  }
  .qr-holder canvas, .qr-holder svg { width: 100% !important; height: auto !important; display: block; border-radius: 4px; }
  .empty {
    position: absolute; inset: 0; display: grid; place-items: center; z-index: 2;
    font-family: var(--sans); font-size: 14px; color: var(--faint);
    text-align: center; padding: 0 36px;
  }

  .readout {
    margin-top: 16px; font-family: var(--mono); font-size: 11px; color: var(--muted);
    display: grid; grid-template-columns: 1fr 1fr; gap: 7px 16px;
  }
  .readout span b { color: var(--ink); font-weight: 500; }

  /* Scanability pill (#8) */
  .below-stage { margin-top: 14px; display: flex; align-items: center; gap: 10px; }
  .below-stage[hidden] { display: none; }
  .scan-pill {
    flex: none; display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--sans); font-size: 11.5px; font-weight: 600;
    padding: 5px 9px 5px 8px; border-radius: 999px;
    border: 1px solid var(--line-strong); background: var(--field); color: var(--muted);
  }
  .scan-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
  .scan-pill.good .scan-dot { background: var(--good); }
  .scan-pill.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 35%, var(--line-strong)); }
  .scan-pill.warn .scan-dot { background: #E0941C; }
  .scan-pill.warn { color: #B9750F; border-color: color-mix(in srgb, #E0941C 35%, var(--line-strong)); }
  .scan-pill.bad .scan-dot { background: #D8473A; }
  .scan-pill.bad { color: #C13B2F; border-color: color-mix(in srgb, #D8473A 35%, var(--line-strong)); }
  .scan-pill .info { width: 14px; height: 14px; }

  .exports { display: flex; gap: 9px; margin-top: 18px; }
  .exports button {
    flex: 1; font-family: var(--sans); font-size: 13.5px; font-weight: 600;
    padding: 12px 8px; border-radius: var(--radius-sm); cursor: pointer; transition: all .14s ease;
    border: 1px solid var(--accent); background: var(--accent); color: #fff; box-shadow: var(--shadow-sm);
  }
  .exports button:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); transform: translateY(-1px); }
  .exports button.ghost { background: var(--panel); color: var(--ink); border-color: var(--line-strong); box-shadow: none; }
  .exports button.ghost:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
  .exports button:disabled { opacity: .45; cursor: not-allowed; }

  .actions { display: flex; gap: 9px; margin-top: 9px; }
  .actions button {
    flex: 1; font-family: var(--sans); font-size: 13.5px; font-weight: 600;
    padding: 12px 8px; border-radius: var(--radius-sm); cursor: pointer; transition: all .14s ease;
    border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink);
  }
  .actions button:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
  .actions button:disabled { opacity: .45; cursor: not-allowed; }

  .site-foot {
    margin-top: 34px; font-family: var(--sans); font-size: 13px; color: var(--faint);
    text-align: center;
  }
  .foot-lockup {
    display: inline-flex; align-items: center; gap: 12px; margin-bottom: 12px;
    opacity: .9;
  }
  .foot-mark { width: 34px; height: 34px; }
  .foot-words { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; }
  .foot-name {
    font-family: var(--display); font-weight: 800; font-size: 24px;
    letter-spacing: -0.03em; color: var(--ink);
  }
  .foot-tag {
    font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--faint); margin-top: 5px;
  }
  .foot-note { margin: 0; }
  .foot-links { margin: 10px 0 0; }
  .foot-links a {
    color: var(--muted); text-decoration: none;
    border-bottom: 1px solid var(--line-strong); transition: color .14s ease, border-color .14s ease;
  }
  .foot-links a:hover { color: var(--accent); border-color: var(--accent); }

  /* Legal / policy pages */
  .topbar a.brand { text-decoration: none; }
  .legal { max-width: 760px; margin: 6px auto 0; }
  .legal h1 {
    font-family: var(--display); font-weight: 800;
    font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.03em; line-height: 1.05; color: var(--ink);
  }
  .legal-updated { font-family: var(--mono); font-size: 12px; color: var(--faint); margin-top: 8px; }
  .legal-lead { font-size: 16px; color: var(--muted); line-height: 1.6; margin-top: 18px; }
  .legal h2 {
    font-family: var(--display); font-weight: 700; font-size: 18px;
    letter-spacing: -0.01em; color: var(--ink); margin-top: 30px;
  }
  .legal p { font-size: 14.5px; color: var(--muted); line-height: 1.65; margin-top: 10px; }
  .legal ul { margin: 10px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 7px; }
  .legal li { font-size: 14.5px; color: var(--muted); line-height: 1.6; }
  .legal strong { color: var(--ink); font-weight: 600; }
  .legal code {
    font-family: var(--mono); font-size: 0.88em; background: var(--field);
    border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px;
  }
  .legal a { color: var(--accent-ink); font-weight: 500; }
  .legal-note {
    margin-top: 30px; padding: 14px 16px; font-size: 13.5px; line-height: 1.6;
    background: var(--accent-soft); border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm); color: var(--muted);
  }

  /* Auth area */
  .auth-area { display: flex; align-items: center; gap: 8px; }
  .auth-btn {
    font-family: var(--sans); font-size: 13px; font-weight: 600;
    padding: 9px 15px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap;
    border: 1px solid var(--accent); background: var(--accent); color: #fff; box-shadow: var(--shadow-sm);
    transition: background .14s ease, border-color .14s ease, color .14s ease, transform .14s ease;
  }
  .auth-btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); transform: translateY(-1px); }
  .auth-btn.ghost { background: var(--panel); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
  .auth-btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
  .user-info { display: flex; align-items: center; gap: 8px; }
  .user-info[hidden] { display: none; }
  .user-avatar { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-strong); flex: none; }

  /* Save row */
  .save-share-row { margin-top: 9px; display: flex; gap: 9px; align-items: stretch; }
  .save-share-row .save-row { margin-top: 0; flex: 1; }
  .save-row { margin-top: 9px; display: flex; gap: 9px; position: relative; }
  .save-row input { flex: 1; min-width: 0; }
  .save-row button {
    flex: none; white-space: nowrap; font-family: var(--sans); font-size: 13.5px; font-weight: 600;
    padding: 12px 16px; border-radius: var(--radius-sm); cursor: pointer; transition: all .14s ease;
    border: 1px solid var(--line-strong); background: var(--panel); color: var(--muted);
  }
  /* when signed out, hide the name field and let the (disabled) button fill the row */
  .save-row.signed-out #save-name { display: none; }
  .save-row.signed-out #save-btn { flex: 1; }

  /* hover reminder shown only while signed out */
  .save-hint {
    position: absolute; bottom: calc(100% + 8px); left: 0; right: 0;
    background: #14182A; color: #ECEEF6; border-radius: 11px; padding: 10px 13px;
    font-family: var(--sans); font-size: 12px; line-height: 1.4; text-align: center;
    opacity: 0; visibility: hidden; transform: translateY(4px); pointer-events: none; z-index: 30;
    box-shadow: var(--shadow-lg);
    transition: opacity .15s ease, transform .15s ease;
  }
  .save-hint::after {
    content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    border: 6px solid transparent; border-top-color: #14182A;
  }
  .save-row:not(.signed-out) .save-hint { display: none; }
  .save-row.signed-out:hover .save-hint,
  .save-row.signed-out:focus-within .save-hint,
  .save-row.signed-out.hint-open .save-hint {
    opacity: 1; visibility: visible; transform: translateY(0);
  }
  /* the disabled signed-out button can't be tapped/focused, so let taps reach the
     row to toggle the hint (the touch equivalent of the desktop hover reminder) */
  .save-row.signed-out #save-btn { pointer-events: none; }
  .save-row button:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
  .save-row button:disabled { opacity: .45; cursor: not-allowed; }
  /* compact iOS-style share icon button, sits to the right of Save */
  .share-icon-btn {
    flex: none; width: 44px; padding: 0; display: grid; place-items: center;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    background: var(--panel); color: var(--muted); cursor: pointer; transition: all .14s ease;
  }
  .share-icon-btn svg {
    width: 18px; height: 18px; fill: none; stroke: currentColor;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  }
  .share-icon-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
  .share-icon-btn:disabled { opacity: .45; cursor: not-allowed; }

  /* Saved codes modal */
  .saved-modal {
    position: fixed; inset: 0; z-index: 200;
    display: flex; align-items: center; justify-content: center;
  }
  .saved-modal[hidden] { display: none; }
  .saved-modal-back { position: absolute; inset: 0; background: rgba(16,19,32,.55); backdrop-filter: blur(2px); }
  .saved-modal-pane {
    position: relative; z-index: 1; background: var(--panel);
    border: 1px solid var(--line-strong); border-radius: 18px;
    width: 90%; max-width: 520px; max-height: 80vh;
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-lg);
  }
  .saved-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--line);
    font-family: var(--display); font-size: 14px; font-weight: 700;
    color: var(--ink); flex: none;
  }
  .saved-modal-head button {
    background: none; border: none; cursor: pointer; color: var(--muted);
    font-size: 14px; padding: 2px 4px; line-height: 1;
    transition: color .14s ease;
  }
  .saved-modal-head button:hover { color: var(--ink); }
  .saved-modal-head-actions { display: flex; align-items: center; gap: 14px; }
  .saved-list { overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 9px; }
  .saved-empty {
    font-family: var(--sans); font-size: 13.5px; color: var(--faint);
    text-align: center; padding: 44px 20px; line-height: 1.7;
  }
  .saved-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px;
    transition: border-color .14s ease, background .14s ease;
  }
  .saved-item:hover { border-color: var(--line-strong); background: var(--field); }
  .saved-swatch {
    width: 36px; height: 36px; flex: none; border-radius: 9px;
    display: grid; place-items: center;
  }
  .saved-info { flex: 1; min-width: 0; }
  .saved-name {
    display: block; font-size: 13.5px; font-weight: 600; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .saved-meta {
    display: block; font-family: var(--mono); font-size: 10.5px;
    color: var(--muted); margin-top: 2px;
  }
  .saved-load {
    font-family: var(--sans); font-size: 12.5px; font-weight: 600;
    padding: 7px 13px; border-radius: 9px; cursor: pointer; flex: none;
    border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent-ink);
    transition: all .14s ease;
  }
  .saved-load:hover { background: var(--accent); color: #fff; }
  .saved-del {
    background: none; border: none; cursor: pointer; color: var(--faint);
    font-size: 14px; padding: 4px; line-height: 1; flex: none;
    transition: color .14s ease;
  }
  .saved-del:hover { color: #c0392b; }

  /* Batch modal (#11) */
  .batch-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 14px; }
  .batch-intro { font-family: var(--sans); font-size: 13.5px; color: var(--ink); line-height: 1.55; margin: 0; }
  .batch-intro strong { color: var(--accent-ink); }
  .batch-help {
    font-family: var(--sans); font-size: 12.5px; color: var(--muted); line-height: 1.55; margin: 0;
    background: var(--accent-soft); border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm); padding: 11px 13px;
  }
  .batch-help a { color: var(--accent-ink); font-weight: 600; }
  .batch-file { font-family: var(--mono); font-size: 12px; color: var(--good); margin: 0; }
  .batch-actions { display: flex; }
  .batch-actions button {
    flex: 1; font-family: var(--sans); font-size: 13.5px; font-weight: 600;
    padding: 12px 8px; border-radius: var(--radius-sm); cursor: pointer; transition: all .14s ease;
    border: 1px solid var(--accent); background: var(--accent); color: #fff; box-shadow: var(--shadow-sm);
  }
  .batch-actions button:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
  .batch-actions button:disabled { opacity: .45; cursor: not-allowed; }
  .batch-status { font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 0; }
  .batch-status.err { color: #C13B2F; }

  /* Help modal */
  .help-modal {
    position: fixed; inset: 0; z-index: 200;
    display: flex; align-items: center; justify-content: center;
  }
  .help-modal[hidden] { display: none; }
  .help-modal-back { position: absolute; inset: 0; background: rgba(16,19,32,.55); backdrop-filter: blur(2px); }
  .help-modal-pane {
    position: relative; z-index: 1; background: var(--panel);
    border: 1px solid var(--line-strong); border-radius: 18px;
    width: 90%; max-width: 560px;
    box-shadow: var(--shadow-lg);
  }
  .help-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--line);
    font-family: var(--display); font-size: 14px; font-weight: 700; color: var(--ink);
  }
  .help-modal-head button {
    background: none; border: none; cursor: pointer; color: var(--muted);
    font-size: 14px; padding: 2px 4px; line-height: 1;
    transition: color .14s ease;
  }
  .help-modal-head button:hover { color: var(--ink); }
  .help-modal-body { padding: 22px 24px 26px; }
  .help-lead {
    font-size: 15.5px; font-weight: 600; color: var(--ink); margin-bottom: 16px; line-height: 1.4;
  }
  .help-steps {
    padding-left: 18px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px;
  }
  .help-steps li { font-size: 14px; color: var(--ink); line-height: 1.5; }
  .help-steps li strong { color: var(--ink); }
  .help-exports { list-style: disc; margin: 6px 0 0 18px; display: flex; flex-direction: column; gap: 3px; }
  .help-exports li { font-size: 13.5px; color: var(--muted); }
  .help-note {
    font-size: 13px; color: var(--muted); line-height: 1.55;
  }
  .help-divider { height: 1px; background: var(--line); margin: 16px 0; }
  .help-signin { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
  .help-signin strong { color: var(--ink); }

  /* Print layout (#12) — show only the QR + payload caption on a clean page */
  @media print {
    :root, html.dark { --bg: #fff; }
    body { background: #fff !important; color: #000; }
    body * { visibility: hidden; }
    .stage-wrap, .stage-wrap * { visibility: visible; }
    .topbar, .hero, .workspace > div:first-child,
    .seclabel, .readout, .exports, .actions, .save-share-row, .below-stage,
    .site-foot, .help-modal, .saved-modal { display: none !important; }
    .shell { max-width: none; padding: 0; }
    .workspace { display: block; }
    .stage-wrap { position: static; }
    .panel { border: none; box-shadow: none; padding: 0; }
    .stage {
      background: #fff; border: none; aspect-ratio: auto;
      display: block; padding: 0; margin: 0 auto;
    }
    .qr-holder {
      display: block !important; position: static; box-shadow: none;
      width: 80%; max-width: 480px; margin: 8vh auto 0; padding: 0;
    }
  }
