@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400;1,600&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&display=swap');

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

:root {
  --espresso:    #2C1A0E;
  --roast:       #5C3317;
  --caramel:     #A0622A;
  --gold:        #C8923C;
  --cream:       #F5EBD8;
  --parchment:   #FDF6EC;
  --milk:        #FFFAF3;
  --foam:        #FFFFFF;
  --sage:        #3D6B4F;
  --sage-light:  #D5EAD9;
  --rust:        #B84A2A;
  --rust-light:  #FAE5DC;
  --border:      rgba(92, 51, 23, 0.14);
  --border-md:   rgba(92, 51, 23, 0.22);
  --shadow-sm:   0 1px 4px rgba(44, 26, 14, 0.08);
  --shadow-md:   0 4px 16px rgba(44, 26, 14, 0.10);
  --shadow-lg:   0 8px 32px rgba(44, 26, 14, 0.13);
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --radius-xl:   24px;
  --transition:  all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--parchment);
  background-image:
    radial-gradient(circle at 20% 0%, rgba(200, 146, 60, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(92, 51, 23, 0.06) 0%, transparent 50%);
  min-height: 100vh;
  color: var(--espresso);
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.app-shell {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 1rem 6rem;
  position: relative;
}

/* ── Header ── */
.app-header {
  padding: 1.5rem 0 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  position: relative;
}
.logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 600;
  color: var(--espresso);
  letter-spacing: -0.5px;
  line-height: 1;
}
.logo em {
  color: var(--gold);
  font-style: italic;
}
.logo-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  margin: 0 1px 4px;
  vertical-align: middle;
}
.app-tagline {
  font-size: 12px;
  font-weight: 400;
  color: var(--caramel);
  letter-spacing: 0.5px;
  margin-top: 5px;
  opacity: 0.85;
}

/* ── Tab Bar ── */
.tab-bar {
  display: flex;
  gap: 3px;
  background: rgba(92, 51, 23, 0.07);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4px;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 9px 13px;
  border: none;
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--caramel);
  transition: var(--transition);
  white-space: nowrap;
  min-height: 40px;
}
.tab-btn .tab-icon { font-size: 15px; line-height: 1; }
.tab-btn:hover { background: rgba(200, 146, 60, 0.12); color: var(--roast); }
.tab-btn.active { background: var(--espresso); color: var(--cream); }

/* ── Step Indicator ── */
.step-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 1.5rem;
}
.step-dot {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--border-md);
  background: var(--milk);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  color: var(--caramel);
  flex-shrink: 0;
  transition: var(--transition);
  font-family: 'DM Sans', sans-serif;
}
.step-dot.active { background: var(--espresso); border-color: var(--espresso); color: var(--cream); box-shadow: 0 2px 8px rgba(44,26,14,0.25); }
.step-dot.done { background: var(--gold); border-color: var(--gold); color: var(--espresso); }
.step-line { width: 28px; height: 1.5px; background: var(--border); flex-shrink: 0; transition: var(--transition); }
.step-line.done { background: var(--gold); }

/* ── Cards ── */
.card {
  background: var(--milk);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.35rem 1.4rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.card-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 5px;
}
.card h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--espresso);
  line-height: 1.2;
  margin-bottom: 6px;
}
.card-desc {
  font-size: 14.5px;
  color: var(--caramel);
  line-height: 1.6;
  margin-bottom: 1.1rem;
  font-weight: 300;
}

/* ── Coffee Grid ── */
.coffee-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 1rem;
}
.coffee-opt {
  padding: 14px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--foam);
  text-align: center;
  transition: var(--transition);
  min-height: 82px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.coffee-opt:hover { border-color: var(--gold); background: var(--cream); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.coffee-opt:active { transform: scale(0.97); }
.coffee-opt.selected { border: 1.5px solid var(--espresso); background: var(--cream); box-shadow: var(--shadow-sm); }
.coffee-opt .c-icon { font-size: 22px; line-height: 1; }
.coffee-opt .c-name { font-size: 12.5px; font-weight: 500; color: var(--espresso); line-height: 1.3; }
.coffee-opt .c-origin { font-size: 11px; color: var(--caramel); font-weight: 300; }

/* ── Divider ── */
.or-divider {
  text-align: center;
  color: var(--caramel);
  font-size: 12.5px;
  margin: 0.8rem 0;
  position: relative;
  font-weight: 300;
}
.or-divider::before, .or-divider::after {
  content: ''; position: absolute; top: 50%;
  width: 42%; height: 1px; background: var(--border);
}
.or-divider::before { left: 0; }
.or-divider::after { right: 0; }

/* ── Search Input ── */
.search-row {
  display: flex;
  gap: 8px;
}
.search-input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 300;
  background: var(--foam);
  color: var(--espresso);
  outline: none;
  transition: var(--transition);
}
.search-input:focus { border-color: var(--gold); border-width: 1.5px; box-shadow: 0 0 0 3px rgba(200,146,60,0.1); }
.search-input::placeholder { color: var(--caramel); opacity: 0.6; }

textarea.search-input { resize: vertical; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 14.5px;
  font-weight: 500;
  transition: var(--transition);
  min-height: 46px;
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--espresso); color: var(--cream); border-color: var(--espresso); }
.btn-primary:hover { background: var(--roast); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-outline { background: transparent; color: var(--espresso); border-color: var(--border-md); }
.btn-outline:hover { background: var(--cream); }
.btn-gold { background: var(--gold); color: var(--espresso); border-color: var(--gold); font-weight: 600; }
.btn-gold:hover { background: var(--caramel); color: var(--foam); }
.btn-green { background: var(--sage); color: var(--foam); border-color: var(--sage); }
.btn-green:hover { background: #2d5039; }
.btn-danger { background: var(--rust); color: var(--foam); border-color: var(--rust); }
.btn-sm { padding: 9px 14px; font-size: 13px; min-height: 38px; border-radius: var(--radius-sm); }

/* ── Tags (process, roast) ── */
.tag-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-bottom: 1rem; }
.tag-opt {
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--foam);
  color: var(--espresso);
  transition: var(--transition);
  min-height: 70px;
  display: flex; flex-direction: column; justify-content: center;
}
.tag-opt:hover { border-color: var(--gold); background: var(--cream); }
.tag-opt:active { transform: scale(0.97); }
.tag-opt.selected { background: var(--espresso); color: var(--cream); border-color: var(--espresso); }
.tag-opt.selected .tag-sub { opacity: 0.7; }
.tag-name { font-size: 13.5px; font-weight: 500; line-height: 1.3; }
.tag-sub { font-size: 11.5px; opacity: 0.65; margin-top: 3px; line-height: 1.4; font-weight: 300; }

/* ── Brew Method Grid ── */
.brew-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 1rem; }
.brew-card {
  padding: 14px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--foam);
  text-align: center;
  transition: var(--transition);
  min-height: 88px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.brew-card:hover { border-color: var(--gold); background: var(--cream); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.brew-card:active { transform: scale(0.97); }
.brew-card.selected { border: 1.5px solid var(--espresso); background: var(--cream); box-shadow: var(--shadow-sm); }
.brew-icon { font-size: 24px; line-height: 1; }
.brew-name { font-size: 13.5px; font-weight: 500; color: var(--espresso); }
.brew-note { font-size: 11.5px; color: var(--caramel); font-weight: 300; }
.brew-match { font-size: 10.5px; padding: 2px 7px; border-radius: 4px; background: var(--sage-light); color: var(--sage); margin-top: 3px; font-weight: 500; }

/* ── AI Response Box ── */
.ai-box {
  background: linear-gradient(135deg, var(--cream) 0%, #FDF0D5 100%);
  border: 1px solid rgba(200, 146, 60, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem;
  margin-top: 0.85rem;
}
.ai-box h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--espresso);
  margin-bottom: 0.6rem;
}
.ai-box p { font-size: 14.5px; color: var(--roast); line-height: 1.7; margin-bottom: 0.5rem; font-weight: 300; }
.ai-box p:last-child { margin-bottom: 0; }
.badge-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 0.6rem; }
.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--espresso);
  color: var(--cream);
}

/* ── Recipe Card ── */
.recipe-card {
  background: var(--foam);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.2rem 1.3rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.recipe-author { font-size: 12px; color: var(--caramel); font-style: italic; font-weight: 300; margin-bottom: 2px; }
.recipe-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--espresso);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}
.recipe-params { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 0.75rem 0; }
.param-chip {
  font-size: 12.5px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--roast);
  border: 1px solid var(--border);
  font-weight: 400;
}
.recipe-steps { margin-top: 0.75rem; }
.step-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--espresso);
  line-height: 1.6;
  font-weight: 300;
}
.step-time { flex-shrink: 0; width: 42px; font-size: 11px; font-weight: 600; color: var(--gold); padding-top: 3px; font-family: 'DM Sans', monospace; }
.recipe-tip {
  background: var(--cream);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 13px;
  font-size: 13.5px;
  color: var(--roast);
  line-height: 1.6;
  margin-top: 0.75rem;
  font-weight: 300;
}
.recipe-actions { display: flex; gap: 7px; margin-top: 1rem; flex-wrap: wrap; }

/* ── Loading dots ── */
.loading-dots { display: inline-flex; gap: 5px; align-items: center; padding: 6px 0; }
.loading-dots span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  animation: bounce-dot 1.3s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce-dot {
  0%, 80%, 100% { transform: scale(0.5); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ── Section Label / Divider ── */
.section-label { font-size: 12.5px; font-weight: 600; color: var(--roast); margin-bottom: 8px; margin-top: 2px; letter-spacing: 0.3px; }
.section-divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

/* ── Nav Row ── */
.nav-row { display: flex; justify-content: space-between; align-items: center; margin-top: 1.1rem; gap: 8px; flex-wrap: wrap; }
.nav-row-right { display: flex; gap: 7px; flex-wrap: wrap; }

/* ── Scaler ── */
.scaler-box { background: var(--cream); border-radius: var(--radius-md); padding: 1rem 1.1rem; margin-top: 0.75rem; border: 1px solid var(--border); }
.scaler-box h4 { font-size: 13px; font-weight: 600; color: var(--roast); margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; }
.slider-row { display: flex; align-items: center; gap: 10px; margin-bottom: 0.5rem; }
.slider-row label { font-size: 13.5px; color: var(--caramel); min-width: 46px; font-weight: 300; }
.slider-row input[type=range] { flex: 1; accent-color: var(--espresso); height: 4px; cursor: pointer; }
.slider-val { font-size: 16px; font-weight: 600; color: var(--espresso); min-width: 50px; text-align: right; font-family: 'Cormorant Garamond', serif; }
.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 1rem; }
.metric-card { background: var(--foam); border-radius: var(--radius-sm); padding: 0.8rem 1rem; border: 1px solid var(--border); text-align: center; }
.metric-val { font-family: 'Cormorant Garamond', serif; font-size: 28px; font-weight: 600; color: var(--espresso); line-height: 1; }
.metric-label { font-size: 11.5px; color: var(--caramel); margin-top: 4px; font-weight: 300; }

/* ── Timer ── */
.timer-wrap { border: 1px solid var(--border); border-radius: var(--radius-xl); overflow: hidden; margin-bottom: 1rem; box-shadow: var(--shadow-md); }
.timer-header { background: var(--espresso); color: var(--cream); padding: 1rem 1.25rem; display: flex; justify-content: space-between; align-items: center; }
.timer-header h3 { font-family: 'Cormorant Garamond', serif; font-size: 20px; font-weight: 600; }
.timer-header span { font-size: 12px; opacity: 0.65; }
.timer-face { text-align: center; padding: 1.75rem 1rem 1.25rem; background: var(--milk); }
.timer-clock { font-family: 'Cormorant Garamond', serif; font-size: 62px; font-weight: 400; color: var(--espresso); letter-spacing: 4px; line-height: 1; }
.timer-clock.done { color: var(--sage); }
.timer-step-text { font-size: 14.5px; color: var(--caramel); margin-top: 0.6rem; min-height: 46px; line-height: 1.5; padding: 0 1rem; font-weight: 300; }
.timer-progress-bar { height: 4px; background: var(--cream); }
.timer-fill { height: 4px; background: linear-gradient(90deg, var(--gold), var(--caramel)); transition: width 0.5s linear; }
.timer-controls { display: flex; gap: 8px; justify-content: center; padding: 1rem 1.25rem; background: var(--milk); flex-wrap: wrap; }
.timer-steps-list { background: var(--milk); border-top: 1px solid var(--border); padding: 0.75rem 1.25rem 1rem; }
.timer-step-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13.5px; line-height: 1.5; }
.timer-step-item:first-child { border-top: none; }
.ts-time { flex-shrink: 0; width: 38px; font-size: 11px; font-weight: 600; color: var(--gold); }
.ts-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-md); flex-shrink: 0; margin-top: 3px; transition: var(--transition); }
.ts-dot.done { background: var(--sage); }
.ts-dot.current { background: var(--gold); box-shadow: 0 0 6px rgba(200,146,60,0.5); }
.ts-text { color: var(--espresso); flex: 1; font-weight: 300; }

/* ── Flavor ── */
.flavor-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 1rem; }
.flavor-card {
  padding: 14px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--foam);
  transition: var(--transition);
  min-height: 90px;
}
.flavor-card:hover { border-color: var(--gold); background: var(--cream); }
.flavor-card:active { transform: scale(0.97); }
.flavor-card .f-icon { font-size: 22px; margin-bottom: 5px; }
.flavor-card .f-name { font-size: 13.5px; font-weight: 500; color: var(--espresso); }
.flavor-card .f-desc { font-size: 11.5px; color: var(--caramel); margin-top: 2px; line-height: 1.4; font-weight: 300; }
.flavor-card.sel-bitter { border: 1.5px solid #b91c1c; background: #fff5f5; }
.flavor-card.sel-sour { border: 1.5px solid var(--sage); background: #f0fff4; }
.flavor-card.sel-flat { border: 1.5px solid #92400e; background: #fffbeb; }
.flavor-card.sel-astringent { border: 1.5px solid #6b21a8; background: #faf5ff; }
.flavor-card.sel-weak { border: 1.5px solid #1d4ed8; background: #eff6ff; }
.flavor-card.sel-uneven { border: 1.5px solid var(--caramel); background: var(--cream); }
.fix-card { background: var(--foam); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem 1.1rem; margin-bottom: 0.75rem; }
.fix-card h4 { font-size: 15.5px; font-weight: 600; color: var(--espresso); margin-bottom: 0.5rem; }
.fix-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--espresso); line-height: 1.6; font-weight: 300; }
.fix-item:first-of-type { border-top: none; }
.fix-priority { flex-shrink: 0; font-size: 10.5px; padding: 3px 7px; border-radius: 4px; font-weight: 600; margin-top: 2px; }
.fix-priority.high { background: #fee2e2; color: #b91c1c; }
.fix-priority.med { background: #fef3c7; color: #92400e; }
.fix-priority.low { background: #dcfce7; color: #166534; }

/* ── Grind ── */
.grinder-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 1rem; }
.grinder-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--foam);
  transition: var(--transition);
  min-height: 60px;
  display: flex; flex-direction: column; justify-content: center;
}
.grinder-card:hover { border-color: var(--gold); background: var(--cream); }
.grinder-card:active { transform: scale(0.97); }
.grinder-card.selected { border: 1.5px solid var(--espresso); background: var(--cream); }
.grinder-card .g-name { font-size: 13px; font-weight: 500; color: var(--espresso); line-height: 1.3; }
.grinder-card .g-type { font-size: 11px; color: var(--caramel); margin-top: 2px; font-weight: 300; }
.grind-result { background: var(--foam); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 1.1rem 1.25rem; margin-top: 0.75rem; box-shadow: var(--shadow-sm); }
.grind-result h4 { font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 600; color: var(--espresso); margin-bottom: 1rem; }
.grind-big { text-align: center; padding: 1rem; background: var(--cream); border-radius: var(--radius-md); margin-bottom: 0.9rem; border: 1px solid var(--border); }
.grind-big .g-val { font-family: 'Cormorant Garamond', serif; font-size: 52px; font-weight: 400; color: var(--espresso); line-height: 1; }
.grind-big .g-unit { font-size: 13px; color: var(--caramel); margin-top: 4px; font-weight: 300; }
.grind-bar-wrap { margin-bottom: 0.9rem; }
.grind-bar-labels { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--caramel); margin-bottom: 6px; }
.grind-bar-track { height: 10px; background: var(--cream); border-radius: 5px; position: relative; overflow: visible; border: 1px solid var(--border); }
.grind-bar-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--gold), var(--caramel)); transition: width 0.4s; }
.grind-bar-thumb { position: absolute; top: -8px; width: 26px; height: 26px; border-radius: 50%; background: var(--espresso); border: 2px solid var(--foam); box-shadow: var(--shadow-sm); transform: translateX(-50%); transition: left 0.4s; }
.grind-tip { font-size: 13.5px; padding: 10px 13px; border-radius: var(--radius-sm); background: var(--cream); color: var(--roast); line-height: 1.6; margin-bottom: 6px; border: 1px solid var(--border); font-weight: 300; }

/* ── Journal ── */
.journal-card {
  background: var(--foam);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  margin-bottom: 0.75rem;
  transition: var(--transition);
}
.journal-card:hover { box-shadow: var(--shadow-sm); }
.journal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 5px; }
.journal-coffee { font-size: 15px; font-weight: 500; color: var(--espresso); line-height: 1.3; flex: 1; margin-right: 8px; }
.journal-delete { background: none; border: none; cursor: pointer; font-size: 16px; color: var(--caramel); padding: 2px 4px; line-height: 1; transition: var(--transition); opacity: 0.5; }
.journal-delete:hover { opacity: 1; color: var(--rust); }
.journal-stars { font-size: 16px; color: var(--gold); letter-spacing: 2px; margin-bottom: 4px; }
.journal-date { font-size: 11.5px; color: var(--caramel); font-weight: 300; margin-bottom: 4px; }
.journal-note { font-size: 13.5px; color: var(--roast); line-height: 1.65; font-weight: 300; }
.star-row { display: flex; gap: 6px; margin-bottom: 0.5rem; }
.star-btn { font-size: 22px; background: none; border: none; cursor: pointer; color: var(--cream); transition: var(--transition); line-height: 1; padding: 2px; }
.star-btn.active { color: var(--gold); }
.star-btn:hover { transform: scale(1.2); }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 2rem 1rem; }
.empty-icon { font-size: 40px; display: block; margin-bottom: 0.75rem; opacity: 0.3; }
.empty-text { font-size: 14.5px; line-height: 1.7; color: var(--caramel); font-weight: 300; }

/* ── Select ── */
select.search-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23A0622A' d='M6 8L0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* ── Animations ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.card, .recipe-card, .journal-card { animation: fadeIn 0.25s ease both; }

/* ── Responsive ── */
@media (max-width: 380px) {
  .app-shell { padding: 0 0.75rem 6rem; }
  .logo { font-size: 28px; }
  .tab-btn { padding: 8px 10px; font-size: 12px; }
}

/* ── Auth Area ── */
.auth-area { display:flex; align-items:center; gap:8px; }
.auth-user { display:flex; align-items:center; gap:8px; cursor:pointer; padding:6px 10px; border-radius:var(--radius-md); transition:var(--transition); }
.auth-user:hover { background:var(--cream); }
.auth-avatar { font-size:22px; line-height:1; }
.auth-info { display:flex; flex-direction:column; }
.auth-name { font-size:13px; font-weight:500; color:var(--espresso); line-height:1.2; }
.auth-level { font-size:11px; color:var(--caramel); font-weight:300; }

/* ── Modal ── */
.modal-overlay { position:fixed; inset:0; background:rgba(44,26,14,0.55); z-index:1000; display:flex; align-items:center; justify-content:center; padding:1rem; backdrop-filter:blur(3px); animation:fadeIn .15s ease; }
.modal-box { background:var(--milk); border-radius:var(--radius-xl); width:100%; max-width:400px; max-height:90vh; overflow-y:auto; position:relative; box-shadow:var(--shadow-lg); }
.modal-close { position:absolute; top:14px; right:14px; background:none; border:none; font-size:18px; cursor:pointer; color:var(--caramel); line-height:1; padding:4px; z-index:1; }
.modal-tabs { display:flex; border-bottom:1px solid var(--border); }
.modal-tab { flex:1; padding:13px; background:none; border:none; cursor:pointer; font-family:'DM Sans',sans-serif; font-size:14px; font-weight:500; color:var(--caramel); transition:var(--transition); }
.modal-tab.active { color:var(--espresso); border-bottom:2px solid var(--espresso); }
.modal-body { padding:1.5rem; }
.modal-title { font-family:'Cormorant Garamond',serif; font-size:26px; font-weight:600; color:var(--espresso); margin-bottom:4px; }
.modal-sub { font-size:14px; color:var(--caramel); margin-bottom:1.25rem; font-weight:300; }
.form-group { margin-bottom:.85rem; }
.form-group label { display:block; font-size:13px; color:var(--caramel); margin-bottom:5px; font-weight:400; }
.auth-error { background:#fee2e2; color:#b91c1c; border-radius:var(--radius-sm); padding:9px 12px; font-size:13.5px; margin-bottom:1rem; }

/* ── Profile ── */
.profile-header-card { text-align:center; }
.profile-avatar { font-size:52px; line-height:1; margin-bottom:.5rem; }
.profile-name { font-family:'Cormorant Garamond',serif; font-size:28px; font-weight:600; color:var(--espresso); }
.profile-username { font-size:13px; color:var(--caramel); margin-top:2px; font-weight:300; }
.profile-bio { font-size:14px; color:var(--roast); margin:.5rem 0; line-height:1.6; font-weight:300; }
.profile-level-badge { display:inline-block; padding:5px 14px; background:var(--espresso); color:var(--cream); border-radius:20px; font-size:12.5px; font-weight:500; margin-top:.5rem; }

/* ── XP & Level ── */
.xp-display { text-align:center; margin:1rem 0 .75rem; }
.xp-num { font-family:'Cormorant Garamond',serif; font-size:48px; font-weight:400; color:var(--espresso); display:block; line-height:1; }
.xp-label { font-size:12px; color:var(--caramel); font-weight:300; }
.level-bar-wrap { margin:.5rem 0 1rem; }
.level-bar-labels { display:flex; justify-content:space-between; font-size:12px; color:var(--caramel); margin-bottom:6px; }
.level-bar-track { height:10px; background:var(--cream); border-radius:5px; border:1px solid var(--border); overflow:hidden; }
.level-bar-fill { height:100%; background:linear-gradient(90deg,var(--gold),var(--caramel)); border-radius:5px; transition:width .6s ease; }
.levels-grid { display:grid; grid-template-columns:repeat(5,1fr); gap:5px; margin-top:1rem; }
.level-chip { display:flex; flex-direction:column; align-items:center; gap:3px; padding:7px 4px; border-radius:var(--radius-sm); background:var(--cream); border:1px solid var(--border); font-size:16px; opacity:0.35; transition:var(--transition); }
.level-chip.reached { opacity:1; background:var(--foam); border-color:var(--gold); }

/* ── Stats ── */
.stat-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; margin-top:.75rem; }
.stat-card { background:var(--cream); border:1px solid var(--border); border-radius:var(--radius-md); padding:1rem; text-align:center; }
.stat-val { font-family:'Cormorant Garamond',serif; font-size:32px; font-weight:600; color:var(--espresso); line-height:1; }
.stat-label { font-size:12px; color:var(--caramel); margin-top:4px; font-weight:300; }

/* ── Badge Grid ── */
.badge-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; }
.badge-card { padding:14px 12px; border:1px solid var(--border); border-radius:var(--radius-md); text-align:center; transition:var(--transition); }
.badge-card.earned { background:var(--cream); border-color:var(--gold); }
.badge-card.locked { background:var(--foam); opacity:0.5; }
.badge-icon { font-size:26px; line-height:1; margin-bottom:5px; }
.badge-name { font-size:13px; font-weight:500; color:var(--espresso); margin-bottom:3px; }
.badge-desc { font-size:11.5px; color:var(--caramel); line-height:1.4; font-weight:300; margin-bottom:5px; }
.badge-earned-tag { font-size:11px; color:var(--sage); font-weight:600; }
.badge-locked-tag { font-size:14px; opacity:0.4; }

/* ── XP Toast ── */
.xp-toast { position:fixed; bottom:80px; left:50%; transform:translateX(-50%) translateY(20px); z-index:999; opacity:0; transition:all .3s ease; pointer-events:none; min-width:260px; max-width:320px; }
.xp-toast.show { opacity:1; transform:translateX(-50%) translateY(0); }
.xp-toast-inner { background:var(--espresso); color:var(--cream); border-radius:var(--radius-lg); padding:12px 16px; display:flex; align-items:center; gap:10px; box-shadow:var(--shadow-lg); }
.xp-badge-icon { font-size:22px; flex-shrink:0; }
.xp-toast-msg { font-size:14px; font-weight:500; line-height:1.3; }
.xp-toast-badge { font-size:12px; opacity:0.8; margin-top:2px; }

/* ── Install Banner ── */
.install-banner { position:fixed; bottom:0; left:0; right:0; z-index:998; padding:.75rem 1rem; background:var(--espresso); }
.install-banner-inner { max-width:520px; margin:0 auto; display:flex; justify-content:space-between; align-items:center; gap:10px; color:var(--cream); font-size:14px; font-weight:400; }
