:root {
  color-scheme: light;
  --bg: #f7f2e9;
  --surface: #fffaf2;
  --surface-strong: #ffffff;
  --ink: #111827;
  --muted: #696156;
  --line: rgba(17, 24, 39, 0.14);
  --accent: #b96b22;
  --accent-dark: #7c3f0f;
  --ok: #0f766e;
  --warn: #a16207;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 20% 0%, #fff8eb 0, var(--bg) 45%, #eee8df 100%); color: var(--ink); }
.app-shell { min-height: 100vh; padding: clamp(16px, 2.6vw, 34px); }
button, input, select { font: inherit; }
button, .upload-button { border: 0; border-radius: 999px; padding: 11px 17px; background: var(--ink); color: white; font-weight: 850; cursor: pointer; text-decoration: none; transition: transform 160ms ease, opacity 160ms ease; }
button:hover, .upload-button:hover, .upload-card:hover { transform: translateY(-1px); }
button.secondary { background: rgba(17, 24, 39, 0.08); color: var(--ink); }
input, select { min-width: 150px; border: 1px solid var(--line); border-radius: 999px; padding: 10px 13px; background: var(--surface-strong); color: var(--ink); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.privacy-pill { width: fit-content; padding: 9px 13px; border: 1px solid rgba(15, 118, 110, 0.2); border-radius: 999px; background: rgba(15, 118, 110, 0.08); color: var(--ok); font-size: 13px; font-weight: 850; letter-spacing: 0.02em; }
.landing-shell { min-height: calc(100vh - 180px); max-width: 1040px; margin: 0 auto; display: grid; place-items: center; gap: 34px; text-align: center; }
.landing-copy { display: grid; justify-items: center; gap: 18px; }
.landing-copy h1 { margin: 0; max-width: 850px; font-size: clamp(56px, 11vw, 128px); line-height: 0.9; letter-spacing: -0.085em; }
.landing-copy p { margin: 0; max-width: 560px; color: var(--muted); font-size: clamp(18px, 2vw, 23px); line-height: 1.45; }
.upload-card { width: min(100%, 520px); min-height: 190px; display: grid; place-items: center; gap: 10px; padding: 34px; border: 2px dashed rgba(185, 107, 34, 0.55); border-radius: 34px; background: rgba(255, 250, 242, 0.86); box-shadow: 0 28px 90px rgba(17, 24, 39, 0.11); cursor: pointer; }
.upload-card input { display: none; }
.upload-card strong { font-size: clamp(30px, 4vw, 48px); letter-spacing: -0.05em; }
.upload-card small { color: var(--muted); font-size: 15px; }
.upload-icon { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--ink); color: white; font-size: 34px; line-height: 1; }
.simple-steps { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 0; padding: 0; list-style: none; color: var(--muted); }
.simple-steps li { display: flex; gap: 8px; align-items: center; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 250, 242, 0.7); }
.simple-steps strong { color: var(--accent-dark); }
.landing-status-row { width: min(100%, 620px); display:flex; align-items:center; justify-content:space-between; gap:12px; margin:-16px auto 0; padding:10px 12px; border:1px solid var(--line); border-radius:16px; background:rgba(255,250,242,0.82); color:var(--muted); font-size:13px; font-weight:800; }
.landing-status { display:inline-flex; align-items:center; gap:8px; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.landing-status.is-loading::before { content:""; width:12px; height:12px; border-radius:999px; border:2px solid #fed7aa; border-top-color:var(--accent-dark); animation: render-progress-spin .84s linear infinite; flex:0 0 auto; }
.topbar { max-width: 1680px; margin: 0 auto 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.topbar div { display: grid; gap: 3px; }
.topbar strong { font-size: 20px; letter-spacing: -0.035em; }
.topbar span, .eyebrow { color: var(--muted); font-size: 13px; }
.editor-layout { max-width: 1680px; margin: 0 auto; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 22px; align-items: start; }
.page-rail { position: sticky; top: 20px; display: grid; gap: 12px; }
.page-rail h2 { margin: 0; font-size: 18px; letter-spacing: -0.04em; }
.thumbnail-list { display: grid; gap: 8px; }
.thumbnail { width: 100%; display: grid; gap: 4px; text-align: left; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 250, 242, 0.75); color: var(--ink); }
.thumbnail.active { border-color: rgba(185, 107, 34, 0.72); background: #fff7e8; }
.thumbnail small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.virtualized-note { margin: 0; color: var(--muted); font-size: 13px; }
.workspace { min-width: 0; display: grid; gap: 14px; }
.document-header { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.document-header h1 { margin: 0; max-width: 980px; font-size: clamp(28px, 3.6vw, 48px); line-height: 0.98; letter-spacing: -0.065em; word-break: break-word; }
.document-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.status { min-height: 24px; margin: 10px 0 0; color: var(--muted); }
.text-object { padding: 2px 6px; border-radius: 7px; background: #ffe8bf; color: var(--ink); }
.viewer-bar, .primary-edit-panel, .advanced-panel, .change-summary { border: 1px solid var(--line); border-radius: 24px; background: rgba(255, 250, 242, 0.82); backdrop-filter: blur(14px); }
.viewer-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px; }
.compact-bar button { padding: 9px 13px; }
.pdf-render-surface { position: relative; overflow: auto; max-width: 100%; min-height: min(82vh, 1120px); margin: 0; border: 1px solid rgba(17, 24, 39, 0.18); border-radius: 28px; background: #d9d4cb; box-shadow: 0 24px 80px rgba(17, 24, 39, 0.14); }
#pdf-canvas { display: block; background: white; box-shadow: 0 10px 32px rgba(17, 24, 39, 0.14); }
.alignment-guide { position: absolute; border: 2px solid rgba(185, 107, 34, 0.75); background: rgba(185, 107, 34, 0.08); pointer-events: none; }
.text-hitbox { position: absolute; z-index: 8; display: grid; place-items: center; overflow: hidden; padding: 0; border: 1px solid transparent; border-radius: 2px; background: transparent; color: transparent; cursor: text; }
.text-hitbox:not(.pdfjs-text-hitbox):not(.annotation-text-hitbox) { z-index: 30; }
.text-hitbox:hover, .text-hitbox.selected { border-color: rgba(185, 107, 34, 0.55); background: transparent; color: transparent; }
.text-hitbox span { display: none; }
.render-placeholder { position: absolute; left: 16px; right: 16px; bottom: 16px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.88); color: var(--muted); font-size: 13px; backdrop-filter: blur(8px); }
.render-progress {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(460px, calc(100% - 24px));
  margin: 0;
  padding: 11px 13px;
  border: 1px solid rgba(17, 24, 39, 0.16);
  border-radius: 16px;
  background: rgba(255, 250, 242, 0.96);
  color: var(--ink);
  box-shadow: 0 16px 46px rgba(17, 24, 39, 0.16);
  backdrop-filter: blur(12px);
}
.render-progress[hidden] { display: none; }
.render-progress.is-subtle { opacity: 0.94; }
.render-progress-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid rgba(17, 24, 39, 0.16);
  border-top-color: var(--accent-dark);
  border-radius: 50%;
  animation: render-progress-spin 840ms linear infinite;
}
.render-progress-copy { display: grid; gap: 2px; min-width: 0; }
.render-progress-copy strong { font-size: 13px; line-height: 1.15; }
.render-progress-copy small { color: var(--muted); font-size: 12px; line-height: 1.2; }
@keyframes render-progress-spin {
  to { transform: rotate(360deg); }
}
.primary-edit-panel { display: grid; grid-template-columns: minmax(180px, 0.8fr) minmax(240px, 1fr) auto; align-items: center; gap: 12px; padding: 14px; }
.primary-edit-panel label { font-weight: 850; }
.primary-edit-panel p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.advanced-panel { padding: 0; overflow: hidden; }
.advanced-panel summary { padding: 14px 16px; cursor: pointer; font-weight: 850; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 0 14px 14px; }
.compact-tools button, .compact-tools input { font-size: 14px; padding: 9px 12px; }
.compact-capability { display: grid; gap: 8px; padding: 0 16px 16px; color: var(--muted); }
.compact-capability strong { color: var(--accent-dark); }
.large-mode { color: var(--warn); font-weight: 750; }
.change-summary { padding: 0 16px 16px; border: 0; background: transparent; }
.change-counts { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); }
.change-list { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 8px; }
.change-list li span { display: block; color: var(--muted); margin-top: 3px; }
.empty-state { margin: 10px 0 0; color: var(--muted); }
.diff { border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: rgba(255, 255, 255, 0.62); color: var(--muted); overflow-x: auto; }
.site-footer { max-width: 1680px; margin: 24px auto 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 10px; }
.site-footer a { color: var(--ink); font-weight: 750; text-decoration: none; }
.site-footer a:hover { color: var(--accent-dark); text-decoration: underline; }
.site-footer p { margin: 0; max-width: 780px; line-height: 1.6; }
@media (max-width: 860px) {
  .app-shell { padding: 18px; }
  .landing-shell { min-height: auto; padding: 36px 0; }
  .topbar, .document-header { align-items: stretch; flex-direction: column; }
  .editor-layout { grid-template-columns: 1fr; }
  .page-rail { position: static; }
  .primary-edit-panel { grid-template-columns: 1fr; }
  .document-actions { justify-content: flex-start; }
}

.document-actions button { min-width: 120px; }
.document-actions .secondary { min-width: 112px; }
.disabled-edit-panel { opacity: 0.78; }
.disabled-edit-panel input, .disabled-edit-panel button { cursor: not-allowed; opacity: 0.62; }
@media (min-width: 1200px) {
  .minimal-workspace { grid-template-columns: minmax(0, 1fr) 220px; align-items: start; }
  .document-header, .viewer-bar, .pdf-render-surface, .primary-edit-panel { grid-column: 1; }
  .advanced-panel { grid-column: 2; }
  .advanced-panel summary { padding: 12px 14px; }
  .compact-tools { display: grid; grid-template-columns: 1fr; }
  .compact-tools input, .compact-tools button { width: 100%; min-width: 0; }
}
/* Workspace-first editing pass: keep the PDF canvas near full-window size. */
.editor-layout { width: calc(100vw - 28px); max-width: none; grid-template-columns: 108px minmax(0, 1fr); gap: 14px; }
.topbar { width: calc(100vw - 28px); max-width: none; padding-bottom: 10px; margin-bottom: 10px; }
.page-rail h2 { font-size: 16px; }
.thumbnail { padding: 10px; border-radius: 14px; }
.thumbnail span { font-size: 14px; }
.thumbnail small { font-size: 11px; }
.document-header { align-items: end; }
.document-header h1 { max-width: 760px; font-size: clamp(22px, 2.5vw, 36px); letter-spacing: -0.055em; }
.status { max-width: 900px; font-size: 15px; line-height: 1.35; }
.viewer-bar { max-width: 980px; }
.pdf-render-surface { width: calc(100vw - 164px) !important; min-height: 90vh !important; }
.primary-edit-panel { max-width: 980px; }
.site-footer { width: calc(100vw - 28px); max-width: none; }
.page-edit-popover { position: absolute; z-index: 8; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px; border: 1px solid rgba(17, 24, 39, 0.22); border-radius: 16px; background: rgba(255, 250, 242, 0.96); box-shadow: 0 18px 48px rgba(17, 24, 39, 0.18); backdrop-filter: blur(10px); }
.page-edit-popover label { grid-column: 1 / -1; font-size: 12px; font-weight: 850; color: var(--accent-dark); text-transform: uppercase; letter-spacing: 0.04em; }
.page-edit-popover input { width: 100%; min-width: 0; border-radius: 12px; }
.page-edit-popover button { border-radius: 12px; padding: 10px 13px; }
.no-source-edit-notice { position: absolute; z-index: 7; left: 18px; top: 18px; max-width: 430px; padding: 12px 14px; border: 1px solid rgba(17, 24, 39, 0.18); border-radius: 16px; background: rgba(255, 250, 242, 0.94); color: var(--muted); box-shadow: 0 14px 40px rgba(17, 24, 39, 0.12); }
@media (min-width: 1200px) {
  .minimal-workspace { grid-template-columns: minmax(0, 1fr); }
  .document-header, .viewer-bar, .pdf-render-surface, .primary-edit-panel, .advanced-panel { grid-column: 1; }
  .compact-tools { display: flex; }
  .compact-tools input, .compact-tools button { width: auto; min-width: 0; }
}
@media (max-width: 860px) {
  .editor-layout, .topbar, .site-footer { width: auto; }
  .pdf-render-surface { width: 100% !important; min-height: 72vh !important; }
}

/* Full-canvas editor pass: keep chrome tiny and make the PDF the product. */
body { overflow-x: hidden; }
.app-shell { padding: 8px; }
.topbar { display: none; }
.editor-layout { width: calc(100vw - 16px); grid-template-columns: 88px minmax(0, 1fr); gap: 8px; }
.page-rail { top: 8px; gap: 8px; }
.page-rail h2 { font-size: 13px; }
.thumbnail { padding: 8px; border-radius: 13px; }
.thumbnail span { font-size: 13px; }
.thumbnail small { font-size: 10px; }
.workspace { gap: 6px; }
.document-header { min-height: 36px; align-items: center; gap: 8px; }
.document-header .eyebrow { display: none; }
.document-header h1 { max-width: min(58vw, 780px); font-size: clamp(17px, 2vw, 24px); line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.045em; }
.status { min-height: 0; margin: 4px 0 0; max-width: min(64vw, 980px); font-size: 12px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.document-actions { flex-wrap: nowrap; }
.document-actions button, .document-actions .secondary { min-width: 0; padding: 8px 13px; font-size: 13px; }
.viewer-bar { max-width: none; padding: 5px; border-radius: 18px; gap: 6px; }
.viewer-bar span { font-size: 13px; }
.compact-bar button { padding: 7px 11px; font-size: 13px; }
.viewer-bar select { min-width: 150px; padding: 8px 12px; font-size: 13px; }
.pdf-render-surface { width: calc(100vw - 112px) !important; min-height: calc(100vh - 78px) !important; border-radius: 18px; cursor: text; }
.primary-edit-panel { display: none; }
.advanced-panel { display: none; }
.site-footer { display: none; }
.no-source-edit-notice { left: 12px; top: 12px; max-width: 360px; padding: 9px 11px; border-radius: 13px; font-size: 13px; pointer-events: none; }
.page-edit-popover { z-index: 10; }
.page-text-draft { position: absolute; z-index: 11; display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 7px; padding: 7px; border: 1px solid rgba(17, 24, 39, 0.22); border-radius: 14px; background: rgba(255, 250, 242, 0.96); box-shadow: 0 16px 44px rgba(17, 24, 39, 0.18); backdrop-filter: blur(10px); }
.page-text-draft input { width: 100%; min-width: 0; border-radius: 10px; padding: 9px 11px; }
.page-text-draft button { border-radius: 10px; padding: 9px 12px; }
.page-text-annotation { position: absolute; z-index: 7; color: var(--ink); font-weight: 500; line-height: 1.04; white-space: pre; overflow: visible; pointer-events: none; text-shadow: 0 1px 0 rgba(255,255,255,0.32); transform: translateY(-0.03em); }
.page-text-annotation-bg { position: absolute; z-index: 6; background: #fff; pointer-events: none; }
@media (max-width: 860px) {
  .app-shell { padding: 6px; }
  .editor-layout { width: auto; grid-template-columns: 1fr; }
  .page-rail { display: none; }
  .document-header { align-items: flex-start; }
  .document-header h1, .status { max-width: 100%; }
  .pdf-render-surface { width: 100% !important; min-height: calc(100vh - 132px) !important; }
}

/* Vertical-compression fix: preserve horizontal workspace, remove stacked header bulk. */
.app-shell { padding: 6px 20px 10px; }
.editor-layout-live { width: calc(100vw - 40px); grid-template-columns: 150px minmax(0, 1fr); gap: 18px; }
.compact-doc-header { display: grid; grid-template-columns: minmax(180px, 280px) minmax(260px, 1fr) auto auto auto; align-items: center; min-height: 34px; gap: 8px; padding: 0; }
.file-chip { min-width: 0; font-size: 13px; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compact-doc-header .status { margin: 0; max-width: none; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compact-doc-header .upload-button, .compact-doc-header button { padding: 7px 12px; font-size: 13px; line-height: 1; min-width: 0; }
.viewer-bar.compact-bar { min-height: 34px; padding: 4px; border-radius: 16px; }
.viewer-bar.compact-bar button { padding: 6px 10px; font-size: 13px; line-height: 1; }
.viewer-bar.compact-bar select { padding: 6px 10px; min-width: 128px; font-size: 13px; }
.edit-affordance { margin-left: auto; color: var(--accent-dark); font-weight: 800; }
.pdf-render-surface { width: calc(100vw - 208px) !important; min-height: calc(100vh - 54px) !important; }
.no-source-edit-notice { top: 10px; left: 10px; }
@media (max-width: 860px) {
  .app-shell { padding: 6px; }
  .editor-layout-live { width: auto; grid-template-columns: 1fr; }
  .compact-doc-header { grid-template-columns: 1fr auto; }
  .compact-doc-header .status { grid-column: 1 / -1; }
  .compact-doc-header .upload-button { display: none; }
  .pdf-render-surface { width: 100% !important; min-height: calc(100vh - 104px) !important; }
}

/* Continuous fit-to-width document view: no sideways editing. */
.continuous-pdf-surface { display: grid; justify-items: center; align-content: start; gap: 18px; overflow-x: hidden !important; overflow-y: auto; padding: 16px; }
.pdf-page-frame { position: relative; max-width: 100%; background: white; border-radius: 14px; box-shadow: 0 14px 42px rgba(17, 24, 39, 0.18); overflow: hidden; cursor: text; }
.pdf-page-frame.active-page-frame { outline: 2px solid rgba(185, 107, 34, 0.34); outline-offset: 3px; }
.pdf-canvas { position: relative; z-index: 0; display: block; max-width: 100%; height: auto !important; background: white; pointer-events: none; }
.continuous-pdf-surface .render-placeholder { position: sticky; left: 12px; right: auto; bottom: 12px; width: fit-content; max-width: min(420px, 80vw); }
@media (max-width: 860px) {
  .continuous-pdf-surface { padding: 10px; gap: 12px; }
}

/* Direct-on-page editing: no modal, no Add button. */
.page-edit-popover, .page-text-draft { display: contents; }
/* Source edits rewrite the actual PDF text on commit. While focused, this tight mask only hides the old canvas glyphs so users do not see doubled text. */
.source-inline-editor {
  background: #fff !important;
  box-shadow: 0 0 0 2px #fff !important;
  padding: 0 !important;
  z-index: 90 !important;
  pointer-events: auto !important;
}
.no-source-edit-notice { display: none; }

.committed-source-preview {
  position: absolute;
  z-index: 88;
  padding: 0;
  border: 0;
  background: #fff;
  color: #111827;
  line-height: 1.12;
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
  box-shadow: 0 0 0 2px #fff;
}

/* Replacement mode: make the editor feel like the PDF text itself, not a form. */
.page-inline-text-input {
  position: absolute;
  z-index: 80;
  pointer-events: auto !important;
  user-select: text;
  -webkit-user-select: text;
  display: inline-block;
  min-width: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #111827;
  box-shadow: none;
  outline: none;
  caret-color: #111827;
  font-family: Arial, Helvetica, ui-sans-serif, system-ui, sans-serif;
  font-weight: 500;
  line-height: 1.12;
  white-space: pre;
  overflow: hidden;
  width: max-content;
  max-width: none;
}
.page-inline-text-input:focus { outline: none; }
.page-inline-text-input:empty::before { content: ""; display: inline-block; width: 1px; }
.visual-replace-inline-editor { background: transparent; }
input.page-inline-text-input {
  appearance: none !important;
  display: block !important;
  line-height: 1.12 !important;
  box-sizing: content-box !important;
  white-space: nowrap !important;
}
.pdfjs-text-hitbox { z-index: 16; border-color: transparent; background: transparent; }
.annotation-text-hitbox { z-index: 17; border-color: transparent; background: transparent; }
.pdfjs-text-hitbox:hover, .annotation-text-hitbox:hover { border-color: rgba(185, 107, 34, 0.35); background: transparent; }
.page-text-annotation { padding: 0 1px; }
.download-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: min(360px, calc(100vw - 36px));
  padding: 13px 16px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  box-shadow: 0 18px 42px rgba(17, 24, 39, 0.22);
  font-weight: 800;
}

.app-version-badge {
  position: fixed;
  left: 10px;
  bottom: 8px;
  z-index: 60;
  max-width: min(520px, calc(100vw - 20px));
  padding: 4px 8px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.88);
  color: var(--muted);
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.1);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
  pointer-events: none;
  backdrop-filter: blur(8px);
}
@media (max-width: 860px) {
  .app-version-badge { font-size: 10px; opacity: 0.86; }
}

.body-inline-editor {
  position: fixed !important;
  z-index: 2147483647 !important;
  pointer-events: auto !important;
  user-select: text !important;
  -webkit-user-select: text !important;
}

/* Go-backed editor compatibility: keep the original JUST FREE PDF shell while using the new renderer. */
[hidden] { display: none !important; }
.landing-upload-form { display: contents; }
.editor-layout-live .page-rail { display: grid; }
.editor-layout-live { grid-template-columns: minmax(112px, 150px) minmax(0, 1fr); }
.editor-layout-live .minimal-workspace { grid-column: 1; }
.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(220px, 17vw, 260px);
  gap: 10px;
  min-height: 0;
}
.inspector {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 250, 242, 0.82);
  backdrop-filter: blur(14px);
}
.history { display: grid; gap: 10px; min-width: 0; }
.history h2 { font-size: 16px; }
.history ol { display: grid; gap: 8px; margin: 0; padding-left: 18px; }
.history li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.history strong { display: block; margin-bottom: 4px; font-size: 13px; }
.history span { color: var(--muted); display: block; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.precision-panel {
  display: grid;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.precision-panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.precision-panel h2 {
  margin: 0;
  font-size: 16px;
}
.precision-panel-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.precision-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.precision-fields label,
.precision-view-options label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}
.precision-fields input,
.precision-fields select,
.precision-view-options input {
  width: 100%;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 12px;
}
.precision-align-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.precision-align-tools button {
  min-width: 0;
  padding: 7px 6px;
  border-radius: 8px;
  font-size: 11px;
}
.precision-view-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.precision-view-options label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 6px;
}
.precision-view-options input[type="checkbox"] {
  width: 14px;
  min-width: 14px;
  height: 14px;
  padding: 0;
}
.pdf-stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
  width: 100%;
  min-height: 640px;
}
.pdf-page-stage {
  position: relative;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 14px 42px rgba(17, 24, 39, 0.18);
  overflow: hidden;
}
.pdf-page-stage.is-page-rotated {
  overflow: visible;
}
.pdf-page-stage.is-page-rotated > * {
  pointer-events: none;
}
.page-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.annotation-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pdf-annotation {
  position: absolute;
  box-sizing: border-box;
  pointer-events: none;
}
.pdf-annotation-highlight {
  background: #ffe45c;
  mix-blend-mode: multiply;
}
.pdf-annotation-underline,
.pdf-annotation-strikeout {
  border-color: #dc2626;
  border-style: solid;
}
.pdf-annotation-comment {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 7px 9px;
  border: 1px solid rgba(146, 64, 14, 0.46);
  border-radius: 8px;
  background: #fff4b8;
  color: #111827;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.14);
  font: 12px/1.25 Arial, Helvetica, sans-serif;
  overflow: hidden;
}
.pdf-annotation-shape {
  border-style: solid;
  background: transparent;
}
.pdf-annotation-line,
.pdf-annotation-ink {
  overflow: visible;
}
.page-extractability-notice {
  position: absolute;
  z-index: 32;
  left: 12px;
  top: 12px;
  max-width: min(430px, calc(100% - 24px));
  padding: 9px 11px;
  border: 1px solid rgba(17, 24, 39, 0.16);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.96);
  color: var(--muted);
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.12);
  font-size: 12px;
  line-height: 1.35;
  pointer-events: none;
}
.editable-text-layer,
.overlay-layer,
.ocr-layer,
.form-layer,
.annotation-layer,
.redaction-layer {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}
.editable-text-layer { z-index: 40; }
.overlay-layer { z-index: 30; pointer-events: none; }
.ocr-layer { z-index: 48; pointer-events: none; }
.form-layer { z-index: 45; pointer-events: none; }
.annotation-layer { z-index: 35; pointer-events: none; }
.redaction-layer { z-index: 57; pointer-events: none; }
.object-layer {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}
.precision-grid-layer,
.page-ruler,
.precision-guide-line {
  position: absolute;
  pointer-events: none;
}
.precision-grid-layer {
  inset: 0;
  z-index: 3;
  background-image:
    linear-gradient(to right, rgba(37, 99, 235, 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(37, 99, 235, 0.12) 1px, transparent 1px);
}
.page-ruler {
  z-index: 54;
  background: rgba(17, 24, 39, 0.72);
}
.page-ruler-top {
  left: 0;
  top: 0;
  right: 0;
  height: 12px;
  background-image: repeating-linear-gradient(to right, rgba(255,255,255,0.75) 0 1px, transparent 1px 24px);
}
.page-ruler-left {
  left: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  background-image: repeating-linear-gradient(to bottom, rgba(255,255,255,0.75) 0 1px, transparent 1px 24px);
}
.precision-guide-line {
  z-index: 55;
  background: rgba(37, 99, 235, 0.68);
}
.precision-guide-x {
  top: 0;
  bottom: 0;
  width: 1px;
}
.precision-guide-y {
  left: 0;
  right: 0;
  height: 1px;
}
.pdf-textbox-object {
  position: absolute;
  box-sizing: border-box;
  min-width: 40px;
  padding: 2px 4px;
  border: 1px solid transparent;
  background: transparent;
  color: #000;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
  outline: none;
  cursor: move;
  pointer-events: auto;
}
.pdf-textbox-object:focus,
.pdf-textbox-object.is-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}
.pdf-textbox-object.is-dragging {
  user-select: none;
  -webkit-user-select: none;
}
.pdf-textbox-resize-handle {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 10px;
  height: 10px;
  border: 1px solid #fff;
  background: #2563eb;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.28);
  cursor: nwse-resize;
  pointer-events: auto;
  touch-action: none;
  z-index: 2;
}
.ocr-status {
  position: absolute;
  left: 14px;
  top: 48px;
  z-index: 2;
  max-width: min(430px, calc(100% - 28px));
  padding: 8px 10px;
  border: 1px solid rgba(20, 83, 45, 0.28);
  border-radius: 8px;
  background: rgba(240, 253, 244, 0.96);
  color: #14532d;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.1);
  font-size: 12px;
  line-height: 1.35;
  pointer-events: none;
}
.ocr-status.is-unavailable,
.ocr-status.is-low-confidence {
  border-color: rgba(146, 64, 14, 0.3);
  background: rgba(255, 251, 235, 0.96);
  color: #92400e;
}
.ocr-review-box,
.ocr-overlay-object {
  position: absolute;
  box-sizing: border-box;
  color: #111827;
  font-family: Helvetica, Arial, sans-serif;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  pointer-events: auto;
}
.ocr-review-box {
  padding: 1px 3px;
  border: 1px dashed rgba(20, 83, 45, 0.84);
  background: rgba(220, 252, 231, 0.24);
  cursor: pointer;
  overflow: hidden;
}
.ocr-review-box.is-low-confidence {
  border-color: rgba(217, 119, 6, 0.92);
  background: rgba(254, 243, 199, 0.38);
}
.ocr-overlay-object {
  padding: 1px 3px;
  border: 1px solid rgba(37, 99, 235, 0.34);
  background: transparent;
  outline: none;
  cursor: text;
}
.ocr-overlay-object:focus,
.ocr-overlay-object.is-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.22);
}
.pdf-redaction-mark {
  position: absolute;
  box-sizing: border-box;
  padding: 0;
  border: 1px solid #111827;
  background: #000;
  cursor: pointer;
  pointer-events: auto;
}
.pdf-redaction-mark.is-selected {
  outline: 2px solid #f59e0b;
  outline-offset: 2px;
}
.pdf-form-field {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(45, 55, 72, 0.62);
  background: rgba(255, 255, 255, 0.96);
  color: #111827;
  outline: none;
  pointer-events: auto;
  cursor: text;
}
.pdf-form-field.is-selected {
  border-color: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.18);
}
.pdf-form-field[data-field-kind="checkbox"],
.pdf-form-field[data-field-kind="radio"] {
  background: transparent;
  border: 0;
  cursor: pointer;
}
.professional-panel {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(17, 24, 39, 0.1);
}
.professional-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.professional-panel-header h2 {
  margin: 0;
}
.professional-panel-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.professional-summary {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
}
.professional-summary div {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 8px;
  align-items: start;
}
.professional-summary dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.professional-summary dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.professional-list {
  margin: 10px 0 0;
  padding-left: 20px;
}
.professional-list li {
  margin: 6px 0;
  font-size: 12px;
}
.professional-list strong,
.professional-list span {
  display: block;
  overflow-wrap: anywhere;
}
.professional-empty {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.pdf-form-text-input {
  width: 100%;
  height: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 2px 4px;
  background: transparent;
  color: #111827;
  outline: none;
}
.pdf-form-choice-box {
  position: relative;
  flex: 0 0 auto;
  display: inline-block;
  border: 1.2px solid rgba(45, 55, 72, 0.72);
  background: #fff;
}
.pdf-form-choice-box.is-checked::after {
  content: "";
  position: absolute;
  left: 22%;
  top: 10%;
  width: 42%;
  height: 68%;
  border: solid #0f766e;
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}
.pdf-form-label {
  color: #111827;
  white-space: nowrap;
  pointer-events: none;
}
.pdf-form-resize-handle {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 10px;
  height: 10px;
  border: 1px solid #fff;
  background: #0f766e;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.28);
  cursor: nwse-resize;
  pointer-events: auto;
}
.committed-text-preview {
  position: absolute;
  z-index: 20;
  display: block;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: visible;
  white-space: pre-wrap;
  overflow-wrap: normal;
  word-break: normal;
  line-height: 1.18;
  color: #000;
  -webkit-text-fill-color: #000;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  background: #fff;
  pointer-events: none;
}
.reflow-mask {
  z-index: 1;
}
.committed-text-preview-line {
  position: absolute;
  left: 0;
  top: 0;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  white-space: pre;
}
.editable-text-run {
  position: absolute;
  z-index: 12;
  display: block;
  min-width: 2px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  outline: none;
  cursor: text;
  pointer-events: auto;
  user-select: none;
  appearance: none;
}
.inline-text-editor {
  position: absolute;
  z-index: 30;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #000;
  box-shadow: none;
  outline: none;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.18;
  caret-color: #000;
  -webkit-text-fill-color: #000;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  appearance: none;
}
.inline-text-editor:focus { outline: none; box-shadow: none; }
.inline-list-edit-marker {
  position: absolute;
  z-index: 31;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #111827;
  white-space: pre;
  pointer-events: none;
  font-weight: 400;
}
.inline-edit-mask {
  position: absolute;
  z-index: 29;
  display: block;
  background: #fff;
  pointer-events: none;
}
.direct-edit-mask {
  z-index: 1;
}
.model-page-stage {
  background: #fff;
}
.model-page-stage.is-virtualized-page::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #fff;
  pointer-events: none;
}
.model-text-layer {
  background: transparent;
}
.hybrid-model-text-layer {
  background: transparent;
}
.hybrid-model-page-stage .model-line {
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.hybrid-model-page-stage .model-line:focus,
.hybrid-model-page-stage .model-line.is-direct-editing,
.hybrid-model-page-stage .model-line.is-direct-editing-marker,
.hybrid-model-page-stage .model-line.has-direct-edit {
  color: #000;
  -webkit-text-fill-color: #000;
  z-index: 2;
}
.hybrid-model-page-stage .model-editable-run.is-direct-editing-pristine .model-line.is-direct-editing,
.hybrid-model-page-stage .model-editable-run.is-direct-editing-pristine .model-line.is-direct-editing-marker {
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.hybrid-model-page-stage .model-line.is-hidden-by-edit {
  visibility: hidden;
}
.model-line {
  position: absolute;
  z-index: 2;
  margin: 0;
  padding: 0;
  color: #000;
  -webkit-text-fill-color: #000;
  white-space: pre;
  pointer-events: auto;
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 400;
  border: 0;
  outline: none;
  caret-color: #000;
  user-select: text;
  -webkit-user-select: text;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}
.model-line:focus { outline: none; }
.model-editable-run .model-line {
  pointer-events: auto;
}
.model-line-list-marker,
.model-line-list-body {
  font-family: Helvetica, Arial, sans-serif;
}
.model-line.is-hidden-by-edit {
  visibility: hidden;
}
.model-editable-run {
  z-index: 12;
  user-select: text;
  -webkit-user-select: text;
}
.model-editable-run[data-direct-editing="true"] {
  z-index: 42;
  pointer-events: none;
}
.model-editable-run[data-direct-editing="true"] .model-line {
  pointer-events: auto;
}
.model-editable-run:hover,
.model-editable-run:focus {
  box-shadow: 0 0 0 1px rgba(185, 107, 34, 0.45);
}
.status-panel dl { margin: 0; display: grid; gap: 9px; }
.status-panel dl div { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); padding-bottom: 9px; }
.status-panel dt { color: var(--muted); }
.status-panel dd { margin: 0; text-align: right; word-break: break-word; }
@media (max-width: 960px) {
  .editor-grid { grid-template-columns: 1fr; }
}

/* Final mode-scoped overrides. The original project CSS uses :has() for the old app,
   but this Go page keeps both landing and editor DOM mounted, so body classes decide. */
body.is-landing .app-shell {
  padding: clamp(18px, 3vw, 40px);
  background: #f2efe6;
}
body.is-landing .site-footer {
  display: block !important;
  width: min(1180px, 100%) !important;
  text-align: center;
}
body.is-landing .site-footer nav { justify-content: center; }
body.is-landing .site-footer p { margin-left: auto; margin-right: auto; }

body.is-editor .app-shell {
  padding: 6px 12px 10px !important;
  overflow-x: hidden;
  background: #f6f4ee;
}
body.is-editor .editor-layout-live {
  width: 100% !important;
  max-width: 100% !important;
  display: grid !important;
  grid-template-columns: minmax(112px, 150px) minmax(0, 1fr) !important;
  gap: 6px !important;
  overflow: hidden !important;
}
body.is-editor .editor-layout-live .page-rail {
  display: grid !important;
  grid-column: 1 !important;
  max-height: calc(100vh - 24px);
  overflow: auto;
}
body.is-editor.is-thumbnails-hidden .editor-layout-live {
  grid-template-columns: minmax(0, 1fr) !important;
}
body.is-editor.is-thumbnails-hidden .editor-layout-live .page-rail {
  display: none !important;
}
body.is-editor .editor-layout-live .workspace {
  grid-column: 2 !important;
  min-width: 0 !important;
  display: grid !important;
  gap: 6px !important;
  overflow: hidden !important;
}
body.is-editor.is-thumbnails-hidden .editor-layout-live .workspace {
  grid-column: 1 !important;
}
body.is-editor .page-nav,
body.is-editor .zoom-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
body.is-editor .page-jump {
  display: contents;
}
body.is-editor .page-jump input {
  width: 54px;
  min-width: 54px;
  padding: 6px 8px;
  border-radius: 10px;
  text-align: center;
}
body.is-editor .page-total,
body.is-editor .zoom-label {
  min-width: max-content;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
body.is-editor .zoom-label {
  min-width: 64px;
  text-align: center;
}
body.is-editor .icon-button {
  min-width: 34px !important;
}
body.is-editor .viewer-bar.compact-bar button.active,
body.is-editor .viewer-bar.compact-bar button[aria-pressed="true"] {
  background: rgba(185, 107, 34, 0.18);
  color: var(--accent-dark);
}
body.is-editor .compact-doc-header {
  display: grid !important;
  grid-template-columns: minmax(160px, 260px) minmax(180px, 1fr) auto !important;
  align-items: center !important;
  min-height: 34px !important;
  gap: 8px !important;
}
body.is-editor .compact-doc-header h1 {
  max-width: min(48vw, 680px) !important;
  font-size: clamp(18px, 2vw, 24px) !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
body.is-editor .compact-doc-header .status {
  margin: 0 !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
body.is-editor .document-actions {
  display: flex !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
  justify-content: flex-end !important;
}
body.is-editor .document-actions button,
body.is-editor .document-actions .upload-button {
  min-width: 0 !important;
  padding: 8px 13px !important;
  font-size: 13px !important;
  line-height: 1 !important;
}
body.is-editor .viewer-bar.compact-bar {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  overflow-x: auto !important;
  min-height: 34px !important;
  max-width: none !important;
  padding: 7px 10px !important;
  border-radius: 18px !important;
}
body.is-editor .editor-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) clamp(220px, 17vw, 260px) !important;
  gap: 10px !important;
  min-width: 0 !important;
}
body.is-editor .pdf-render-surface {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: calc(100vh - 84px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding: 12px !important;
  border-radius: 18px !important;
}
body.is-editor .inspector {
  width: auto !important;
  max-width: 260px !important;
  overflow: hidden !important;
}
body.is-editor .status-panel { display: none !important; }
body.is-editor .site-footer { display: none !important; }
@media (max-width: 960px) {
  body.is-editor .compact-doc-header,
  body.is-editor .editor-grid { grid-template-columns: 1fr !important; }
  body.is-editor .editor-layout-live { grid-template-columns: 1fr !important; }
  body.is-editor .editor-layout-live .page-rail { display: none !important; }
  body.is-editor .editor-layout-live .workspace { grid-column: 1 !important; }
  body.is-editor .document-actions { justify-content: flex-start !important; flex-wrap: wrap !important; }
  body.is-editor .inspector { max-width: none !important; }
  body.is-editor .edit-affordance { display: none; }
}


.source-hitbox-input {
  appearance: none !important;
  box-sizing: border-box !important;
  display: grid !important;
  place-items: center !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid transparent !important;
  outline: none !important;
  border-radius: 2px !important;
  color: transparent !important;
  background: transparent !important;
  text-align: left !important;
  line-height: 1.12 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  pointer-events: auto !important;
}

.source-hitbox-input:focus,
.source-hitbox-input:hover,
.source-hitbox-input.selected {
  border-color: rgba(185, 107, 34, 0.55) !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* AdSense readiness: useful content block without distracting from upload. */
.trust-panel { max-width: 760px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255, 250, 242, 0.72); text-align: left; }
.trust-panel h2 { margin: 0 0 8px; font-size: clamp(20px, 2.3vw, 30px); letter-spacing: -0.045em; }
.trust-panel p { margin: 0 0 10px; max-width: none; font-size: 16px; }
.trust-panel a { color: var(--accent-dark); font-weight: 850; text-decoration: none; }
.trust-panel a:hover { text-decoration: underline; }

/* Premium compact landing redesign: restrained, readable, AdSense footer visible. */
body { background: #f6f4ee; color: #171717; }
.app-shell { padding: clamp(18px, 3vw, 42px); }
.landing-shell {
  width: min(1120px, 100%);
  min-height: auto;
  margin: 0 auto;
  padding: clamp(32px, 7vh, 72px) 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  align-items: center;
  justify-items: stretch;
  gap: clamp(28px, 6vw, 84px);
  text-align: left;
}
.landing-copy { justify-items: start; gap: 14px; }
.product-name {
  margin: 0;
  color: #171717 !important;
  font-size: 14px !important;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.privacy-pill {
  padding: 6px 10px;
  border-color: rgba(23, 23, 23, 0.1);
  background: rgba(255, 255, 255, 0.58);
  color: #2f6f5e;
  font-size: 12px;
  font-weight: 760;
}
.landing-copy h1 {
  max-width: 680px;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.065em;
}
.landing-copy p {
  max-width: 570px;
  color: #5f5a52;
  font-size: clamp(15px, 1.35vw, 18px);
  line-height: 1.62;
}
.seo-support-copy { font-size: 14px !important; color: #777168 !important; }
.upload-card {
  width: 100%;
  min-height: 250px;
  place-items: start;
  align-content: end;
  gap: 12px;
  padding: 28px;
  border: 1px solid rgba(23, 23, 23, 0.12);
  border-radius: 28px;
  background: linear-gradient(145deg, #ffffff 0%, #faf7f0 100%);
  box-shadow: 0 24px 70px rgba(23, 23, 23, 0.09);
}
.upload-card:hover { transform: translateY(-2px); box-shadow: 0 28px 80px rgba(23, 23, 23, 0.12); }
.upload-card strong { font-size: clamp(24px, 3vw, 34px); letter-spacing: -0.045em; }
.upload-card small { max-width: 260px; color: #6d675e; font-size: 14px; line-height: 1.45; }
.upload-icon { width: 48px; height: 48px; background: #171717; font-size: 28px; }
.simple-steps {
  grid-column: 1 / -1;
  justify-content: flex-start;
  gap: 8px;
  color: #6b665e;
}
.simple-steps li {
  padding: 7px 11px;
  border-color: rgba(23, 23, 23, 0.1);
  background: rgba(255, 255, 255, 0.48);
  font-size: 13px;
}
.simple-steps strong { color: #171717; }
.trust-panel {
  grid-column: 1 / -1;
  max-width: none;
  display: grid;
  grid-template-columns: minmax(180px, 0.42fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid rgba(23, 23, 23, 0.12);
  border-radius: 0;
  background: transparent;
}
.trust-panel h2 { margin: 0; font-size: clamp(18px, 2vw, 24px); letter-spacing: -0.04em; }
.trust-panel p { margin: 0; color: #625d55; font-size: 14px; line-height: 1.55; }
.trust-panel a { color: #171717; white-space: nowrap; }
.site-footer {
  display: block !important;
  width: min(1120px, 100%) !important;
  max-width: none;
  margin: 18px auto 0;
  padding: 18px 0 0;
  border-top: 1px solid rgba(23, 23, 23, 0.12);
  color: #716b62;
  font-size: 13px;
}
.site-footer nav { gap: 8px 14px; margin-bottom: 10px; }
.site-footer a { color: #262626; font-size: 13px; font-weight: 720; }
.site-footer p { max-width: 920px; font-size: 12px; line-height: 1.6; }
.editor-layout-live + .site-footer { display: none !important; }
@media (max-width: 860px) {
  .app-shell { padding: 18px; }
  .landing-shell { grid-template-columns: 1fr; padding: 28px 0 18px; gap: 22px; }
  .landing-copy h1 { font-size: clamp(34px, 10vw, 52px); }
  .upload-card { min-height: 190px; padding: 24px; }
  .trust-panel { grid-template-columns: 1fr; gap: 8px; }
  .trust-panel a { white-space: normal; }
  .site-footer { width: 100% !important; }
}

/* Editor overflow fix: landing padding must not inflate the live PDF workspace. */
.app-shell:has(.editor-layout-live) {
  padding: 6px 12px 10px;
  overflow-x: hidden;
}
.editor-layout-live {
  width: 100%;
  max-width: 100%;
  grid-template-columns: minmax(96px, 132px) minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}
.editor-layout-live .workspace { min-width: 0; overflow: hidden; }
.compact-doc-header {
  grid-template-columns: minmax(120px, 220px) minmax(120px, 1fr) auto auto auto;
  max-width: 100%;
  overflow: hidden;
}
.compact-doc-header .status { min-width: 0; }
.pdf-render-surface {
  max-width: 100% !important;
}
.editor-layout-live .pdf-render-surface {
  width: 100% !important;
  min-width: 0;
}
@media (max-width: 860px) {
  .app-shell:has(.editor-layout-live) { padding: 6px; }
  .editor-layout-live { grid-template-columns: 1fr; }
}

/* High-contrast vertical homepage: make upload the primary visual target. */
.app-shell:not(:has(.editor-layout-live)) {
  padding: clamp(18px, 3vw, 40px);
  background: #f2efe6;
}
.landing-shell {
  width: min(1180px, 100%);
  min-height: auto;
  padding: clamp(18px, 4vh, 42px) 0 18px;
  grid-template-columns: 1fr;
  justify-items: center;
  align-items: start;
  gap: 18px;
  text-align: center;
}
.landing-copy {
  max-width: 1040px;
  justify-items: center;
  gap: 10px;
}
.product-name { font-size: 12px !important; letter-spacing: 0.12em; color: #0f172a !important; }
.privacy-pill {
  background: #ffffff;
  border-color: #0f172a;
  color: #0f766e;
  box-shadow: 0 2px 0 #0f172a;
}
.landing-copy h1 {
  max-width: 1100px;
  margin: 4px 0 0;
  font-size: clamp(32px, 5.1vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.055em;
  text-wrap: balance;
}
.landing-copy p {
  max-width: 920px;
  font-size: clamp(15px, 1.35vw, 19px);
  line-height: 1.5;
  color: #37322b;
}
.seo-support-copy { max-width: 760px !important; font-size: 14px !important; color: #5c554c !important; }
.upload-card {
  width: min(760px, 100%);
  min-height: 190px;
  place-items: center;
  align-content: center;
  text-align: center;
  padding: clamp(26px, 4vw, 44px);
  border: 3px solid #0f172a;
  border-radius: 30px;
  background: #ffffff;
  box-shadow: 12px 12px 0 #0f172a, 0 28px 90px rgba(15, 23, 42, 0.18);
}
.upload-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 16px 16px 0 #0f172a, 0 34px 100px rgba(15, 23, 42, 0.22);
}
.upload-icon { width: 54px; height: 54px; background: #e44757; color: #fff; font-size: 31px; box-shadow: 0 0 0 3px #0f172a; }
.upload-card strong { font-size: clamp(30px, 4vw, 48px); color: #0b0f19; }
.upload-card small { max-width: none; color: #34302a; font-size: 16px; }
.simple-steps { justify-content: center; }
.simple-steps li {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
  font-size: 13px;
}
.simple-steps strong { color: #ffffff; }
.trust-panel {
  width: min(960px, 100%);
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  gap: 8px;
  padding: 16px 0 0;
  border-top-color: rgba(15, 23, 42, 0.22);
}
.trust-panel h2 { font-size: clamp(17px, 2vw, 24px); }
.trust-panel p { max-width: 780px; color: #403a32; }
.trust-panel a { color: #0f172a; text-decoration: underline; text-underline-offset: 4px; }
.site-footer { border-top-color: rgba(15, 23, 42, 0.22); }
@media (max-width: 860px) {
  .landing-shell { gap: 16px; padding-top: 18px; }
  .landing-copy h1 { font-size: clamp(31px, 9vw, 48px); }
  .upload-card { min-height: 170px; box-shadow: 7px 7px 0 #0f172a, 0 20px 70px rgba(15, 23, 42, 0.16); }
}

/* Center homepage footer links and policy note. */
.app-shell:not(:has(.editor-layout-live)) .site-footer {
  text-align: center;
}
.app-shell:not(:has(.editor-layout-live)) .site-footer nav {
  justify-content: center;
}
.app-shell:not(:has(.editor-layout-live)) .site-footer p {
  margin-left: auto;
  margin-right: auto;
}


/* Homepage modules restored in build 071 */
.homepage-section { width:min(1120px,100%); margin:22px auto 0; padding:28px; border:1px solid var(--line); border-radius:28px; background:rgba(255,250,242,.76); text-align:left; box-shadow:0 14px 40px rgba(17,24,39,.06); }
.section-heading { max-width:760px; margin:0 0 18px; }
.section-kicker { margin:0 0 6px; color:var(--accent-dark); font-size:12px; font-weight:900; letter-spacing:.09em; text-transform:uppercase; }
.section-heading h2 { margin:0 0 8px; color:var(--ink); font-size:clamp(24px,3vw,38px); line-height:1.05; letter-spacing:-.055em; }
.section-heading p { margin:0; color:var(--muted); font-size:16px; line-height:1.65; }
.feature-grid, .workflow-grid, .article-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.workflow-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.article-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.feature-card, .workflow-grid article, .article-grid article { border:1px solid var(--line); border-radius:20px; background:#fff; padding:18px; }
.feature-card h3, .workflow-grid h3, .article-grid h3 { margin:0 0 8px; color:var(--ink); font-size:18px; letter-spacing:-.03em; }
.feature-card p, .workflow-grid p, .article-grid p { margin:0; color:var(--muted); font-size:14px; line-height:1.6; }
.workflow-grid strong { display:inline-flex; margin-bottom:12px; color:var(--accent-dark); font-weight:900; }
.use-case-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.use-case-list a, .article-grid a { color:var(--ink); font-weight:850; text-decoration:none; }
.use-case-list a { display:block; border:1px solid var(--line); border-radius:999px; background:#fff; padding:12px 14px; }
.use-case-list a:hover, .article-grid a:hover { color:var(--accent-dark); text-decoration:underline; text-underline-offset:4px; }
body.is-editor .homepage-section { display:none !important; }
@media (max-width: 980px) { .feature-grid, .workflow-grid, .article-grid, .use-case-list { grid-template-columns:1fr 1fr; } }
@media (max-width: 640px) { .homepage-section { padding:20px; border-radius:22px; } .feature-grid, .workflow-grid, .article-grid, .use-case-list { grid-template-columns:1fr; } }


/* Build 072: restored homepage modules must be reachable on the live runtime. */
body.appjs-rebuild-standalone.is-landing { overflow-x:hidden !important; overflow-y:auto !important; }
body.appjs-rebuild-standalone.is-landing .rebuild-app { min-height:100vh !important; height:auto !important; overflow:visible !important; }
body.is-landing .runtime-build-watermark { left:10px !important; top:auto !important; bottom:10px !important; opacity:.72 !important; font-size:10px !important; padding:5px 8px !important; border-radius:999px !important; }
body.is-landing .landing-shell { padding-top:clamp(12px,2.4vh,24px) !important; gap:14px !important; }
body.is-landing .landing-copy h1 { font-size:clamp(30px,4.4vw,62px) !important; }
body.is-landing .upload-card { width:min(700px,100%) !important; min-height:150px !important; padding:clamp(20px,3vw,32px) !important; }
body.is-landing .upload-card strong { font-size:clamp(26px,3.4vw,40px) !important; }
body.is-landing .homepage-section { display:block !important; }


/* 087 AdSense readiness content modules */
.homepage-checklist { display:grid; gap:10px; margin:16px 0 0; padding-left:1.2rem; color:var(--ink); line-height:1.65; }
.faq-section details { border:1px solid var(--line); border-radius:18px; padding:14px 16px; background:rgba(255,255,255,.68); margin:10px 0; }
.faq-section summary { cursor:pointer; font-weight:850; color:var(--ink); }
.faq-section details p { margin:10px 0 0; color:var(--muted); line-height:1.65; }
.feature-card a, .article-grid a { font-weight:850; color:var(--ink); text-decoration-color:var(--accent); text-underline-offset:4px; }
.homepage-section p, .homepage-section li { font-size:15.5px; }
