body.mode-workspace .workspace-shell {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.workspace-shell .app-body {
  flex: 1;
  min-height: 0;
}

:root {
  --tab-bar-h: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --mobile-header-h: 52px;
}

/* Trust strip */
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: center;
  list-style: none;
  margin: 16px 0 28px;
  padding: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.trust-strip li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trust-icon {
  opacity: 0.85;
}

/* Homepage top nav */
.landing-top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: center;
  padding: 8px 0 4px;
  font-size: 0.9rem;
}

.landing-top-nav a {
  color: var(--muted);
  text-decoration: none;
}

.landing-top-nav a:hover {
  color: var(--text);
}

.landing-nav-muted {
  opacity: 0.7;
}

.landing-eyebrow {
  margin: 0 0 8px;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 600;
}

.landing-accept-line {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.landing-band {
  margin: 36px 0;
  padding: 28px 20px;
  text-align: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.landing-band h2 {
  margin: 0 0 10px;
  font-size: 1.45rem;
}

.landing-band p {
  margin: 0 0 14px;
  color: var(--muted);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.landing-band .btn {
  margin: 4px;
}

.landing-band-redact {
  background: linear-gradient(135deg, rgba(79, 124, 255, 0.08), rgba(16, 185, 129, 0.06));
}

.landing-ai-example {
  font-style: italic;
  color: var(--text) !important;
}

.landing-tools-grid-sm {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.tool-upload-status {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.tool-upload-status.is-error {
  color: #f87171;
}

.tool-landing-nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.88rem;
}

.tool-landing-nav a {
  color: var(--muted);
  text-decoration: none;
}

.pii-findings {
  margin: 12px 0;
  max-height: 280px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px;
}

.pii-finding-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
}

.pii-finding-row:last-child {
  border-bottom: none;
}

.pii-finding-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.pii-type-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 10px 0 14px;
  font-size: 0.85rem;
}

.pii-pack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 2px;
}

.pii-pack-row .btn-sm {
  padding: 4px 10px;
  font-size: 0.78rem;
}

.pii-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.docai-chat {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px;
  margin: 10px 0;
  background: rgba(0, 0, 0, 0.2);
}

.docai-chat-msg {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.docai-chat-user {
  background: rgba(59, 130, 246, 0.18);
}

.docai-chat-assistant {
  background: rgba(255, 255, 255, 0.06);
}

.docai-chat-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.docai-chat-form input {
  flex: 1;
  min-width: 0;
}

.docai-agent-steps {
  margin-top: 10px;
  font-size: 0.85rem;
  opacity: 0.9;
}

.docai-step {
  padding: 4px 0;
}

.landing-band-api {
  border-color: rgba(56, 189, 248, 0.25);
}


body.mode-workspace .landing-view {
  display: none !important;
}

body.mode-landing .workspace-shell {
  display: none !important;
}

body.mode-landing .toolbar-workspace-only {
  display: none !important;
}

body.mode-workspace .toolbar-landing-only {
  display: none !important;
}

/* ── Landing ── */
.landing-view {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, var(--bg) 0%, #12151c 100%);
}

.landing-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 32px;
}

.landing-hero {
  text-align: center;
  padding: 24px 12px 28px;
}

.landing-hero h1 {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.landing-hero .lead {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 560px;
  margin: 0 auto 20px;
}

.landing-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 8px;
}

.landing-badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(79, 124, 255, 0.15);
  color: #a5b8ff;
  border: 1px solid rgba(79, 124, 255, 0.25);
}

.landing-upload-zone {
  margin: 0 auto 28px;
  max-width: 520px;
  padding: 28px 20px;
  border: 2px dashed var(--border);
  border-radius: 16px;
  background: var(--surface);
  text-align: center;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  cursor: pointer;
}

.landing-upload-zone:hover,
.landing-upload-zone.is-dragover,
.landing-upload-zone.is-pulse {
  border-color: var(--primary);
  background: rgba(79, 124, 255, 0.06);
}

.landing-upload-zone.is-pulse {
  animation: landing-pulse 1s ease 2;
}

@keyframes landing-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.01); }
}

.landing-upload-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  color: var(--primary);
}

.landing-upload-zone h2 {
  font-size: 1.1rem;
  margin: 0 0 6px;
}

.landing-upload-zone p {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 16px;
}

.landing-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--text);
}

.landing-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.landing-tool-card-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.landing-tool-guide {
  align-self: center;
  font-size: 0.75rem;
  color: var(--primary);
  text-decoration: none;
  padding: 2px 8px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}

.landing-tool-guide:hover {
  background: rgba(79, 124, 255, 0.12);
  text-decoration: underline;
}

.landing-tool-card-wrap:focus-within .landing-tool-card {
  border-color: var(--primary);
}

.landing-tool-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
  min-height: 120px;
}

.landing-tool-card:hover,
.landing-tool-card:focus-visible {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  outline: none;
}

.landing-tool-card:active {
  transform: scale(0.98);
}

.landing-tool-card .card-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(79, 124, 255, 0.12);
  color: var(--primary);
}

.landing-tool-card .card-icon svg {
  width: 20px;
  height: 20px;
}

.landing-tool-card .card-label {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.3;
}

.landing-tool-card .card-desc {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.landing-tool-card .card-tag {
  margin-top: auto;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}

.landing-tool-card .card-tag.free { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.landing-tool-card .card-tag.premium { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.landing-seo {
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.landing-seo h2 {
  font-size: 1.25rem;
  margin: 0 0 16px;
}

.landing-faq details {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  background: var(--surface);
  padding: 0 14px;
}

.landing-faq summary {
  cursor: pointer;
  font-weight: 500;
  padding: 14px 0;
  list-style: none;
}

.landing-faq summary::-webkit-details-marker { display: none; }

.landing-faq p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 14px;
}

.landing-footer-seo {
  margin-top: 24px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
}

.landing-footer-links {
  margin-top: 12px;
  font-size: 0.9rem;
}

/* ── Mobile tab bar ── */
.mobile-tab-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: calc(var(--tab-bar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
}

.mobile-tab-bar-inner {
  display: flex;
  height: var(--tab-bar-h);
  max-width: 520px;
  margin: 0 auto;
}

.mobile-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px;
  -webkit-tap-highlight-color: transparent;
}

.mobile-tab svg {
  width: 22px;
  height: 22px;
}

.mobile-tab.active {
  color: var(--primary);
}

.mobile-tab:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Tools bottom sheet (mobile) */
.tools-sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
}

.tools-sheet.is-open {
  display: block;
  pointer-events: auto;
}

.tools-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.25s;
}

.tools-sheet.is-open .tools-sheet-backdrop {
  opacity: 1;
}

.tools-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 85vh;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--tab-bar-h) + var(--safe-bottom));
}

.tools-sheet.is-open .tools-sheet-panel {
  transform: translateY(0);
}

.tools-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 8px;
  border-bottom: 1px solid var(--border);
}

.tools-sheet-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.tools-sheet-close {
  border: none;
  background: var(--surface-2);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
}

.tools-sheet-body {
  overflow-y: auto;
  padding: 12px 16px 20px;
  -webkit-overflow-scrolling: touch;
}

.tools-sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.tools-sheet-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
}

.tools-sheet-item span.tag {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}

.toolbar-back-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  margin-right: 4px;
}

/* ── Mobile workspace ── */
@media (max-width: 768px) {
  html, body {
    overscroll-behavior: none;
  }

  .app {
    height: 100dvh;
    height: 100vh;
    padding-bottom: calc(var(--tab-bar-h) + var(--safe-bottom));
  }

  body.mode-landing .app {
    padding-bottom: calc(var(--tab-bar-h) + var(--safe-bottom));
  }

  .mobile-tab-bar {
    display: block;
  }

  .toolbar {
    padding: 8px 12px;
    gap: 8px;
    min-height: var(--mobile-header-h);
  }

  .toolbar-back-btn.visible-mobile {
    display: inline-flex;
  }

  body.mode-workspace .toolbar-back-btn {
    display: inline-flex;
  }

  .brand span#brandName {
    font-size: 0.95rem;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .auth-bar .btn.secondary:not(#btnLogout) {
    display: none;
  }

  .auth-bar #btnSignIn,
  .auth-bar #btnSignUp {
    display: none;
  }

  body.mode-landing .upload-btn.toolbar-workspace-only {
    display: none;
  }

  .tools-sidebar {
    display: none !important;
  }

  .workspace {
    padding: 8px !important;
  }

  .landing-tools-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .landing-tool-card {
    min-height: 110px;
    padding: 14px 12px;
  }

  .landing-upload-zone {
    padding: 24px 16px;
  }

  .toolbar-group#editorTools {
    order: 10;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .toolbar-group#pageNav {
    flex: 1;
    min-width: 0;
  }

  .platform-footer {
    display: none;
  }
}

@media (min-width: 769px) {
  .mobile-tab-bar,
  .tools-sheet {
    display: none !important;
  }

  .toolbar-back-btn {
    display: none !important;
  }
}

@media (display-mode: standalone) {
  .app {
    padding-top: env(safe-area-inset-top, 0px);
  }

  .toolbar {
    padding-top: max(8px, env(safe-area-inset-top, 0px));
  }
}

.auth-google-wrap {
  margin-top: 14px;
  text-align: center;
}

.auth-or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #888;
  font-size: 0.85rem;
  margin: 12px 0;
}

.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

#googleSignInBtn {
  display: flex;
  justify-content: center;
}

.download-pay-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
}

.download-pay-options .btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  height: auto;
  padding: 12px 14px;
}

.download-pay-options .btn-sub {
  font-size: 0.78rem;
  font-weight: 400;
  opacity: 0.85;
}

.pricing-table-wrap {
  overflow-x: auto;
  margin: 12px 0 8px;
}

.pricing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.pricing-table th,
.pricing-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.pricing-table th {
  opacity: 0.7;
  font-weight: 600;
}

.price-note {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.72rem;
  opacity: 0.65;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.plan-grid-multi {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

