/* JustNodu home page styles (moved out of index.html on 2026-11-23 so browsers cache them) */
  :root {
    --bg: #eef1fb;
    --bg-blob-1: #dbe3ff;
    --bg-blob-2: #e7defc;
    --surface: #ffffff;
    --surface-2: #f6f7fc;
    --border: #e3e6f3;
    --text: #171a2b;
    --text-dim: #6b7086;
    --text-faint: #9aa0b5;
    --accent-1: #1477c6;
    --accent-2: #17c1e0;
    --accent-grad: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    --accent-soft: #e6f4fb;
    --green: #12b76a;
    --green-soft: #e6f9ef;
    --orange: #f79009;
    --orange-soft: #fef2e2;
    --blue-soft: #e7f0fe;
    --shadow-sm: 0 1px 2px rgba(23,26,43,0.05);
    --shadow-md: 0 8px 24px rgba(37,42,90,0.08);
    --shadow-lg: 0 20px 50px rgba(37,42,90,0.14);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --cursive: 'Caveat', cursive;
    --sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  }
  :root[data-theme="dark"] {
    --bg: #10121c;
    --bg-blob-1: #1c2036;
    --bg-blob-2: #211b34;
    --surface: #171a29;
    --surface-2: #1e2233;
    --border: #2a2e42;
    --text: #edeef7;
    --text-dim: #a3a8c2;
    --text-faint: #8a90b0;   /* was #6c7191: small grey labels were hard to read on the dark panels */
    --accent-soft: #123249;
    --green-soft: #123526;
    --orange-soft: #3a2a10;
    --blue-soft: #1c2440;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.35);
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.5);
  }

  * { box-sizing: border-box; }
  html, body { height: 100%; }
  /* a phone set to large text (or the app's text zoom) must not push labels over each other */
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  /* room for Google's sticky ad bar (measured, see the ads loader): page content, floating buttons and toasts
     stay above / below it instead of under it */
  html.has-ad-bar body { padding-top: var(--ad-top, 0px); padding-bottom: var(--ad-bottom, 0px); }
  html.has-ad-bar .feedback-fab { bottom: calc(14px + var(--ad-bottom, 0px)) !important; }
  html.has-ad-bar .toast, html.has-ad-bar #toast { bottom: calc(24px + var(--ad-bottom, 0px)) !important; }
  html.has-ad-bar .speed-notice { bottom: calc(90px + var(--ad-bottom, 0px)) !important; }
  /* windows and side panels: never under an ad bar, and their contents scroll when they do not fit */
  .modal-overlay { top: var(--ad-top, 0px) !important; bottom: var(--ad-bottom, 0px) !important; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .export-modal { max-height: calc(100vh - 24px - var(--ad-top, 0px) - var(--ad-bottom, 0px)); max-height: calc(100dvh - 24px - var(--ad-top, 0px) - var(--ad-bottom, 0px)); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  @media (max-width: 640px) { .sidebar, .panel-col { top: var(--ad-top, 0px) !important; bottom: var(--ad-bottom, 0px) !important; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; } }
  body {
    margin: 0;
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
  }
  button { font-family: inherit; }
  [hidden] { display: none !important; }
  svg { display: block; }

  /* ---------- Shared header ---------- */
  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 32px; gap: 16px; position: relative; z-index: 5;
  }
  .brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
  .brand-icon {
    width: 112px; height: 112px; border-radius: 14px; background: transparent;
    display: flex; align-items: center; justify-content: center; flex: none;
    overflow: hidden; padding: 0;
  }
  .brand-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .brand-text h1.nodu-wordmark {
    margin: 0; width: 128px; height: 56px; position: relative; overflow: hidden;
  }
  .nodu-wordmark img {
    display: block; width: 128%; max-width: none; height: auto;
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  }
  .nodu-wordmark img.wordmark-caption { display: none; pointer-events: none; }
  :root[data-theme="dark"] .nodu-wordmark img.wordmark-caption {
    display: block; filter: brightness(0) invert(1);
  }
  /* dark mode: things that were drawn for a white page and disappeared on the dark one */
  :root[data-theme="dark"] .nde-home-ic { background: var(--surface, #1e2233); border-color: rgba(120,180,255,.35); }
  :root[data-theme="dark"] .nde-home-ic-l { color: #e6e9f2; }
  :root[data-theme="dark"] .upload-font-finder strong { color: #c4b5fd; }
  :root[data-theme="dark"] a:not([class]), :root[data-theme="dark"] a:not([class]):visited { color: #7cc4ff; }
  .wordmark-caption-top { clip-path: inset(0 0 68% 0); }
  .wordmark-caption-bottom { clip-path: inset(70% 0 0 0); }

  .topbar-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
  .privacy-pill {
    display: flex; align-items: center; gap: 8px; background: var(--green-soft); color: var(--green);
    padding: 8px 14px; border-radius: 999px; font-size: 0.78rem; line-height: 1.15;
  }
  .privacy-pill strong { display: block; font-size: 0.8rem; }
  .privacy-pill span.sub { color: var(--text-dim); font-weight: 400; }
  .script-caption { font-family: var(--cursive); font-size: 1.3rem; color: var(--accent-1); transform: rotate(-2deg); }

  .icon-btn {
    width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text-dim); display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background .15s, color .15s, border-color .15s; position: relative;
  }
  .icon-btn:hover { background: var(--surface-2); color: var(--text); }
  .icon-btn.active { color: var(--accent-1); border-color: var(--accent-1); background: var(--accent-soft); }
  .language-control { position: relative; flex: none; }
  .language-control select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
  .language-control option { color: var(--text); background: var(--surface); font-size: 15px; }
  .language-control:focus-within { outline: 2px solid var(--accent-1); outline-offset: 3px; }
  html:not([lang="en"]) .toolbar-btn { height: auto; min-height: 36px; white-space: normal; }
  html:not([lang="en"]) .viewer-toolbar .grp { flex-wrap: wrap; }
  html[dir="rtl"] .viewer-body, html[dir="rtl"] .ruler-grid, html[dir="rtl"] .viewport, html[dir="rtl"] .brand { direction: ltr; }
  html[dir="rtl"] .panel-inner, html[dir="rtl"] .viewer-toolbar, html[dir="rtl"] .tip-bar { direction: rtl; }
  html[dir="rtl"] #toolbarExportBtn { margin-left: 0; margin-right: auto; }
  html[dir="rtl"] .export-modal { text-align: right; }
  .theme-toggle { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px; }
  .theme-toggle button {
    width: 30px; height: 30px; border-radius: 999px; border: none; background: transparent; color: var(--text-faint);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
  }
  .theme-toggle button.active { background: var(--accent-grad); color: #fff; }

  /* ---------- Landing screen ---------- */
  #screen-landing { position: relative; min-height: 100vh; overflow: hidden; }
  /* Capped to the hero's height (not inset:0/full-page) — the landing section is now much
     taller than one screen, and letting this stretch the whole way made the glow bleed into
     the sections below the hero. */
  .blobs { position: absolute; top: 0; left: 0; right: 0; height: 640px; overflow: hidden; z-index: 0; pointer-events: none; }
  .blobs span { position: absolute; border-radius: 50%; filter: blur(10px); opacity: .7; }
  .blobs span:nth-child(1) { width: 420px; height: 420px; background: var(--bg-blob-1); top: -140px; right: 8%; }
  .blobs span:nth-child(2) { width: 320px; height: 320px; background: var(--bg-blob-2); top: 60px; right: 28%; }
  .blobs span:nth-child(3) { width: 260px; height: 260px; background: var(--bg-blob-1); bottom: -80px; left: 6%; }

  .landing-main { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; padding: 24px 32px 48px; }
  .hero-grid { display: grid; grid-template-columns: 320px minmax(0,1fr) 260px; gap: 40px; align-items: stretch; margin-top: 12px; }
  .hero-features { display: flex; flex-direction: column; }
  @media (max-width: 1100px) { .hero-grid { grid-template-columns: 1fr; } }

  .hero-copy h2 { font-size: 2.3rem; line-height: 1.15; margin: 0 0 14px; letter-spacing: -0.02em; }
  .hero-copy h2 .grad { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .hero-copy p { color: var(--text-dim); line-height: 1.6; font-size: 0.95rem; margin: 0 0 28px; }

  .feature-row { display: flex; gap: 14px; margin-bottom: 20px; align-items: flex-start; }
  .feature-icon {
    width: 44px; height: 44px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center;
  }
  .feature-row h4 { margin: 0 0 2px; font-size: 0.92rem; }
  .feature-row p { margin: 0; font-size: 0.8rem; color: var(--text-faint); }
  .fi-green { background: var(--green-soft); color: var(--green); }
  .fi-purple { background: var(--accent-soft); color: var(--accent-1); }
  .fi-orange { background: var(--orange-soft); color: var(--orange); }
  .fi-blue { background: var(--blue-soft); color: #2563eb; }

  .hero-quote { margin-top: 24px; font-family: var(--cursive); font-size: 1.5rem; color: var(--text); line-height: 1.15; transform: rotate(-2deg); }
  .hero-quote .u { text-decoration: underline; text-decoration-color: var(--accent-2); text-underline-offset: 6px; }

  .upload-card {
    background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    padding: 28px; border: 1px solid var(--border);
  }
  .dropzone {
    border: 2px dashed #c7cdf0; border-radius: var(--radius-md); padding: 48px 24px; text-align: center;
    cursor: pointer; transition: border-color .15s, background .15s;
  }
  :root[data-theme="dark"] .dropzone { border-color: #333a5c; }
  .dropzone.drag, .dropzone:hover { border-color: var(--accent-1); background: var(--accent-soft); }
  .upload-merge-card { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
  .upload-merge-card strong { font-size: 15px; }
  .pdft-feature-card { border-color: var(--accent-1); background: var(--accent-soft); }
  /* Made in Bharat badge (2026-10-25) */
  .mii{display:inline-flex;align-items:center;gap:8px;padding:6px 12px 6px 8px;border-radius:999px;background:linear-gradient(90deg,rgba(255,153,51,.12),rgba(255,255,255,.4),rgba(19,136,8,.12));border:1px solid rgba(19,136,8,.25);line-height:1.15;text-align:left}.mii-flag{width:30px;height:20px;border-radius:3px;box-shadow:0 0 0 1px rgba(0,0,0,.12);flex:none}.mii-txt b{display:block;font-size:.85rem;color:#0b6b1f}.mii-txt small{display:block;font-size:.72rem;opacity:.8}html[data-theme="dark"] .mii-txt b{color:#5fd27a}.mii-row{display:flex;justify-content:center;margin:10px 0 2px}
  .edit-drop { flex: 1 0 100%; display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 92px; padding: 14px 18px; border: 2px dashed var(--accent-1); border-radius: 14px; background: var(--surface); color: var(--accent-1); cursor: pointer; text-align: left; transition: background .15s, transform .15s; }
  .edit-drop span { display: flex; flex-direction: column; gap: 3px; color: var(--text); }
  .edit-drop b { font-size: 1rem; }
  .edit-drop small { color: var(--text-dim); font-size: .85rem; }
  .edit-drop:hover, .edit-drop.over { background: var(--accent-soft); transform: scale(1.01); }
  .edit-drop.over { border-style: solid; }
  .pdft-new { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #e8613c; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .04em; vertical-align: 2px; }
  /* Word / Excel / PowerPoint drawn on the device (office-viewer.js) */
  .office-view { position: absolute; inset: 0; z-index: 6; overflow: auto; background: #e9ecf2; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; }
  .office-view[hidden] { display: none; }
  .office-docx { padding: 8px 0 24px; }
  .office-docx .docx-wrapper { background: transparent !important; padding: 8px !important; }
  .office-docx section.docx { box-shadow: 0 2px 10px rgba(0,0,0,.18) !important; margin-bottom: 12px !important; }
  .office-sheet { flex: 1; overflow: auto; background: #fff; }
  .office-sheet table { border-collapse: collapse; font: 13px/1.35 Calibri, Arial, sans-serif; color: #111; }
  .office-sheet td { border: 1px solid #d9dce3; padding: 3px 7px; white-space: nowrap; min-width: 48px; }
  .office-sheet thead th, .office-sheet tbody th { position: sticky; background: #f1f3f7; color: #555; font-weight: 600; font-size: 11px; border: 1px solid #d0d4dc; padding: 2px 6px; text-align: center; z-index: 1; }
  .office-sheet thead th { top: 0; } .office-sheet tbody th { left: 0; min-width: 34px; }
  .office-sheet .office-corner { position: sticky; top: 0; left: 0; z-index: 2; background: #e4e7ee; border: 1px solid #d0d4dc; }
  .office-tabs { position: sticky; bottom: 0; display: flex; gap: 2px; overflow-x: auto; background: #f1f3f7; border-top: 1px solid #d0d4dc; padding: 4px 6px; }
  .office-tabs button { border: 1px solid transparent; background: none; padding: 6px 12px; border-radius: 6px; font: 600 12px var(--sans); color: #444; white-space: nowrap; cursor: pointer; }
  .office-tabs button.on { background: #fff; border-color: #c9ced8; color: #1477c6; }
  .office-empty { padding: 24px; color: #777; }
  .office-pptx { padding: 8px; display: flex; flex-direction: column; align-items: center; }
  .office-pptx .pptx-preview-wrapper { height: auto !important; overflow: visible !important; background: transparent !important; }
  .office-pptx .pptx-preview-slide-wrapper { box-shadow: 0 2px 10px rgba(0,0,0,.18); margin-bottom: 12px !important; }
  .office-pagebtn { position: absolute; top: 10px; right: 10px; z-index: 7; border: 1px solid var(--border); background: var(--surface); color: var(--accent-1); font: 600 12px var(--sans); padding: 7px 12px; border-radius: 999px; box-shadow: var(--shadow-sm); cursor: pointer; }
  .office-pagebtn[hidden] { display: none; }
  .viewport.office-on { overflow: hidden !important; }
  /* PDF Tools grid on the home page (the tool panels themselves are in pdf-tools.css) */
  .pdft-home { position: relative; z-index: 1; max-width: 1100px; margin: 28px auto 0; padding: 22px 32px 26px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
  .pdft-featured { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--accent-1); border-radius: 12px; background: var(--accent-soft); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
  .pdft-featured b { display: block; font-size: .95rem; } .pdft-featured small { display: block; margin-top: 2px; color: var(--text-dim); font-size: .8rem; line-height: 1.4; }
  .pdft-featured .pdft-ic { width: 34px; height: 34px; } .pdft-featured:hover { border-color: var(--accent-2); }
  .pdft-body .pdft-home { margin: 0; padding: 0; border: 0; box-shadow: none; background: none; max-width: none; }
  .pdft-home h3 { margin: 0; font-size: 1.4rem; text-align: center; }
  .pdft-home-sub { margin: 4px 0 18px; text-align: center; color: var(--text-dim); font-size: .9rem; }
  /* 2026-11-19 the owner's design: three panels - Organize PDF, Convert PDF, Edit & Enhance */
  .pdft-panels { display: grid; grid-template-columns: 1fr 1.55fr 1fr; gap: 16px; align-items: start; }
  .pdft-p { border-radius: 18px; padding: 16px 14px 14px; border: 1px solid var(--pc-b); background: linear-gradient(160deg, var(--pc-a), rgba(255,255,255,0) 70%), var(--surface); box-shadow: 0 6px 22px rgba(30,50,90,.07); }
  .pdft-p-org { --pc: #3b82f6; --pc-a: rgba(59,130,246,.10); --pc-b: rgba(59,130,246,.28); }
  .pdft-p-conv { --pc: #16a34a; --pc-a: rgba(22,163,74,.10); --pc-b: rgba(22,163,74,.28); }
  .pdft-p-edit { --pc: #7c5cff; --pc-a: rgba(124,92,255,.11); --pc-b: rgba(124,92,255,.30); }
  .pdft-ph { display: flex; align-items: center; gap: 12px; margin: 0 4px 12px; }
  .pdft-pic { flex: none; width: 46px; height: 46px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--pc-b); }
  .pdft-pic svg { width: 26px; height: 26px; fill: none; stroke: var(--pc); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .pdft-ph h4 { margin: 0; font-size: 1.15rem; font-weight: 800; color: var(--text); letter-spacing: 0; text-transform: none; }
  .pdft-ph p { margin: 2px 0 0; font-size: .82rem; color: var(--text-dim); }
  .pdft-list { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 4px 6px; }
  .pdft-list2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; }
  .pdft-list .pdft-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 6px; margin: 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: none; color: var(--text); font: 700 .88rem/1.25 var(--sans); text-align: left; cursor: pointer; }
  .pdft-list .pdft-item:last-child, .pdft-list2 .pdft-item:nth-last-child(2) { border-bottom: 0; }
  .pdft-list .pdft-item:hover, .pdft-list .pdft-item:focus-visible { background: var(--surface-2); border-radius: 10px; color: var(--text); }
  .pdft-list .pdft-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--c); box-shadow: 0 3px 8px rgba(0,0,0,.12); }
  .pdft-list .pdft-ic svg { width: 19px; height: 19px; }
  .pdft-t { flex: 1; min-width: 0; }
  .pdft-d { display: block; margin-top: 2px; font-weight: 500; font-size: .74rem; color: var(--text-dim); line-height: 1.3; }
  .pdft-chev { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--text-dim); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
  .pdft-list .pdft-new { background: #ec4899; }
  .pdft-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 6px; margin: 0 0 2px; border: 0; border-radius: 9px; background: none; color: var(--text); font: 600 .86rem/1.25 var(--sans); text-align: left; cursor: pointer; }
  .pdft-ic { flex: none; width: 26px; height: 26px; border-radius: 7px; background: var(--c); display: inline-flex; align-items: center; justify-content: center; }
  .pdft-ic svg { width: 17px; height: 17px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .pdft-ic svg text { fill: #fff; stroke: none; font: 800 13px Arial, sans-serif; }
  @media (max-width: 1080px) { .pdft-panels { grid-template-columns: 1fr 1fr; } .pdft-p-conv { grid-column: 1 / -1; grid-row: 1; } }
  @media (max-width: 700px) { .pdft-panels { grid-template-columns: 1fr; } .pdft-p-conv { grid-row: auto; } .pdft-home { margin: 18px 12px 0; padding: 16px 12px 18px; } }
  @media (max-width: 520px) { .pdft-list2 { grid-template-columns: 1fr; } .pdft-list2 .pdft-item:nth-last-child(2) { border-bottom: 1px solid var(--border); } }
  .upload-merge-card p { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-dim); }
  .merge-pdf-button.icon-btn { width: auto; min-height: 40px; padding: 8px 12px; gap: 7px; display: inline-flex; align-items: center; background: var(--accent-grad); color: #fff; border: none; border-radius: 12px; font-weight: 700; font-size: 13px; white-space: nowrap; cursor: pointer; }
  .merge-pdf-button.icon-btn:hover { opacity: .9; }
  .merge-pdf-file-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
  .merge-pdf-file-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: 13px; }
  .merge-pdf-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
  .merge-pdf-file-size { color: var(--text-faint); font-size: 12px; white-space: nowrap; }
  .merge-pdf-file-list button { background: none; border: 1px solid var(--border); border-radius: 6px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-dim); font-size: 13px; flex: none; }
  .merge-pdf-file-list button:hover:not(:disabled) { border-color: var(--accent-1); color: var(--accent-1); }
  .merge-pdf-file-list button:disabled { opacity: .35; cursor: not-allowed; }
  .font-notice { margin: 6px 24px 8px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); font-size: 12px; color: var(--text-dim); }
  .font-notice.warn { border-color: #f0b44c; background: #fff6e5; color: #6b4a00; }
  :root[data-theme="dark"] .font-notice.warn { background: #3a2c0c; color: #f5d58a; border-color: #8a6a1f; }
  .font-notice summary { cursor: pointer; font-weight: 600; line-height: 1.4; }
  .font-notice ul { margin: 6px 0 0; padding-left: 18px; }
  .font-notice li { margin: 2px 0; }
  .font-notice li b { font-weight: 600; color: var(--text); }
  .font-notice.warn li b { color: inherit; }
  .font-notice .font-notice-help { margin: 6px 0 0; font-size: 11px; }
  .font-notice .font-notice-help:empty { display: none; }
  @media (max-width: 700px) { .font-notice { margin: 4px 10px; padding: 6px 10px; font-size: 11px; } }
  .v3d-overlay { position: fixed; inset: 0; z-index: 150; display: flex; flex-direction: column; background: var(--bg); }
  .v3d-overlay[hidden] { display: none; }
  .v3d-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .v3d-title { font-weight: 700; font-size: 0.95rem; min-width: 0; flex: 1 1 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .v3d-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .v3d-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
  .v3d-btn:hover:not(:disabled) { border-color: var(--accent-1); color: var(--accent-1); }
  .v3d-btn:disabled { opacity: .45; cursor: not-allowed; }
  .v3d-btn.on { background: var(--accent-grad); border-color: transparent; color: #fff; }
  .v3d-btn.primary { background: var(--accent-grad); border-color: transparent; color: #fff; }
  .v3d-select { min-height: 34px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 0.82rem; }
  .v3d-sheet-backdrop { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(10,14,28,.55); }
  .v3d-sheet-backdrop[hidden] { display: none; }
  .v3d-sheet { width: min(440px, 100%); padding: 16px 18px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 20px 50px rgba(0,0,0,.35); }
  .v3d-sheet-head { display: flex; align-items: center; justify-content: space-between; }
  .v3d-sheet-head h3 { margin: 0; font-size: 1.05rem; }
  .v3d-sheet-label { margin: 14px 0 8px; font-size: 0.78rem; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }
  .v3d-sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .v3d-fmt { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; }
  .v3d-fmt b { font-size: 0.95rem; }
  .v3d-fmt span { font-size: 0.7rem; color: var(--text-faint); }
  .v3d-fmt:hover { border-color: var(--accent-1); }
  .v3d-risk { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg); }
  .v3d-risk[hidden] { display: none; }
  .v3d-risk-card { width: min(420px, 100%); padding: 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); text-align: center; }
  .v3d-risk-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
  .v3d-risk-card p { margin: 0 0 16px; font-size: 0.9rem; line-height: 1.5; color: var(--text-dim); }
  .v3d-risk-actions { display: flex; gap: 10px; justify-content: center; }
  .v3d-body { flex: 1; display: flex; min-height: 0; }
  .v3d-stage { position: relative; flex: 1; min-width: 0; }
  .v3d-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
  .v3d-load { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; padding: 20px; pointer-events: none; }
  .v3d-load[hidden] { display: none; }
  .v3d-load-card { width: min(380px, 100%); padding: 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md); }
  .v3d-load-file { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; min-width: 0; }
  .v3d-load-badge { flex: none; width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--accent-grad); color: #fff; font-weight: 800; font-size: 0.78rem; letter-spacing: .02em; }
  .v3d-load-file > div:last-child { min-width: 0; display: flex; flex-direction: column; }
  .v3d-load-file b { font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .v3d-load-file span { font-size: 0.78rem; color: var(--text-faint); }
  .v3d-load-bar { height: 10px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; }
  .v3d-load-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--accent-grad); transition: width .25s ease; }
  .v3d-load-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 0.85rem; color: var(--text-dim); }
  .v3d-load-row b { color: var(--text); font-variant-numeric: tabular-nums; }
  .v3d-load-note { margin: 10px 0 0; font-size: 0.78rem; line-height: 1.45; color: var(--text-faint); }
  .v3d-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; color: var(--text-dim); font-size: 0.95rem; pointer-events: none; }
  .v3d-msg.error { color: #b3261e; pointer-events: auto; }
  .v3d-msg[hidden] { display: none; }
  .v3d-hint { position: absolute; left: 12px; bottom: 10px; font-size: 0.74rem; color: var(--text-faint); background: color-mix(in srgb, var(--surface) 80%, transparent); padding: 4px 9px; border-radius: 8px; pointer-events: none; }
  .v3d-info { width: 250px; flex: none; overflow-y: auto; padding: 14px 16px; background: var(--surface); border-left: 1px solid var(--border); font-size: 0.82rem; }
  .v3d-info h4 { margin: 0 0 10px; font-size: 0.9rem; }
  .v3d-info dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; }
  .v3d-info dt { color: var(--text-faint); }
  .v3d-info dd { margin: 0; text-align: right; font-weight: 600; word-break: break-word; }
  @media (max-width: 800px) {
    .v3d-body { flex-direction: column; }
    .v3d-info { width: auto; border-left: 0; border-top: 1px solid var(--border); max-height: 32%; }
    .v3d-hint { display: none; }
  }
  /* 3D measuring panel (2026-11-04) */
  .v3d-mpanel { position: absolute; left: 12px; top: 12px; z-index: 3; width: 268px; max-height: calc(100% - 24px); overflow-y: auto; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 0.8rem; color: var(--text); }
  .v3d-mpanel h4 { margin: 0 0 8px; font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
  .v3d-mpanel h4 select { margin-left: auto; min-height: 28px; font-size: 0.78rem; }
  .v3d-mpanel dl { margin: 0 0 8px; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; }
  .v3d-mpanel dt { color: var(--text-faint); }
  .v3d-mpanel dd { margin: 0; text-align: right; font-weight: 700; }
  .v3d-mpanel .v3d-mtip { margin: 6px 0; padding: 7px 9px; border-radius: 9px; background: color-mix(in srgb, #ff2d6f 10%, transparent); color: var(--text); }
  .v3d-mpanel ol { margin: 4px 0 8px; padding-left: 20px; }
  .v3d-mpanel li { margin: 3px 0; }
  .v3d-mpanel li b { color: #e11d5c; }
  .v3d-mpanel li small { display: block; color: var(--text-faint); }
  .v3d-mpanel .v3d-mrow { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
  .v3d-mpanel .v3d-mrow .v3d-btn { min-height: 30px; padding: 4px 10px; }
  .v3d-mpanel label { display: inline-flex; align-items: center; gap: 5px; color: var(--text-faint); }
  @media (max-width: 800px) { .v3d-mpanel { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 42%; padding: 9px 11px; } .v3d-mpanel h4 { font-size: 0.82rem; flex-wrap: wrap; } }
  .merge-pdf-empty { margin: 14px 0 0; font-size: 13px; color: var(--text-faint); text-align: center; padding: 18px; border: 1px dashed var(--border); border-radius: 10px; }
  .dropzone .cloud { width: 88px; height: 88px; margin: 0 auto 18px; border-radius: 50%; background: var(--accent-grad); display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: var(--shadow-md); }
  .dropzone h3 { margin: 0 0 6px; font-size: 1.3rem; }
  .dropzone .sub { margin: 0 0 20px; color: var(--text-faint); font-size: 0.88rem; }
  .choose-btn {
    display: inline-flex; align-items: center; gap: 8px; background: var(--accent-grad); color: #fff; border: none;
    padding: 13px 28px; border-radius: 12px; font-weight: 600; font-size: 0.95rem; cursor: pointer; box-shadow: var(--shadow-md);
  }
  .choose-btn:hover { filter: brightness(1.05); }
  .dropzone .hint { margin: 16px 0 0; font-size: 0.78rem; color: var(--text-faint); }
  input[type=file] { display: none; }

  .supported-head { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 12px; }
  .supported-head h4 { margin: 0; font-size: 0.92rem; }
  .format-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
  .format-badge-dots { width: 48px; height: 48px; margin: 0 auto 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; gap: 4px; }
  .format-badge-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); display: block; }
  .format-card .format-badge.format-badge-dots { display: flex; align-items: center; justify-content: center; gap: 4px; flex-direction: row; flex-wrap: nowrap; width: 48px; height: 48px; min-width: 48px; padding: 0; background: var(--surface-2); }
  .format-card .format-badge.format-badge-dots span { flex: 0 0 6px; width: 6px; height: 6px; margin: 0; }
  .format-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 10px; text-align: center; background: var(--surface-2); cursor: pointer; transition: border-color .15s, transform .15s; }
  .format-card:hover, .format-card:focus-visible { border-color: var(--accent-1); transform: translateY(-2px); outline: none; }
  .format-badge { width: 48px; height: auto; margin: 0 auto 10px; display: block; }
  .format-card .ext { font-weight: 700; font-size: 0.88rem; }
  .format-card .name { font-size: 0.72rem; color: var(--text-faint); margin-top: 2px; }

  /* Folded-corner document icon style, used only in the homepage's format grid so it
     doesn't affect the plain square badges used elsewhere in the app (sidebar, export panel). */
  .doc-icon {
    position: relative; width: 46px; height: 54px; border-radius: 6px 6px 6px 6px;
    background: #fff; box-shadow: 0 2px 6px rgba(23,26,43,0.12); border: 1px solid rgba(0,0,0,0.04);
    clip-path: polygon(0 0, 68% 0, 100% 32%, 100% 100%, 0 100%);
  }
  .doc-icon::before {
    content: ''; position: absolute; top: 0; right: 0; width: 32%; height: 32%;
    background: rgba(0,0,0,0.12); clip-path: polygon(0 0, 100% 100%, 0 100%);
  }
  .doc-icon::after {
    content: attr(data-ext); position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
    font-size: 0.56rem; font-weight: 800; letter-spacing: .01em; color: #fff; padding: 2px 6px; border-radius: 4px;
    background: var(--doc-color, #64748b); white-space: nowrap;
  }
  .doc-icon.badge-cdr { --doc-color: #12b76a; }
  .doc-icon.badge-ai { --doc-color: #ff9a00; }
  .doc-icon.badge-psd { --doc-color: #001e36; }
  .doc-icon.badge-pdf { --doc-color: #cf354a; }
  .doc-icon.badge-docx { --doc-color: #2b579a; }
  .doc-icon.badge-xlsx { --doc-color: #217346; }
  .doc-icon.badge-pptx { --doc-color: #d24726; }
  .doc-icon.badge-doc { --doc-color: #64748b; }
  .doc-icon.badge-dxf { --doc-color: #b91c1c; }

  .badge-cdr { background: #12b76a; }
  .badge-ai { background: #ff9a00; color: #1a1200; }
  .badge-psd { background: #001e36; }
  .badge-docx { background: #2b579a; }
  .badge-xlsx { background: #217346; }
  .badge-pptx { background: #d24726; }
  .badge-doc { background: #64748b; }
  .badge-dxf { background: #b91c1c; }

  .status-banner {
    margin-top: 16px; border-radius: var(--radius-sm); padding: 12px 16px; font-size: 0.85rem;
    background: #fdecec; color: #b3261e; border: 1px solid #f6c6c3; display: flex; gap: 10px; align-items: flex-start;
  }
  :root[data-theme="dark"] .status-banner { background: #3a1616; color: #ff9c94; border-color: #5a2222; }
  .status-banner pre { white-space: pre-wrap; font-size: 0.75rem; margin: 6px 0 0; opacity: .85; max-height: 140px; overflow: auto; }

  .side-callouts { display: flex; flex-direction: column; gap: 22px; height: 100%; }

  .ad-slot {
    display: none;
  }
  .ad-slot span { font-weight: 700; font-size: 0.78rem; letter-spacing: .04em; text-transform: uppercase; }
  .ad-slot-tall { flex: 1; min-height: 220px; }
  :root[data-theme="dark"] .ad-slot { background: #16324a; border-color: #1f4763; color: #9fc3de; }

  /* ==================== Homepage v2 (nav, hero, try-online, features, about, footer) ==================== */
  .hp-nav { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 32px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .hp-nav-links { display: flex; gap: 28px; }
  .hp-nav-links a { color: var(--text); font-weight: 600; font-size: 0.92rem; text-decoration: none; opacity: 0.85; }
  .hp-nav-links a:hover { opacity: 1; color: var(--accent-1); }
  .hp-nav-right { display: flex; align-items: center; gap: 12px; }
  .hp-nav-cta { background: var(--accent-grad); color: #fff; border: none; padding: 10px 20px; border-radius: 999px; font-weight: 700; font-size: 0.86rem; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
  .hp-nav-burger { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: 6px; }

  .hp-hero { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; padding: 48px 32px 8px; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.1fr); gap: 24px; align-items: center; }
  .hp-kicker { margin: 0 0 8px; font-size: 0.8rem; font-weight: 700; letter-spacing: .08em; color: var(--text-faint); }
  .hp-hero-title { margin: 0 0 16px; font-size: 3rem; line-height: 1.08; font-weight: 800; }
  .hp-hero-sub { margin: 0 0 22px; color: var(--text-dim); font-size: 1.05rem; line-height: 1.5; }
  .nodu-pulse { outline: 4px solid #ff9800; outline-offset: 6px; border-radius: 18px; transition: outline-color .3s; }
.hp-howto { max-width: 820px; margin: 0 auto; line-height: 1.65; } .hp-howto ol { padding-left: 1.3em; } .hp-howto li { margin: 6px 0; }
.hp-store-badges { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
  .hp-store-badge { display: flex; align-items: center; gap: 10px; background: #000; color: #fff; padding: 9px 18px; border-radius: 10px; text-decoration: none; }
  .hp-store-badge span { font-size: 0.66rem; line-height: 1.3; display: block; }
  .hp-store-badge strong { font-size: 0.96rem; }
  .hp-store-badge-disabled { opacity: 0.5; cursor: not-allowed; }
  .hp-hero-tagline { font-family: var(--cursive); font-size: 1.3rem; color: var(--accent-1); display: inline-block; border-bottom: 2px solid var(--accent-2); padding-bottom: 2px; }

  .hp-phone { width: 210px; height: 350px; border-radius: 32px; background: var(--surface); border: 8px solid var(--text); box-shadow: var(--shadow-lg); display: flex; align-items: center; justify-content: center; }
  .hp-phone-logo img { width: 84px; height: auto; border-radius: 18px; display: block; }

  /* ---- Hero visual image (web only) ---- */
  .hp-hero-phone { position: relative; display: flex; align-items: center; justify-content: center; }
  .hp-phone-photo { width: 100%; max-width: 620px; height: auto; display: block; border-radius: var(--radius-md); }


  .hp-try-online { position: relative; z-index: 1; max-width: 1100px; margin: 12px auto 0; padding: 0 32px; text-align: center; }
  .hp-try-online h3 { margin: 0 0 6px; font-size: 1.6rem; }
  .hp-try-online > p { margin: 0 0 20px; color: var(--text-dim); }

  .hp-features-row { position: relative; z-index: 1; max-width: 1280px; margin: 56px auto 0; padding: 0 32px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
  .hp-feature-card { display: flex; flex-direction: column; align-items: center; gap: 12px; }
  .hp-feature-icon { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
  .hp-feature-card h5 { margin: 0; font-size: 0.96rem; }
  .hp-feature-card p { margin: 0; font-size: 0.8rem; color: var(--text-faint); }

  .hp-about {
    max-width: 1280px; margin: 64px auto 0; padding: 40px; display: flex; align-items: stretch; justify-content: space-between; gap: 24px;
    background: var(--surface-2); border-radius: var(--radius-lg); overflow: hidden;
  }
  .hp-about-text { max-width: 460px; align-self: center; }
  .hp-about-kicker { margin: 0 0 6px; font-size: 0.78rem; font-weight: 700; letter-spacing: .06em; color: var(--text-faint); }
  .hp-about h3 { margin: 0 0 14px; font-size: 1.7rem; }
  .hp-about p { color: var(--text-dim); line-height: 1.6; margin: 0 0 18px; }
  .hp-about-link { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-1); font-weight: 700; text-decoration: none; }
  .hp-about-visual { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 14px; flex: 1; margin: 0; min-height: 0; }
  .hp-about-visual p { margin: 0; font-size: .92rem; line-height: 1.6; text-align: left; }
  .hp-about-photo { width: 100%; height: auto; object-fit: contain; display: block; border-radius: 16px; }

  .site-footer { max-width: 1280px; margin: 48px auto 0; padding: 24px 32px 40px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--border); color: var(--text-faint); font-size: 0.82rem; }
  .hp-about-note { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: .92rem; }
  .nodu-beta { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff !important; font: 800 10px/16px Inter, system-ui, sans-serif; letter-spacing: .06em; vertical-align: middle; text-transform: uppercase; white-space: nowrap; }
  /* Home page content sections (tools, guides, questions): the site's own colours, cards and dark mode */
  .hp-sec { max-width: 1180px; margin: 56px auto 0; padding: 0 32px; box-sizing: border-box; }
  .hp-sec-head { max-width: 720px; margin: 0 auto 24px; text-align: center; }
  .hp-sec-head .hp-about-kicker { margin-bottom: 6px; }
  .hp-sec-head h3 { margin: 0 0 8px; font-size: clamp(1.35rem, 2.6vw, 1.9rem); line-height: 1.2; color: var(--text); }
  .hp-sec-head p { margin: 0; color: var(--text-dim); font-size: .95rem; }
  .hp-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .hp-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); text-align: left; transition: border-color .15s, box-shadow .15s; }
  .hp-card:hover { border-color: var(--accent-1); box-shadow: var(--shadow-md); }
  .hp-card .hp-feature-icon { width: 44px; height: 44px; border-radius: 12px; }
  .hp-card h4 { margin: 4px 0 0; font-size: 1.02rem; color: var(--text); }
  .hp-card p { margin: 0; font-size: .88rem; color: var(--text-dim); line-height: 1.5; flex: 1; }
  .hp-card-link { margin-top: 4px; padding: 0; border: 0; background: none; font: inherit; font-size: .88rem; font-weight: 700; color: var(--accent-1); text-decoration: none; cursor: pointer; }
  .hp-card-tag { font-size: .7rem; font-weight: 800; letter-spacing: .04em; color: var(--accent-1); background: var(--accent-soft); border-radius: 6px; padding: 4px 8px; }
  .hp-faq { max-width: 820px; margin: 0 auto; }
  .hp-faq details { border-bottom: 1px solid var(--border); padding: 14px 4px; }
  .hp-faq summary { cursor: pointer; font-weight: 700; color: var(--text); font-size: .97rem; }
  .hp-faq details p { margin: 8px 0 0; color: var(--text-dim); font-size: .92rem; line-height: 1.55; }
  @media (max-width: 900px) { .hp-cards { grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 560px) { .hp-sec { padding: 0 16px; margin-top: 40px; } .hp-cards { grid-template-columns: 1fr; } .hp-sec-head { text-align: left; } }
  /* phones: the first 4 guides, the rest behind "Show all guides" */
  .hp-guides-more { display: none; }
  @media (max-width: 560px) {
    #hpGuides:not(.show-all) .hp-cards .hp-card:nth-child(n+5) { display: none; }
    #hpGuides:not(.show-all) .hp-guides-more { display: block; margin: 14px auto 0; padding: 11px 20px; border: 1px solid var(--accent-1); border-radius: 12px; background: var(--surface); color: var(--accent-1); font: inherit; font-weight: 700; cursor: pointer; }
  }
  .hp-contact { width: calc(100% - 32px); max-width: 760px; box-sizing: border-box; margin: 40px auto 0; padding: 28px 20px; text-align: center; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-2); }
  .hp-contact h3 { margin: 0 0 10px; font-size: 1.5rem; }
  .hp-contact p { color: var(--text-dim); line-height: 1.6; margin: 0 0 14px; }
  .hp-contact .hp-contact-small { font-size: .82rem; margin: 14px 0 0; }
  .hp-contact-mail { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 12px; background: var(--accent-1); color: #fff; font-weight: 700; text-decoration: none; word-break: break-all; }
  .site-footer a { color: var(--text-faint); text-decoration: none; margin-right: 16px; }
  .site-footer a:hover { color: var(--accent-1); }

  @media (max-width: 1100px) {
    .hp-hero { grid-template-columns: 1fr; text-align: center; }
    .hp-store-badges { justify-content: center; }
    .hp-hero-tagline { display: block; }
    .hp-hero-phone { order: -1; }
    .hp-features-row { grid-template-columns: repeat(2, 1fr); }
    .hp-about { flex-direction: column; text-align: center; padding: 28px 20px; }
    .hp-about-link { margin: 0 auto; }
    .hp-about-text { max-width: none; }
    .hp-about-visual { margin: 24px 0 0; min-height: 0; }
  }
  /* ---- App-only view: the Android app loads this same page in a WebView, so the
     new marketing homepage above is web-only — inside the app we keep the plain tool. ---- */
  html.in-app .hp-nav-links, html.in-app .hp-nav-cta, html.in-app .hp-kicker,
  html.in-app .hp-hero-sub, html.in-app .hp-store-badges, html.in-app .hp-hero-tagline,
  html.in-app .hp-hero-phone, html.in-app .hp-features-row,
  html.in-app .hp-about, html.in-app .hp-contact, html.in-app .site-footer, html.in-app #hpTryOnline > p,
  html.in-app .hp-try-online > h3, html.in-app #hpTools, html.in-app #hpGuides, html.in-app #hpFaq, html.in-app #hpHowTo, html.in-app #hpPopular { display: none; }
  .hp-pop { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
  .hp-pop a { padding: 10px 16px; border: 1px solid var(--accent-1); border-radius: 999px; color: var(--accent-1); background: var(--surface); text-decoration: none; font-weight: 600; font-size: .95rem; }
  .hp-pop a:hover { background: var(--accent-1); color: #fff; }
  html.in-app .hp-hero { grid-template-columns: 1fr; padding: 20px 20px 0; }
  html.in-app .hp-hero-title { font-size: 1.9rem; margin-bottom: 6px; }
  html.in-app .hp-try-online { margin-top: 8px; }
  .app-footer { display: none; }
  html.in-app .app-footer { display: block; }

  @media (max-width: 720px) {
    .hp-nav-links, .hp-nav-cta { display: none; }
    .hp-nav-links.hp-nav-open { display: flex; position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); flex-direction: column; padding: 16px 24px; border-bottom: 1px solid var(--border); gap: 16px; box-shadow: var(--shadow-md); }
    /* 2026-10-25: on phones the page links (Home, Features...) were hidden with no way to open them - now a row under the logo */
    .hp-nav { flex-wrap: wrap; }
    .hp-nav-links { display: flex; order: 5; flex-basis: 100%; overflow-x: auto; gap: 20px; padding: 8px 2px 2px; scrollbar-width: none; }
    .hp-nav-links::-webkit-scrollbar { display: none; }
    .hp-nav-links a { white-space: nowrap; font-size: .88rem; }
    .hp-nav-burger { display: flex; flex-direction: column; align-items: center; gap: 1px; }
    .hp-nav-burger-label { font-size: 0.62rem; font-weight: 600; line-height: 1.1; color: var(--text-dim); white-space: nowrap; }
    .hp-nav-right #landingRecentBtn, .hp-nav-right #themeToggle { display: none; }
    .hp-nav { padding: 12px 16px; }
    .hp-hero { padding: 28px 20px 8px; overflow: hidden; }
    .hp-hero-title { font-size: 2.1rem; }
    .hp-features-row { grid-template-columns: repeat(2, 1fr); }
  }

  .steps-bar {
    margin-top: 32px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
    padding: 20px 28px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; border: 1px solid var(--border);
  }
  .step { display: flex; align-items: center; gap: 12px; }
  .step-num { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; flex: none; }
  .step:nth-child(1) .step-num { background: var(--accent-1); }
  .step:nth-child(3) .step-num { background: var(--accent-2); }
  .step:nth-child(5) .step-num { background: #10b981; }
  .step h5 { margin: 0; font-size: 0.85rem; }
  .step p { margin: 1px 0 0; font-size: 0.75rem; color: var(--text-faint); }
  .step-chevron { color: var(--text-faint); flex: none; }
  .steps-bar .doodle-end { margin-left: auto; font-family: var(--cursive); font-size: 1.25rem; color: var(--accent-1); }
  .app-footer { text-align: center; font-size: 0.75rem; color: var(--text-faint); margin-top: 28px; padding-bottom: 8px; }

  /* ---------- Viewer screen ---------- */
  #screen-viewer { display: flex; flex-direction: column; height: 100vh; }
  .viewer-body { flex: 1; display: flex; min-height: 0; border-top: 1px solid var(--border); }

  /* Side panels are hidden by default (width 0) and only open when the user
     drags or clicks the handle beside them — keeps the canvas front and center. */
  .sidebar, .panel-col { width: 0; flex: 0 0 auto; overflow: hidden; }
  .sidebar.animated, .panel-col.animated { transition: width .18s ease; }

  .resize-handle {
    flex: 0 0 auto; width: 14px; background: var(--surface);
    border-left: 1px solid var(--border); border-right: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center; position: relative;
    cursor: col-resize; z-index: 2; -webkit-tap-highlight-color: transparent;
  }
  .resize-handle:hover, .resize-handle.dragging { background: var(--accent-soft); }
  .resize-handle .handle-grip { width: 3px; height: 40px; border-radius: 3px; background: var(--border); }
  .resize-handle:hover .handle-grip, .resize-handle.dragging .handle-grip { background: var(--accent-1); }
  .handle-chevron {
    position: absolute; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; border-radius: 50%;
    background: var(--accent-grad); border: 1px solid var(--accent-1); color: #fff; box-shadow: var(--shadow-sm);
    display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
  }
  .resize-handle:hover .handle-chevron { box-shadow: var(--shadow-md); }

  /* ---------- NODU banner header (replaces the file-info bar) ---------- */
  .nodu-header { display: none; }
  .topbar-divider { width: 1px; height: 22px; background: var(--border); margin: 0 2px; }
  .nodu-user {
    display: flex; align-items: center; gap: 8px; border: none; background: none; cursor: pointer;
    padding: 4px 8px; border-radius: 999px; color: var(--text);
  }
  .nodu-user:hover { background: var(--surface-2); }
  .nodu-avatar {
    width: 28px; height: 28px; border-radius: 50%; background: var(--accent-grad); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; flex: none;
  }
  .nodu-name { font-size: 0.86rem; font-weight: 600; }
  /* ---------- Auto-sliding advertisement carousel (replaces the old banner) ---------- */
  .ad-carousel { position: relative; overflow: hidden; height: 130px; }
  .ad-carousel-track { display: flex; height: 100%; transition: transform .5s ease; }
  .ad-slide {
    flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    background: #dcedfb; border-bottom: 1px solid #b9d8f2;
  }
  :root[data-theme="dark"] .ad-slide { background: #16324a; border-color: #1f4763; }
  .ad-slide span { text-align: center; color: #5b6b7a; font-weight: 700; font-size: 0.85rem; letter-spacing: .04em; text-transform: uppercase; line-height: 1.6; }
  :root[data-theme="dark"] .ad-slide span { color: #9fc3de; }
  .ad-slide span em { display: block; font-style: normal; font-size: 1.15rem; letter-spacing: .02em; }
  .ad-nav {
    position: absolute; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--surface); color: var(--text-dim);
    display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 3; box-shadow: var(--shadow-sm);
  }
  .ad-nav:hover { color: var(--text); }
  .ad-prev { left: 14px; }
  .ad-next { right: 14px; }
  .ad-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 3; }
  .ad-dots button { width: 7px; height: 7px; border-radius: 50%; border: none; background: rgba(0,0,0,.2); cursor: pointer; padding: 0; }
  :root[data-theme="dark"] .ad-dots button { background: rgba(255,255,255,.25); }
  .ad-dots button.active { background: #1f7cd4; width: 16px; border-radius: 4px; }

  .file-topbar {
    display: flex; align-items: center; gap: 18px; padding: 14px 28px; border-top: 1px solid var(--border);
    background: var(--surface);
  }
  .file-topbar .ftype-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; font-size: 0.75rem; flex: none; }
  .file-topbar .fname-block { min-width: 0; }
  .file-topbar .fname-block h3 { margin: 0; font-size: 0.98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
  .file-topbar .fname-block p { margin: 1px 0 0; font-size: 0.75rem; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
  .file-stats { display: flex; gap: 26px; margin-left: auto; }
  .file-stat { text-align: right; }
  .file-stat strong { display: block; font-size: 0.88rem; }
  .file-stat span { font-size: 0.7rem; color: var(--text-faint); }
  .kebab-wrap { position: relative; flex: none; }
  .kebab-menu { position: absolute; right: 0; top: 46px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); min-width: 170px; padding: 6px; z-index: 20; }
  .kebab-menu button { width: 100%; text-align: left; background: none; border: none; padding: 9px 10px; border-radius: 8px; font-size: 0.85rem; color: var(--text); cursor: pointer; display: flex; align-items: center; gap: 8px; }
  .kebab-menu button:hover { background: var(--surface-2); }

  .sidebar { background: var(--surface); border-right: 1px solid var(--border); }
  .sidebar .panel-inner { width: 244px; height: 100%; padding: 18px 16px; overflow-y: auto; display: flex; flex-direction: column; box-sizing: border-box; scrollbar-width: none; -ms-overflow-style: none; }
  .sidebar .panel-inner::-webkit-scrollbar { display: none; width: 0; height: 0; }
  .open-file-card {
    display: flex; align-items: center; gap: 12px; background: var(--accent-soft); border: 1px solid transparent;
    border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; margin-bottom: 16px;
  }
  .open-file-card .icon { width: 36px; height: 36px; border-radius: 9px; background: var(--accent-grad); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
  .open-file-card strong { display: block; font-size: 0.88rem; color: var(--accent-1); }
  .open-file-card span { font-size: 0.72rem; color: var(--text-dim); }
  .open-file-card .chev { margin-left: auto; color: var(--accent-1); }

  .nav-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
  .nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 10px; border-radius: 9px; cursor: pointer; color: var(--text-dim); font-size: 0.86rem; background: none; border: none; text-align: left; }
  .nav-item:hover { background: var(--surface-2); color: var(--text); }
  .nav-item svg { flex: none; }
  .nav-item.active { background: var(--accent-soft); color: var(--accent-1); font-weight: 600; }
  .nav-item .nav-item-label { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
  .nav-item .nav-item-sub { font-size: 0.72rem; font-weight: 400; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
  .nav-item.active .nav-item-sub { color: var(--accent-1); opacity: .8; }

  .sidebar hr { border: none; border-top: 1px solid var(--border); margin: 8px 0 14px; }
  .sidebar h5 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); margin: 0 0 10px; }
  .format-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
  .format-list .row { display: flex; align-items: center; gap: 10px; }
  .format-list .sq { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.62rem; font-weight: 800; flex: none; }
  .format-list strong { display: block; font-size: 0.8rem; }
  .format-list span { font-size: 0.7rem; color: var(--text-faint); }

  .privacy-card { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 14px; display: flex; gap: 10px; align-items: flex-start; margin-top: auto; }
  .privacy-card .icon { width: 32px; height: 32px; border-radius: 8px; background: var(--accent-grad); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
  .privacy-card strong { display: block; font-size: 0.82rem; color: var(--accent-1); }
  .privacy-card span { font-size: 0.72rem; color: var(--text-dim); }
  .sidebar-doodle { font-family: var(--cursive); font-size: 1.1rem; color: var(--accent-1); text-align: center; margin-top: 16px; line-height: 1.25; }
  .sidebar-copyright { font-size: 0.68rem; color: var(--text-faint); text-align: center; margin: 10px 0 0; }

  .canvas-col { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; background: var(--bg); }
  .viewer-toolbar { display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
  .viewer-toolbar .grp { display: flex; align-items: center; gap: 4px; }
  .nodu-ad-stack { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 728px; margin: 14px auto; padding: 0 8px; box-sizing: border-box; }
  .nodu-ad-stack[hidden] { display: none; }
  .nodu-ad { min-height: 100px; }
  /* With ads under the percentage the export screen can be taller than the window: let it scroll instead of clipping. */
  .modal-overlay.ad-gate-overlay { overflow-y: auto; justify-content: flex-start; }
  .ad-gate-overlay .ad-gate-box { height: auto; min-height: 100%; flex-shrink: 0; box-sizing: border-box; }
  .nodu-ad-label { display: block; font-size: 0.66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 3px; }
  select.unit-sync { font: inherit; font-size: 0.8em; font-weight: 600; padding: 2px 4px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--accent-1); cursor: pointer; margin-left: 4px; }
  .viewer-toolbar .div { width: 1px; height: 22px; background: var(--border); margin: 0 6px; }
  .viewer-toolbar select {
    border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 7px 8px; font-size: 0.82rem; cursor: pointer;
  }
  .toolbar-btn {
    height: 36px; min-width: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid transparent; background: none;
    color: var(--text-dim); display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 0.82rem;
  }
  .toolbar-btn:hover { background: var(--surface-2); color: var(--text); }
  .toolbar-btn.active { background: var(--accent-soft); color: var(--accent-1); }
  #editInEditorBtn { margin-left: auto; color: #fff; background: var(--accent-grad); font-weight: 600; }
  #editInEditorBtn + #toolbarExportBtn { margin-left: 0; }
  #toolbarExportBtn { margin-left: auto; color: var(--accent-1); background: var(--accent-soft); font-size: 0.82rem; gap: 6px; }
  #toolbarExportBtn:disabled { opacity: .45; cursor: not-allowed; }

  .ruler-grid {
    flex: 1; min-height: 0; display: grid; grid-template-columns: 22px 1fr; grid-template-rows: 22px 1fr;
  }
  .ruler-corner { grid-column: 1; grid-row: 1; background: var(--surface); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .ruler-h-wrap { grid-column: 2; grid-row: 1; overflow: hidden; background: var(--surface); border-bottom: 1px solid var(--border); }
  .ruler-v-wrap { grid-column: 1; grid-row: 2; overflow: hidden; background: var(--surface); border-right: 1px solid var(--border); }
  .ruler-h-wrap canvas, .ruler-v-wrap canvas { display: block; width: 100%; height: 100%; }
  body.canvas-focus-mode .ruler-grid { display: block; }
  body.canvas-focus-mode .ruler-corner, body.canvas-focus-mode .ruler-h-wrap, body.canvas-focus-mode .ruler-v-wrap { display: none; }

  .viewport {
    grid-column: 2; grid-row: 2; min-width: 0; min-height: 0;
    overflow: auto; position: relative; display: flex; align-items: center; justify-content: center;
    /* Single-finger panning stays native; the browser's own pinch/double-tap
       zoom is excluded so a two-finger pinch can drive setZoom() instead of
       zooming the whole page. */
    touch-action: pan-x pan-y;
  }
  .viewport.bg-white .canvas-surface { background: #fff; }
  .viewport.bg-dark .canvas-surface { background: #222; }
  .viewport.bg-checker .canvas-surface {
    background-color: #fff;
    background-image: linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  }
  .canvas-surface { box-shadow: var(--shadow-lg); transform-origin: center center; flex: none; }
  .canvas-surface svg, .canvas-surface img { display: block; width: 100%; height: 100%; object-fit: contain; }
  .viewport.has-pages { display: block; overscroll-behavior: contain; }
  .viewport.has-pages .canvas-surface { box-shadow: none; background: none; padding: 32px; box-sizing: content-box; margin: 0 auto; }
  .document-page-slot { position: relative; margin: 0 auto 32px; }
  .document-page-slot:last-child { margin-bottom: 0; }
  .document-page { position: absolute; left: 50%; top: 50%; box-shadow: var(--shadow-lg); background: #fff; }
  .viewport.bg-dark .document-page { background: #222; }
  .viewport.bg-checker .document-page { background: repeating-conic-gradient(#ccc 0% 25%, #fff 0% 50%) 0 / 20px 20px; }
  .viewport.panning { cursor: grabbing; }
  .viewport.pan-mode { cursor: grab; }
  :fullscreen, :-webkit-full-screen { background: var(--bg); }

  /* Canvas-only focus mode: hide every other panel/toolbar, blow the
     viewport up to fill the whole screen. */
  body.canvas-focus-mode > *:not(#screen-viewer) { display: none !important; }
  body.canvas-focus-mode .nodu-header,
  body.canvas-focus-mode .topbar,
  body.canvas-focus-mode .file-topbar,
  body.canvas-focus-mode .viewer-body > .sidebar,
  body.canvas-focus-mode .viewer-body > .panel-col,
  body.canvas-focus-mode .resize-handle,
  body.canvas-focus-mode .viewer-toolbar,
  body.canvas-focus-mode .export-fab,
  body.canvas-focus-mode .viewer-tip {
    display: none !important;
  }
  body.canvas-focus-mode .viewport {
    position: fixed; inset: 0; z-index: 9999; width: 100vw; height: 100vh;
  }
  .focus-exit-btn {
    display: none; position: absolute; top: 16px; right: 16px; z-index: 10000;
    width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--surface); color: var(--text-dim); align-items: center; justify-content: center; cursor: pointer;
    box-shadow: var(--shadow-md);
  }
  .focus-exit-btn:hover { color: var(--text); }
  body.canvas-focus-mode .focus-exit-btn { display: flex; }

  .empty-canvas, .loading-canvas { text-align: center; color: var(--text-faint); }
  /* 2026-11-13 (owner: "open CDR faster"): the file's own picture is shown big and clear at once, like the opened
     design, while the full-quality version is made - no longer a small, fading stamp */
  .quick-preview-img {
    display: block; width: min(640px, calc(100vw - 72px)); height: auto; max-height: 62vh; object-fit: contain; margin: 0 auto 14px;
    background: #fff; border-radius: 8px; box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  }
  @keyframes quick-preview-pulse { 0%,100% { opacity: .88; } 50% { opacity: .62; } }
  @media (prefers-reduced-motion: reduce) { .quick-preview-img { animation: none; } }
  .loading-canvas svg { margin: 0 auto 12px; }
  .loading-canvas p { color: var(--text); }
  .opening-file-name {
    font-weight: 700; font-size: 0.95rem; margin: 0 auto 6px; max-width: min(320px, 80vw);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .opening-progress { display:block; appearance:none; -webkit-appearance:none; width:200px; max-width:80vw; height:4px; margin:0 auto; border:0; border-radius:3px; overflow:hidden; background:var(--border); color:#187dc3; }
  .opening-progress::-webkit-progress-bar { background:var(--border); border-radius:3px; }
  .opening-progress::-webkit-progress-value { border-radius:3px; background:linear-gradient(100deg,#187dc3 20%,#52b8ef 50%,#187dc3 80%); background-size:200% 100%; animation:opening-bar 1.6s linear infinite; transition:width .3s ease; }
  .opening-progress::-moz-progress-bar { border-radius:3px; background:linear-gradient(100deg,#187dc3 20%,#52b8ef 50%,#187dc3 80%); background-size:200% 100%; animation:opening-bar 1.6s linear infinite; }
  @keyframes opening-bar { from { background-position:200% 0; } to { background-position:0 0; } }
  @media(prefers-reduced-motion:reduce) { .opening-progress::-webkit-progress-value { animation:none; transition:none; } .opening-progress::-moz-progress-bar { animation:none; } }
  .opening-cancel-btn { display:block; margin:18px auto 0; padding:8px 20px; border-radius:999px; border:1px solid var(--border); background:var(--surface); color:var(--text-dim); font-size:0.82rem; font-weight:600; cursor:pointer; }
  .opening-cancel-btn:hover { border-color:#d92d20; color:#d92d20; }
  .empty-canvas {
    padding: 40px 48px; border: 2px dashed var(--border); border-radius: var(--radius-md);
    transition: border-color .15s, background .15s;
  }
  .empty-canvas.drag { border-color: var(--accent-1); background: var(--accent-soft); }
  .empty-canvas-icon {
    width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: var(--accent-grad);
    color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md);
  }
  .empty-canvas h4 { margin: 0 0 4px; font-size: 1.05rem; color: var(--text); }
  .empty-canvas p { margin: 0 0 16px; font-size: 0.82rem; }
  .empty-canvas-btn {
    background: var(--accent-grad); color: #fff; border: none; padding: 10px 22px; border-radius: 10px;
    font-weight: 600; font-size: 0.85rem; cursor: pointer; box-shadow: var(--shadow-sm);
  }
  .empty-canvas-btn:hover { filter: brightness(1.05); }
  .spinner { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent-1); animation: spin 0.8s linear infinite; margin: 0 auto 14px; }
  @keyframes spin { to { transform: rotate(360deg); } }

  .viewer-tip { padding: 10px 20px; border-top: 1px solid var(--border); background: var(--surface); font-size: 0.78rem; color: var(--text-faint); display: flex; align-items: center; gap: 8px; }

  .panel-col { background: var(--surface); border-left: 1px solid var(--border); }
  .panel-col .panel-inner { width: 264px; height: 100%; padding: 18px 16px; overflow-y: auto; display: flex; flex-direction: column; box-sizing: border-box; scrollbar-width: none; -ms-overflow-style: none; }
  .panel-col .panel-inner::-webkit-scrollbar { display: none; width: 0; height: 0; }
  .panel-col h5 { font-size: 0.78rem; margin: 0 0 12px; }
  .pages-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
  .page-thumb {
    border: 2px solid transparent; border-radius: 12px; padding: 8px; cursor: pointer; background: var(--surface-2); position: relative;
  }
  .page-thumb.active { border-color: var(--accent-1); background: var(--accent-soft); }
  .page-thumb .thumb-box { aspect-ratio: 3/4; border-radius: 8px; background: #fff; overflow: hidden; display: flex; align-items: center; justify-content: center; }
  .page-thumb .thumb-box svg, .page-thumb .thumb-box img { width: 100%; height: 100%; object-fit: contain; }
  .page-thumb .num {
    position: absolute; left: 12px; bottom: 12px; background: var(--accent-1); color: #fff; font-size: 0.68rem; font-weight: 700;
    width: 18px; height: 18px; border-radius: 5px; display: flex; align-items: center; justify-content: center;
  }
  .props-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
  .design-inspector { border-top: 1px solid var(--border); padding-top: 16px; margin-bottom: 20px; }
  .design-inspector details { border-bottom: 1px solid var(--border); padding: 10px 0; }
  .design-inspector summary { cursor: pointer; font-size: .8rem; font-weight: 700; color: var(--text); }
  .inspector-note { font-size: .75rem; line-height: 1.5; color: var(--text-dim); }
  .inspector-colors { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
  .color-chip { display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; padding: 4px; border: 1px solid var(--border); border-radius: 6px; }
  .color-swatch { width: 15px; height: 15px; border: 1px solid var(--border); border-radius: 3px; }
  .inspector-fonts { padding-inline-start: 18px; font-size: .75rem; line-height: 1.6; overflow-wrap: anywhere; }
  .health-row { margin-top: 12px; font-size: .75rem; }
  .health-row p { color: var(--text-dim); line-height: 1.5; margin: 4px 0; }
  .library-launch { display: block; width: 100%; margin-top: 16px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--accent-soft); color: var(--accent-1); cursor: pointer; font-weight: 700; }
  .design-library { width: min(680px, calc(100vw - 32px)); max-height: 85vh; overflow-y: auto; padding: 22px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
  .design-library::backdrop { background: rgba(0,0,0,.5); }
  .library-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .library-header h2 { font-size: 1.15rem; margin: 0; }
  .design-library .export-field { display: block; margin-top: 16px; }
  .library-files { display: flex; flex-direction: column; gap: 8px; }
  .library-file { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; text-align: start; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
  .library-file:hover { border-color: var(--accent-1); }
  .library-file > span:last-child { min-width: 0; }
  .library-file strong, .library-file small { display: block; overflow-wrap: anywhere; }
  .library-file small { font-size: .72rem; color: var(--text-dim); margin-top: 4px; }
  .library-file-type { color: var(--accent-1); font-size: .8rem; font-weight: 700; flex: none; }
  .badge-pdf { background: #cf354a; color: #fff; }
  .print-tools { border-top: 1px solid var(--border); margin-bottom: 20px; padding-top: 14px; }
  .print-tools details { border-bottom: 1px solid var(--border); padding: 10px 0; }
  .print-tools summary { cursor: pointer; font-size: .8rem; font-weight: 700; }
  .print-tools label { display: block; margin: 9px 0; font-size: .74rem; color: var(--text-dim); }
  .print-tools input, .print-tools textarea { display: block; width: 100%; margin-top: 4px; padding: 7px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: var(--text); font: inherit; }
  .print-tools textarea { resize: vertical; min-height: 70px; }
  .print-tool-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
  .print-tool-actions button, .print-tool-actions a { border: 1px solid var(--border); border-radius: 6px; background: var(--accent-soft); color: var(--accent-1); padding: 7px; font-size: .74rem; cursor: pointer; text-decoration: none; }
  .print-tool-actions button:disabled { opacity: .45; cursor: not-allowed; }
  .signature-mismatch { color: #dc3545; }
  .signature-matched, .signature-compatible { color: var(--green); }
  #paperResult { white-space: pre-line; font-size: .75rem; line-height: 1.8; overflow-wrap: anywhere; }
  .prop-row { display: flex; align-items: center; gap: 10px; font-size: 0.82rem; }
  .prop-row .icon { color: var(--text-faint); flex: none; }
  .prop-row .k { color: var(--text-faint); }
  .prop-row .v { margin-left: auto; font-weight: 600; }

  .export-btn {
    margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent-grad);
    color: #fff; border: none; padding: 13px; border-radius: 12px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-md); font-size: 0.9rem;
  }
  .export-btn:hover { filter: brightness(1.05); }
  .export-btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }

  .toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg);
    padding: 11px 18px; border-radius: 10px; font-size: 0.85rem; box-shadow: var(--shadow-lg); z-index: 300;
    opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  }
  .toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

  /* ---------- Export modal + ad-gate overlay ---------- */
  .modal-overlay {
    position: fixed; inset: 0; background: rgba(10,12,20,.55); z-index: 200;
    display: flex; align-items: center; justify-content: center; padding: 20px;
  }
  .export-modal {
    background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    padding: 24px; width: 340px; max-width: 100%;
  }
  .export-modal h3 { margin: 0 0 4px; font-size: 1.1rem; }
  .export-source { margin: 0 0 16px; font-size: 0.8rem; color: var(--text-faint); }
  .export-field {
    display: block; width: 100%; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
    border-radius: 8px; padding: 9px 10px; font-size: 0.85rem; margin-top: 6px; margin-bottom: 4px; font-family: inherit;
  }
  select.export-field { cursor: pointer; }
  select.export-field option:disabled { color: var(--text-faint); font-style: italic; }
  .export-option-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
  .export-option {
    flex: 1; min-width: 70px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim);
    border-radius: 8px; padding: 9px 8px; font-size: 0.8rem; cursor: pointer; text-align: center;
  }
  .export-option.active { border-color: var(--accent-1); background: var(--accent-soft); color: var(--accent-1); font-weight: 600; }
  .export-size-hint { margin: 10px 0 0; font-size: 0.74rem; color: var(--text-faint); }
  .export-modal-actions { display: flex; gap: 10px; margin-top: 22px; }
  .export-cancel-btn, .export-confirm-btn {
    flex: 1; padding: 11px; border-radius: 10px; font-weight: 600; font-size: 0.85rem; cursor: pointer; border: none;
  }
  .export-cancel-btn { background: var(--surface-2); color: var(--text-dim); display:inline-flex; align-items:center; justify-content:center; gap:8px; }
  .export-confirm-btn { background: var(--accent-grad); color: #fff; box-shadow: var(--shadow-sm); display:inline-flex; align-items:center; justify-content:center; gap:8px; }
  .export-cancel-btn:disabled, .export-confirm-btn:disabled { opacity:.55; cursor:default; }

  /* ---- App-download gate (one free web preview, see handleFile()) ---- */
  .app-gate-modal { width: 360px; position: relative; padding-top: 40px; text-align: center; }
  .app-gate-icon { display: flex; justify-content: center; margin-bottom: 4px; }
  .app-gate-icon img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; }
  .app-gate-modal h3 { text-align: center; }
  .app-gate-modal .export-modal-subtitle { display: block; margin: 8px 0 18px; }
  .app-gate-cta { width: 100%; text-decoration: none; }
  .app-gate-cta[hidden] { display: none; } /* .export-confirm-btn's own unconditional display:inline-flex would otherwise win */
  .app-gate-continue { display: block; width: 100%; margin: 10px 0 0; padding: 10px; border: none; background: none; color: var(--text-faint); font: inherit; font-size: 0.82rem; cursor: pointer; }
  .app-gate-continue:hover { color: var(--text-dim); text-decoration: underline; }
  .app-gate-ios-steps { text-align: left; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
  .app-gate-ios-step { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; color: var(--text); padding: 4px 0; }
  .app-gate-ios-num { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent-grad); color: #fff; font-size: 0.7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }

  /* ---- Slow-connection notice (see checkConnectionSpeed()) ---- */
  .speed-notice {
    position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 260;
    display: flex; align-items: center; gap: 10px; max-width: min(420px, calc(100vw - 32px));
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    padding: 12px 14px; box-shadow: var(--shadow-lg); font-size: 0.82rem; color: var(--text);
    animation: speedNoticeIn .2s ease;
  }
  .speed-notice svg { flex: none; color: var(--orange); }
  .speed-notice span { flex: 1; line-height: 1.4; }
  .speed-notice button { flex: none; border: none; background: none; color: var(--text-faint); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 2px 4px; }
  .speed-notice button:hover { color: var(--text); }
  @keyframes speedNoticeIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
  /* 2026-11-07 (customer-journey tester): at the bottom it covered the editor's tool bar and the help guide's Skip
     button - on phones it now shows at the top, and its × is finger-sized */
  /* 2026-11-07 (customer-journey tester): the main buttons were 38 px tall - finger-sized on phones */
  @media (max-width: 640px) { .export-confirm-btn, .export-cancel-btn { min-height: 48px; } .nodu-dialog .v3d-sheet button { min-height: 44px; min-width: 64px; } }
  @media (max-width: 640px) { html .speed-notice, html.has-ad-bar .speed-notice { bottom: auto !important; top: calc(env(safe-area-inset-top, 0px) + 8px); width: calc(100vw - 24px); max-width: none; box-sizing: border-box; padding: 8px 10px; font-size: .78rem; } .speed-notice button { min-width: 40px; min-height: 40px; } }

  /* ---- Recent files modal ---- */
  .recent-files-modal { width: 620px; position: relative; padding-top: 40px; max-height: 82vh; display: flex; flex-direction: column; }
  .recent-files-toolbar { display: flex; gap: 8px; margin-bottom: 14px; }
  .recent-files-toolbar input[type="search"] { flex: 1; margin: 0; }
  .recent-files-toolbar select { width: auto; margin: 0; flex: none; }
  .recent-files-toolbar #recentFilesClearAll { flex: none; font-size: 0.78rem; padding: 9px 14px; }
  .recent-files-list { overflow-y: auto; margin: 0 -8px; padding: 0 8px; }
  .recent-files-group-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); margin: 14px 0 6px; }
  .recent-files-group-label:first-child { margin-top: 0; }
  .recent-file-row { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 10px; }
  .recent-file-row:hover { background: var(--surface-2); }
  .recent-file-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; border: 1px solid var(--border); background: var(--surface-2); }
  .recent-file-badge { width: 44px; height: 44px; border-radius: 8px; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.7rem; color: #fff; }
  .recent-file-info { min-width: 0; flex: 1; }
  .recent-file-name { font-size: 0.86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .recent-file-meta { font-size: 0.74rem; color: var(--text-faint); margin-top: 1px; }
  .recent-file-reopen { flex: none; border: none; background: var(--accent-soft); color: var(--accent-1); font-weight: 700; font-size: 0.78rem; padding: 8px 14px; border-radius: 999px; cursor: pointer; }
  .recent-file-reopen:disabled { opacity: .5; cursor: default; }
  .recent-file-delete { flex: none; border: none; background: none; color: var(--text-faint); cursor: pointer; padding: 6px; border-radius: 8px; display: flex; }
  .recent-file-delete:hover { color: #d92d20; background: #d92d2014; }
  .recent-files-empty { text-align: center; color: var(--text-faint); font-size: 0.85rem; padding: 40px 0; }

  /* ---- Feedback modal ---- */
  .feedback-modal { width: 420px; position: relative; padding-top: 40px; }
  .feedback-label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-dim); margin-top: 4px; }
  .feedback-textarea { resize: vertical; min-height: 80px; }
  .feedback-dropzone {
    margin-top: 14px; border: 1.5px dashed var(--border); border-radius: 10px; padding: 16px; text-align: center;
    cursor: pointer; color: var(--text-faint); transition: border-color .15s ease, background .15s ease;
  }
  .feedback-dropzone:hover, .feedback-dropzone:focus-visible, .feedback-dropzone.feedback-drag { border-color: var(--accent-1); background: var(--accent-soft); }
  .feedback-dropzone svg { display: block; margin: 0 auto 6px; }
  .feedback-dropzone span { font-size: 0.78rem; }
  #feedbackPreviewWrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
  #feedbackPreviewImg { max-width: 100%; max-height: 140px; border-radius: 8px; box-shadow: var(--shadow-sm); }
  .feedback-remove-img { border: none; background: var(--surface-2); color: var(--text-dim); font-size: 0.74rem; padding: 5px 10px; border-radius: 6px; cursor: pointer; }
  .feedback-status { min-height: 1.1em; }
  .feedback-status.feedback-error { color: #dc2626; }
  .feedback-status.feedback-ok { color: #16a34a; }

  /* ---- Feedback floating button (bottom of screen, always reachable) ---- */
  .feedback-fab {
    position: fixed; right: 20px; bottom: 20px; z-index: 150;
    display: flex; align-items: center; gap: 8px; border: none; cursor: pointer;
    padding: 13px 20px; border-radius: 999px; background: var(--accent-grad); color: #fff;
    font-size: 0.86rem; font-weight: 700; box-shadow: 0 8px 22px rgba(20,119,198,.38);
    transition: transform .15s ease, box-shadow .15s ease;
  }
  .feedback-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(20,119,198,.46); }
  .feedback-fab:active { transform: translateY(0); }
  @media (max-width: 640px) {
    .feedback-fab { right: 14px; bottom: 14px; padding: 12px; box-shadow: 0 6px 16px rgba(20,119,198,.4); }
    .feedback-fab span { display: none; }
    .site-footer { padding-bottom: 84px; }   /* room for the round Feedback button, so it covers no text */
    .viewer-tip { padding-right: 64px; }
  }

  /* ---- Export pill (blurred glass), always visible just above the tip bar ---- */
  .export-fab {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: fit-content; margin: 0 auto 8px; padding: 12px 24px; cursor: pointer;
    border: 1px solid rgba(255,255,255,.4); border-radius: 999px;
    background: rgba(255,255,255,.2); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    color: var(--text); font-size: 0.86rem; font-weight: 700;
    box-shadow: 0 8px 22px rgba(0,0,0,.16);
    transition: transform .15s ease, background .15s ease;
  }
  .export-fab:hover { transform: translateY(-2px); background: rgba(255,255,255,.32); }
  .export-fab:active { transform: translateY(0); }
  .export-fab:disabled { opacity: .45; cursor: not-allowed; transform: none; }
  :root[data-theme="dark"] .export-fab { background: rgba(23,26,41,.45); border-color: rgba(255,255,255,.14); }
  :root[data-theme="dark"] .export-fab:hover { background: rgba(23,26,41,.65); }

  /* ---- Redesigned export modal ---- */
  .export-modal-v2 { width: min(760px, 100%); padding: 0; overflow: hidden; position: relative; max-height: 88vh; display: flex; flex-direction: column; }
  .export-modal-close {
    position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text-dim); cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 2;
  }
  .export-modal-close:hover { background: var(--surface-2); color: var(--text); }
  .export-modal-header { display: flex; gap: 16px; align-items: flex-start; padding: 24px 56px 20px 24px; background: var(--accent-soft); }
  .export-modal-icon {
    flex: none; width: 56px; height: 56px; border-radius: 16px; background: var(--accent-grad); color: #fff;
    display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md);
  }
  .export-modal-header h3 { margin: 0 0 4px; font-size: 1.35rem; }
  .export-modal-subtitle { margin: 0; font-size: 0.85rem; color: var(--text-dim); }
  .export-modal-v2 .export-source { margin: 0; padding: 8px 24px; font-size: 0.76rem; background: var(--surface-2); border-bottom: 1px solid var(--border); }
  .export-modal-body { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; padding: 20px 24px; overflow-y: auto; }
  .export-section-head { display: flex; align-items: center; gap: 8px; margin: 18px 0 6px; color: var(--text); }
  .export-section-head:first-child { margin-top: 0; }
  .export-section-head svg { flex: none; color: var(--accent-1); }
  .export-section-head h4 { margin: 0; font-size: 0.88rem; }
  .export-hint-small { margin: 0 0 8px; font-size: 0.74rem; color: var(--text-faint); }
  .export-filename-row { display: flex; align-items: stretch; gap: 0; margin-top: 6px; }
  .export-filename-row .export-field { margin: 0; border-radius: 8px 0 0 8px; border-right: none; }
  .export-ext-suffix { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--border); border-left: none; border-radius: 0 8px 8px 0; background: var(--surface-2); color: var(--text-faint); font-size: 0.82rem; font-weight: 600; white-space: nowrap; }

  .export-format-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .export-format-group-label { grid-column: 1 / -1; margin: 10px 0 -2px; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-faint); }
  .export-format-group-label:first-child { margin-top: 0; }
  /* The export format is chosen from one drop-down; the picture cards stay in the page (hidden) and do the work. */
  .export-format-grid[hidden] { display: none; }
  .feedback-cats { display: flex; gap: 8px; margin: 4px 0 10px; }
  .feedback-cat { flex: 1; padding: 9px 6px; border-radius: 10px; border: 1px solid var(--border, #d7dbe6); background: transparent; color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
  .feedback-cat[aria-checked="true"] { background: #4f46e5; border-color: #4f46e5; color: #fff; }
  .merge-size-box { margin: 12px 0 4px; }
  #exportSizeLimitBlock[hidden] { display: none; }
  .export-size-row { display: flex; gap: 8px; margin: 6px 0 4px; }
  .export-size-row[hidden], #exportSizeLimitSection[hidden] { display: none; }
  .export-size-row input { flex: 1; min-width: 0; }
  .export-size-row select { width: 92px; flex: none; }
  /* A file was opened from another app: show only a quiet "Opening your file" screen instead of the home page. */
  #sharedOpening { display: none; }
  html.opening-shared #screen-landing { display: none !important; }
  html.opening-shared #sharedOpening { display: flex; position: fixed; inset: 0; z-index: 300; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: var(--bg); color: var(--text); font-weight: 600; }
  #sharedOpening .shared-spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--border); border-top-color: #2563eb; animation: noduSharedSpin .8s linear infinite; }
  @keyframes noduSharedSpin { to { transform: rotate(360deg); } }
  @media (prefers-reduced-motion: reduce) { #sharedOpening .shared-spinner { animation: none; } }
  .export-format-select { width: 100%; box-sizing: border-box; min-height: 48px; margin: 4px 0 6px; padding: 10px 12px; font: inherit; font-size: 1rem; font-weight: 600; color: var(--text); background: var(--surface-2); border: 2px solid var(--border); border-radius: 12px; cursor: pointer; }
  .export-format-select:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
  /* Highlighted shortcut at the top of the export screen: convert a CDR to an older CorelDRAW version. */
  .cdr-version-top { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; margin: 18px 0 10px; padding: 16px 16px 14px; text-align: left; font: inherit; color: #fff; background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 45%, #06b6d4 100%); border: 0; border-radius: 16px; cursor: pointer; box-shadow: 0 6px 20px rgba(37,99,235,.45), 0 0 0 3px rgba(37,99,235,.25); animation: cdrTopGlow 2.4s ease-in-out infinite; }
  .cdr-version-top:hover:not(:disabled) { filter: brightness(1.08); }
  .cdr-version-top:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
  .cdr-version-top:disabled { opacity: .55; cursor: not-allowed; animation: none; background: var(--surface-2); color: var(--text-dim); box-shadow: none; border: 1px solid var(--border); }
  .cdr-version-top .cvt-new { position: absolute; top: -10px; right: 14px; padding: 3px 10px; border-radius: 999px; background: #f59e0b; color: #1f2937; font-size: .68rem; font-weight: 800; letter-spacing: .06em; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
  .cdr-version-top .cvt-badge { flex: none; min-width: 46px; padding: 9px 0; text-align: center; border-radius: 10px; background: #fff; color: #1d4ed8; font-weight: 900; font-size: .85rem; }
  .cdr-version-top .cvt-text { flex: 1 1 150px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  .cdr-version-top .cvt-text strong { font-size: 1rem; font-weight: 800; }
  .cdr-version-top .cvt-text small { font-size: .78rem; color: rgba(255,255,255,.9); }
  .cdr-version-top:disabled .cvt-text small { color: var(--text-dim); }
  .cdr-version-top .cvt-go { flex: 0 0 auto; padding: 7px 14px; border-radius: 999px; background: #fff; color: #1d4ed8; font-size: .8rem; font-weight: 800; }
  @keyframes cdrTopGlow { 0%, 100% { box-shadow: 0 6px 20px rgba(37,99,235,.45), 0 0 0 3px rgba(37,99,235,.25); } 50% { box-shadow: 0 6px 24px rgba(6,182,212,.6), 0 0 0 7px rgba(6,182,212,.18); } }
  @media (prefers-reduced-motion: reduce) { .cdr-version-top { animation: none; } }
  /* 2026-11-07: on a phone the card is compact (one line of text) so the formats and the Export button stay in view */
  @media (max-width: 600px) { .cdr-version-top { padding: 10px 12px; gap: 8px; margin: 12px 0 6px; } .cdr-version-top .cvt-text small { display: none; } .cdr-version-top .cvt-text strong { font-size: .92rem; } }
  @media (max-width: 560px) { .cdr-version-top .cvt-go { flex: 1 0 100%; text-align: center; } }
  .format-card-mini {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
    border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface-2); padding: 10px 6px; cursor: pointer;
    transition: border-color .15s, background .15s, transform .1s; color: var(--text);
  }
  .format-card-mini:hover:not(:disabled) { border-color: var(--accent-1); transform: translateY(-1px); }
  .format-card-mini.active { border-color: var(--accent-1); background: var(--accent-soft); }
  .format-card-mini:disabled { opacity: .45; cursor: not-allowed; }
  .format-card-mini .fc-badge { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 0.68rem; }
  .format-card-mini .fc-name { font-size: 0.76rem; font-weight: 700; }
  .format-card-mini .fc-sub { font-size: 0.62rem; color: var(--text-faint); line-height: 1.2; }
  .format-card-mini .fc-check {
    position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent-1); color: #fff;
    display: none; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--surface);
  }
  .format-card-mini.active .fc-check { display: flex; }

  .export-range-options { display: flex; flex-direction: column; gap: 8px; }
  .export-radio-card {
    display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface-2);
    padding: 10px 12px; cursor: pointer; font-size: 0.82rem;
  }
  .export-radio-card input { accent-color: var(--accent-1); width: 16px; height: 16px; flex: none; }
  .export-radio-card:has(input:checked) { border-color: var(--accent-1); background: var(--accent-soft); }
  .export-radio-card em { font-style: normal; color: var(--text-faint); }
  #exportPageRange { margin-top: 8px; }
  #exportRangeSection[hidden] { display: none; }

  .export-colormode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .export-res-grid { display: grid; gap: 8px; }
  .export-res-card {
    display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface-2);
    padding: 10px 12px; cursor: pointer; text-align: left; width: 100%; color: var(--text); font-family: inherit;
  }
  .export-res-card .res-icon { flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-1); display: flex; align-items: center; justify-content: center; }
  .export-res-card strong { display: block; font-size: 0.82rem; color: var(--text); }
  .export-res-card span { display: block; font-size: 0.72rem; color: var(--text-faint); }
  .export-res-card .res-tick { margin-left: auto; flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); }
  /* the chosen resolution stands out clearly (owner, 2026-10-28): solid blue with white writing and a white tick */
  .export-res-card.active { border-color: #1463f3; background: #1463f3; box-shadow: 0 6px 16px rgba(20, 99, 243, .3); }
  .export-res-card.active strong, .export-res-card.active span { color: #fff; }
  .export-res-card.active .res-icon { background: rgba(255,255,255,.22); color: #fff; }
  .export-res-card.active .res-tick { border-color: #fff; background: #fff; position: relative; }
  .export-res-card.active .res-tick::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: #1463f3; }
  .export-res-card:not(.active):hover { border-color: #1463f3; }
  .export-res-card:disabled, .export-res-card.disabled { opacity: .5; cursor: not-allowed; }

  .export-anim-toggle { display: flex; gap: 10px; align-items: flex-start; padding: 12px; margin-top: 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
  .export-anim-toggle input { margin-top: 2px; flex: none; }
  .export-anim-toggle span { font-size: 0.8rem; font-weight: 700; }
  .export-anim-toggle small { display: block; font-weight: 400; font-size: 0.74rem; color: var(--text-dim); margin-top: 3px; line-height: 1.5; }
  .export-info-box { display: flex; gap: 10px; align-items: flex-start; background: var(--accent-soft); border-radius: 10px; padding: 12px; margin-top: 14px; }
  .export-info-box svg { flex: none; color: var(--accent-1); margin-top: 1px; }
  .export-info-box strong { display: block; font-size: 0.8rem; color: var(--accent-1); margin-bottom: 3px; }
  .export-info-box p { margin: 0; font-size: 0.74rem; color: var(--text-dim); line-height: 1.5; }

  .export-modal-v2 .export-modal-actions { margin: 0; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surface); }
  @media (max-width: 640px) {
    .export-modal-body { grid-template-columns: 1fr; }
    .export-format-grid, .export-colormode-grid { grid-template-columns: repeat(2, 1fr); }
  }

  /* The ad-gate overlay takes over the entire screen (a real interstitial,
     not a small dialog) so the ad is the only thing on screen while it plays. */
  .ad-gate-overlay {
    background: var(--bg); padding: 0; flex-direction: column;
  }
  .export-thumb { width: 150px; height: 150px; margin: 0 auto 10px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-md); display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 8px; }
  .export-thumb[hidden] { display: none; }
  .export-thumb img, .export-thumb svg, .export-thumb canvas { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
  .export-file-name { margin: 0 0 12px; font-weight: 700; font-size: .92rem; color: var(--text); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .export-stage { margin: 6px 0 0; font-size: .82rem; color: var(--text-dim); min-height: 1.2em; }
  .ad-gate-box {
    position: relative; width: 100%; height: 100%; max-width: none; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center; padding: 24px;
  }
  .ad-gate-kicker { position: absolute; top: 20px; left: 20px; font-size: 0.7rem; font-weight: 700; letter-spacing: .1em; color: var(--text-faint); text-transform: uppercase; }
  .ad-gate-carousel {
    width: min(92vw, 900px); height: min(50vh, 420px); border-radius: var(--radius-lg);
    background: #dcedfb; border: 1px solid #b9d8f2; box-shadow: var(--shadow-lg);
    display: flex; align-items: center; justify-content: center; margin-bottom: 26px;
  }
  :root[data-theme="dark"] .ad-gate-carousel { background: #16324a; border-color: #1f4763; }
  .ad-gate-carousel span { color: #5b6b7a; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; line-height: 1.7; font-size: 1.1rem; }
  :root[data-theme="dark"] .ad-gate-carousel span { color: #9fc3de; }
  .ad-gate-carousel span em { display: block; font-style: normal; font-size: 2.2rem; letter-spacing: .02em; }
  .ad-gate-text { margin: 0 0 18px; font-size: 0.9rem; color: var(--text-dim); }
  .export-progress { width: min(92vw, 480px); height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
  .export-progress-bar { height: 100%; width: 0%; background: var(--accent-grad); transition: width .2s linear; }
  .ad-gate-countdown { margin: 10px 0 0; font-size: 0.82rem; color: var(--text-faint); }
  @media (max-width: 600px) {
    .ad-gate-carousel span { font-size: 0.85rem; }
    .ad-gate-carousel span em { font-size: 1.5rem; }
  }

  /* =========================================================
     Mobile responsiveness
     ========================================================= */
  @media (max-width: 640px) {
    .topbar { padding: 12px 16px; gap: 8px; }
    .brand-icon { width: 80px; height: 80px; border-radius: 11px; }
    .brand-text h1.nodu-wordmark { width: 98px; height: 44px; }
    .brand-text p { display: none; }
    .privacy-pill { padding: 6px 10px; gap: 6px; }
    .privacy-pill strong { font-size: 0.72rem; }
    .privacy-pill .sub { display: none; }
    .script-caption { display: none; }
    .theme-toggle { padding: 3px; }
    .theme-toggle button { width: 26px; height: 26px; }
    .icon-btn { width: 32px; height: 32px; }
    .topbar-divider { display: none; }

    .landing-main { padding: 16px 16px 32px; }
    .hero-grid { gap: 26px; margin-top: 4px; }
    .hero-copy h2 { font-size: 1.7rem; }
    .hero-copy p { font-size: 0.85rem; }
    .hero-quote { font-size: 1.15rem; }
    .upload-card { padding: 16px; }
    .dropzone { padding: 26px 12px; }
    .dropzone h3 { font-size: 1.05rem; }
    .choose-btn { padding: 11px 20px; font-size: 0.88rem; }
    .format-grid { gap: 8px; grid-template-columns: repeat(3, 1fr); }
    .format-card { padding: 10px 4px; }
    .format-badge { width: 38px; height: auto; }
    .steps-bar { padding: 14px; gap: 12px; }
    .steps-bar .doodle-end { display: none; }
    .ad-slot-tall { min-height: 120px; }

    .ad-carousel { height: 96px; }
    .ad-slide span { font-size: 0.66rem; }
    .ad-slide span em { font-size: 0.92rem; }
    .ad-nav { width: 26px; height: 26px; }

    .file-topbar { padding: 10px 14px; gap: 10px; }
    .file-topbar .fname-block h3 { font-size: 0.85rem; max-width: 32vw; }
    .file-topbar .fname-block p { display: none; }
    .file-stats { gap: 12px; }
    .file-stat strong { font-size: 0.76rem; }
    .file-stat span { font-size: 0.62rem; }

    .viewer-toolbar { padding: 8px 10px; gap: 4px; }
    .toolbar-btn { font-size: 0; padding: 0 8px; height: 32px; gap: 0; }
    .toolbar-btn svg { flex: none; }
    #fitBtn, #rotateBtn, #fullscreenBtn { font-size: 0.7rem; gap: 4px; padding: 0 8px; }
    .viewer-toolbar select { font-size: 0.72rem; padding: 5px 6px; }
    .viewer-toolbar .div { margin: 0 2px; }

    .ruler-grid { grid-template-columns: 16px 1fr; grid-template-rows: 16px 1fr; }
    .resize-handle { width: 20px; }

    .sidebar .panel-inner { width: min(78vw, 280px); }
    .panel-col .panel-inner { width: min(80vw, 300px); }

    /* Side panels become full overlay drawers instead of squeezing the
       canvas — two panels open at once would otherwise add up to more
       width than the screen has, overflowing the whole page sideways. */
    .viewer-body { position: relative; overflow: hidden; }
    .sidebar, .panel-col {
      position: fixed !important; top: 0; bottom: 0; width: 82vw !important; max-width: 320px;
      z-index: 60; box-shadow: var(--shadow-lg); transition: transform .25s ease !important;
    }
    .sidebar { left: 0; transform: translateX(-100%); }
    .sidebar.panel-open { transform: translateX(0); }
    .panel-col { right: 0; transform: translateX(100%); }
    .panel-col.panel-open { transform: translateX(0); }
    .resize-handle .handle-grip { display: none; }
    .mobile-backdrop {
      position: fixed; inset: 0; background: rgba(10,12,20,.5); z-index: 55;
    }

    .nodu-banner-text, .cs-card { max-width: 100%; }
    .export-modal, .ad-gate-box { padding: 18px; }
    .export-option { min-width: 56px; font-size: 0.72rem; padding: 8px 6px; }
    .export-modal-actions { flex-direction: column; }
  }
  .mobile-backdrop { display: none; }
  @media (max-width: 640px) { .mobile-backdrop:not([hidden]) { display: block; } }

  @media (max-width: 420px) {
    .file-stat:nth-child(3) { display: none; }
  }

  #backToUploadBtn { font-size: 14px; gap: 8px; min-height: 40px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }

  .viewer-brand-row { display:flex; align-items:center; gap:10px; min-width:0; }
  #screen-viewer > .topbar { padding:8px 16px; }
  #screen-viewer .brand-icon { width:64px; height:64px; }
  #screen-viewer .brand-text h1.nodu-wordmark { width:76px; height:34px; }
  .viewer-back-button { width:40px; height:40px; padding:0; flex-shrink:0; justify-content:center; }
  #moveObjectsBtn { gap:6px; font-size:13px; white-space:nowrap; }
  #screen-viewer { height:100dvh; }
  @media(max-width:640px) {
    #screen-viewer > .topbar { padding:4px 8px; min-height:48px; box-sizing:border-box; gap:4px; flex-wrap:nowrap; }
    .viewer-brand-row { gap:4px; }
    #screen-viewer .brand { gap:3px; }
    #screen-viewer .brand-icon { width:75px; height:75px; }
    #screen-viewer .brand-text h1.nodu-wordmark { width:56px; height:25px; }
    #screen-viewer .topbar-right { flex-wrap:nowrap; gap:4px; }
    #screen-viewer .icon-btn { width:40px; height:40px; }
    #screen-viewer .theme-toggle button { width:28px; height:34px; }
    #screen-viewer .nodu-header { display:none; }
    #previewInfo { margin:3px 10px !important; font-size:10px !important; max-height:26px; overflow:auto; }
    #screen-viewer .viewer-toolbar { flex-wrap:nowrap; overflow-x:auto; overscroll-behavior-x:contain; padding:3px 6px; gap:4px; min-height:46px; box-sizing:border-box; scrollbar-width:thin; }
    #screen-viewer .viewer-toolbar > *, #screen-viewer .viewer-toolbar .grp { flex-shrink:0; flex-wrap:nowrap; }
    #screen-viewer .viewer-toolbar .toolbar-btn { width:40px; min-width:40px; height:40px; min-height:40px; padding:0; justify-content:center; font-size:0 !important; gap:0; }
    #screen-viewer .viewer-toolbar .toolbar-btn span { display:none; }
    #screen-viewer .viewer-toolbar select { height:40px; }
    #screen-viewer .viewer-toolbar .div { display:none; }
    #screen-viewer .viewer-toolbar > .grp[title="Ruler units"] { order:-1; }
    #screen-viewer .viewer-toolbar > .grp[title="Ruler units"] select { min-width:84px; font-size:0.85rem; font-weight:600; }
    #screen-viewer .tip-bar { display:none; }
    #screen-viewer .viewport.has-pages .canvas-surface { padding:10px; }
    .landing-main { padding:10px 12px 20px; }
    .hero-grid { gap:12px; }
    .hero-features,.side-callouts,.steps-bar { display:none; }
    .hero-copy { margin-bottom:12px !important; }
    .hero-copy h2 { font-size:1.35rem; }
    .hero-copy h2 br { display:none; }
    .hero-copy p { margin:7px 0; }
    .upload-card { padding:12px; }
    .dropzone { padding:16px 10px; }
    .dropzone .cloud { width:56px; height:56px; margin-bottom:12px; }
    .object-workspace { width:100%; max-width:100%; height:100dvh; max-height:100dvh; box-sizing:border-box; margin:0; border-radius:0; padding:10px; }
    .object-workspace .toolbar-btn { font-size:12px; min-height:40px; height:auto; padding:8px; }
    .object-workspace h2 { font-size:18px; margin:4px 0; }
    .object-workspace .object-controls { gap:6px; margin:6px 0; }
    .object-workspace p { margin:6px 0; font-size:12px; }
    .object-layout select { height:64px; }
  }

  .page-thumb .page-size { padding:7px 3px 2px 24px; text-align:center; font-size:11px; color:var(--text-dim); line-height:1.4; }
  .opening-stage { font-size:12px; color:var(--text-dim); max-width:260px; margin:8px auto 12px; }
