:root {
  --bg-primary: #09090b;
  --bg-secondary: #18181b;
  --bg-card: #27272a;
  --bg-card-hover: #3f3f46;
  --bg-input: #121215;
  --border-color: #3f3f46;
  --border-focus: #ec4899;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent: #ec4899;
  --accent-hover: #db2777;
  --accent-light: rgba(236, 72, 153, 0.12);
  --purple: #8b5cf6;
  --purple-light: rgba(139, 92, 246, 0.12);
  --gold: #eab308;
  --cyan: #06b6d4;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --radius: 14px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="light"] {
  --bg-primary: #fafafa;
  --bg-secondary: #f4f4f5;
  --bg-card: #ffffff;
  --bg-card-hover: #f4f4f5;
  --bg-input: #f4f4f5;
  --border-color: #e4e4e7;
  --border-focus: #db2777;
  --text-primary: #09090b;
  --text-secondary: #52525b;
  --text-muted: #a1a1aa;
  --accent: #db2777;
  --accent-hover: #be185d;
  --accent-light: rgba(219, 39, 119, 0.08);
  --purple: #7c3aed;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
}

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

body {
  font-family: var(--font);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s, color 0.2s;
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
  width: 100%;
}

/* Header */
header {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-badge {
  font-size: 0.72rem;
  background: var(--accent-light);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 700;
  margin-left: 6px;
}

.back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}
.back-link:hover {
  color: var(--accent);
}

.theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s;
}
.theme-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Presets Bar */
.presets-bar {
  margin: 22px 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.presets-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.preset-chip {
  padding: 8px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 20px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.preset-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* Main Grid */
.calc-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  margin-bottom: 32px;
}

@media (max-width: 860px) {
  .calc-grid {
    grid-template-columns: 1fr;
  }
}

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

.card-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

/* Form inputs */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 520px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-sublabel {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 1.05rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 700;
  transition: border-color 0.2s;
}
.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
}

.btn-toggle-group {
  display: flex;
  gap: 8px;
}

.btn-toggle {
  flex: 1;
  padding: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-toggle:hover {
  border-color: var(--accent);
}
.btn-toggle.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* Category Checkbox Grid */
.drinks-category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

@media (max-width: 500px) {
  .drinks-category-grid {
    grid-template-columns: 1fr;
  }
}

.drink-check-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.drink-check-card:hover {
  border-color: var(--accent);
}
.drink-check-card input[type="checkbox"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  cursor: pointer;
}
.drink-check-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
}

/* Results Hero */
.results-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.hero-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 18px 14px;
  text-align: center;
}

.hero-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
}

.hero-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 6px;
}

/* Shopping Item Cards */
.shopping-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.shop-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}
.shop-card:hover {
  border-color: var(--border-focus);
}

.shop-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shop-emoji {
  font-size: 1.4rem;
}

.shop-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}

.shop-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.shop-right {
  text-align: right;
}

.shop-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent);
}

.shop-unit {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Action Toolbar */
.action-toolbar {
  display: flex;
  gap: 10px;
}

.btn-primary {
  flex: 1;
  padding: 14px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-weight: 800;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}
.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  padding: 14px 18px;
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

/* Sticky Mobile Bar */
.sticky-mobile-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 10px 16px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
  z-index: 900;
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 768px) {
  .sticky-mobile-bar {
    display: flex;
  }
}

.sticky-metric {
  display: flex;
  flex-direction: column;
}
.sticky-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}
.sticky-val {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
}

.sticky-btn {
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Ad Slot Container */
.ad-slot-container {
  margin: 32px 0 24px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius);
  text-align: center;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.ad-disclaimer {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

/* SEO Section */
.seo-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 36px 32px;
  margin-top: 32px;
}

.seo-section h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.seo-section h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 28px 0 12px;
}

.seo-section p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.seo-box {
  background: var(--bg-input);
  border-left: 4px solid var(--accent);
  padding: 16px;
  border-radius: 4px;
  margin: 20px 0;
  color: var(--text-primary);
  font-size: 0.92rem;
}

/* FAQ Accordion */
.faq-accordion {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-question {
  padding: 16px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-answer {
  padding: 0 16px 16px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* Related Apps Cluster */
.related-cluster {
  margin-top: 32px;
  padding: 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

.related-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.related-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.related-app-card {
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}
.related-app-card:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
