:root {
  --bg: #f7efe3;
  --panel: rgba(255, 250, 244, 0.9);
  --panel-strong: #fff7ee;
  --text: #26170f;
  --muted: #705648;
  --accent: #bb4b27;
  --accent-dark: #8b3014;
  --accent-soft: rgba(187, 75, 39, 0.12);
  --stroke: rgba(65, 39, 26, 0.12);
  --shadow: 0 24px 70px rgba(77, 38, 20, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 999px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 187, 125, 0.45), transparent 34%),
    radial-gradient(circle at right 20%, rgba(187, 75, 39, 0.13), transparent 28%),
    linear-gradient(180deg, #f5eadc 0%, #f7efe3 48%, #efe2d0 100%);
}

.page-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 28px;
}

.hero-copy,
.hero-card,
.panel {
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
}

.hero-copy {
  padding: 34px;
}

.hero-card {
  padding: 28px;
  background: linear-gradient(180deg, rgba(187, 75, 39, 0.96), rgba(122, 40, 19, 0.97));
  color: #fff7f1;
}

.eyebrow,
.section-kicker,
.hero-card-label {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 800;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Georgia", "Times New Roman", serif;
  line-height: 1.05;
}

h1 {
  font-size: clamp(2.6rem, 5vw, 4.6rem);
  max-width: 11ch;
}

h2 {
  font-size: clamp(1.55rem, 2.8vw, 2.15rem);
}

h3 {
  font-size: 1.2rem;
}

.hero-text,
.mode-description,
.summary-card p,
.cocktail-meta,
.ingredient-meta,
.empty-state,
.inline-note,
.saved-card p,
.print-subline {
  color: var(--muted);
  line-height: 1.6;
}

.hero-text {
  margin: 18px 0 0;
  font-size: 1.04rem;
  max-width: 62ch;
}

.hero-card ul {
  margin: 18px 0 0;
  padding-left: 18px;
  line-height: 1.8;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  gap: 24px;
}

.results-column {
  display: grid;
  gap: 24px;
}

.panel {
  padding: 24px;
}

.controls-panel {
  position: sticky;
  top: 18px;
  align-self: start;
}

.section-heading,
.mini-heading {
  margin-bottom: 18px;
}

.section-heading,
.mini-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.heading-copy {
  min-width: 0;
}

.collapse-toggle {
  border: 0;
  background: rgba(38, 23, 15, 0.06);
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.collapsible-body {
  display: block;
}

.is-collapsed > .collapsible-body {
  display: none;
}

.stacked-section + .stacked-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(65, 39, 26, 0.1);
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
  padding: 6px;
  background: rgba(112, 86, 72, 0.08);
  border-radius: var(--radius-md);
}

.mode-button,
.ghost-button,
.chip,
.primary-button,
.ghost-pill {
  font: inherit;
}

.mode-button {
  border: 0;
  background: transparent;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 800;
  color: var(--muted);
  cursor: pointer;
  transition: 180ms ease;
}

.mode-button.active {
  background: var(--text);
  color: #fff6ef;
}

.mode-panel {
  display: none;
}

.mode-panel.active {
  display: block;
}

.field-label {
  display: block;
  margin: 16px 0 8px;
  font-weight: 700;
}

.search-input,
.textarea-input {
  width: 100%;
  border: 1px solid rgba(65, 39, 26, 0.16);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.72);
  font: inherit;
  outline: none;
}

.textarea-input {
  min-height: 104px;
  resize: vertical;
}

.search-input:focus,
.textarea-input:focus {
  border-color: rgba(187, 75, 39, 0.65);
  box-shadow: 0 0 0 4px rgba(187, 75, 39, 0.12);
}

.selection-summary,
.action-row,
.saved-actions,
.inline-form {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.selection-summary {
  margin: 14px 0;
}

.action-row,
.inline-form {
  margin-top: 14px;
}

.inline-form .search-input {
  flex: 1;
}

.ghost-button,
.ghost-pill {
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  font-weight: 800;
  cursor: pointer;
}

.primary-button,
.ghost-pill {
  border-radius: 999px;
  padding: 12px 16px;
}

.primary-button {
  border: 0;
  background: var(--text);
  color: #fff7f1;
  font-weight: 800;
  cursor: pointer;
}

.ghost-pill {
  background: rgba(38, 23, 15, 0.06);
}

.wide-button {
  margin-top: 14px;
  width: 100%;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.chip {
  border: 1px solid rgba(65, 39, 26, 0.12);
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: 180ms ease;
}

.chip.active,
.chip:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff9f4;
  transform: translateY(-1px);
}

.summary-grid,
.card-grid,
.saved-list,
.shopping-grid {
  display: grid;
  gap: 14px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.summary-card,
.result-card,
.saved-card,
.print-sheet {
  border-radius: 20px;
  background: var(--panel-strong);
  border: 1px solid rgba(65, 39, 26, 0.1);
  padding: 18px;
}

.summary-card strong,
.result-card strong {
  display: block;
  font-size: 1.5rem;
  font-family: "Georgia", "Times New Roman", serif;
  margin-top: 6px;
}

.summary-card p {
  margin: 6px 0 0;
}

.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.card-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.result-card h3,
.saved-card h4,
.print-sheet h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
  font-family: "Georgia", "Times New Roman", serif;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.9rem;
  background: rgba(38, 23, 15, 0.08);
  color: var(--text);
  border: 0;
}

.tag.highlight {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
}

.empty-state {
  border: 1px dashed rgba(65, 39, 26, 0.18);
  border-radius: 20px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.42);
}

.inline-note {
  min-height: 24px;
  margin-top: 10px;
}

.saved-card {
  display: grid;
  gap: 10px;
}

.saved-card .tag,
.saved-card .ghost-pill {
  cursor: pointer;
}

.saved-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.mini-form + .mini-form {
  margin-top: 18px;
}

.print-preview {
  display: grid;
  gap: 16px;
}

.print-sheet {
  background: linear-gradient(180deg, rgba(255, 247, 238, 1) 0%, rgba(250, 242, 234, 1) 100%);
}

.print-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(65, 39, 26, 0.1);
}

.print-header h3 {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

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

.print-cocktail {
  padding: 14px 0;
  border-top: 1px solid rgba(65, 39, 26, 0.08);
}

.print-cocktail:first-child {
  border-top: 0;
  padding-top: 0;
}

.print-cocktail strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.06rem;
}

.calc-toolbar {
  margin-bottom: 18px;
}

.shopping-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 18px;
}

.shopping-card {
  border-radius: 20px;
  background: var(--panel-strong);
  border: 1px solid rgba(65, 39, 26, 0.1);
  padding: 18px;
}

.shopping-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-family: "Georgia", "Times New Roman", serif;
}

.shopping-meta {
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 980px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

  .controls-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1280px);
    padding-top: 16px;
  }

  .hero-copy,
  .hero-card,
  .panel {
    padding: 20px;
  }

  .mode-switch,
  .action-row,
  .inline-form {
    grid-template-columns: 1fr;
    display: grid;
  }

  .selection-summary,
  .saved-actions,
  .print-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .hero,
  .controls-panel,
  .insight-panel,
  #upgrade-ingredients,
  #nearby-cocktails,
  #direct-cocktails {
    display: none !important;
  }

  .layout,
  .results-column,
  .print-preview,
  .print-grid {
    display: block;
  }

  .panel,
  .print-sheet {
    border: 0;
    box-shadow: none;
    padding: 0;
    background: #ffffff;
  }

  .page-shell {
    width: 100%;
    padding: 0;
  }
}
