:root {
  --bg: #f5f7fb;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --surface-alt: #edf2f9;
  --text: #0f172a;
  --muted: #5b677e;
  --border: rgba(15, 23, 42, 0.085);
  --primary: #007aff;
  --primary-hover: #0066d6;
  --primary-soft: rgba(0, 122, 255, 0.1);
  --green: #16a34a;
  --green-soft: rgba(22, 163, 74, 0.12);
  --red: #dc2626;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.055);
  --shadow-hover: 0 20px 44px rgba(0, 102, 255, 0.12);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
  --bg: #070a11;
  --surface: rgba(16, 22, 34, 0.88);
  --surface-solid: #0f1522;
  --surface-alt: #172033;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.09);
  --primary: #3b96ff;
  --primary-hover: #58a6ff;
  --primary-soft: rgba(59, 150, 255, 0.15);
  --green: #34c759;
  --green-soft: rgba(52, 199, 89, 0.14);
  --red: #f87171;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 24px 56px rgba(0, 0, 0, 0.65);
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}
*::-webkit-scrollbar { width: 7px; height: 7px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.28); border-radius: 999px; }

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.28s ease, color 0.28s ease;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: var(--surface-alt);
  padding: 2px 6px;
  border-radius: 6px;
}

button, input, select { font: inherit; }

/* Bidirectional Scroll Reveal & Spring Motion */
@keyframes viewEnter {
  from { opacity: 0; transform: translateY(14px) scale(0.992); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.view-animate {
  animation: viewEnter 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.reveal-item {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.2s ease,
    box-shadow 0.22s ease,
    background-color 0.25s ease;
}
.reveal-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2.5px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--primary), #16a34a);
  z-index: 60;
  pointer-events: none;
}

.ambient-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 48% at 15% 0%, rgba(0, 122, 255, 0.11), transparent 72%),
    radial-gradient(ellipse 65% 42% at 88% 8%, rgba(22, 163, 74, 0.08), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.container { max-width: 1220px; width: 100%; margin: 0 auto; padding: 0 22px; }

/* Header */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: var(--safe-top);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1220px;
  margin: 0 auto;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-btn {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  text-align: left;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}
.brand-btn:hover { transform: scale(1.015); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1rem; letter-spacing: -0.015em; }
.brand-text small { font-size: 11.5px; color: var(--muted); }

.quick-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-alt);
  padding: 4px;
  border-radius: 13px;
  border: 1px solid var(--border);
  overflow-x: auto;
}

.nav-pill {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}
.nav-pill:hover { color: var(--text); }
.nav-pill:active { transform: scale(0.96); }
.nav-pill.active { background: var(--surface-solid); color: var(--primary); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }

.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.offline-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.offline-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

/* Compact Theme Dropdown Menu */
.theme-dropdown { position: relative; }
.theme-trigger {
  min-height: 36px;
  padding: 5px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.12s ease;
}
.theme-trigger:hover { border-color: color-mix(in srgb, var(--primary) 42%, var(--border)); }
.theme-trigger:active { transform: scale(0.96); }
.theme-trigger-icon { display: grid; place-items: center; color: var(--primary); }
.theme-trigger-icon svg { width: 15px; height: 15px; }
.caret { font-size: 11px; color: var(--muted); }

@keyframes menuPop {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.theme-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 172px;
  padding: 6px;
  border-radius: 14px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
  display: grid;
  gap: 3px;
  z-index: 60;
  animation: menuPop 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.theme-menu[hidden] { display: none; }

.theme-menu-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.14s ease, color 0.14s ease;
}
.theme-menu-item svg { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }
.theme-menu-item:hover { background: var(--surface-alt); }
.theme-menu-item.active { background: var(--primary-soft); color: var(--primary); }
.theme-menu-item.active svg { color: var(--primary); }
.menu-check { margin-left: auto; font-size: 12px; opacity: 0; }
.theme-menu-item.active .menu-check { opacity: 1; }

.ram-switch-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 5px 11px;
  border-radius: 10px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.ios-switch {
  appearance: none;
  -webkit-appearance: none;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.4);
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin: 0;
}
.ios-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.ios-switch:checked { background: var(--primary); }
.ios-switch:checked::after { transform: translateX(14px); }

.action-chip {
  min-height: 36px;
  padding: 6px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.14s ease, border-color 0.16s ease, background-color 0.16s ease;
}
.action-chip:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.action-chip:active { transform: scale(0.96); }
.action-chip.accent { background: var(--primary-soft); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 35%, transparent); }
.action-chip[hidden] { display: none; }

/* Hub View */
.hub-view { flex: 1; }
.hub-view[hidden], .studio-view[hidden] { display: none; }

.hub-hero { text-align: center; max-width: 780px; margin: 0 auto; padding: 42px 0 30px; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px;
  border-radius: 999px; background: var(--primary-soft); color: var(--primary);
  font-size: 12.5px; font-weight: 600;
}
.hero-kicker .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.hub-hero h1 { font-size: clamp(2rem, 3.8vw, 3.05rem); line-height: 1.09; letter-spacing: -0.03em; margin: 16px 0 12px; }
.gradient-span { background: linear-gradient(125deg, var(--primary), #16a34a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hub-hero p { margin: 0 auto; max-width: 60ch; color: var(--muted); font-size: 1.03rem; }

/* Hub Cards Grid + Cursor Spotlight */
.hub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 10px 0 28px; }
.hub-card {
  position: relative;
  overflow: hidden;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hub-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(0, 122, 255, 0.11), transparent 70%);
  transition: opacity 0.25s ease;
}
.hub-card:hover::after { opacity: 1; }
.hub-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--primary) 48%, var(--border)); box-shadow: var(--shadow-hover); }
.hub-card:active { transform: translateY(-1px) scale(0.988); }

.hub-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; transition: transform 0.22s ease; }
.hub-card:hover .hub-icon { transform: scale(1.08); }
.hub-icon svg { width: 22px; height: 22px; }

.ic-blue { background: rgba(0, 122, 255, 0.12); color: #007aff; }
.ic-green { background: rgba(22, 163, 74, 0.12); color: #16a34a; }
.ic-purple { background: rgba(147, 51, 234, 0.13); color: #9333ea; }
.ic-orange { background: rgba(234, 88, 12, 0.13); color: #ea580c; }
.ic-red { background: rgba(220, 38, 38, 0.12); color: #dc2626; }
.ic-teal { background: rgba(13, 148, 136, 0.13); color: #0d9488; }
.ic-indigo { background: rgba(79, 70, 229, 0.13); color: #4f46e5; }
.ic-amber { background: rgba(217, 119, 6, 0.14); color: #d97706; }
.ic-emerald { background: rgba(5, 150, 105, 0.14); color: #059669; }

.hub-card-body h3 { margin: 0 0 5px; font-size: 1.06rem; }
.hub-card-body p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.hub-tag { margin-top: auto; align-self: flex-start; font-size: 11.5px; font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 4px 10px; border-radius: 999px; }

/* Non-intrusive Android Companion Card */
.companion-promo {
  margin: 0 0 46px;
  padding: 20px 24px;
  border-radius: 22px;
  background: linear-gradient(135deg, #0d182d, #132544);
  border: 1px solid rgba(230, 194, 117, 0.28);
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: 0 18px 42px rgba(10, 20, 41, 0.2);
}
.companion-promo[hidden] { display: none; }
.promo-left { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 260px; }
.promo-badge { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; color: #e2b45a; }
.promo-left h3 { margin: 3px 0 3px; font-size: 1.05rem; }
.promo-left p { margin: 0; font-size: 13px; color: #cbd5e1; }
.promo-actions { display: flex; align-items: center; gap: 10px; }
.promo-cta {
  padding: 10px 18px;
  border-radius: 12px;
  background: #0a66ff;
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.promo-cta:hover { background: #2678ff; transform: translateY(-1px); }
.promo-dismiss {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: #cbd5e1;
  font-size: 18px;
  cursor: pointer;
}

/* Studio Workbench (Apple-inspired Clean Elevation) */
.studio-view { flex: 1; padding-top: 20px; padding-bottom: 42px; }
.studio-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.studio-bar-left { display: flex; align-items: center; gap: 14px; }
.studio-bar-left h2 { margin: 0; font-size: 1.25rem; }
.studio-sub { font-size: 12.5px; color: var(--muted); }
.studio-bar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.studio-columns { display: grid; grid-template-columns: 1fr 336px; gap: 18px; align-items: start; }
.studio-columns.empty-mode { grid-template-columns: minmax(0, 680px); justify-content: center; padding-top: 14px; }
.studio-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* Clean Centered Focal Drop Card (Apple-like breathing room) */
.drop-card {
  border: 1.5px dashed color-mix(in srgb, var(--primary) 38%, var(--border));
  background: var(--surface);
  border-radius: 24px;
  padding: 52px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  box-shadow: var(--shadow);
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.15s ease;
}
.drop-card.compact {
  padding: 16px 20px;
  flex-direction: row;
  justify-content: space-between;
  text-align: left;
  border-radius: 16px;
}
.drop-card.compact .drop-icon-circle { display: none; }
.drop-card[hidden], .stage-panel[hidden], .inspector-card[hidden] { display: none; }
.drop-card.drag-over { border-color: var(--primary); background: var(--primary-soft); transform: scale(1.005); }
.drop-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
}
.drop-icon-circle svg { width: 21px; height: 21px; }
.drop-copy { display: grid; gap: 3px; }
.drop-copy strong { font-size: 1rem; }
.drop-copy span { font-size: 12.5px; color: var(--muted); }
.drop-btn-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.btn-pick {
  padding: 9px 18px;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.btn-sample {
  padding: 9px 16px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.hidden-input { display: none; }

.stage-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
  min-height: 220px;
}

.inspector-card {
  position: sticky;
  top: 78px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.inspector-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.inspector-head h3 { margin: 0; font-size: 1rem; }
.inspector-pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-alt); color: var(--muted); }

.grouped-panel {
  background: var(--surface-alt);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 10px;
}
.section-cap { font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }

.field-group { display: grid; gap: 6px; }
.field-group label { font-size: 12px; font-weight: 700; color: var(--muted); }
.field-group input[type="text"],
.field-group input[type="password"],
.field-group input[type="number"],
.field-group select {
  width: 100%; min-height: 40px; padding: 8px 10px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-solid); color: var(--text);
}

.preset-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn {
  min-height: 36px; padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-solid);
  color: var(--text); font-size: 12.5px; font-weight: 700; cursor: pointer;
  transition: all 0.15s ease;
}
.chip-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.btn-primary {
  width: 100%; min-height: 46px; border: 0; border-radius: 13px;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 14px;
  cursor: pointer; transition: background-color 0.15s ease, transform 0.12s ease;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: scale(0.985); }
.btn-primary:disabled { opacity: 0.48; cursor: not-allowed; }

.btn-secondary {
  width: 100%; min-height: 42px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface-alt); color: var(--text);
  font-weight: 700; font-size: 13.5px; cursor: pointer;
}

.stat-card { background: var(--surface-alt); border-radius: 14px; padding: 12px; font-size: 12.5px; display: grid; gap: 6px; }
.stat-row { display: flex; justify-content: space-between; gap: 8px; }
.status-msg { font-size: 12.5px; color: var(--primary); font-weight: 600; min-height: 18px; }

/* Interactive Reader Canvas + Direct Cursor Markup */
.reader-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 14px; background: var(--surface-alt); margin-bottom: 14px;
}
.reader-viewport {
  position: relative;
  overflow: auto;
  max-height: 70dvh;
  border-radius: 14px;
  background: var(--surface-alt);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  touch-action: pan-x pan-y;
}
.reader-viewport.mode-draw { touch-action: none; }
.reader-viewport.mode-pan { cursor: grab; }
.reader-viewport.mode-pan:active { cursor: grabbing; }
.reader-canvas-wrap {
  position: relative;
  margin: 0 auto;
  flex-shrink: 0;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}
.reader-canvas-wrap canvas { display: block; }
.reader-viewport.tone-sepia .reader-canvas-wrap { filter: sepia(0.32) contrast(0.95) brightness(0.97); }
.reader-viewport.tone-night .reader-canvas-wrap { filter: invert(0.9) hue-rotate(180deg); }

/* Visual PPTX Slide Canvas & Rich DOCX Paper */
.pptx-stage-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.pptx-slide-surface {
  position: relative;
  container-type: inline-size;
  width: 100%;
  max-width: 920px;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.16);
  border: 1px solid var(--border);
}
.pptx-layer-shape, .pptx-layer-pic {
  position: absolute;
  box-sizing: border-box;
  overflow: visible;
}
.pptx-layer-pic { overflow: hidden; }
.pptx-layer-pic img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.pptx-layer-shape {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 0.45% 0.85%;
  line-height: 1.18;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.docx-paper {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  background: #ffffff;
  color: #18181b;
  padding: 36px 42px;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border);
  line-height: 1.65;
}
.docx-paper h1, .docx-paper h2, .docx-paper h3 { color: #0f172a; margin: 16px 0 8px; }
.docx-paper p { margin: 0 0 10px; font-size: 14.5px; }
.docx-paper table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.docx-paper td, .docx-paper th { border: 1px solid #d1d5db; padding: 6px 9px; text-align: left; }
.docx-paper img { max-width: 100%; height: auto; border-radius: 8px; margin: 10px 0; display: block; }

/* Office Slide / Document Cards */
.office-doc-wrap { display: grid; gap: 14px; }
.office-slide-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
}
.office-slide-num { font-size: 11px; font-weight: 800; color: var(--primary); letter-spacing: 0.06em; margin-bottom: 6px; }
.office-para { margin: 0 0 8px; font-size: 14px; line-height: 1.6; }

/* Split & Page Grid */
.split-grid, .id-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.preview-box { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.preview-box canvas, .preview-box img { max-width: 100%; height: auto; border-radius: 8px; background: #fff; }
.preview-label { width: 100%; display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--muted); }
.interactive-canvas-wrap { position: relative; display: inline-block; max-width: 100%; touch-action: none; user-select: none; }
.interactive-canvas-wrap canvas { display: block; max-width: 100%; height: auto; border-radius: 10px; cursor: crosshair; }

.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.page-card { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.page-card img { width: 100%; height: 165px; object-fit: contain; background: #fff; border-radius: 8px; }
.page-card-actions { display: flex; gap: 4px; width: 100%; justify-content: center; flex-wrap: wrap; }
.mini-btn { min-width: 34px; min-height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-solid); color: var(--text); cursor: pointer; font-size: 12px; font-weight: 700; }
.mini-btn.danger { color: var(--red); }

.id-slot {
  border: 1.5px dashed var(--border); border-radius: 14px; padding: 18px; text-align: center;
  background: var(--surface-alt); cursor: pointer; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.id-slot img { max-height: 150px; max-width: 100%; border-radius: 8px; }

.text-doc-view {
  width: 100%; max-height: 62dvh; overflow: auto; padding: 16px; border-radius: 12px;
  background: var(--surface-alt); border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; white-space: pre-wrap; word-break: break-word;
}
.csv-table-wrap { width: 100%; max-height: 62dvh; overflow: auto; border-radius: 12px; border: 1px solid var(--border); }
.csv-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.csv-table th, .csv-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); text-align: left; }
.csv-table thead th { position: sticky; top: 0; background: var(--surface-alt); font-weight: 700; }

/* Floating Smooth Scroll Button */
.float-scroll-btn {
  position: fixed;
  right: 22px;
  bottom: calc(22px + var(--safe-bottom));
  z-index: 45;
  padding: 10px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease, background-color 0.15s ease;
}
.float-scroll-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.float-scroll-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Footer */
.site-footer { margin-top: auto; background: var(--surface-solid); border-top: 1px solid var(--border); padding: 40px 0 calc(26px + var(--safe-bottom)); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 28px; }
.footer-desc { margin: 12px 0 0; max-width: 34ch; font-size: 13px; color: var(--muted); }
.footer-col h4 { margin: 0 0 12px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text); }
.footer-col a, .footer-link-btn {
  display: block; padding: 0; margin-bottom: 8px; border: 0; background: transparent;
  color: var(--muted); font-size: 13.5px; text-decoration: none; cursor: pointer; text-align: left; transition: color 0.15s ease;
}
.footer-col a:hover, .footer-link-btn:hover { color: var(--primary); }
.footer-bottom {
  margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 12.5px; color: var(--muted);
}

@media (max-width: 1060px) {
  .quick-pills { display: none; }
  .hub-grid { grid-template-columns: 1fr 1fr; }
  .studio-columns { grid-template-columns: 1fr; }
  .inspector-card { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .hub-grid, .split-grid, .id-slots, .footer-grid { grid-template-columns: 1fr; }
  .nav-inner { padding: 10px 14px; }
  .container { padding: 0 14px; }
  .offline-badge span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
