/* ==========================================================================
   CartaAI - Matte Architectural SaaS Design (Multi-Page & Continuous Paper)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&family=Newsreader:ital,wght@0,500;0,600;1,500&family=Playfair+Display:ital,wght@0,600;0,700;1,600&family=Courier+Prime:wght@400;700&display=swap');

:root {
  /* Matte Professional Color Tokens */
  --bg-app: #0f172a;
  --bg-panel: #1e293b;
  --bg-element: #334155;
  --bg-element-hover: #475569;
  
  --border-matte: #475569;
  --border-subtle: #334155;
  
  /* Matte Accents */
  --btn-matte-blue: #2563eb;
  --btn-matte-slate: #334155;
  --btn-matte-amber: #d97706;
  --btn-matte-indigo: #4f46e5;
  --btn-matte-emerald: #059669;

  /* Typography Options */
  --font-ui: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-serif: 'Newsreader', Georgia, serif;

  /* Text Colors */
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;

  /* Paper Sheet Default Variables */
  --paper-bg: #ffffff;
  --paper-text: #0f172a;
  --paper-accent: #0f172a;
  --paper-border: #cbd5e1;
  --paper-font: 'Newsreader', Georgia, serif;
  --paper-line-style: solid;

  --radius-flat: 4px;
}

/* Custom Scrollbar System */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: #0f172a;
  border-left: 1px solid var(--border-subtle);
}

::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 2px;
  border: 2px solid #0f172a;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

* {
  scrollbar-width: auto;
  scrollbar-color: #475569 #0f172a;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0 !important;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.app-header {
  height: 60px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f172a;
  border-bottom: 1px solid var(--border-matte);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-main);
  text-decoration: none;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--bg-panel);
  border: 1px solid var(--border-matte);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.brand-badge {
  font-size: 0.7rem;
  background: var(--btn-matte-amber);
  color: #ffffff;
  font-weight: 700;
  padding: 2px 8px;
  letter-spacing: 0.5px;
}

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

.user-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border-matte);
  font-size: 0.85rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--btn-matte-emerald);
}
.status-dot.inactive { background: var(--btn-matte-amber); }

/* MATTE FLAT BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.55rem 1rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius-flat) !important;
  box-shadow: none !important;
}

.btn-primary {
  background: var(--btn-matte-blue);
  color: #ffffff;
  border-color: #1d4ed8;
}
.btn-primary:hover { background: #1d4ed8; }

.btn-secondary {
  background: var(--bg-element);
  border-color: var(--border-matte);
  color: var(--text-main);
}
.btn-secondary:hover { background: var(--bg-element-hover); }

.btn-gold {
  background: var(--btn-matte-amber);
  color: #ffffff;
  border-color: #b45309;
}
.btn-gold:hover { background: #b45309; }

.btn-ai {
  background: var(--btn-matte-indigo);
  color: #ffffff;
  border-color: #4338ca;
}
.btn-ai:hover { background: #4338ca; }

.btn-icon-only {
  padding: 5px 9px;
  background: var(--bg-element);
  border: 1px solid var(--border-matte);
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-flat) !important;
}
.btn-icon-only:hover {
  color: var(--text-main);
  background: var(--bg-element-hover);
}

/* Views */
.view-container { display: none; }
.view-container.active { display: block; }

.glass-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-matte);
  box-shadow: none;
  border-radius: var(--radius-flat) !important;
}
.glass-card:hover { border-color: #64748b; }

/* Auth Layout */
.auth-wrapper {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #0f172a;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 2rem;
}

.auth-title {
  font-family: var(--font-ui);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  text-align: center;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.form-group { margin-bottom: 1rem; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: #0f172a;
  border: 1px solid var(--border-matte);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  border-radius: var(--radius-flat) !important;
}

.form-input:focus { border-color: var(--btn-matte-blue); }

.auth-toggle {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.auth-toggle a { color: #60a5fa; cursor: pointer; font-weight: 600; }

.demo-presets {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-matte);
  text-align: center;
}

.demo-presets-title {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.demo-btn-group { display: flex; gap: 8px; }
.demo-btn-group .btn { flex: 1; font-size: 0.8rem; }

/* Activation Gateway */
.activation-wrapper {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.activation-card {
  width: 100%;
  max-width: 500px;
  padding: 2.25rem;
  text-align: center;
}

.activation-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--btn-matte-amber);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.activation-title {
  font-family: var(--font-ui);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.activation-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.key-input-box input {
  width: 100%;
  text-align: center;
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 0.8rem;
  background: #0f172a;
  border: 1px solid var(--border-matte);
  color: #fbbf24;
  outline: none;
  border-radius: var(--radius-flat) !important;
}

.sample-keys-list {
  background: #0f172a;
  border: 1px solid var(--border-matte);
  padding: 0.85rem;
  margin-top: 1.25rem;
  text-align: left;
}

.sample-keys-title {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.key-tag {
  display: inline-block;
  padding: 3px 8px;
  background: var(--bg-element);
  border: 1px solid var(--border-matte);
  color: #93c5fd;
  font-family: monospace;
  font-size: 0.8rem;
  cursor: pointer;
  margin-right: 4px;
  margin-bottom: 4px;
  border-radius: var(--radius-flat) !important;
}

/* Dashboard */
.dashboard-wrapper {
  padding: 2rem 1.5rem;
  max-width: 1300px;
  margin: 0 auto;
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.dash-title-group h1 {
  font-family: var(--font-ui);
  font-size: 1.75rem;
  font-weight: 700;
}

.dash-title-group p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 2px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon-wrapper {
  width: 42px;
  height: 42px;
  background: var(--bg-element);
  border: 1px solid var(--border-matte);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.stat-info .stat-value {
  font-family: var(--font-ui);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
}

.stat-info .stat-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 4px;
}

.section-title-bar { margin-bottom: 1rem; }
.section-title-bar h2 { font-family: var(--font-ui); font-size: 1.2rem; font-weight: 700; }

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.doc-card {
  display: flex;
  flex-direction: column;
  height: 330px;
  overflow: hidden;
}

.doc-preview-thumb {
  height: 150px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.doc-preview-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.doc-card:hover .doc-preview-thumb-overlay { opacity: 1; }

.doc-content-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.doc-title {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.doc-meta { color: var(--text-dim); font-size: 0.75rem; margin-top: 3px; }

.doc-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-matte);
}

.qr-mini-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #38bdf8;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  background: #0f172a;
  padding: 3px 8px;
  border: 1px solid var(--border-matte);
}

.create-doc-card {
  border: 2px dashed var(--border-matte);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 2rem;
  text-align: center;
  background: transparent;
}

.create-doc-card:hover {
  border-color: var(--btn-matte-blue);
  background: var(--bg-panel);
}

.create-icon-circle {
  width: 44px;
  height: 44px;
  background: var(--bg-element);
  border: 1px solid var(--border-matte);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--text-main);
}

/* ==========================================================================
   WORD EDITOR & CONTINUOUS INFINITE MULTI-PAGE SYSTEM
   ========================================================================== */
.editor-layout {
  height: calc(100vh - 60px);
  display: grid;
  grid-template-columns: 1fr 380px;
  background: #0b1120;
  overflow: hidden;
}

.editor-main-panel {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
  border-right: 1px solid var(--border-matte);
  background: #0f172a;
  overflow: hidden;
}

.word-toolbar {
  padding: 0.55rem 1rem;
  background: #1e293b;
  border-bottom: 1px solid var(--border-matte);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  z-index: 10;
}

.customizer-bar {
  padding: 0.5rem 1rem;
  background: #0f172a;
  border-bottom: 1px solid var(--border-matte);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.8rem;
}

.customizer-label {
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.72rem;
}

.color-swatch-btn {
  width: 22px;
  height: 22px;
  border: 1px solid var(--border-matte);
  cursor: pointer;
  display: inline-block;
  border-radius: 2px !important;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.toolbar-btn {
  padding: 5px 9px;
  background: var(--bg-element);
  border: 1px solid var(--border-matte);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.82rem;
  border-radius: var(--radius-flat) !important;
}

.toolbar-btn:hover, .toolbar-btn.active {
  background: var(--btn-matte-blue);
  color: #fff;
  border-color: var(--btn-matte-blue);
}

.toolbar-select {
  padding: 5px 8px;
  background: #0f172a;
  border: 1px solid var(--border-matte);
  color: var(--text-main);
  font-size: 0.82rem;
  outline: none;
}

.doc-name-input {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  outline: none;
  width: 200px;
}

/* Scroll Area for Digital Paper Sheet */
.canvas-scroll-area {
  flex: 1;
  min-height: 0; /* Critical for flex scroll child */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #090d16;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Realistic Word Paper Sheet - CONTINUOUS INFINITE HEIGHT */
.paper-sheet {
  width: 100%;
  max-width: 760px;
  min-height: 1100px;
  height: auto; /* Grows as content expands - infinite scroll */
  background: var(--paper-bg);
  color: var(--paper-text);
  font-family: var(--paper-font);
  border: 1px solid var(--paper-border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
  padding: 3.5rem 4rem;
  margin-bottom: 4rem;
  transition: background 0.25s ease, color 0.25s ease;
  flex-shrink: 0;
}

/* ── Cover Image Upload Zone ─────────────────────────────── */
.paper-cover-empty {
  width: calc(100% + 8rem); /* bleed to edges of paper */
  margin: -3.5rem -4rem 0 -4rem;
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #f1f5f9;
  border-bottom: 2px dashed #cbd5e1;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 2rem;
}

.paper-cover-empty:hover {
  background: #e2e8f0;
}

.paper-cover-image {
  width: calc(100% + 8rem);
  margin: -3.5rem -4rem 0 -4rem;
  height: 260px;
  background-size: cover;
  background-position: center;
  position: relative;
  margin-bottom: 2rem;
  overflow: hidden;
}

.paper-cover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.paper-cover-image:hover .paper-cover-overlay {
  opacity: 1;
}

.paper-cover-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.55rem 1.1rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.15s;
  letter-spacing: 0.3px;
}

.paper-cover-upload-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* When in empty state, button is dark-on-light */
.paper-cover-empty .paper-cover-upload-btn {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

.paper-cover-empty .paper-cover-upload-btn:hover {
  background: #1e293b;
}

.paper-cover-hint {
  font-size: 0.75rem;
  color: #94a3b8;
  font-family: var(--font-ui);
}

/* ── Paper Header ──────────────────────────────────────────── */

.word-page-break {
  margin: 3.5rem -3.5rem 3.5rem -3.5rem;
  padding: 1.25rem 0;
  background: #090d16;
  border-top: 2px dashed #475569;
  border-bottom: 2px dashed #475569;
  text-align: center;
  color: #cbd5e1;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.word-page-break span {
  background: #1e293b;
  padding: 4px 14px;
  border: 1px solid #475569;
  color: #38bdf8;
}

.paper-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px var(--paper-line-style) var(--paper-border);
}

.paper-title {
  font-family: var(--paper-font);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--paper-accent);
  outline: none;
}

.paper-subtitle {
  font-size: 0.85rem;
  color: var(--paper-text);
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 4px;
  outline: none;
}

.paper-category {
  margin-top: 1.75rem;
  margin-bottom: 1.25rem;
}

.paper-category-title {
  font-family: var(--font-ui);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--paper-accent);
  border-bottom: 2px var(--paper-line-style) var(--paper-border);
  padding-bottom: 4px;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.paper-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.75rem;
}

.item-details { flex: 1; }

.item-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--paper-text);
  outline: none;
}

.item-desc {
  font-size: 0.85rem;
  color: var(--paper-text);
  opacity: 0.8;
  margin-top: 2px;
  outline: none;
}

.item-price {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--paper-accent);
  white-space: nowrap;
  outline: none;
}

.allergen-badge {
  font-size: 0.68rem;
  padding: 1px 5px;
  background: rgba(0,0,0,0.05);
  border: 1px solid var(--paper-border);
  color: var(--paper-text);
  margin-left: 4px;
}

/* AI Copilot Sidebar Panel */
.ai-copilot-panel {
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
  border-left: 1px solid var(--border-matte);
}

.copilot-header {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-matte);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #152033;
}

.copilot-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.9rem;
}

.copilot-body {
  flex: 1;
  overflow-y: scroll !important;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ai-chips-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chip-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ai-action-chip {
  padding: 0.6rem 0.8rem;
  background: var(--bg-element);
  border: 1px solid var(--border-matte);
  color: var(--text-main);
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  border-radius: var(--radius-flat) !important;
}

.ai-action-chip:hover {
  background: var(--bg-element-hover);
  border-color: #64748b;
}

.ai-chat-history {
  flex: 1;
  min-height: 180px;
  background: #0f172a;
  border: 1px solid var(--border-matte);
  padding: 0.85rem;
  overflow-y: scroll !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-bubble {
  padding: 0.65rem 0.85rem;
  font-size: 0.82rem;
  line-height: 1.4;
  max-width: 92%;
  border-radius: var(--radius-flat) !important;
}

.chat-bubble.user {
  align-self: flex-end;
  background: var(--btn-matte-blue);
  color: #fff;
}

.chat-bubble.ai {
  align-self: flex-start;
  background: var(--bg-element);
  border: 1px solid var(--border-matte);
  color: var(--text-main);
}

.copilot-footer {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border-matte);
  background: #152033;
}

.ai-input-box {
  display: flex;
  gap: 6px;
}

.ai-input-box input {
  flex: 1;
  padding: 0.6rem 0.85rem;
  background: #0f172a;
  border: 1px solid var(--border-matte);
  color: var(--text-main);
  font-size: 0.82rem;
  outline: none;
  border-radius: var(--radius-flat) !important;
}

/* Mobile Device Modal */
.mobile-device-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
}

.mobile-device-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.iphone-frame {
  width: 360px;
  height: 720px;
  background: #000;
  border: 8px solid #334155;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.iphone-notch {
  width: 130px;
  height: 22px;
  background: #334155;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.iphone-screen {
  flex: 1;
  background: #ffffff;
  overflow-y: scroll !important;
  margin-top: 12px;
}

.close-modal-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
}

/* Public Menu Page */
.public-menu-container {
  max-width: 480px;
  margin: 0 auto;
  background: var(--paper-bg);
  color: var(--paper-text);
  font-family: var(--paper-font);
  min-height: 100vh;
  border-left: 1px solid #cbd5e1;
  border-right: 1px solid #cbd5e1;
}

.public-hero {
  height: 180px;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 1.25rem;
}

.public-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 80%);
}

.public-hero-info {
  position: relative;
  z-index: 2;
  color: #fff;
}

.public-hero-title {
  font-family: var(--paper-font);
  font-size: 1.6rem;
}

.public-nav-tabs {
  display: flex;
  gap: 6px;
  padding: 0.75rem;
  overflow-x: auto;
  background: var(--paper-bg);
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.public-tab {
  padding: 6px 12px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
  cursor: pointer;
}

.public-tab.active {
  background: var(--paper-accent);
  color: #fff;
}

.public-category-block { padding: 1.25rem 0.85rem; }

.public-category-title {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--paper-accent);
  margin-bottom: 0.85rem;
  padding-bottom: 4px;
  border-bottom: 2px var(--paper-line-style) var(--paper-accent);
}

.public-item-card {
  background: var(--paper-bg);
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--paper-border);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.public-item-price {
  font-weight: 700;
  color: var(--paper-accent);
  font-size: 1rem;
}

.public-footer-bar {
  position: sticky;
  bottom: 0;
  background: var(--paper-bg);
  padding: 0.85rem;
  border-top: 1px solid #e2e8f0;
}

/* AI Typing Animation */
.typing-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0.8rem 1rem !important;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: #60a5fa;
  border-radius: 50% !important;
  animation: typing-pulse 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-pulse {
  0%, 80%, 100% { transform: scale(1); opacity: 0.5; }
  40% { transform: scale(1.3); opacity: 1; }
}

.chat-bubble { animation: fadeInUp 0.2s ease; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Animate fade in */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn 0.35s ease; }

/* Modal Backdrop */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-matte);
  padding: 1.75rem;
  width: 100%;
  max-width: 480px;
}

.qr-display-box {
  background: #ffffff;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1.25rem 0;
  border: 1px solid var(--border-matte);
}

.qr-link-url {
  font-family: monospace;
  font-size: 0.8rem;
  color: #2563eb;
  background: #eff6ff;
  padding: 4px 10px;
  border: 1px solid #bfdbfe;
  margin-top: 10px;
  word-break: break-all;
}

@media (max-width: 850px) {
  .editor-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .ai-copilot-panel {
    border-left: none;
    border-top: 1px solid var(--border-matte);
    height: 400px;
  }
}

/* Cloud Sync Status Indicator */
.sync-status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-flat) !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sync-status-badge.saved {
  background: #064e3b;
  color: #6ee7b7;
  border: 1px solid #059669;
}
.sync-status-badge.syncing {
  background: #1e3a8a;
  color: #93c5fd;
  border: 1px solid #2563eb;
  animation: pulse 1.5s infinite;
}
.sync-status-badge.offline,
.sync-status-badge.local {
  background: #451a03;
  color: #fcd34d;
  border: 1px solid #d97706;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Table Pill in Public View */
.public-table-pill {
  background: #d97706;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  display: inline-block;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

