/* ==========================================================================
   MathForge - High-End Academic Theme (Editorial Luxury)
   ========================================================================== */

:root {
  /* Editorial Luxury Color Palette */
  --bg-cream: #FDFBF7;
  --bg-cream-alt: #F9F6EE;
  --bg-white: #FFFFFF;
  
  --text-espresso: #292524;
  --text-charcoal: #1C1917;
  --text-muted: #78716C;
  --text-light: #A8A29E;
  
  --accent-gold: #D4AF37;
  --accent-ink: #0F172A;
  
  --border-delicate: rgba(0, 0, 0, 0.05);
  --border-hover: rgba(0, 0, 0, 0.12);
  
  --shadow-diffused: 0 30px 60px -15px rgba(28, 25, 23, 0.05);
  --shadow-inner: inset 0 1px 1px rgba(255, 255, 255, 0.8);
  
  /* Haptic Motion Physics */
  --ease-fluid: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* Spatial Rhythm */
  --radius-outer: 2.5rem;
  --radius-inner: calc(2.5rem - 0.5rem);
  --radius-pill: 9999px;
  --radius-sm: 0.75rem;
}

/* ==========================================================================
   Reset & Base Typography
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-cream);
  color: var(--text-charcoal);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Haptic Noise / Film Grain (Fixed pseudo-element) */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.04;
  mix-blend-mode: multiply;
}

/* Typography Classes */
.serif-title {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  color: var(--text-espresso);
  letter-spacing: -0.02em;
}

.sans-title {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sans-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.badge-eyebrow {
  display: inline-block;
  border-radius: var(--radius-pill);
  background: var(--bg-cream-alt);
  border: 1px solid var(--border-delicate);
  padding: 0.35rem 1rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   Header
   ========================================================================== */
.app-header {
  padding: 6rem 2rem 4rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.app-header .serif-title {
  font-size: 4.5rem;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.app-header .subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 500px;
  line-height: 1.6;
}

/* ==========================================================================
   Double-Bezel Architecture (Nested Containers)
   ========================================================================== */
.app-container {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.section-margin {
  margin-top: 4rem;
  margin-bottom: 6rem;
}

/* Outer Shell */
.bezel-outer {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-delicate);
  padding: 0.5rem; /* The nest gap */
  border-radius: var(--radius-outer);
  transition: transform 0.6s var(--ease-fluid);
}

/* Inner Core */
.bezel-inner {
  background: var(--bg-white);
  border-radius: var(--radius-inner);
  box-shadow: var(--shadow-diffused), var(--shadow-inner);
  padding: 2.5rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

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

/* ==========================================================================
   Scroll Reveal Animation
   ========================================================================== */
.reveal-up {
  opacity: 0;
  transform: translateY(30px);
  animation: revealUp 1s var(--ease-fluid) forwards;
  animation-delay: var(--delay, 0ms);
}

@keyframes revealUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* ==========================================================================
   Buttons (Haptic & Nested CTA)
   ========================================================================== */
.group {
  position: relative;
  cursor: pointer;
  outline: none;
  border: none;
}

.group:active {
  transform: scale(0.98);
}

/* Primary Nested Pill (Button-in-Button) */
.cta-pill {
  background: var(--bg-cream-alt);
  border: 1px solid var(--border-delicate);
  border-radius: var(--radius-pill);
  padding: 0.5rem 0.5rem 0.5rem 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-charcoal);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.4s var(--ease-fluid);
}

.cta-pill.dark {
  background: var(--text-espresso);
  color: var(--bg-white);
  border-color: transparent;
}

.cta-icon-wrapper {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-white);
  border: 1px solid var(--border-delicate);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-charcoal);
  transition: all 0.4s var(--ease-fluid);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.cta-pill.dark .cta-icon-wrapper {
  background: rgba(255,255,255,0.1);
  border-color: transparent;
  color: var(--bg-white);
}

.cta-pill:hover {
  background: var(--bg-white);
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05);
}
.cta-pill.dark:hover {
  background: #000000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.cta-pill:hover .cta-icon-wrapper {
  transform: scale(1.05) translate(2px, 0);
  background: var(--bg-cream-alt);
}
.cta-pill.dark:hover .cta-icon-wrapper {
  background: rgba(255,255,255,0.2);
}

/* Minimalist Action Buttons */
.action-btn {
  background: var(--bg-cream-alt);
  border: 1px solid var(--border-delicate);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-charcoal);
  transition: all 0.4s var(--ease-fluid);
}

.action-btn.outline {
  background: transparent;
}

.action-icon {
  color: var(--text-muted);
  transition: transform 0.4s var(--ease-fluid);
}

.action-btn:hover {
  background: var(--bg-white);
  border-color: var(--border-hover);
  box-shadow: 0 8px 20px -5px rgba(0,0,0,0.04);
}

.action-btn:hover .action-icon {
  transform: translateX(4px);
  color: var(--text-charcoal);
}

.text-link-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.3s;
}
.text-link-btn:hover {
  color: #DC2626; /* Deep Red */
}

/* ==========================================================================
   Toolbar & Editor
   ========================================================================== */
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.toolbar-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.toolbar-row.wrap {
  flex-wrap: wrap;
}

.spacer { flex: 1; }

.toolbar-divider {
  height: 1px;
  background: var(--border-delicate);
  width: 100%;
}

.quick-symbols {
  display: flex;
  background: var(--bg-cream-alt);
  border: 1px solid var(--border-delicate);
  border-radius: var(--radius-pill);
  padding: 0.25rem;
}

.tool-text-btn, .tool-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-charcoal);
  font-family: 'Fira Code', monospace;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--ease-fluid);
}

.tool-text-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}
.tool-text-btn:hover {
  background: var(--bg-white);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.tool-icon-btn {
  background: var(--bg-cream-alt);
  border: 1px solid var(--border-delicate);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.8rem;
}
.tool-icon-btn:hover {
  background: var(--bg-white);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.fraction {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.65rem;
  line-height: 1.1;
}
.fraction span:first-child {
  border-bottom: 1px solid var(--text-charcoal);
  padding-bottom: 1px;
}

.textarea-wrapper {
  flex: 1;
  min-height: 200px;
  margin-bottom: 2rem;
  position: relative;
}

textarea {
  width: 100%;
  height: 100%;
  background: var(--bg-cream-alt);
  border: 1px solid var(--border-delicate);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  color: var(--text-espresso);
  font-family: 'Fira Code', monospace;
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: all 0.4s var(--ease-fluid);
}

textarea:focus {
  background: var(--bg-white);
  border-color: var(--border-hover);
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* ==========================================================================
   Options / Form Elements
   ========================================================================== */
.options-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-cream-alt);
  border: 1px solid var(--border-delicate);
  border-radius: var(--radius-sm);
  padding: 1rem 1.5rem;
  gap: 2rem;
}

.option-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.select-icon {
  position: absolute;
  right: 0.75rem;
  pointer-events: none;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.refined-input {
  appearance: none;
  background: var(--bg-white);
  border: 1px solid var(--border-delicate);
  border-radius: var(--radius-pill);
  padding: 0.5rem 2.5rem 0.5rem 1rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-charcoal);
  outline: none;
  cursor: pointer;
  transition: all 0.3s;
}
.refined-input:focus {
  border-color: var(--text-light);
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

/* Custom Haptic Slider */
.haptic-slider {
  -webkit-appearance: none;
  width: 100px;
  height: 4px;
  background: rgba(0,0,0,0.05);
  border-radius: 2px;
  outline: none;
}
.haptic-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-espresso);
  cursor: pointer;
  transition: transform 0.2s var(--ease-fluid);
}
.haptic-slider::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

/* Colors */
.color-picker-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.color-swatches {
  display: flex;
  gap: 0.5rem;
}
.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: transform 0.3s var(--ease-elastic);
  position: relative;
}
.color-swatch::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 1px solid var(--text-light);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s var(--ease-elastic);
}
.color-swatch.active::after {
  opacity: 1;
  transform: scale(1);
}
.color-swatch:hover {
  transform: translateY(-2px);
}

.custom-color-wrapper {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border-delicate);
}
input[type="color"] {
  width: 150%;
  height: 150%;
  margin: -25%;
  cursor: pointer;
  border: none;
}

/* ==========================================================================
   Preview Area
   ========================================================================== */
.bg-toggle-container {
  display: flex;
  background: var(--bg-cream-alt);
  border: 1px solid var(--border-delicate);
  border-radius: var(--radius-pill);
  padding: 0.25rem;
}
.bg-toggle-btn {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s;
}
.bg-toggle-btn.active {
  background: var(--bg-white);
  color: var(--text-charcoal);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.preview-area {
  flex: 1;
  min-height: 300px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-delicate);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  margin-bottom: 2rem;
  overflow-x: auto;
  overflow-y: hidden;
  transition: background-color 0.4s;
}

.preview-area.light { background: #FFFFFF; }
.preview-area.dark { background: #1C1917; }
.preview-area.checkered {
  background-color: #F9F6EE;
  background-image: 
    linear-gradient(45deg, #F3EFE6 25%, transparent 25%), 
    linear-gradient(-45deg, #F3EFE6 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #F3EFE6 75%), 
    linear-gradient(-45deg, transparent 75%, #F3EFE6 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

#math-output svg {
  margin: auto;
  max-width: none !important;
}

/* ==========================================================================
   Actions Grid
   ========================================================================== */
.actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.col-span-2 {
  grid-column: span 2;
}
.full-width {
  width: 100%;
}
.mt-4 {
  margin-top: 1rem;
}

/* ==========================================================================
   Library Asymmetrical Masonry
   ========================================================================== */
.library-masonry {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.library-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem;
  text-align: center;
  color: var(--text-muted);
}
.empty-icon {
  background: var(--bg-cream-alt);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--text-light);
}

.library-item {
  background: var(--bg-cream-alt);
  border: 1px solid var(--border-delicate);
  border-radius: var(--radius-sm);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.4s var(--ease-fluid);
}

.library-item:hover {
  background: var(--bg-white);
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 15px 30px -10px rgba(0,0,0,0.06);
}

.library-item-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  margin-bottom: 1.5rem;
  overflow: auto;
}

.library-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-delicate);
}

.library-item-code {
  font-family: 'Fira Code', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 85%;
}

.library-item-delete {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  transition: color 0.3s;
}
.library-item-delete:hover {
  color: #DC2626;
}

/* ==========================================================================
   Greek Modal (Haptic Overlay)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(253, 251, 247, 0.7);
  backdrop-filter: blur(20px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease-fluid);
}

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

.modal-bezel {
  width: 90%;
  max-width: 1100px;
  height: 85vh;
  transform: translateY(40px) scale(0.96);
  transition: transform 0.6s var(--ease-fluid);
}
.modal-overlay.active .modal-bezel {
  transform: translateY(0) scale(1);
}

.modal-inner {
  padding: 0;
}

.modal-header {
  padding: 2.5rem 3rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--border-delicate);
}

.serif-title.small {
  font-size: 2.5rem;
  line-height: 1;
}

.modal-close {
  background: var(--bg-cream-alt);
  border: 1px solid var(--border-delicate);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-charcoal);
}

.modal-controls {
  padding: 1.5rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-cream-alt);
  border-bottom: 1px solid var(--border-delicate);
}

.search-box {
  position: relative;
  width: 350px;
}
.search-box i {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}
.search-box input {
  width: 100%;
  background: var(--bg-white);
}

.filter-group {
  display: flex;
  gap: 0.5rem;
}
.filter-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-pill);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s;
}
.filter-btn:hover {
  background: rgba(0,0,0,0.02);
  color: var(--text-charcoal);
}
.filter-btn.active {
  background: var(--text-espresso);
  color: var(--bg-white);
}

.modal-body {
  padding: 3rem;
  overflow-y: auto;
  flex: 1;
}

.greek-masonry {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.greek-card {
  background: var(--bg-cream-alt);
  border: 1px solid var(--border-delicate);
  border-radius: var(--radius-sm);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.4s var(--ease-fluid);
  display: flex;
  flex-direction: column;
}

.greek-card:hover {
  background: var(--bg-white);
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.06);
}

.greek-card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.greek-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-delicate);
}
.badge-lower { color: #64748B; background: var(--bg-white); }
.badge-upper { color: #0F766E; background: #F0FDFA; border-color: #CCFBF1; }
.badge-popular { color: #B45309; background: #FEF3C7; border-color: #FDE68A; display: flex; gap: 0.25rem; align-items: center; }

.greek-symbol {
  font-family: 'Playfair Display', serif;
  font-size: 4rem;
  color: var(--text-charcoal);
  margin: 1.5rem 0;
  transition: transform 0.4s var(--ease-fluid);
}
.greek-card:hover .greek-symbol {
  transform: scale(1.1);
}

.greek-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.greek-divider {
  width: 40px;
  height: 2px;
  background: var(--border-delicate);
  margin: 1rem auto;
}

.greek-codes {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.greek-codes code {
  font-family: 'Fira Code', monospace;
  color: var(--text-espresso);
  font-weight: 500;
}

.greek-usage {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.greek-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-espresso);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s var(--ease-fluid);
}
.greek-card:hover .greek-card-overlay {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Toasts
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 1000;
}

.toast {
  background: var(--bg-white);
  border: 1px solid var(--border-delicate);
  border-left: 3px solid var(--text-charcoal);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-charcoal);
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 15px 35px -10px rgba(0,0,0,0.1);
  animation: toastSlide 0.5s var(--ease-elastic) forwards;
}
.toast.success { border-left-color: #059669; }
.toast.success i { color: #059669; }
.toast.error { border-left-color: #DC2626; }
.toast.error i { color: #DC2626; }

@keyframes toastSlide {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
  font-size: 0.85rem;
  margin-top: auto;
}

/* ==========================================================================
   Responsive Mobile Adjustments
   ========================================================================== */
@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-header {
    padding: 4rem 1rem 2rem;
  }
  .app-header .serif-title {
    font-size: 3rem;
  }
  .options-container {
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
  }
  .actions-grid {
    grid-template-columns: 1fr;
  }
  .col-span-2 {
    grid-column: span 1;
  }
  .modal-bezel {
    width: 100%;
    height: 100vh;
    transform: translateY(100vh);
    border-radius: 0;
  }
  .modal-inner {
    border-radius: 0;
  }
  .modal-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box {
    width: 100%;
  }
}
