/* ==========================================================================
   Infinity Office - Landing Page & Hub Styles
   ========================================================================== */

:root {
  --primary-blue: #2563eb;
  --primary-blue-hover: #1d4ed8;
  --primary-green: #107c41;
  --primary-green-hover: #0a5c30;
  --primary-orange: #ea580c;
  --primary-orange-hover: #c2410c;

  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.09), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

[data-theme="dark"],
html.dark,
body.dark {
  --bg-page: #090d16;
  --bg-surface: #111827;
  --bg-surface-elevated: #1f2937;
  --bg-card: #141d2e;
  --bg-hover: #1e293b;
  --border-color: #243048;
  --border-hover: #334155;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 30px -5px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] body,
html.dark body {
  background-color: var(--bg-page) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .hub-header,
html.dark .hub-header {
  background: rgba(17, 24, 39, 0.92) !important;
  border-bottom-color: var(--border-color) !important;
}

[data-theme="dark"] .hero-glow,
html.dark .hero-glow {
  background: radial-gradient(circle, rgba(37, 99, 235, 0.25) 0%, rgba(124, 58, 237, 0.15) 50%, transparent 70%) !important;
}

[data-theme="dark"] .blank-card,
html.dark .blank-card {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .blank-preview-box,
html.dark .blank-preview-box {
  background: rgba(255, 255, 255, 0.03) !important;
}

[data-theme="dark"] .template-card,
html.dark .template-card {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .template-info-box,
html.dark .template-info-box {
  background: var(--bg-card) !important;
}

[data-theme="dark"] .filter-pill,
html.dark .filter-pill {
  background: var(--bg-surface) !important;
  border-color: var(--border-color) !important;
  color: var(--text-secondary) !important;
}

[data-theme="dark"] .filter-pill:hover,
html.dark .filter-pill:hover {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .filter-pill.active,
html.dark .filter-pill.active {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
}

[data-theme="dark"] .template-search-wrapper,
html.dark .template-search-wrapper {
  background: var(--bg-surface) !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .template-search-input,
html.dark .template-search-input {
  background: transparent !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .recent-item-card,
html.dark .recent-item-card {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .recent-item-card:hover,
html.dark .recent-item-card:hover {
  background: var(--bg-hover) !important;
}

[data-theme="dark"] .hub-footer,
html.dark .hub-footer {
  background: #0b0f19 !important;
  border-top-color: var(--border-color) !important;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.hub-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s ease, border-color 0.2s ease;
}

[data-theme="dark"] .hub-header {
  background: rgba(17, 24, 39, 0.85);
}

.hub-nav-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hub-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.hub-logo-box {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  background: transparent;
}

.hub-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 11px;
  display: block;
}

.hub-brand:hover .hub-logo-box {
  transform: scale(1.06);
}

.hub-brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.hub-nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hub-nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.hub-nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

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

.badge-pwa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
}

[data-theme="dark"] .badge-pwa {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.btn-theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-theme-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  padding: 64px 24px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 350px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, rgba(234, 88, 12, 0.08) 50%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.hero-pill i {
  color: #f59e0b;
}

.hero-title {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.2px;
  margin-bottom: 18px;
  color: var(--text-primary);
}

.hero-title .gradient-brand {
  background: linear-gradient(135deg, #2563eb, #7c3aed 45%, #ea580c);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto 36px;
}

/* Quick launch bar */
.hero-launch-bar {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-launch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-md);
}

.btn-launch:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-launch.docs {
  background: #2563eb;
  color: #ffffff;
}
.btn-launch.docs:hover {
  background: #1d4ed8;
}

.btn-launch.sheets {
  background: #107c41;
  color: #ffffff;
}
.btn-launch.sheets:hover {
  background: #0a5c30;
}

.btn-launch.slides {
  background: #ea580c;
  color: #ffffff;
}
.btn-launch.slides:hover {
  background: #c2410c;
}

.btn-launch.notes {
  background: #f59e0b;
  color: #ffffff;
}
.btn-launch.notes:hover {
  background: #d97706;
}

/* ==========================================================================
   Main Hub Layout
   ========================================================================== */
.hub-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 64px;
  width: 100%;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-subtitle {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ==========================================================================
   Start Blank Section
   ========================================================================== */
.blank-starters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 48px;
}

@media (max-width: 1024px) {
  .blank-starters-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .blank-starters-grid {
    grid-template-columns: 1fr;
  }
}

.blank-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.blank-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
}

.blank-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.blank-card.docs::before { background: #2563eb; }
.blank-card.sheets::before { background: #107c41; }
.blank-card.slides::before { background: #ea580c; }
.blank-card.notes::before { background: #f59e0b; }

.blank-preview-box {
  height: 140px;
  background: var(--bg-hover);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px dashed var(--border-color);
  transition: all 0.2s ease;
}

.blank-card:hover .blank-preview-box {
  background: rgba(37, 99, 235, 0.04);
}
.blank-card.sheets:hover .blank-preview-box {
  background: rgba(16, 124, 65, 0.04);
}
.blank-card.slides:hover .blank-preview-box {
  background: rgba(234, 88, 12, 0.04);
}
.blank-card.notes:hover .blank-preview-box {
  background: rgba(245, 158, 11, 0.06);
}

/* Simulated miniature blank paper / grid / canvas */
.mockup-paper {
  width: 90px;
  height: 110px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mockup-line {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
}
.mockup-line.title {
  width: 60%;
  height: 6px;
  background: #93c5fd;
}

.mockup-grid {
  width: 120px;
  height: 100px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 1px;
  padding: 2px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}
.mockup-cell {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.mockup-cell.header {
  background: #bbf7d0;
}

.mockup-slide {
  width: 130px;
  height: 85px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.mockup-slide-title {
  width: 70%;
  height: 8px;
  background: #fdba74;
  border-radius: 2px;
}
.mockup-slide-subtitle {
  width: 45%;
  height: 5px;
  background: #e2e8f0;
  border-radius: 2px;
}

.blank-icon-overlay {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  font-size: 1rem;
}
.blank-card.docs .blank-icon-overlay { color: #2563eb; }
.blank-card.sheets .blank-icon-overlay { color: #107c41; }
.blank-card.slides .blank-icon-overlay { color: #ea580c; }
.blank-card.notes .blank-icon-overlay { color: #d97706; }

.btn-launch.base {
  background: #b43635;
  color: #ffffff;
}
.btn-launch.base:hover {
  background: #8a1f20;
}
.blank-card.base::before { background: #b43635; }
.blank-card.base:hover .blank-preview-box {
  background: rgba(180, 54, 53, 0.06);
}
.blank-card.base .blank-icon-overlay { color: #b43635; }

.btn-launch.pdf {
  background: #e11d48;
  color: #ffffff;
}
.btn-launch.pdf:hover {
  background: #be123c;
}
.blank-card.pdf::before { background: #e11d48; }
.blank-card.pdf:hover .blank-preview-box {
  background: rgba(225, 29, 72, 0.06);
}
.blank-card.pdf .blank-icon-overlay { color: #e11d48; }

.btn-launch.photo {
  background: #8b5cf6;
  color: #ffffff;
}
.btn-launch.photo:hover {
  background: #7c3aed;
}
.blank-card.photo::before { background: #8b5cf6; }
.blank-card.photo:hover .blank-preview-box {
  background: rgba(139, 92, 246, 0.08);
}
.blank-card.photo .blank-icon-overlay { color: #8b5cf6; }

.btn-launch.sound {
  background: #0d9488;
  color: #ffffff;
}
.btn-launch.sound:hover {
  background: #0f766e;
}
.blank-card.sound::before { background: #0d9488; }
.blank-card.sound:hover .blank-preview-box {
  background: rgba(13, 148, 136, 0.08);
}
.blank-card.sound .blank-icon-overlay { color: #0d9488; }

.btn-launch.video {
  background: #0284c7;
  color: #ffffff;
}
.btn-launch.video:hover {
  background: #0369a1;
}
.blank-card.video::before { background: #0284c7; }
.blank-card.video:hover .blank-preview-box {
  background: rgba(2, 132, 199, 0.08);
}
.blank-card.video .blank-icon-overlay { color: #0284c7; }


.mockup-note {
  width: 95px;
  height: 105px;
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 10px;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.12);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.mockup-note::before {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
}
.mockup-note .mockup-line.title {
  width: 55%;
  height: 6px;
  background: #f59e0b;
}

.blank-card-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.blank-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.blank-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.blank-card-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.blank-card:hover .blank-card-arrow {
  background: var(--text-primary);
  color: var(--bg-surface);
  transform: translateX(3px);
}

/* ==========================================================================
   Templates Gallery Section
   ========================================================================== */
.templates-section {
  margin-bottom: 48px;
}

.template-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.template-filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 8px 16px;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-pill:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.filter-pill.active {
  background: var(--text-primary);
  color: var(--bg-surface);
  border-color: var(--text-primary);
}

.template-search-wrapper {
  position: relative;
  min-width: 280px;
}

.template-search-input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.template-search-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.template-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

.template-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.template-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
}

.template-preview-frame {
  height: 160px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
  padding: 12px;
}

/* Template Miniature Previews */
.preview-mini-doc {
  width: 130px;
  height: 136px;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  transition: transform 0.2s ease;
}

.template-card:hover .preview-mini-doc,
.template-card:hover .preview-mini-sheet,
.template-card:hover .preview-mini-slide {
  transform: translateY(-2px) scale(1.02);
}

.p-bar {
  height: 4px;
  border-radius: 2px;
  background: #e2e8f0;
}
.p-bar.title {
  height: 7px;
  width: 65%;
  background: #2563eb;
  margin-bottom: 2px;
}
.p-bar.sub {
  height: 4px;
  width: 45%;
  background: #94a3b8;
  margin-bottom: 4px;
}
.p-bar.w100 { width: 100%; }
.p-bar.w90 { width: 90%; }
.p-bar.w80 { width: 80%; }
.p-bar.w70 { width: 70%; }
.p-bar.w60 { width: 60%; }
.p-bar.w50 { width: 50%; }
.p-bar.w40 { width: 40%; }
.p-bar.w30 { width: 30%; }

.p-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 2px 0;
}
.p-row-sidebar {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 6px;
  height: 100%;
}
.p-sidebar-col {
  background: #f1f5f9;
  border-radius: 2px;
  padding: 4px 3px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.p-avatar-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #cbd5e1;
  margin: 0 auto 2px;
}

.p-mini-table {
  width: 100%;
  border-collapse: collapse;
  margin: 3px 0;
  border-radius: 2px;
  overflow: hidden;
}
.p-mini-table th, .p-mini-table td {
  padding: 2.5px 3px;
  font-size: 5.5px;
  border: 1px solid #e2e8f0;
  line-height: 1;
}
.p-mini-table th {
  background: #eff6ff;
  font-weight: 700;
  color: #1e40af;
}

/* Sheets Miniature Grid */
.preview-mini-sheet {
  width: 180px;
  height: 125px;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  border: 1px solid #cbd5e1;
  overflow: hidden;
  font-size: 7px;
  transition: transform 0.2s ease;
}

.p-sheet-header-bar {
  background: #f8fafc;
  border-bottom: 1px solid #cbd5e1;
  padding: 3px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.p-sheet-title-text {
  font-size: 7.5px;
  font-weight: 700;
  color: #107c41;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p-sheet-grid-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.p-sheet-grid-table th, .p-sheet-grid-table td {
  border: 1px solid #e2e8f0;
  padding: 2.5px 4px;
  font-size: 6.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
}
.p-sheet-grid-table th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
}
.p-sheet-grid-table th.col-hdr {
  background: #f8fafc;
  color: #64748b;
  font-size: 6px;
  text-align: center;
}
.p-sheet-grid-table td.row-num {
  background: #f8fafc;
  color: #94a3b8;
  font-size: 6px;
  text-align: center;
  width: 14px;
}
.p-sheet-grid-table tr.total-row td {
  font-weight: 700;
  background: #f0fdf4;
}

/* Slides Miniature Canvas */
.preview-mini-slide {
  width: 185px;
  height: 110px;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14), 0 1px 3px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}

.p-slide-badge {
  font-size: 6px;
  font-weight: 700;
  text-transform: uppercase;
  color: #ea580c;
  letter-spacing: 0.5px;
}

.p-slide-headline {
  font-size: 9px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.15;
  margin-top: 2px;
}

.p-slide-subtext {
  font-size: 6.5px;
  color: #64748b;
  margin-top: 2px;
  line-height: 1.2;
}

.p-slide-blocks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: auto;
  padding-top: 4px;
}
.p-slide-block-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 2px;
  padding: 3px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.p-slide-block-title {
  font-size: 6px;
  font-weight: 700;
  color: #0f172a;
}
.p-slide-block-desc {
  height: 3px;
  background: #cbd5e1;
  border-radius: 1px;
}

/* Tag & Badges */
.template-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.12);
  z-index: 2;
}

.template-badge.docs {
  background: #2563eb;
  color: #ffffff;
}
.template-badge.sheets {
  background: #107c41;
  color: #ffffff;
}
.template-badge.slides {
  background: #ea580c;
  color: #ffffff;
}

/* Dark theme adaptation for preview frames */
[data-theme="dark"] .template-preview-frame {
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .preview-mini-doc {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .preview-mini-doc .p-bar {
  background: #334155;
}
[data-theme="dark"] .preview-mini-doc .p-sidebar-col {
  background: #0f172a;
}
[data-theme="dark"] .preview-mini-doc .p-avatar-circle {
  background: #475569;
}
[data-theme="dark"] .p-mini-table th,
[data-theme="dark"] .p-mini-table td {
  border-color: #334155;
  color: #e2e8f0;
}
[data-theme="dark"] .p-mini-table th {
  background: #1e3a8a;
  color: #93c5fd;
}
[data-theme="dark"] .preview-mini-sheet {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .p-sheet-header-bar {
  background: #0f172a;
  border-color: #334155;
}
[data-theme="dark"] .p-sheet-grid-table th,
[data-theme="dark"] .p-sheet-grid-table td {
  border-color: #334155;
  color: #e2e8f0;
}
[data-theme="dark"] .p-sheet-grid-table th {
  background: #0f172a;
  color: #94a3b8;
}
[data-theme="dark"] .p-sheet-grid-table th.col-hdr,
[data-theme="dark"] .p-sheet-grid-table td.row-num {
  background: #0f172a;
  color: #64748b;
}
[data-theme="dark"] .p-sheet-grid-table tr.total-row td {
  background: #064e3b;
}
[data-theme="dark"] .preview-mini-slide:not([style*="background: #0f172a"]) {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .preview-mini-slide .p-slide-headline {
  color: #f8fafc;
}
[data-theme="dark"] .preview-mini-slide .p-slide-subtext {
  color: #94a3b8;
}
[data-theme="dark"] .preview-mini-slide .p-slide-block-card {
  background: #0f172a;
  border-color: #334155;
}
[data-theme="dark"] .preview-mini-slide .p-slide-block-title {
  color: #f8fafc;
}

.template-category-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.template-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
}

.template-desc {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 16px;
  flex: 1;
}

.template-btn-use {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 14px;
  background: var(--bg-hover);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.template-card:hover .template-btn-use {
  background: var(--text-primary);
  color: var(--bg-surface);
}

/* ==========================================================================
   Recent Documents Section
   ========================================================================== */
.recent-docs-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 48px;
  box-shadow: var(--shadow-sm);
}

.recent-docs-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.recent-doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease;
}

.recent-doc-item:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.recent-doc-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.recent-doc-icon.docs { background: rgba(37, 99, 235, 0.15); color: #2563eb; }
.recent-doc-icon.sheets { background: rgba(16, 124, 65, 0.15); color: #107c41; }
.recent-doc-icon.slides { background: rgba(234, 88, 12, 0.15); color: #ea580c; }

.recent-doc-info {
  flex: 1;
  min-width: 0;
}

.recent-doc-title {
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-doc-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.recent-empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
}
.recent-empty-state i {
  font-size: 2.2rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

/* ==========================================================================
   Features Highlight Section
   ========================================================================== */
.features-section {
  margin-bottom: 48px;
}

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

.feature-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.feature-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-hover);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.feature-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.hub-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 40px 24px;
  margin-top: auto;
}

.hub-footer-content {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.hub-footer-links {
  display: flex;
  gap: 18px;
}

.hub-footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
}
.hub-footer-link:hover {
  color: var(--text-primary);
}

.hub-footer-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .blank-starters-grid {
    grid-template-columns: 1fr;
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.3rem;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .template-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .template-search-wrapper {
    width: 100%;
  }
  .hub-nav-links {
    display: none;
  }
}

.btn-launch.cad {
  background: #4f46e5;
  color: #ffffff;
}
.btn-launch.cad:hover {
  background: #4338ca;
  color: #ffffff;
}
.blank-card.cad::before { background: #4f46e5; }
.blank-card.cad:hover .blank-preview-box {
  background: rgba(79, 70, 229, 0.08);
}
.blank-card.cad .blank-icon-overlay { color: #4f46e5; }

/* ==========================================================================
   Chrome Extension Banner
   ========================================================================== */
.extension-banner {
  background: linear-gradient(135deg, #090e1a 0%, #171b38 50%, #0d1224 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 105;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px 12px;
  box-sizing: border-box;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: opacity 0.25s ease, max-height 0.3s ease;
}

.extension-banner[hidden],
.extension-banner.is-dismissed {
  display: none !important;
}

.extension-banner-wrapper {
  position: relative;
  max-width: 980px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.extension-banner-link {
  display: block;
  width: 100%;
  text-decoration: none;
  cursor: pointer;
  line-height: 0;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.extension-banner-link:hover {
  transform: translateY(-2px) scale(1.006);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.35);
}

.extension-banner-img {
  width: 100%;
  height: auto;
  max-height: 190px;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  user-select: none;
  -webkit-user-drag: none;
}

.extension-banner-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #f8fafc;
  cursor: pointer;
  font-size: 0.85rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: all 0.18s ease;
}

[dir="rtl"] .extension-banner-close {
  right: auto;
  left: 8px;
}

.extension-banner-close:hover {
  background: rgba(239, 68, 68, 0.9);
  border-color: rgba(255, 255, 255, 0.6);
  color: #ffffff;
  transform: scale(1.08);
}

@media (max-width: 768px) {
  .extension-banner {
    padding: 4px 6px;
  }
  .extension-banner-img {
    max-height: 140px;
    border-radius: 8px;
  }
  .extension-banner-link {
    border-radius: 8px;
  }
  .extension-banner-close {
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
    top: 6px;
    right: 6px;
  }
  [dir="rtl"] .extension-banner-close {
    right: auto;
    left: 6px;
  }
}
