:root {
  --ink: #0e1217;
  --ink-light: #1e293b;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --paper: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --lime: #dff55f;
  --lime-hover: #d2ee44;
  --lime-dark: #4d7c0f;
  --lime-glow: rgba(223, 245, 95, 0.4);
  --orange: #ff7559;
  --white: #ffffff;
  --brand-accent: #0ea5e9;
  --danger: #ef4444;
  --stage-bg: #e5e9f0;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.1), 0 6px 12px -4px rgba(15, 23, 42, 0.05);
  --shadow-page: 0 10px 30px -5px rgba(15, 23, 42, 0.16), 0 4px 10px -2px rgba(15, 23, 42, 0.08);
  --transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', Manrope, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 80px);
  background: rgba(248, 250, 252, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 19px;
  transition: var(--transition);
}

.brand:hover {
  opacity: 0.9;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--lime);
  box-shadow: 0 2px 8px rgba(14, 18, 23, 0.25);
  transition: var(--transition);
}

.brand:hover .brand-mark {
  transform: rotate(-3deg) scale(1.05);
}

.brand-name em,
.brand-accent {
  font-style: normal;
  color: #64748b;
  font-weight: 600;
}

nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}

nav a:hover {
  color: var(--ink);
}

button {
  font: inherit;
  border: 0;
  cursor: pointer;
  background: transparent;
  outline: none;
}

button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.ghost-btn:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.ghost-btn svg {
  color: var(--orange);
  transition: transform 0.2s ease;
}

.ghost-btn:hover svg {
  transform: translate(2px, -2px);
}

/* ==========================================================================
   Hero & Upload Section
   ========================================================================== */
.hero {
  min-height: 540px;
  max-width: 1200px;
  margin: auto;
  padding: 60px clamp(20px, 5vw, 80px) 70px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 50px;
  align-items: center;
}

.eyebrow-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #edf7ed;
  border: 1px solid #c8e6c9;
  border-radius: var(--radius-full);
  margin-bottom: 20px;
}

.eyebrow,
.section-kicker,
.rail-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #2e7d32;
  font-weight: 600;
  text-transform: uppercase;
}

.section-kicker,
.rail-label {
  color: var(--muted);
}

.pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.hero h1 {
  font-size: clamp(44px, 5.5vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.05em;
  margin: 0 0 20px;
  font-weight: 800;
  color: var(--ink);
}

.gradient-text {
  background: linear-gradient(135deg, #475569 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text {
  max-width: 480px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
  margin: 0 0 30px;
}

.hero-features {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.feature-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-dark);
}

.feature-tag svg {
  color: #10b981;
}

/* Upload Card */
.upload-card {
  background: var(--surface);
  min-height: 380px;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-xl);
  padding: 44px 36px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.upload-card:hover,
.upload-card.dragging {
  border-color: var(--ink);
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
  background: #fbfdf9;
}

.upload-card.dragging {
  border-color: #22c55e;
  background: #f0fdf4;
}

.upload-icon-wrapper {
  margin-bottom: 20px;
}

.upload-icon {
  width: 64px;
  height: 64px;
  background: var(--lime);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  box-shadow: 0 8px 20px var(--lime-glow);
  transition: transform 0.2s ease;
}

.upload-card:hover .upload-icon {
  transform: scale(1.08) translateY(-2px);
}

.upload-card h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
  color: var(--ink);
}

.upload-card p {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 24px;
}

.lime-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--lime);
  padding: 13px 28px;
  border-radius: var(--radius-md);
  color: var(--ink);
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 4px 14px var(--lime-glow);
  transition: var(--transition);
}

.lime-btn:hover {
  background: var(--lime-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(223, 245, 95, 0.6);
}

.lime-btn svg {
  transition: transform 0.2s ease;
}

.lime-btn:hover svg {
  transform: translateX(4px);
}

.upload-card-footer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-light);
  font-size: 12px;
  margin-top: 26px;
}

/* ==========================================================================
   Stats / Counts Block
   ========================================================================== */
.stats-section {
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 68px clamp(20px, 5vw, 80px) 72px;
}

.stats-container {
  width: 100%;
}

.stats-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}

.stats-header h2 {
  font-size: clamp(28px, 3.2vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.04em;
  margin: 12px 0 14px;
  font-weight: 800;
  color: var(--ink);
}

.stats-subtext {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: background 0.25s ease;
}

.stat-card:hover {
  border-color: var(--ink);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stat-card:hover::after {
  background: var(--lime);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.stat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  transition: var(--transition);
}

.stat-card:hover .stat-icon-wrap {
  transform: scale(1.06);
}

.stat-icon-docs {
  background: #eff6ff;
  color: #2563eb;
}

.stat-icon-users {
  background: #ecfdf5;
  color: #059669;
}

.stat-icon-privacy {
  background: #f0fdf4;
  color: #16a34a;
}

.stat-icon-rating {
  background: #fefce8;
  color: #ca8a04;
}

.stat-pill {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.stat-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}

.stat-number {
  font-size: clamp(30px, 2.8vw, 36px);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1.1;
}

.stat-label {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.stat-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* ==========================================================================
   Homepage Banner Head Strip
   ========================================================================== */
.homepage-banner-head-strip {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px clamp(20px, 5vw, 80px) 0;
}

.homepage-banner-head-strip[hidden] {
  display: none !important;
}

.banner-head-container {
  width: 100%;
}

.banner-head-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--line);
  border-left: 4px solid #0071e3;
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.banner-head-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #0071e3;
  border-left-color: #0071e3;
}

.banner-head-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.banner-head-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(0, 113, 227, 0.1);
  color: #0071e3;
  border: 1px solid rgba(0, 113, 227, 0.2);
  white-space: nowrap;
}

.banner-head-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.banner-head-headline {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.3;
}

.banner-head-subline {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.banner-head-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.banner-head-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--ink);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.banner-head-card:hover .banner-head-cta-btn {
  background: #0071e3;
  transform: translateX(2px);
}

@media (max-width: 768px) {
  .banner-head-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    gap: 14px;
  }
  .banner-head-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .banner-head-subline {
    white-space: normal;
  }
  .banner-head-right {
    width: 100%;
  }
  .banner-head-cta-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   Tools Strip
   ========================================================================== */
.tools-strip {
  max-width: 1200px;
  margin: auto;
  border-top: 1px solid var(--line);
  padding: 70px clamp(20px, 5vw, 80px);
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 48px;
}

.section-heading h2 {
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.04em;
  margin: 12px 0 14px;
  font-weight: 800;
}

.section-subtext {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.tool-card {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.tool-card:hover {
  border-color: var(--ink);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.tool-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  transition: var(--transition);
}

.tool-card:hover .tool-card-icon {
  transform: scale(1.06);
}

.text-icon { background: #eff6ff; color: #2563eb; }
.draw-icon { background: #fef2f2; color: #ef4444; }
.highlight-icon { background: #fefce8; color: #ca8a04; }
.whiteout-icon { background: #f8fafc; color: #475569; border: 1px solid var(--line); }

.tool-card strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.tool-card small {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* ==========================================================================
   Privacy Note
   ========================================================================== */
.privacy-note {
  max-width: 1200px;
  width: min(1200px, calc(100% - clamp(32px, 5vw, 80px)));
  margin: 0 auto 56px;
  padding: 24px clamp(20px, 5vw, 36px);
  display: flex;
  align-items: center;
  gap: 20px;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-lg);
  background: #f0fdf4;
}

@media (max-width: 640px) {
  .privacy-note {
    flex-direction: column;
    text-align: center;
    gap: 14px;
    padding: 20px 16px;
    margin-bottom: 44px;
  }
}

.shield-badge {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: #dcfce7;
  color: #15803d;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.privacy-note strong {
  font-size: 15px;
  font-weight: 700;
  color: #166534;
}

.privacy-note p {
  color: #374151;
  font-size: 14px;
  margin: 4px 0 0;
  line-height: 1.5;
}

body.in-editor,
body:has(#editorView:not([hidden])) {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

body.in-editor .site-header,
body:has(#editorView:not([hidden])) .site-header {
  display: none;
}

/* ==========================================================================
   Editor View
   ========================================================================== */
.editor {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  background: var(--stage-bg);
  display: flex;
  flex-direction: column;
}

.editor-topbar {
  height: 60px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  z-index: 30;
}

.editor-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-divider {
  width: 1px;
  height: 20px;
  background: var(--line);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  transition: var(--transition);
}

.back-btn:hover {
  background: var(--surface-hover);
}

.doc-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--surface-hover);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  max-width: 420px;
  min-width: 0;
}

.doc-icon {
  color: var(--muted);
  flex-shrink: 0;
}

.doc-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ghost-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-dark);
  transition: var(--transition);
}

.ghost-pill-btn:hover {
  background: var(--surface-hover);
  color: var(--ink);
  border-color: var(--line-strong);
}

.history-group {
  display: inline-flex;
  align-items: center;
  background: var(--surface-hover);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--muted-dark);
  transition: var(--transition);
}

.icon-btn:hover:not(:disabled) {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--lime);
  color: var(--ink);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 2px 8px var(--lime-glow);
  transition: var(--transition);
}

.download-btn:hover:not(:disabled) {
  background: var(--lime-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--lime-glow);
}

.download-btn span {
  font-size: 13px;
}

/* Editor Body Grid */
.editor-body {
  display: grid;
  grid-template-columns: 84px 1fr 280px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Left Tool Rail */
.tool-rail {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 20;
}

.rail-label {
  font-size: 10px;
  margin: 0 0 10px;
  text-align: center;
}

.rail-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 68px;
  height: 60px;
  border-radius: var(--radius-md);
  color: var(--muted);
  transition: var(--transition);
  position: relative;
}

.tool-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--muted-dark);
  transition: var(--transition);
}

.tool-text {
  font-size: 11px;
  font-weight: 600;
}

.rail-tool:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.rail-tool:hover .tool-icon {
  color: var(--ink);
}

.rail-tool.active {
  background: #f0fdf4;
  color: #166534;
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px #22c55e;
}

.rail-tool.active .tool-icon {
  color: #166534;
}

.rail-divider {
  width: 40px;
  height: 1px;
  background: var(--line);
  margin: 6px 0;
}

.shapes-tool-group {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.shapes-flyout {
  position: absolute;
  left: calc(100% + 8px);
  top: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-xl);
  z-index: 100;
  min-width: 125px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-6px);
  pointer-events: none;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.shapes-flyout::before {
  content: '';
  position: absolute;
  top: -6px;
  bottom: -6px;
  left: -12px;
  width: 14px;
}

.shapes-tool-group:hover .shapes-flyout,
.shapes-tool-group:focus-within .shapes-flyout,
.shapes-tool-group.open .shapes-flyout {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
}

.shapes-flyout .flyout-item {
  width: 100%;
  height: 42px;
  flex-direction: row;
  justify-content: flex-start;
  padding: 6px 12px;
  gap: 10px;
  border-radius: var(--radius-sm);
}

.shapes-flyout .flyout-item .tool-text {
  font-size: 13px;
}

.rail-spacer {
  flex: 1;
}

.rail-tool.muted {
  color: var(--muted-light);
}

/* Center Canvas Area */
.canvas-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--stage-bg);
}

.canvas-toolbar {
  height: 48px;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.toolbar-pill-group {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  padding: 3px 6px;
  box-shadow: var(--shadow-sm);
  gap: 6px;
}

.small-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted-dark);
  transition: var(--transition);
}

.small-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--ink);
}

.toolbar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  padding: 0 6px;
}

.reset-zoom-btn {
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--surface-hover);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-dark);
  transition: var(--transition);
}

.reset-zoom-btn:hover {
  background: var(--ink);
  color: var(--white);
}

/* Page Stage */
.page-stage {
  flex: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 32px 30px 60px;
}

.pdf-page {
  position: relative;
  background: #ffffff;
  box-shadow: var(--shadow-page);
  border-radius: 2px;
}

.pdf-page canvas {
  display: block;
  max-width: 100%;
}

.empty-editor {
  margin-top: 140px;
  text-align: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-editor-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--orange);
  box-shadow: var(--shadow-sm);
}

/* Right Properties Rail */
.properties {
  background: var(--surface);
  border-left: 1px solid var(--line);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow-y: auto;
}

.panel-section {
  display: flex;
  flex-direction: column;
}

.property-action {
  width: 100%;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 12px;
  background: var(--surface-hover);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.property-action:hover {
  background: #f0fdf4;
  border-color: #86efac;
}

.prop-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  display: grid;
  place-items: center;
  color: #2563eb;
  box-shadow: var(--shadow-sm);
}

.property-action div {
  flex: 1;
}

.property-action strong {
  display: block;
  font-size: 13px;
  color: var(--ink);
}

.property-action small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.property-action b {
  font-size: 18px;
  font-weight: 500;
  color: var(--muted-dark);
}

/* Stats Card */
.page-stats-card {
  background: var(--surface-hover);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.stat-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
}

.clear-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  transition: var(--transition);
}

.clear-page-btn:hover:not(:disabled) {
  background: #fef2f2;
  border-color: #fca5a5;
}

/* Shortcuts Card */
.shortcuts-card {
  background: var(--surface-hover);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shortcut-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.shortcut-desc {
  color: var(--muted);
}

.shortcut-keys kbd {
  font-family: 'DM Mono', monospace;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.1);
  color: var(--ink);
}

.editor-note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}

.tip-card {
  padding: 14px;
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius-md);
  display: flex;
  gap: 12px;
  box-shadow: var(--shadow-md);
}

.tip-icon {
  color: var(--lime);
  flex-shrink: 0;
  margin-top: 1px;
}

.tip-card strong {
  font-size: 12px;
  color: var(--white);
}

.tip-card p {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.5;
  margin: 4px 0 0;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

[hidden] {
  display: none !important;
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  nav a {
    display: none;
  }
  .hero {
    grid-template-columns: 1fr;
    padding-top: 40px;
    gap: 36px;
  }
  .stats-section {
    padding-top: 48px;
    padding-bottom: 48px;
  }
  .stats-header {
    margin-bottom: 32px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .tools-strip {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .editor-body {
    grid-template-columns: 72px 1fr;
  }
  .properties {
    display: none;
  }
  .editor-topbar {
    padding: 0 14px;
    gap: 12px;
  }
  .tool-rail {
    padding: 16px 4px;
  }
  .rail-tool {
    width: 60px;
  }
}

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .tool-grid {
    grid-template-columns: 1fr;
  }
  .page-stage {
    padding: 16px 10px 50px;
  }
  .editor-topbar {
    height: auto;
    padding-block: 10px;
    flex-wrap: wrap;
  }
  .editor-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ==========================================================================
   Service Switcher Options Bar (Homepage Hero)
   ========================================================================== */
.upload-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.service-selector-bar {
  width: 100%;
}

.service-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: none;
}

@media (min-width: 901px) and (max-width: 1120px) {
  .service-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
}

.service-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.service-tab:hover:not(.active) {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.service-tab.active {
  background: #0e1217;
  border-color: #0e1217;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(14, 18, 23, 0.18);
}

/* Service Tab Icon Themes */
.service-tab-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.edit-icon-theme {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}
.service-tab.active .edit-icon-theme {
  background: #dff55f;
  color: #0e1217;
  border-color: #dff55f;
}

.merge-icon-theme {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}
.service-tab.active .merge-icon-theme {
  background: #3b82f6;
  color: #ffffff;
  border-color: #3b82f6;
}

.sign-icon-theme {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}
.service-tab.active .sign-icon-theme {
  background: #f59e0b;
  color: #ffffff;
  border-color: #f59e0b;
}

.compress-icon-theme {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}
.service-tab.active .compress-icon-theme {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
}

/* Service Tab Meta Text */
.service-tab-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.service-tab-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.service-tab-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0e1217;
  white-space: nowrap;
}
.service-tab.active .service-tab-title {
  color: #ffffff;
}

.service-tab-desc {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.service-tab.active .service-tab-desc {
  color: #94a3b8;
}

/* Service Pill Tags */
.service-pill-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tag-lime {
  background: #ecfccb;
  color: #4d7c0f;
}
.service-tab.active .tag-lime {
  background: rgba(223, 245, 95, 0.2);
  color: #dff55f;
}

.tag-blue {
  background: #dbeafe;
  color: #1e40af;
}
.service-tab.active .tag-blue {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

.tag-amber {
  background: #fef3c7;
  color: #92400e;
}
.service-tab.active .tag-amber {
  background: rgba(245, 158, 11, 0.25);
  color: #fcd34d;
}

.tag-emerald {
  background: #d1fae5;
  color: #065f46;
}
.service-tab.active .tag-emerald {
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

@media (max-width: 500px) {
  .service-tabs {
    grid-template-columns: 1fr;
  }
}

/* Tool card action link */
.tool-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: #0284c7;
  margin-top: auto;
  padding-top: 14px;
  transition: var(--transition);
}

.tool-card:hover .tool-action-btn {
  color: #0369a1;
  transform: translateX(3px);
}

/* Ecosystem Roadmap Banner */
.ecosystem-banner {
  grid-column: 1 / -1;
  background: #f8fafc;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-top: 16px;
}

.ecosystem-header {
  text-align: center;
  margin-bottom: 20px;
}

.ecosystem-header h3 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 6px 0 4px;
}

.ecosystem-header p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.badge-mini {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(14, 165, 233, 0.1);
  color: #0284c7;
  letter-spacing: 0.05em;
}

.ecosystem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.eco-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 14px 16px;
  border-radius: var(--radius-md);
}

.eco-icon {
  font-size: 22px;
  line-height: 1;
}

.eco-item strong {
  display: block;
  font-size: 13.5px;
  margin-bottom: 2px;
}

.eco-item small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* ==========================================================================
   SEO Sections: How It Works, Comparison Matrix, FAQ, Footer
   ========================================================================== */

.seo-section {
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 68px clamp(20px, 5vw, 80px) 72px;
}

.seo-section .section-heading {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 36px;
}

.seo-section .section-heading .section-kicker {
  display: inline-block;
  margin-bottom: 8px;
}

.seo-section .section-heading h2 {
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  font-weight: 800;
  color: var(--ink);
}

.seo-section .section-heading .section-subtext {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

/* 1. How It Works Steps */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.step-card:hover {
  border-color: var(--ink);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.step-number {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.step-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(223, 245, 95, 0.2);
  color: #1a2e05;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}

.step-card h3 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.step-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* 2. Comparison Table */
.table-responsive-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-top: 24px;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.comparison-table th,
.comparison-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.comparison-table th {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f8fafc;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table .col-highlight {
  background: rgba(223, 245, 95, 0.08);
  font-weight: 600;
}

.comparison-table th.col-highlight {
  background: rgba(223, 245, 95, 0.22);
  color: #1a2e05;
  font-weight: 800;
}

.check-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  background: #dcfce7;
  color: #15803d;
  font-size: 12.5px;
  font-weight: 700;
}

.cross-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 12.5px;
  font-weight: 600;
}

/* 3. FAQ Accordion */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.faq-item.open {
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  text-align: left;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.faq-question:hover {
  background: rgba(0, 0, 0, 0.02);
}

.faq-chevron {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
  color: var(--ink);
}

.faq-answer {
  display: none;
  padding: 0 22px 20px;
  font-size: 14.5px;
  color: #475569;
  line-height: 1.6;
}

.faq-item.open .faq-answer {
  display: block;
  animation: faqFadeIn 0.2s ease-out;
}

@keyframes faqFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 4. Semantic SEO Footer */
.site-footer {
  margin-top: 80px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
  padding-top: 64px;
  color: var(--ink);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto 48px;
  padding: 0 clamp(20px, 5vw, 80px);
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand-col .brand {
  margin-bottom: 14px;
  display: inline-flex;
}

.footer-desc {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 16px;
  max-width: 320px;
}

.privacy-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(22, 163, 74, 0.1);
  color: #15803d;
  border: 1px solid rgba(22, 163, 74, 0.2);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.footer-links-col h4 {
  font-size: 13.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin-bottom: 16px;
}

.footer-links-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links-col a {
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-links-col a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 24px clamp(20px, 5vw, 80px) 32px;
}

.footer-bottom-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
  text-align: center;
}

.footer-disclaimer {
  font-size: 11.5px;
  color: #94a3b8;
  max-width: 720px;
  margin: 0 auto;
}

/* Responsive Breakpoints */
@media (max-width: 960px) {
  .footer-container {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .steps-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .footer-container {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .comparison-table th,
  .comparison-table td {
    padding: 12px 14px;
    font-size: 13px;
  }
}

