    :root {
      --bg-root: #0D0D0C;
      --bg-rail: #131311;
      --bg-panel: #181816;
      --bg-elev: #22221F;
      --bg-stage: #090908;
      --border: rgba(245, 242, 235, 0.10);
      --border-strong: rgba(245, 242, 235, 0.22);
      --ink-strong: #F5F2EB;
      --ink-body: #D6D2C8;
      --ink-muted: #8E8A80;
      --accent: #D97706;
      --accent-soft: rgba(217, 119, 6, 0.14);
      color-scheme: dark;
    }
    html[data-theme="light"] {
      --bg-root: #F5F2EB;
      --bg-rail: #ECE8DF;
      --bg-panel: #FFFFFF;
      --bg-elev: #E4DFD3;
      --bg-stage: #DDD8CC;
      --border: rgba(18, 18, 16, 0.11);
      --border-strong: rgba(18, 18, 16, 0.24);
      --ink-strong: #121210;
      --ink-body: #2C2B28;
      --ink-muted: #6B6860;
      --accent: #B45309;
      --accent-soft: rgba(180, 83, 9, 0.12);
      color-scheme: light;
    }
    * { box-sizing: border-box; }
    html, body {
      max-width: 100vw;
      overflow-x: hidden;
    }
    body {
      margin: 0;
      background: var(--bg-root);
      color: var(--ink-body);
      font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
      height: 100vh;
      height: 100dvh;
      overflow: hidden;
    }
    #doc-stage-wrap {
      margin: 0 auto;
      flex-shrink: 0;
    }
    .nx-zoom-hud {
      position: fixed;
      top: 108px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 85;
      padding: 5px 12px;
      border-radius: 999px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 11.5px;
      font-weight: 600;
      background: rgba(18, 18, 16, 0.86);
      color: #F5F2EB;
      border: 1px solid rgba(245, 242, 235, 0.18);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
      pointer-events: none;
      opacity: 0;
      transition: opacity 160ms ease;
    }
    .nx-zoom-hud.is-visible {
      opacity: 1;
    }
    html.is-embedded #media-top-header,
    body.is-embedded #media-top-header,
    html.is-embedded #media-fullscreen-btn,
    body.is-embedded #media-fullscreen-btn {
      display: none !important;
    }
    html.is-embedded:not(.has-active-doc) #doc-studio-toolbar {
      display: none !important;
    }
    @media (max-width: 767px) {
      html.is-embedded.has-active-doc #doc-studio-toolbar {
        height: auto !important;
        min-height: 48px;
        padding-top: calc(5px + var(--safe-top, 0px)) !important;
        padding-bottom: 5px !important;
      }
    }
    html.has-active-doc #doc-toolbar-upload-label {
      display: none !important;
    }
    html.has-active-doc #doc-toolbar-upload-btn {
      background: var(--bg-elev) !important;
      color: var(--ink-body) !important;
      border: 1px solid var(--border) !important;
      padding: 0 !important;
      width: 32px !important;
      min-width: 32px !important;
    }
    #doc-annot-canvas.is-passive-scroll {
      pointer-events: none !important;
      touch-action: pan-x pan-y !important;
    }
    .nx-doc-zoom-pill {
      display: none !important;
    }
    @media (min-width: 1024px) {
      .nx-doc-zoom-pill:not(.hidden) {
        position: absolute;
        right: 16px;
        bottom: max(12px, env(safe-area-inset-bottom, 0px));
        z-index: 29;
        display: inline-flex !important;
        align-items: center;
        gap: 2px;
        padding: 4px;
        background: var(--bg-panel);
        border: 1px solid var(--border-strong);
        border-radius: 13px;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
      }
    }
    .font-editorial { font-family: 'Instrument Serif', Georgia, serif; }
    .font-calligraphy { font-family: 'Cormorant Garamond', 'Times New Roman', serif; }
    .font-mono-tech { font-family: 'JetBrains Mono', monospace; }
    .studio-rail { background: var(--bg-rail); border-color: var(--border); }
    .studio-panel { background: var(--bg-panel); border: 1px solid var(--border); }
    .studio-btn {
      background: var(--bg-elev);
      border: 1px solid var(--border);
      color: var(--ink-body);
      transition: all 140ms ease;
    }
    .studio-btn:hover { border-color: var(--border-strong); color: var(--ink-strong); }
    .studio-btn-active {
      background: var(--accent-soft);
      border-color: var(--accent);
      color: var(--ink-strong);
    }
    .studio-input {
      background: var(--bg-root);
      border: 1px solid var(--border);
      color: var(--ink-strong);
    }
    .studio-input:focus { outline: none; border-color: var(--accent); }
    ::-webkit-scrollbar { width: 6px; height: 6px; }
    ::-webkit-scrollbar-thumb { background: rgba(142, 138, 128, 0.32); border-radius: 999px; }

    /* Open-Source Office, Organize PDF, Present & Export UI */
    .org-thumb-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
      gap: 14px;
    }
    .org-page-card {
      background: var(--bg-panel);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 10px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      transition: border-color 140ms ease, transform 140ms ease;
    }
    .org-page-card:hover { border-color: var(--accent); transform: translateY(-1px); }
    .org-page-thumb {
      background: #FFFFFF;
      border-radius: 6px;
      aspect-ratio: 1 / 1.38;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      border: 1px solid rgba(0,0,0,0.08);
    }
    .org-page-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
    .office-sheet-table { border-collapse: collapse; width: 100%; font-size: 12px; }
    .office-sheet-table th, .office-sheet-table td {
      border: 1px solid var(--border);
      padding: 6px 8px;
      min-width: 110px;
      vertical-align: top;
    }
    .office-sheet-table th {
      background: var(--bg-rail);
      font-family: 'JetBrains Mono', monospace;
      font-size: 11px;
      color: var(--ink-muted);
      text-align: left;
    }
    .office-cell-input {
      width: 100%;
      background: transparent;
      color: var(--ink-strong);
      border: none;
      outline: none;
      font-family: inherit;
      font-size: 12px;
    }
    .office-cell-input:focus { background: var(--accent-soft); border-radius: 3px; }
    .nx-export-menu {
      position: absolute;
      right: 0;
      top: calc(100% + 6px);
      width: 238px;
      max-width: calc(100vw - 20px);
      max-height: min(72vh, 460px);
      overflow-y: auto;
      background: var(--bg-panel);
      border: 1px solid var(--border-strong);
      border-radius: 12px;
      padding: 6px;
      z-index: 60;
      box-shadow: 0 18px 40px rgba(0,0,0,0.45);
    }
    .nx-menu-sep {
      height: 1px;
      margin: 5px 4px;
      background: var(--border);
    }
    .nx-doc-dock {
      position: absolute;
      bottom: max(12px, env(safe-area-inset-bottom, 0px));
      left: 50%;
      transform: translateX(-50%);
      z-index: 30;
      display: flex;
      align-items: center;
      gap: 3px;
      padding: 5px 6px;
      max-width: calc(100vw - 16px);
      overflow-x: auto;
      scrollbar-width: none;
      background: var(--bg-panel);
      border: 1px solid var(--border-strong);
      border-radius: 16px;
      box-shadow: 0 14px 36px rgba(0,0,0,0.42);
    }
    .nx-doc-dock::-webkit-scrollbar { display: none; }
    .nx-dock-btn {
      height: 32px;
      min-width: 32px;
      padding: 0 7px;
      border-radius: 10px;
      font-size: 11.5px;
      font-weight: 500;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      flex-shrink: 0;
      background: transparent;
      border: 1px solid transparent;
      color: var(--ink-body);
      cursor: pointer;
      transition: all 130ms ease;
    }
    .nx-dock-btn:hover { background: var(--bg-elev); color: var(--ink-strong); }
    .nx-dock-btn.studio-btn-active {
      background: var(--accent-soft);
      border-color: var(--accent);
      color: var(--ink-strong);
    }
    .nx-doc-dock.hidden,
    .nx-dock-btn.hidden,
    #doc-page-stepper.hidden {
      display: none !important;
    }
    @media (max-width: 639px) {
      .nx-doc-dock { gap: 2px; padding: 4px 5px; }
      .nx-dock-btn { height: 30px; min-width: 30px; padding: 0 5px; border-radius: 9px; }
    }
    .nx-export-item {
      width: 100%;
      text-align: left;
      padding: 7px 10px;
      border-radius: 8px;
      font-size: 11.5px;
      color: var(--ink-body);
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: transparent;
      border: none;
      cursor: pointer;
    }
    .nx-export-item:hover { background: var(--accent-soft); color: var(--ink-strong); }
    .nx-laser-dot {
      position: fixed;
      width: 14px;
      height: 14px;
      border-radius: 999px;
      background: radial-gradient(circle, #fff 0%, #ef4444 45%, rgba(239,68,68,0) 75%);
      box-shadow: 0 0 14px rgba(239,68,68,0.9);
      pointer-events: none;
      transform: translate(-50%, -50%);
      z-index: 120;
    }
    #doc-scroll-viewport {
      background-image: radial-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px);
      background-size: 22px 22px;
      background-position: -1px -1px;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior: contain;
    }
    #doc-scroll-viewport::-webkit-scrollbar { width: 10px; height: 10px; }
    #doc-scroll-viewport::-webkit-scrollbar-thumb {
      background: rgba(142, 138, 128, 0.48);
      border-radius: 999px;
      border: 2px solid transparent;
      background-clip: padding-box;
    }
    #doc-scroll-viewport::-webkit-scrollbar-thumb:hover {
      background: rgba(217, 119, 6, 0.72);
      border: 2px solid transparent;
      background-clip: padding-box;
    }
    html[data-theme="light"] #doc-scroll-viewport {
      background-image: radial-gradient(rgba(15, 23, 42, 0.08) 1px, transparent 1px);
    }
    #doc-empty-dropzone {
      margin: auto !important;
      box-shadow: 0 24px 64px rgba(0, 0, 0, 0.36);
    }
    html[data-theme="light"] #doc-empty-dropzone {
      box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
    }
    .nx-doc-page-slot {
      position: relative;
      background: #FFFFFF;
      border-radius: 3px;
      box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
      flex-shrink: 0;
      margin: 0 auto;
      transition: box-shadow 150ms ease;
    }
    .nx-doc-page-slot.is-active-page {
      box-shadow: 0 22px 54px rgba(0, 0, 0, 0.5), 0 0 0 2px var(--accent);
    }
    .nx-doc-page-slot > .nx-slot-base,
    .nx-doc-page-slot > .nx-slot-annot {
      width: 100%;
      height: 100%;
      display: block;
    }
    .nx-doc-page-slot > .nx-slot-annot {
      position: absolute;
      inset: 0;
      pointer-events: none;
    }
    .nx-doc-page-slot.is-stage-host > .nx-slot-base,
    .nx-doc-page-slot.is-stage-host > .nx-slot-annot {
      display: none !important;
    }
    .nx-slot-page-pill {
      position: absolute;
      top: 10px;
      right: 10px;
      z-index: 25;
      padding: 2px 8px;
      border-radius: 999px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 10px;
      font-weight: 600;
      background: rgba(18, 18, 16, 0.68);
      color: #F5F2EB;
      pointer-events: none;
      backdrop-filter: blur(6px);
      -webkit-backdrop-filter: blur(6px);
    }
    #doc-thumbs-rail {
      width: 116px;
      min-width: 116px;
      max-width: 116px;
      flex: 0 0 116px;
      padding: 8px 6px;
    }
    @media (max-width: 639px) {
      #doc-thumbs-rail {
        width: 84px;
        min-width: 84px;
        max-width: 84px;
        flex-basis: 84px;
        padding: 6px 4px;
      }
    }
    #doc-thumbs-list { width: 100%; }
    .nx-doc-thumb-btn {
      width: 100%;
      padding: 4px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
      padding: 6px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: var(--bg-panel);
      cursor: pointer;
      transition: border-color 140ms ease, background 140ms ease;
    }
    .nx-doc-thumb-btn:hover { border-color: var(--border-strong); }
    .nx-doc-thumb-btn.is-active {
      border-color: var(--accent);
      background: var(--accent-soft);
    }
    .nx-doc-thumb-canvas-wrap {
      width: 100%;
      aspect-ratio: 1 / 1.414;
      background: #FFFFFF;
      border-radius: 4px;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .nx-doc-thumb-canvas-wrap canvas {
      width: 100%;
      height: 100%;
      display: block;
    }
    #doc-annot-canvas.is-touch-pan {
      touch-action: pan-x pan-y pinch-zoom !important;
    }
