* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: sans-serif; background: #fff; color: #111; }

/* --- Sticky header --- */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: #1e3a5f;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  padding: 6px 0 8px;
}
.app-header .topbar,
.app-header .breadcrumb,
.app-header .tabs,
.app-header .sub-bar {
  max-width: 480px; margin: 0 auto;
}

/* --- Sub-bar (search + back, sticky in header) --- */
.sub-bar {
  padding: 8px 16px 10px;
}
.sub-bar #search {
  width: 100%; padding: 9px 12px; font-size: 15px;
  border: none; border-radius: 8px;
  background: rgba(255,255,255,0.15); color: #fff;
  outline: none;
}
.sub-bar #search::placeholder { color: rgba(255,255,255,0.55); }
.sub-bar #search:focus { background: rgba(255,255,255,0.25); }
.sub-back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: none; color: #fff;
  font-size: 14px; cursor: pointer; padding: 4px 0;
  opacity: 0.85;
}
.sub-back-btn:hover { opacity: 1; }

/* --- Top bar --- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 0; position: relative;
}
.logo-link { display: flex; align-items: center; text-decoration: none; }
.logo-img  { height: 40px; width: auto; display: block; }
.account-btn {
  background: none; border: 1px solid rgba(255,255,255,.4); border-radius: 20px;
  padding: 6px 14px; font-size: 12px; cursor: pointer; color: #fff;
  white-space: nowrap; flex-shrink: 0; max-width: 160px;
}
.account-btn.signed-in { border-color: #fff; background: rgba(255,255,255,.15); color: #fff; }

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 2px;
  padding: 8px 16px 4px; font-size: 12px; color: rgba(255,255,255,.55);
}
.bc-link { color: rgba(255,255,255,.8); cursor: pointer; }
.bc-link:hover { color: #fff; text-decoration: underline; }
.bc-current { color: #fff; font-weight: 500; }
.bc-sep { color: rgba(255,255,255,.35); padding: 0 4px; }

/* --- Nav tabs --- */
.tabs {
  display: flex; border-bottom: 1px solid rgba(255,255,255,.15);
  margin: 10px 0 0; padding: 0 16px;
}
.tab {
  padding: 8px 0; margin-right: 20px; font-size: 14px;
  border-bottom: 2px solid transparent; cursor: pointer;
  color: rgba(255,255,255,.55);
}
.tab.active { color: #fff; border-bottom-color: #fff; }

/* --- Main content --- */
.content { max-width: 480px; margin: 0 auto; padding: 16px; }

input[type="text"] {
  width: 100%; padding: 10px 12px; font-size: 16px;
  border: 1px solid #ccc; border-radius: 6px; margin-bottom: 16px;
}

/* --- Spirit buttons --- */
.spirits { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.spirit-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 14px; border: 1px solid #ddd; border-radius: 20px;
  background: #fff; cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.spirit-btn:active { background: #f0f0f0; border-color: #bbb; }
.spirit-emoji { font-size: 16px; line-height: 1; }
.spirit-label { font-size: 14px; }
.spirit-count {
  font-size: 11px; color: #999; background: #f2f2f2;
  border-radius: 10px; padding: 1px 6px;
}

/* --- Section titles --- */
.section-title {
  font-size: 13px; color: #666; margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* --- Drink lists --- */
.drink-list { list-style: none; border-top: 1px solid #eee; }
.drink-list li {
  padding: 12px 4px; border-bottom: 1px solid #eee;
  font-size: 16px; display: flex; justify-content: space-between;
  align-items: center; cursor: pointer;
}
.drink-list li span.drink-name { flex: 1; }
.drink-list li:active { background: #f5f5f5; }

/* --- Save heart — larger tap target --- */
.save-icon {
  font-size: 20px; padding: 10px 12px; cursor: pointer;
  color: #ddd; user-select: none; flex-shrink: 0;
  margin: -10px -12px -10px 0;
  transition: transform 0.1s;
}
.save-icon.saved { color: #e74c3c; }
.save-icon:active { transform: scale(1.25); }


/* --- Loading / empty states --- */
.loading    { color: #888; font-size: 15px; padding: 12px 0; cursor: default !important; }
.no-results { color: #888; font-size: 15px; padding: 12px 0; cursor: default !important; }
.search-result-spirit { font-size: 12px; color: #999; margin-left: 6px; }

/* --- Recently viewed --- */
#recentlyViewed { margin-top: 4px; }
.recently-viewed-list li { cursor: pointer; }
.rv-link {
    display: flex; align-items: center; gap: 0;
    text-decoration: none; color: inherit;
    width: 100%; padding: 0;
}

/* --- Recipe card --- */
.recipe { border: 1px solid #ddd; border-radius: 8px; padding: 16px; }
.recipe-title-row {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 8px; margin-bottom: 4px;
}
.recipe h2 { font-size: 20px; }
.recipe-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }

.save-btn {
  background: none; border: 1px solid #ddd; border-radius: 20px;
  padding: 5px 14px; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; color: #aaa;
  white-space: nowrap; transition: color 0.2s, border-color 0.2s;
  font-family: inherit; line-height: 1;
}
.save-btn:hover  { border-color: #e74c3c; color: #e74c3c; }
.save-btn.saved  { border-color: #e74c3c; color: #e74c3c; background: #fff5f5; }
.save-heart {
  font-size: 15px; line-height: 1;
  font-style: normal;
  /* Force text rendering — prevents browser/OS turning ♥ into a colour emoji */
  font-family: sans-serif;
}

.share-btn {
  background: none; border: 1px solid #ddd; border-radius: 20px;
  padding: 5px 12px; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; gap: 4px; color: #666;
  white-space: nowrap;
}
.share-btn:active { background: #f5f5f5; }

.recipe .spirit-tag { font-size: 13px; color: #999; margin-bottom: 14px; display: block; }

/* Ingredient section heading */
.recipe h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px;
  color: #aaa; margin-bottom: 8px; margin-top: 16px; font-weight: 600;
}

/* Ingredients */
.ingredient-list { list-style: none; padding: 0; }
.ingredient-item {
  padding: 5px 0; border-bottom: 1px solid #f5f5f5;
  font-size: 15px; line-height: 1.5;
}
.ingredient-item:last-child { border-bottom: none; }

/* Method — distinct prose block */
.method-block {
  background: #fafafa; border-left: 3px solid #ddd;
  border-radius: 0 6px 6px 0; padding: 12px 14px; margin-top: 4px;
}
.method-text { font-size: 15px; line-height: 1.7; color: #333; }

/* --- Saved tab empty state --- */
.empty-saved { text-align: center; padding: 48px 0; color: #aaa; font-size: 15px; }

/* --- Toast notification --- */
#toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #111; color: #fff; padding: 10px 20px;
  border-radius: 20px; font-size: 14px; z-index: 500;
  opacity: 0; transition: opacity 0.2s, transform 0.2s;
  pointer-events: none; white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- Auth modal --- */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 200;
  align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: 10px; padding: 24px;
  width: 100%; max-width: 380px; max-height: 90vh; overflow-y: auto;
}
.modal h2 { font-size: 18px; margin-bottom: 20px; }
.modal-close-row { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: #999; line-height: 1; }

/* Auth modal tabs */
.auth-tabs {
  display: flex; border-bottom: 1px solid #eee; margin-bottom: 20px;
}
.auth-tab {
  flex: 1; padding: 10px; font-size: 14px; font-weight: 500;
  background: none; border: none; cursor: pointer; color: #888;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.auth-tab.active { color: #111; border-bottom-color: #111; }

/* Auth form fields */
.auth-field { margin-bottom: 14px; }
.auth-field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.auth-field input {
  width: 100%; padding: 9px 11px; font-size: 15px;
  border: 1px solid #ccc; border-radius: 6px;
}
.auth-error   { color: #c0392b; font-size: 13px; margin-bottom: 12px; min-height: 18px; }
.auth-success { color: #27ae60; font-size: 13px; margin-bottom: 12px; min-height: 18px; }
.auth-submit {
  width: 100%; padding: 11px; background: #111; color: #fff;
  border: none; border-radius: 6px; font-size: 15px; cursor: pointer; margin-bottom: 4px;
}

/* --- User menu dropdown --- */
.user-menu {
  display: none; position: absolute; right: 16px; top: 48px;
  background: #fff; border: 1px solid #ddd; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2); z-index: 200; min-width: 190px;
  padding: 6px 0;
}
.user-menu.open { display: block; }
.user-menu-name {
  padding: 10px 16px 6px; font-size: 13px; font-weight: 600;
  color: #333; border-bottom: 1px solid #eee; margin-bottom: 4px;
}
.user-menu button {
  display: block; width: 100%; text-align: left;
  padding: 9px 16px; background: none; border: none;
  font-size: 14px; cursor: pointer; color: #111;
}
.user-menu button:hover { background: #f5f5f5; }
.user-menu button.danger { color: #c0392b; }

/* --- Account settings modal --- */
.account-section { margin-bottom: 8px; }
.account-section h3 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.account-danger-zone { border-top: 1px solid #eee; padding-top: 20px; margin-top: 20px; }
.account-danger-zone h3 { color: #c0392b; }
.danger-hint { font-size: 13px; color: #888; margin-bottom: 14px; line-height: 1.5; }
.btn-outline-danger {
  width: 100%; padding: 10px; margin-top: 4px;
  background: none; border: 1px solid #c0392b; color: #c0392b;
  border-radius: 6px; font-size: 14px; cursor: pointer;
}
.btn-danger-full {
  width: 100%; padding: 10px; margin-top: 8px;
  background: #c0392b; border: none; color: #fff;
  border-radius: 6px; font-size: 14px; cursor: pointer;
}

/* --- Promo / ad zones --- */
.promo-zone {
  display: flex; align-items: center; justify-content: center;
  text-align: center;
}
.promo-label {
  color: #bbb; font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase;
}
.promo-home   { margin: 4px 0 20px; }
.promo-recipe { margin-top: 20px; }

/* --- Registration banner --- */
.reg-banner {
  position: relative;
  background: linear-gradient(135deg, #1e3a5f 0%, #2a5298 100%);
  border-radius: 10px; padding: 16px; margin-bottom: 18px;
  color: #fff; box-shadow: 0 2px 10px rgba(30,58,95,.2);
}
.reg-banner-body {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px;
  padding-right: 28px;
}
.reg-banner-icon { font-size: 28px; line-height: 1; flex-shrink: 0; }
.reg-banner-text { display: flex; flex-direction: column; gap: 4px; }
.reg-banner-text strong { font-size: 15px; font-weight: 700; }
.reg-banner-text span   { font-size: 13px; color: rgba(255,255,255,.8); line-height: 1.4; }
.reg-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.reg-banner-cta {
  padding: 9px 18px; background: #fff; color: #1e3a5f;
  border: none; border-radius: 20px; font-size: 13px;
  font-weight: 700; cursor: pointer; white-space: nowrap;
}
.reg-banner-cta:active { background: #eef3fa; }
.reg-banner-signin {
  padding: 9px 18px; background: none;
  border: 1px solid rgba(255,255,255,.5); color: #fff;
  border-radius: 20px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.reg-banner-signin:active { background: rgba(255,255,255,.1); }
.reg-banner-dismiss {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; color: rgba(255,255,255,.6);
  font-size: 20px; cursor: pointer; line-height: 1; padding: 2px 4px;
}
.reg-banner-dismiss:hover { color: #fff; }

/* --- Forgot password link --- */
.auth-forgot { text-align: center; margin-top: 10px; font-size: 13px; }
.auth-forgot a { color: #0066cc; cursor: pointer; }
.auth-forgot a:hover { text-decoration: underline; }
.forgot-intro { font-size: 13px; color: #666; line-height: 1.5; margin-bottom: 16px; }

/* ── Recipe Image ──────────────────────────────────────────── */
.recipe-image-wrap {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    background: #f0f0f0;
    max-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.recipe-image {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
}

/* ── Recipe Meta Row (glassware / garnish / flavor) ───────── */
.recipe-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 18px;
}
.recipe-meta-item {
    background: #f0f4f8;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 13px;
    color: #444;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ── Optional Detail Sections (history / variations / tips) ── */
.optional-block {
    background: #f8f9fa;
    border-left: 3px solid #1e3a5f;
    border-radius: 0 8px 8px 0;
    padding: 12px 16px;
    margin-bottom: 20px;
}
.optional-block p {
    margin: 0;
    font-size: 14px;
    color: #444;
    line-height: 1.6;
    white-space: pre-line;
}

/* ── Star Ratings ─────────────────────────────────────── */
.rating-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0 16px;
    padding: 12px 14px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 10px;
}
.rating-label {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.rating-interactive {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.stars {
    display: flex;
    gap: 2px;
    cursor: pointer;
    user-select: none;
}
.star {
    font-size: 28px;
    color: #ccc;
    line-height: 1;
    transition: color 0.1s, transform 0.1s;
}
.star.filled  { color: #f5a623; }
.star.hovered { color: #f9c05a; transform: scale(1.2); }
.rating-summary {
    font-size: 13px;
    color: #888;
}

/* ── Search Mode Toggle ───────────────────────────────── */
.search-mode-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}
.smt-btn {
    flex: 1;
    padding: 5px 0;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #ccc;
    border-radius: 20px;
    background: none;
    color: #888;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-family: inherit;
}
.smt-btn.active {
    background: #1a2e4a;
    border-color: #1a2e4a;
    color: #fff;
}

/* ── Ingredient search group header ─────────────────────*/
.ingredient-group-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #888;
    padding: 12px 0 4px;
    cursor: default;
    border-bottom: 1px solid #eee;
    margin-bottom: 2px;
}
.ingredient-group-header:first-child { padding-top: 4px; }

/* ── Ad zones ─────────────────────────────────────────── */
.ad-link    { display: inline-block; }
.ad-image   { max-width: 100%; height: auto; border-radius: 4px; display: block; margin: 0 auto; }
.ad-code-wrapper { width: 100%; overflow: hidden; }
