/* Apron & Olive — Account Navigation, My Account & Settings Redesign */

/* Top Header & Profile Icon */
.desktop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 36px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}
@media (max-width: 760px) {
  .desktop-header {
    display: none !important;
  }
}
.desktop-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--gold);
}
.header-sep {
  color: var(--line);
  font-size: 14px;
}
.desktop-header-left h2 {
  font-size: 20px;
  font-family: Georgia, serif;
  margin: 0;
  color: var(--text);
}
.desktop-header-right,
.header-right-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-icon-btn,
.theme-toggle-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.header-icon-btn:hover,
.theme-toggle-btn:hover {
  background: var(--tint);
  border-color: var(--gold);
  transform: translateY(-1px);
}

/* Circular Profile Button */
.profile-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--gold);
  border-radius: 30px;
  padding: 3px 12px 3px 4px;
  cursor: pointer;
  color: var(--text);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.profile-icon-btn:hover {
  background: var(--panel);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(164, 118, 37, 0.18);
  transform: translateY(-1px);
}
.profile-icon-btn.active {
  background: var(--button);
  color: var(--button-text);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(164, 118, 37, 0.3);
}
.profile-icon-btn.active .profile-avatar-circle {
  border-color: var(--gold);
}
.profile-icon-btn.active .profile-btn-label {
  color: var(--button-text);
}
.profile-btn-label {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .profile-icon-btn {
    padding: 2px;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    justify-content: center;
  }
  .profile-btn-label {
    display: none;
  }
}

/* Avatar Elements */
.profile-avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff9ec;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.5px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.profile-avatar-circle.large {
  width: 72px;
  height: 72px;
  font-size: 28px;
  border: 2px solid var(--gold);
}
.profile-avatar-circle.medium {
  width: 52px;
  height: 52px;
  font-size: 20px;
  border: 2px solid var(--gold);
}
.profile-avatar-svg {
  width: 60%;
  height: 60%;
  fill: currentColor;
}

/* Settings Top My Account Option Card */
.settings-account-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 24px 28px;
  margin-bottom: 32px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--panel) 100%);
  border: 1.5px solid var(--gold);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(50, 32, 19, 0.05);
}
.settings-account-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(164, 118, 37, 0.16);
  border-color: var(--gold);
}
.account-hero-left {
  display: flex;
  align-items: center;
  gap: 20px;
}
.account-hero-info h2 {
  font-size: 24px;
  font-family: Georgia, serif;
  margin: 4px 0 6px;
  color: var(--text);
}
.account-hero-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--gold);
  text-transform: uppercase;
}
.account-hero-meta {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.meta-dot {
  color: var(--line);
}
.tier-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 12px;
  background: var(--tint);
  color: var(--text);
  border: 1px solid var(--line);
}
.account-manage-btn {
  white-space: nowrap;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 12px;
}
@media (max-width: 760px) {
  .settings-account-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 20px;
    gap: 16px;
  }
  .account-hero-left {
    gap: 14px;
  }
  .account-manage-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Dedicated My Account Screen */
.my-account-page {
  max-width: 1050px;
  margin: 0 auto;
}
.account-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.account-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.account-back-btn:hover {
  background: var(--surface);
  border-color: var(--gold);
}
.account-profile-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 28px;
  box-shadow: 0 4px 24px rgba(50, 32, 19, 0.04);
}
.account-header-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.account-user-cluster {
  display: flex;
  align-items: center;
  gap: 24px;
}
.account-titles h1 {
  font-size: 32px;
  margin: 0 0 6px;
  font-family: Georgia, serif;
}
.account-handle {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}
.account-handle span {
  color: var(--gold);
  font-weight: 600;
}
.account-badges-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* Avatar Selection Modal / Row */
.avatar-selection-panel {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.avatar-selection-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.avatar-selection-grid {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.avatar-option-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.avatar-option-btn:hover {
  transform: scale(1.08);
  border-color: var(--gold);
}
.avatar-option-btn.selected {
  border-color: var(--gold);
  background: var(--tint);
  box-shadow: 0 0 0 3px rgba(164, 118, 37, 0.25);
}

/* Account Stats Grid */
.account-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 28px 0;
}
@media (max-width: 900px) {
  .account-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.account-stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.account-stat-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.stat-number {
  font-size: 32px;
  font-weight: 700;
  font-family: Georgia, serif;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Membership Card */
.membership-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--panel) 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 28px;
}
.membership-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.membership-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #386629;
  background: #edf7e8;
  border: 1px solid #c5e3ba;
  padding: 4px 12px;
  border-radius: 20px;
}
html[data-theme="dark"] .membership-status-tag {
  background: #1b2e17;
  color: #8ed676;
  border-color: #305427;
}
.membership-perks-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0;
}
@media (max-width: 600px) {
  .membership-perks-list {
    grid-template-columns: 1fr;
  }
}
.perk-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}
.perk-check {
  color: var(--gold);
  font-weight: bold;
}
.membership-disclosure {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  padding: 12px 16px;
  background: var(--tint);
  border-radius: 10px;
  margin-top: 16px;
}

/* Danger Zone Card */
.danger-zone-card {
  border: 1px solid #e2b4a8;
  background: #fffafa;
  border-radius: 20px;
  padding: 28px;
  margin-top: 36px;
}
html[data-theme="dark"] .danger-zone-card {
  background: #201514;
  border-color: #5a2c26;
}
.danger-zone-card h3 {
  color: #a82e1e;
  margin: 0 0 8px;
}
html[data-theme="dark"] .danger-zone-card h3 {
  color: #f07b6c;
}

/* Reorganized Settings Sections */
.settings-section-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(50, 32, 19, 0.03);
}
.settings-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.settings-section-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--gold);
  text-transform: uppercase;
}
.settings-section-header h2 {
  font-size: 24px;
  font-family: Georgia, serif;
  margin: 4px 0 0;
}
.settings-section-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
}

/* Preset Buttons */
.preset-pills-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 16px;
  flex-wrap: wrap;
}
.preset-pill-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}
.preset-pill-btn:hover {
  border-color: var(--gold);
  background: var(--tint);
}
.preset-pill-btn.active {
  background: var(--button);
  color: var(--button-text);
  border-color: var(--gold);
}

/* Modal Custom Confirmation */
.confirm-delete-modal {
  max-width: 480px;
  background: var(--panel);
  border: 1.5px solid #a82e1e;
  border-radius: 20px;
  padding: 32px;
}
.confirm-delete-modal h2 {
  color: #a82e1e;
  margin-top: 0;
}
.confirm-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.confirm-actions button {
  flex: 1;
}

/* Legacy Cloud Account Form Tuning */
.cloud-account {
  border: 1px solid var(--line, #d8cdbb);
  border-radius: 20px;
  padding: 24px;
}
.auth-tabs,
.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}
.auth-show {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
}
.auth-show input {
  width: 20px;
  height: 20px;
}
.account-entry {
  margin-bottom: 20px;
}
.cloud-account button {
  min-height: 44px;
}
.cloud-account input {
  font-size: 16px;
}
@media (max-width: 600px) {
  .cloud-account {
    padding: 18px;
  }
  .auth-tabs button {
    flex: 1;
  }
  .auth-links button {
    width: 100%;
  }
}

/* ==========================================================================
   Mobile Responsive System for My Account, Settings, and Household Forms
   Eliminates horizontal scrolling at 320px, 375px, 390px, 430px viewports
   ========================================================================== */

.my-account-page,
.settings {
  width: 100%;
  max-width: 1050px;
  box-sizing: border-box;
}

.account-profile-card,
.settings-section-card,
.membership-card,
.danger-zone-card,
.cloud-account {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.settings-section-card input,
.settings-section-card select,
.account-profile-card input,
.account-profile-card select,
.danger-zone-card input,
.danger-zone-card select,
.cloud-account input,
.cloud-account select {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 760px) {
  .page.my-account-page,
  .page.settings {
    padding-left: 16px;
    padding-right: 16px;
    padding-top: 20px;
    padding-bottom: 96px;
    width: 100%;
    box-sizing: border-box;
  }

  .account-nav-bar {
    margin-bottom: 18px;
    gap: 10px;
  }

  .account-back-btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .account-profile-card,
  .settings-section-card,
  .membership-card,
  .danger-zone-card,
  .cloud-account {
    padding: 20px 16px;
    border-radius: 16px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .account-header-layout {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .account-user-cluster {
    gap: 14px;
    width: 100%;
    min-width: 0;
  }

  .account-titles {
    min-width: 0;
    flex: 1;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .account-titles h1 {
    font-size: 24px;
    line-height: 1.15;
    word-break: break-word;
  }

  .account-handle {
    font-size: 13px;
    word-break: break-word;
  }

  .account-badges-strip {
    gap: 6px;
    margin-top: 6px;
  }

  .tier-badge {
    font-size: 11px;
    padding: 3px 8px;
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }

  .avatar-selection-grid {
    gap: 8px;
    justify-content: flex-start;
  }

  .avatar-option-btn {
    width: 40px;
    height: 40px;
    font-size: 17px;
  }

  /* Form Grid and input controls responsiveness */
  .form-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 16px 0 !important;
  }

  .form-grid > * {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .form-grid label {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    font-size: 13px !important;
  }

  .form-grid input,
  .form-grid select,
  .settings-section-card input,
  .settings-section-card select,
  .account-profile-card input,
  .account-profile-card select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    font-size: 16px !important;
    min-height: 44px !important;
  }

  .form-grid select,
  .settings-section-card select,
  .account-profile-card select {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }

  .settings-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  .settings-section-header h2 {
    font-size: 20px;
    word-break: break-word;
  }

  .settings-section-desc {
    font-size: 12px;
    line-height: 1.45;
  }

  .account-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 20px 0;
  }

  .account-stat-card {
    padding: 14px 10px;
    border-radius: 12px;
  }

  .stat-number {
    font-size: 26px;
  }

  .stat-label {
    font-size: 10px;
    letter-spacing: 0.5px;
  }

  .membership-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .membership-header h2 {
    font-size: 20px !important;
  }

  .membership-status-tag {
    font-size: 11px;
    padding: 4px 10px;
    white-space: normal;
    word-break: break-word;
  }

  .membership-perks-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .membership-disclosure {
    font-size: 11px;
    padding: 10px 12px;
  }

  .auth-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .auth-tabs button {
    flex: 1 1 calc(50% - 8px);
    min-width: 110px;
    font-size: 13px;
    padding: 10px 8px;
  }
}

/* Extra small mobile screens (320px to 375px) */
@media (max-width: 375px) {
  .page.my-account-page,
  .page.settings {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .account-profile-card,
  .settings-section-card,
  .membership-card,
  .danger-zone-card,
  .cloud-account {
    padding: 16px 12px !important;
    border-radius: 14px !important;
  }

  .account-titles h1 {
    font-size: 20px !important;
  }

  .account-back-btn {
    padding: 6px 10px !important;
    font-size: 11px !important;
  }

  .account-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .stat-number {
    font-size: 22px !important;
  }

  .stat-label {
    font-size: 9px !important;
  }

  .avatar-option-btn {
    width: 36px !important;
    height: 36px !important;
    font-size: 15px !important;
  }

  .preset-pill-btn {
    padding: 5px 10px !important;
    font-size: 11px !important;
  }
}

/* ========================================================
   Feature 1: Live Ingredient Autocomplete Dropdown
   ======================================================== */

.ingredient-autocomplete-container {
  position: relative;
  width: 100%;
}

.ingredient-autocomplete-input-wrap {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
}

.ingredient-autocomplete-input-wrap input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.home-ingredient-autocomplete {
  flex: 1;
  min-width: 115px;
}

.autocomplete-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gold);
  padding: 6px 10px;
  border-radius: 6px;
  min-width: 38px;
  min-height: 38px;
  transition: transform 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.autocomplete-add-btn:hover {
  transform: scale(1.08);
  color: var(--text);
}

.ingredient-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(45, 30, 18, 0.18);
  max-height: 360px;
  overflow-y: auto;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  animation: autocompleteFadeIn 0.15s ease-out;
}

@keyframes autocompleteFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ingredient-suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s ease;
  text-align: left;
}

.ingredient-suggestion-item:last-child {
  border-bottom: none;
}

.ingredient-suggestion-item:hover,
.ingredient-suggestion-item.is-highlighted {
  background: var(--tint);
}

.suggestion-thumb {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
}

.suggestion-thumb svg {
  width: 18px;
  height: 18px;
}

.suggestion-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.suggestion-title-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.suggestion-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

.suggestion-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.suggestion-category {
  font-size: 11px;
  color: var(--gold);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1px 7px;
  border-radius: 12px;
  font-weight: 500;
}

.suggestion-arrow {
  font-size: 18px;
  font-weight: 500;
  color: var(--gold);
  padding: 0 4px;
  flex-shrink: 0;
}

/* ========================================================
   Feature 2: Compact Ingredient Detail Popup (Desktop & Mobile)
   ======================================================== */

.ingredient-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 24, 18, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: modalBackdropFadeIn 0.2s ease-out;
  overscroll-behavior: contain;
}

@keyframes modalBackdropFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Compact Desktop Modal */
.ingredient-modal-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  width: 440px;
  max-width: 94vw;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(45, 30, 18, 0.32);
  position: relative;
  overflow: hidden;
  animation: desktopModalScaleIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

@keyframes desktopModalScaleIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.sheet-grabber-area {
  display: none;
}

.sheet-grabber {
  display: none;
}

.compact-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  gap: 12px;
}

.compact-title-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.compact-ingredient-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
}

.compact-ingredient-icon svg {
  width: 22px;
  height: 22px;
}

.compact-heading-texts {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.compact-category-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--gold);
  text-transform: uppercase;
  line-height: 1.2;
}

.compact-ingredient-title {
  font-size: 21px;
  font-weight: 600;
  font-family: Georgia, serif;
  color: var(--text);
  margin: 2px 0 0 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-close-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
  transition: all 0.15s ease;
  padding: 0;
}

.compact-close-btn:hover {
  background: var(--tint);
  transform: scale(1.06);
}

.compact-modal-body {
  padding: 14px 20px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.compact-ingredient-desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  opacity: 0.9;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.compact-recipes-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  gap: 10px;
}

.compact-recipes-count {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.compact-recipes-count strong {
  color: var(--text);
  font-weight: 600;
}

.compact-view-recipes-btn {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.compact-view-recipes-btn:hover {
  color: var(--text);
  text-decoration: underline;
}

.compact-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 20px 16px 20px;
}

.compact-primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.12s ease;
}

.compact-primary-btn:hover {
  opacity: 0.94;
  transform: translateY(-1px);
}

.compact-primary-btn.already-added {
  background: #3e5a3c;
  color: #fff;
}

.compact-secondary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 38px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}

.compact-secondary-btn:hover {
  background: var(--surface);
  transform: translateY(-1px);
}

/* ========================================================
   Mobile Bottom-Sheet Behavior (< 760px)
   ======================================================== */
@media (max-width: 760px) {
  .ingredient-modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .ingredient-modal-card {
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    max-height: 65vh;
    animation: mobileSheetSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    padding-bottom: max(14px, env(safe-area-inset-bottom, 16px));
    touch-action: pan-y;
  }

  @keyframes mobileSheetSlideUp {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }

  .sheet-grabber-area {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 0 2px 0;
    cursor: grab;
    width: 100%;
    background: var(--panel);
  }

  .sheet-grabber {
    display: block;
    width: 38px;
    height: 4px;
    background: var(--line);
    border-radius: 999px;
  }

  .compact-modal-header {
    padding: 10px 18px 12px 18px;
  }

  .compact-ingredient-title {
    font-size: 19px;
  }

  .compact-modal-body {
    padding: 12px 18px 10px 18px;
    gap: 10px;
  }

  .compact-modal-actions {
    padding: 0 18px max(14px, env(safe-area-inset-bottom, 16px)) 18px;
    gap: 8px;
  }

  .ingredient-autocomplete-dropdown {
    max-height: 280px;
  }
}

/* ========================================================
   Compact Mobile Screens (320px - 375px)
   ======================================================== */
@media (max-width: 375px) {
  .compact-ingredient-icon {
    width: 36px;
    height: 36px;
  }

  .compact-ingredient-title {
    font-size: 17px;
  }

  .compact-modal-header {
    padding: 8px 14px 10px 14px;
  }

  .compact-modal-body {
    padding: 10px 14px 8px 14px;
  }

  .compact-modal-actions {
    padding: 0 14px max(12px, env(safe-area-inset-bottom, 12px)) 14px;
  }
}

/* ========================================================
   Apron & Olive — Community Foundation & Recipe Expansion
   ======================================================== */

/* Collection Filter Bar */
.recipe-collection-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.recipe-collection-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px;
}

.collection-tab-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.collection-tab-btn:hover {
  border-color: var(--gold);
  background: var(--tint);
}

.collection-tab-btn.active {
  background: var(--button);
  color: var(--button-text);
  border-color: var(--button);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.collection-tab-btn .badge-count {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.1);
}

.collection-tab-btn.active .badge-count {
  background: rgba(255, 255, 255, 0.2);
}

.create-recipe-action-btn {
  background: var(--gold);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(164, 118, 37, 0.25);
}

.create-recipe-action-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* Badges on Recipe Cards & Modal */
.badge-official-seal {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #fbf7f0 0%, #f4ebd9 100%);
  border: 1px solid #d4af37;
  color: #7a5814;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(164, 118, 37, 0.15);
}

.badge-official-seal svg,
.badge-official-seal .sparkle {
  color: #d4af37;
  font-size: 12px;
}

.badge-community-author {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 500;
  padding: 2px 8px 2px 4px;
  border-radius: 14px;
}

.author-mini-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  overflow: hidden;
}

.author-mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Card Social Overlay & Stats */
.card-community-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--muted);
}

.card-rating-display {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text);
  font-weight: 600;
}

.card-rating-display .star {
  color: #e5a524;
  font-size: 13px;
}

.card-rating-display .unrated {
  font-weight: 400;
  color: var(--muted);
  font-size: 11px;
}

.card-like-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 12px;
  transition: all 0.15s ease;
}

.card-like-pill:hover {
  background: var(--tint);
  color: #c94040;
}

.card-like-pill.liked {
  color: #c94040;
  font-weight: 600;
}

/* ========================================================
   Recipe Detail Modal — Community Section
   ======================================================== */
.recipe-community-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1.5px solid var(--line);
}

.community-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.community-section-header h2 {
  font-family: Georgia, serif;
  font-size: 22px;
  color: var(--text);
  margin: 0;
}

.recipe-creator-header-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 12px 16px;
  border-radius: 14px;
  margin-bottom: 20px;
}

.recipe-creator-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  overflow: hidden;
  border: 2px solid var(--gold);
}

.recipe-creator-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-creator-details {
  flex: 1;
}

.recipe-creator-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 2px 0;
}

.recipe-creator-sub {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

/* Community Interactive Bar: Likes, Ratings, "I Made This" */
.community-interactive-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 14px;
  margin-bottom: 24px;
}

.interaction-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.interaction-box-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
}

.btn-interactive-like {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-interactive-like:hover {
  background: var(--tint);
  border-color: #c94040;
}

.btn-interactive-like.liked {
  background: #fdf2f2;
  border-color: #e58d8d;
  color: #c94040;
  font-weight: 600;
}

.btn-interactive-like svg {
  color: #c94040;
}

/* Star Rating System */
.star-rating-widget {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.star-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: #d1c7b7;
  font-size: 20px;
  line-height: 1;
  transition: color 0.15s ease, transform 0.1s ease;
}

.star-btn:hover {
  transform: scale(1.15);
}

.star-btn.active {
  color: #e5a524;
}

.rating-summary-text {
  font-size: 12.5px;
  color: var(--muted);
  margin-left: 6px;
}

/* "I Made This" Button */
.btn-made-this {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-made-this:hover {
  background: var(--tint);
  border-color: var(--accent);
}

.btn-made-this.has-made {
  background: #edf5ed;
  border-color: #79a879;
  color: #2b612b;
  font-weight: 600;
}

/* Cooking Reviews & Comments Section */
.comment-composer-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 24px;
}

.comment-composer-box textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  resize: vertical;
  box-sizing: border-box;
}

.comment-composer-box textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--bg);
}

.composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.composer-toggles {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text);
}

.composer-toggles label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.composer-photo-preview {
  position: relative;
  display: inline-block;
  margin-top: 8px;
}

.composer-photo-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.composer-photo-preview button {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #2c2825;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 11px;
  cursor: pointer;
}

/* Comments List */
.comments-thread-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comment-item-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  transition: border-color 0.15s ease;
}

.comment-item-card.is-reply {
  margin-left: 28px;
  background: var(--panel);
  border-left: 3px solid var(--gold);
}

.comment-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.comment-author-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-author-name {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
}

.comment-date {
  font-size: 11.5px;
  color: var(--muted);
}

.comment-made-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #edf5ed;
  color: #2b612b;
  border: 1px solid #c0d9c0;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.comment-text-body {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  margin: 4px 0 8px 0;
  white-space: pre-wrap;
}

.comment-photo-attachment {
  margin: 8px 0;
}

.comment-photo-attachment img {
  max-width: 220px;
  max-height: 180px;
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: pointer;
}

.comment-footer-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  margin-top: 6px;
  color: var(--muted);
}

.comment-action-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
}

.comment-action-link:hover {
  color: var(--text);
}

.comment-action-link.danger {
  color: #c94040;
}

/* ========================================================
   Recipe Editor Modal (Create / Edit Recipe)
   ======================================================== */
.recipe-editor-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.recipe-editor-card {
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
}

.recipe-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.recipe-editor-header h2 {
  font-family: Georgia, serif;
  font-size: 21px;
  margin: 0;
  color: var(--text);
}

.recipe-editor-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.editor-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.editor-form-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.editor-form-group input[type="text"],
.editor-form-group input[type="number"],
.editor-form-group select,
.editor-form-group textarea {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
}

.editor-form-group input:focus,
.editor-form-group select:focus,
.editor-form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.editor-grid-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.editor-dynamic-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dynamic-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dynamic-row input,
.dynamic-row select {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}

.btn-remove-row {
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #c94040;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-add-dynamic-item {
  background: var(--surface);
  border: 1px dashed var(--gold);
  color: var(--gold);
  border-radius: 10px;
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-add-dynamic-item:hover {
  background: var(--tint);
}

.recipe-editor-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ========================================================
   Chef Progression Card in My Account
   ======================================================== */
.chef-progression-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--panel) 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.progression-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.level-badge-large {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f4ebd9 0%, #e6ce9e 100%);
  border: 2px solid #d4af37;
  color: #7a5814;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(164, 118, 37, 0.2);
}

.level-badge-large .lvl-label {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.level-badge-large .lvl-num {
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.progression-title-area h3 {
  font-family: Georgia, serif;
  font-size: 19px;
  margin: 0 0 4px 0;
  color: var(--text);
}

.progression-title-area p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.xp-progress-bar-wrap {
  margin: 12px 0 16px 0;
}

.xp-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.xp-progress-track {
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.xp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #d4af37, #b88e28);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.chef-stats-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.chef-stat-box .num {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.chef-stat-box .lbl {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badges-shelf {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.badges-shelf h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin: 0 0 10px 0;
}

.badges-flex-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text);
}

.badge-tag.unearned {
  opacity: 0.45;
  filter: grayscale(1);
}

/* Report Modal Dialog */
.report-modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
}

.report-modal-card h3 {
  font-family: Georgia, serif;
  font-size: 18px;
  margin: 0 0 12px 0;
  color: var(--text);
}

.report-modal-card select,
.report-modal-card textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.report-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* =========================================================
   STAGE 2 & 3: CHEF DISCOVERY, USERNAME & SOCIAL STYLES
   ========================================================= */

/* Find Chefs Section */
.find-chefs-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  margin: 24px 0;
}

.find-chefs-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.find-chefs-header h3 {
  font-family: Georgia, serif;
  font-size: 20px;
  margin: 0;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.find-chefs-header p {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0;
}

.find-chefs-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.find-chefs-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.find-chefs-input:focus {
  border-color: var(--gold, #c5a059);
  box-shadow: 0 0 0 2px rgba(197, 160, 89, 0.18);
}

.find-chefs-search-icon {
  position: absolute;
  left: 14px;
  color: var(--muted);
  pointer-events: none;
  font-size: 16px;
}

.find-chefs-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.chef-search-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.chef-search-card:hover {
  border-color: var(--gold, #c5a059);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.chef-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.chef-avatar-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--gold, #c5a059);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--text);
  font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
}

.chef-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chef-info-col {
  flex: 1;
  min-width: 0;
}

.chef-display-name {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text);
  margin: 0 0 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chef-handle {
  font-size: 12.5px;
  color: var(--gold, #c5a059);
  font-weight: 500;
  margin: 0 0 4px 0;
}

.chef-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 500;
}

.chef-bio-snip {
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0 12px 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chef-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.chef-recipes-count {
  font-size: 11.5px;
  color: var(--muted);
}

.follow-toggle-btn {
  padding: 5px 14px;
  border-radius: 18px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid var(--gold, #c5a059);
}

.follow-toggle-btn.not-following {
  background: var(--gold, #c5a059);
  color: #fff;
}

.follow-toggle-btn.not-following:hover {
  opacity: 0.92;
  transform: scale(1.02);
}

.follow-toggle-btn.is-following {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.follow-toggle-btn.is-following:hover {
  border-color: #d9534f;
  color: #d9534f;
  background: rgba(217, 83, 79, 0.08);
}

/* Public Chef Profile Modal */
.public-chef-modal-card {
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  box-sizing: border-box;
}

.public-chef-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.public-chef-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid var(--gold, #c5a059);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
  overflow: hidden;
}

.public-chef-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.public-chef-titles h2 {
  font-family: Georgia, serif;
  font-size: 22px;
  margin: 0 0 3px 0;
  color: var(--text);
}

.public-chef-handle {
  font-size: 14px;
  color: var(--gold, #c5a059);
  font-weight: 500;
  margin: 0 0 6px 0;
}

.social-counts-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 6px;
}

.social-count-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.social-count-btn strong {
  color: var(--gold, #c5a059);
  font-weight: 600;
}

.social-count-btn:hover {
  text-decoration: underline;
}

.public-chef-bio {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface);
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  border-left: 3px solid var(--gold, #c5a059);
}

.public-chef-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.public-chef-recipes-section {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.public-chef-recipes-section h4 {
  font-family: Georgia, serif;
  font-size: 16px;
  margin: 0 0 14px 0;
  color: var(--text);
}

.public-chef-recipes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mini-recipe-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.mini-recipe-item:hover {
  border-color: var(--gold, #c5a059);
}

.mini-recipe-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
}

.mini-recipe-details {
  flex: 1;
}

.mini-recipe-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 2px 0;
}

.mini-recipe-meta {
  font-size: 11.5px;
  color: var(--muted);
}

/* Followers / Following List Modal */
.social-list-modal-card {
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-sizing: border-box;
}

.social-list-modal-card h3 {
  font-family: Georgia, serif;
  font-size: 18px;
  margin: 0 0 16px 0;
  color: var(--text);
}

.social-users-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.social-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface);
}

.social-user-left {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
}

/* Username Claim Modal */
.claim-username-modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  box-sizing: border-box;
  text-align: center;
}

.claim-username-modal-card h3 {
  font-family: Georgia, serif;
  font-size: 20px;
  margin: 0 0 8px 0;
  color: var(--text);
}

.claim-username-modal-card p {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 0 20px 0;
  line-height: 1.45;
}

.username-input-group {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.username-at-prefix {
  position: absolute;
  left: 14px;
  color: var(--gold, #c5a059);
  font-weight: 700;
  font-size: 16px;
  pointer-events: none;
}

.username-claim-input {
  width: 100%;
  padding: 12px 38px 12px 34px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
}

.username-claim-input:focus {
  border-color: var(--gold, #c5a059);
}

.username-status-icon {
  position: absolute;
  right: 12px;
  font-size: 16px;
}

.username-feedback-msg {
  font-size: 12px;
  margin: 4px 0 16px 0;
  text-align: left;
  min-height: 16px;
}

.username-feedback-msg.error {
  color: #d9534f;
}

.username-feedback-msg.success {
  color: #5cb85c;
}

/* =========================================================
   CHEF PROFILES, DEMO BADGES & SOCIAL FOLLOWER ENHANCEMENTS
   ========================================================= */

.demo-chef-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #fbf7f0 0%, #f4ebd9 100%);
  border: 1px solid #d4af37;
  color: #7a5814;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(164, 118, 37, 0.12);
}

.demo-chef-badge-tiny {
  display: inline-flex;
  align-items: center;
  background: #fbf7f0;
  border: 1px solid #d4af37;
  color: #7a5814;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  letter-spacing: 0.4px;
}

.chef-profile-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}

.chef-profile-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--line);
  border-top-color: var(--gold, #c5a059);
  border-radius: 50%;
  animation: chefSpin 0.8s linear infinite;
}

@keyframes chefSpin {
  to { transform: rotate(360deg); }
}

.chef-profile-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 36px 20px;
}

.chef-profile-empty-state h3 {
  font-family: Georgia, serif;
  font-size: 20px;
  margin: 0 0 8px 0;
  color: var(--text);
}

.chef-profile-empty-state p {
  font-size: 13.5px;
  color: var(--muted);
  max-width: 360px;
  margin: 0 0 16px 0;
  line-height: 1.45;
}

.clickable-stat-box {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 6px 4px;
  border-radius: 8px;
  transition: background 0.15s ease, transform 0.1s ease;
}

.clickable-stat-box:hover {
  background: var(--tint);
  transform: translateY(-1px);
}

.social-counts-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.social-count-box {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text);
}

.social-count-box strong {
  color: var(--gold, #c5a059);
  font-weight: 700;
}

.social-count-dot {
  color: var(--line);
  font-size: 14px;
}

.social-count-btn {
  background: none;
  border: none;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s ease;
}

.social-count-btn:hover {
  background: var(--tint);
  text-decoration: underline;
}

.social-count-btn strong {
  color: var(--gold, #c5a059);
  font-weight: 700;
}

.social-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.social-list-subtitle {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin-left: 2px;
}

.social-list-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 13.5px;
}

.social-user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.social-user-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

/* =========================================================
   PUBLIC PROFILE DISHES GRID & EDIT PROFILE MODAL
   ========================================================= */

.public-chef-joined-date {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.public-chef-dishes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.chef-dish-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
}

.chef-dish-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold, #c5a059);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.chef-dish-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--tint);
}

.chef-dish-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.chef-dish-card:hover .chef-dish-thumb {
  transform: scale(1.05);
}

.chef-dish-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.chef-dish-title {
  font-family: Georgia, serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chef-dish-meta {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 4px;
}

/* Edit Profile Modal */
.edit-profile-modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
  box-sizing: border-box;
}

.edit-profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.edit-profile-header h3 {
  font-family: Georgia, serif;
  font-size: 20px;
  margin: 0;
  color: var(--text);
}

.avatar-upload-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.avatar-preview-box {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid var(--gold, #c5a059);
  background: var(--tint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-upload-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.avatar-presets-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.avatar-preset-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.avatar-preset-btn:hover {
  border-color: var(--gold, #c5a059);
  transform: scale(1.08);
}

.avatar-preset-btn.selected {
  border-color: var(--gold, #c5a059);
  box-shadow: 0 0 0 2px rgba(197, 160, 89, 0.35);
  background: var(--tint);
}