:root {
  color-scheme: light;
  --surface-page: #fbf8f2;
  --surface-card: #ffffff;
  --surface-accent: #fbefd9;
  --text-primary: #241e15;
  --text-secondary: #5d5344;
  --text-inverse: #fdfaf4;
  --border-color: #e7decd;
  --amber-3: #e9a83e;
  --font-serif: "Literata", Georgia, serif;
  --font-sans: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-card: 0 1px 2px rgba(90, 70, 30, 0.06),
    0 4px 14px rgba(90, 70, 30, 0.07);
  --shadow-raised: 0 2px 6px rgba(90, 70, 30, 0.08),
    0 10px 30px rgba(90, 70, 30, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--surface-page);
  overflow-x: hidden;
}

body {
  background-color: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
}

.min-h-screen {
  background: transparent;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 80px;
  padding-top: 88px;
  width: 100%;
}

.principal-container,
.app-boot {
  align-items: center;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  width: 100%;
}

.app-boot {
  padding: 88px 16px 80px;
}

.app-header {
  align-items: center;
  background: rgba(251, 248, 242, 0.9);
  border-bottom: 1px solid rgba(68, 58, 40, 0.08);
  display: flex;
  justify-content: space-between;
  left: 0;
  min-height: 72px;
  padding: 1rem clamp(1rem, 3vw, 2rem);
  position: fixed;
  right: 0;
  top: 0;
  z-index: 50;
}

@supports (backdrop-filter: blur(12px)) {
  .app-header {
    backdrop-filter: blur(14px);
  }
}

.logo-link,
.header-actions,
.language-switcher,
.language-options {
  align-items: center;
  display: inline-flex;
}

.app-logo {
  display: block;
  height: 40px;
  width: 40px;
}

.header-actions {
  gap: 0.75rem;
}

.language-switcher {
  gap: 0.65rem;
}

.language-switcher-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 800;
}

.language-options {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  gap: 0.15rem;
  padding: 0.18rem;
}

.language-option {
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--text-primary);
  cursor: pointer;
  font: 800 0.78rem/1.1 var(--font-sans);
  min-width: 2.35rem;
  padding: 0.48rem 0.58rem;
}

.language-option.active {
  background: var(--text-primary);
  color: var(--text-inverse);
}

.mobile-menu-button,
.mobile-menu,
.mobile-menu-overlay {
  display: none;
}

.search-section,
.search-input-wrapper {
  display: flex;
  justify-content: center;
  min-width: 0;
  width: 100%;
}

.search-input-shell,
.app-boot__shell {
  color: var(--text-primary);
  margin: 0 auto;
  max-width: min(820px, calc(100vw - 32px));
  min-width: 0;
  padding: 20px;
  width: 100%;
}

.search-input-shell h2,
.app-boot__title {
  color: var(--text-primary);
  font: 600 clamp(1.8rem, 2.2vw + 1rem, 2.7rem) / 1.12 var(--font-serif);
  margin: 0 0 0.5rem;
  text-wrap: balance;
}

.help-text,
.app-boot__text {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.5;
  margin: 0 auto 1.75rem;
  max-width: 620px;
}

.categories-container {
  margin: 0 auto 2rem;
  max-width: 720px;
  width: 100%;
}

.categories-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.category-chip {
  appearance: none;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
  color: var(--text-secondary);
  cursor: pointer;
  font: 700 0.95rem/1 var(--font-sans);
  padding: 0.72rem 1rem;
}

.input-wrapper,
.app-boot__panel {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  min-height: 220px;
  min-width: 0;
  padding: 1.25rem;
  width: 100%;
}

.custom-textarea,
.app-boot__placeholder {
  color: var(--text-primary);
  font: 400 1.08rem/1.55 var(--font-sans);
  margin: 0 0 1rem;
  min-height: 120px;
  text-align: left;
}

.app-boot__placeholder {
  color: #8a7e6b;
}

.submit-button,
.app-boot__button {
  align-items: center;
  align-self: flex-end;
  background: var(--text-primary);
  border: 1px solid var(--text-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  color: var(--text-inverse);
  display: inline-flex;
  font: 700 0.98rem/1 var(--font-sans);
  gap: 0.5rem;
  justify-content: center;
  padding: 0.85rem 1.35rem;
}

@media (max-width: 768px) {
  .min-h-screen,
  .app-boot {
    padding-left: 12px;
    padding-right: 12px;
  }

  .header-actions > .language-switcher {
    display: none;
  }

  .mobile-menu-button {
    appearance: none;
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    height: 40px;
    justify-content: center;
    padding: 0 10px;
    width: 44px;
  }

  .hamburger-line {
    background: var(--text-primary);
    border-radius: 999px;
    display: block;
    height: 2px;
    width: 100%;
  }

  .search-input-shell,
  .app-boot__shell {
    max-width: calc(100vw - 24px);
    padding: 16px 0;
  }
}

@media (max-width: 480px) {
  .search-input-shell h2,
  .app-boot__title {
    font-size: clamp(1.55rem, 7vw, 1.9rem);
    margin-inline: auto;
    max-width: 12ch;
    overflow-wrap: break-word;
  }

  .categories-grid {
    display: grid;
    gap: 0.55rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-chip,
  .submit-button,
  .app-boot__button {
    width: 100%;
  }

  .input-wrapper,
  .app-boot__panel {
    min-height: 200px;
    padding: 1rem;
  }
}
