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

:root {
  --bg: #111;
  --card: #1a1a1a;
  --card-hover: #222;
  --text: #fff;
  --text-muted: #888;
  --accent: #3b82f6;
  --protein: #3b82f6;
  --fat: #f59e0b;
  --carbs: #a855f7;
  --calories: #84cc16;
  --success: #22c55e;
  --danger: #ef4444;
  --star: #fbbf24;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 80px;
}

#app {
  max-width: 480px;
  margin: 0 auto;
}

/* Tab Bar */
.tab-bar {
  display: flex;
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #333;
}

.tab {
  flex: 1;
  padding: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tab.active {
  color: var(--text);
  background: linear-gradient(to top, rgba(59, 130, 246, 0.2), transparent);
  border-bottom: 2px solid var(--accent);
}

/* Stats Header */
.stats-header {
  padding: 16px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.stats-header-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.app-icon {
  width: 48px;
  height: 48px;
}

.stats-header h1 {
  font-size: 24px;
  font-weight: 700;
}

.subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-card {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 12px;
}

.stat-card.clickable {
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}

.stat-card.clickable:hover {
  border-color: var(--accent);
}

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

.stat-value {
  font-size: 28px;
  font-weight: 700;
}

.stat-value span {
  font-size: 14px;
  color: var(--text-muted);
}

.stat-value-large {
  font-size: 32px;
  font-weight: 700;
}

.stat-value-large span {
  font-size: 14px;
  color: var(--text-muted);
}

.stat-value-macro {
  font-size: 20px;
  font-weight: 600;
}

.stat-target, .stat-info {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Progress Section */
.progress-section {
  padding: 16px;
  background: var(--card);
  margin: 12px;
  border-radius: 16px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-header h2 {
  font-size: 16px;
}

.progress-remaining {
  font-size: 14px;
  font-weight: 600;
}

.progress-remaining.under { color: var(--success); }
.progress-remaining.over { color: var(--danger); }

.macro-row {
  margin-bottom: 10px;
}

.macro-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
}

.macro-bar {
  height: 8px;
  background: #333;
  border-radius: 4px;
  overflow: hidden;
}

.macro-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}

.macro-bar-fill.calories { background: var(--calories); }
.macro-bar-fill.protein { background: var(--protein); }
.macro-bar-fill.fat { background: var(--fat); }
.macro-bar-fill.carbs { background: var(--carbs); }
.macro-bar-fill.over { background: var(--danger); }

/* Coffee Section */
.coffee-section {
  margin: 12px;
  padding: 14px 16px;
  background: var(--card);
  border-radius: 12px;
}

.coffee-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.coffee-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.coffee-icon {
  font-size: 24px;
}

.coffee-label {
  font-size: 14px;
  font-weight: 600;
}

.coffee-detail {
  font-size: 11px;
  color: var(--text-muted);
}

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

.coffee-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #333;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}

.coffee-count {
  font-size: 20px;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

.coffee-cals {
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Meal Sections */
.meal-section {
  margin: 16px 12px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 0 4px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
}

.section-counter {
  font-size: 13px;
  color: var(--text-muted);
}

/* Carousel */
.meal-carousel {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
}

.meal-track {
  display: flex;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.meal-card {
  flex: 0 0 100%;
  padding: 0 2px;
}

.meal-card.starred .meal-card-inner {
  border: 2px solid var(--star);
}

.meal-card-inner {
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid transparent;
}

.meal-card-inner.logged {
  border-color: var(--success);
}

.meal-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.meal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge.cutting { background: #22c55e; color: #000; }
.badge.everyday { background: #3b82f6; color: #fff; }
.badge.quick { background: #f59e0b; color: #000; }
.badge.treat { background: #ec4899; color: #fff; }
.badge.meal-prep { background: #8b5cf6; color: #fff; }

.logged-badge, .starred-badge, .placeholder-badge, .tiktok-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.logged-badge { background: var(--success); color: #000; }
.starred-badge { background: var(--star); color: #000; top: 45px; }
.placeholder-badge { background: #666; color: #fff; top: 45px; }
.tiktok-badge { background: #000; color: #fff; border: 1px solid #fff; top: 80px; }
.unverified-badge { background: #f59e0b; color: #000; top: 115px; }

.recipe-btn, .star-btn {
  position: absolute;
  bottom: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.recipe-btn { right: 10px; }
.star-btn { right: 52px; }

.star-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
}

.star-btn.active {
  background: var(--star);
}

.star-btn.active svg {
  fill: #000;
  stroke: #000;
}

.meal-content {
  padding: 14px;
}

.meal-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.meal-portions {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}

/* Macro Display - v1.1 style */
.macro-display {
  background: #18181b;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.macro-display-label {
  background: #3f3f46;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
}

.macro-display-items {
  display: flex;
  flex: 1;
  justify-content: space-between;
}

.macro-display-item {
  text-align: center;
  color: white;
}

.macro-display-item .icon {
  font-size: 16px;
  margin-bottom: 2px;
}

.macro-display-item .value {
  font-size: 20px;
  font-weight: 700;
}

.macro-display-item .label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #a1a1aa;
}

.macro-display-item.calories {
  background: #27272a;
  padding: 8px 12px;
  border-radius: 8px;
  margin-left: 8px;
}

.log-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.log-btn.logged {
  background: var(--success);
}

/* Carousel Dots */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  border: none;
  background: #444;
  cursor: pointer;
  transition: all 0.2s;
}

.dot.active {
  width: 20px;
  background: var(--accent);
}

/* Snacks */
.snacks-section {
  margin: 12px;
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
}

.snacks-section .section-header {
  padding: 14px 16px;
  margin: 0;
  cursor: pointer;
}

.snacks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 12px 12px;
}

.snacks-grid.collapsed {
  display: none;
}

.snack-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: #252525;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
}

.snack-item.logged {
  border-color: var(--success);
}

.snack-check {
  width: 20px;
  height: 20px;
  border: 2px solid #444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--success);
}

.snack-item.logged .snack-check {
  background: var(--success);
  border-color: var(--success);
  color: #000;
}

.snack-name {
  font-size: 12px;
  font-weight: 500;
}

.snack-macros {
  font-size: 10px;
  color: var(--text-muted);
}

/* Extras */
.extras-section {
  margin: 12px;
  background: var(--card);
  border-radius: 16px;
}

.extras-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
}

.extras-count {
  font-size: 12px;
  color: var(--text-muted);
}

.extras-panel {
  padding: 0 16px 16px;
}

.extras-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.preset-btn {
  padding: 6px 10px;
  border: 1px solid #444;
  border-radius: 16px;
  background: none;
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
}

.extras-custom {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.extras-custom input {
  flex: 1;
  padding: 8px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #222;
  color: var(--text);
  font-size: 13px;
}

.extras-custom button {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.extra-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background: #252525;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}

.extra-item button {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 18px;
  cursor: pointer;
}

/* Notes */
.notes-section {
  margin: 12px;
}

.notes-textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid #333;
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  resize: vertical;
}

/* Settings */
.settings-section {
  margin: 12px;
}

.settings-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-buttons button {
  flex: 1;
  min-width: 120px;
  padding: 12px;
  border: 1px solid #333;
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.settings-buttons button.danger {
  border-color: var(--danger);
  color: var(--danger);
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.recipe-modal, .weight-modal {
  background: var(--card);
  border-radius: 20px;
  max-width: 400px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
}

.recipe-modal img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.recipe-modal h2 {
  padding: 16px 16px 8px;
  font-size: 20px;
}

.recipe-modal h3 {
  padding: 12px 16px 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.recipe-servings {
  padding: 0 16px;
  font-size: 13px;
  color: var(--accent);
}

.recipe-tbc {
  padding: 0 16px;
  font-size: 12px;
  color: var(--fat);
}

.recipe-unverified {
  padding: 8px 16px;
  margin: 0 16px;
  font-size: 12px;
  color: #000;
  background: #f59e0b;
  border-radius: 8px;
}

.ingredients-list {
  padding: 0 16px 0 32px;
  font-size: 13px;
}

.ingredients-list li {
  margin-bottom: 4px;
}

.ing-cals {
  color: var(--text-muted);
  font-size: 11px;
}

.recipe-steps {
  padding: 0 16px 16px;
  font-size: 13px;
  line-height: 1.6;
}

.recipe-macros-summary {
  padding: 12px 16px;
  background: #252525;
  font-size: 12px;
  margin: 16px;
  border-radius: 10px;
}

/* Weight Modal */
.weight-modal {
  padding: 24px;
  text-align: center;
}

.weight-modal h2 {
  margin-bottom: 20px;
}

.weight-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.weight-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #333;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
}

#weight-display {
  font-size: 48px;
  font-weight: 700;
}

.weight-unit {
  font-size: 24px;
  color: var(--text-muted);
}

.bf-preview {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.save-weight-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

/* To Try Tab */
.to-try-container {
  padding: 16px;
}

.to-try-header {
  margin-bottom: 16px;
}

.to-try-header h2 {
  font-size: 20px;
  margin-bottom: 4px;
}

.to-try-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.to-try-card {
  background: var(--card);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}

.to-try-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.to-try-title {
  font-weight: 600;
}

.to-try-category {
  font-size: 11px;
  padding: 3px 8px;
  background: #333;
  border-radius: 10px;
  color: var(--text-muted);
}

.to-try-notes {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.to-try-actions {
  display: flex;
  gap: 8px;
}

.btn-small {
  padding: 6px 12px;
  border: 1px solid #444;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
}

.btn-small.primary {
  background: var(--accent);
  border-color: var(--accent);
}

.to-try-empty {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Toggle icon */
.toggle-icon {
  transition: transform 0.2s;
}

/* ==================== V3 ADDITIONS ==================== */

/* Stats Panel */
.stats-panel {
  margin: 12px;
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
}

.stats-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
}

.stats-panel-toggle {
  color: var(--text-muted);
  font-size: 12px;
}

.stats-panel-body {
  padding: 0 16px 16px;
}

.stats-summary-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.stats-summary-item {
  flex: 1;
  background: #252525;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}

.stats-summary-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.stats-summary-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
}

.chart-container {
  margin-bottom: 12px;
}

.chart-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.mini-chart {
  width: 100%;
  height: 100px;
  border-radius: 8px;
  background: #1a1a2e;
}

.stats-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 6px;
  padding: 0 0 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  padding: 6px 12px;
  border: 1px solid #444;
  border-radius: 20px;
  background: none;
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* TikTok Recipe Grid */
.tiktok-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tiktok-card {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s;
}

.tiktok-card:active {
  transform: scale(0.97);
}

.tiktok-thumb {
  width: 100%;
  aspect-ratio: 3/2;
  overflow: hidden;
  background: #222;
}

.tiktok-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tiktok-card-info {
  padding: 8px 10px;
}

.tiktok-card-title {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tiktok-card-source {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Develop Section (in To Try) */
.develop-section {
  margin-bottom: 16px;
}

.develop-title {
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text-muted);
}

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

.develop-thumb {
  width: 60px;
  height: 60px;
  min-width: 60px;
  border-radius: 10px;
  overflow: hidden;
  background: #222;
}

.develop-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.develop-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 24px;
  background: #222;
}

.develop-card-content {
  flex: 1;
  min-width: 0;
}

/* TikTok Modal */
.tiktok-modal {
  background: var(--card);
  border-radius: 20px;
  max-width: 400px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}

.tiktok-modal-preview {
  width: 100%;
  aspect-ratio: 3/2;
  overflow: hidden;
  border-radius: 20px 20px 0 0;
  background: #222;
}

.tiktok-modal-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tiktok-modal-video {
  width: 100%;
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  background: #000;
}

.tiktok-modal-video video {
  width: 100%;
  max-height: 60vh;
  display: block;
}

.video-error {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.tiktok-modal-info {
  padding: 16px;
}

.tiktok-modal-info h2 {
  font-size: 18px;
  margin-bottom: 10px;
}

.tiktok-modal-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tiktok-modal-note {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.tiktok-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.tiktok-action-btn {
  flex: 1;
  padding: 12px 8px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.tiktok-save-btn {
  background: #22c55e;
  color: #fff;
  border-color: #22c55e;
}

.tiktok-save-btn.saved {
  background: transparent;
  color: #22c55e;
  border-color: #22c55e;
}

.tiktok-delete-btn {
  background: transparent;
  color: #ef4444;
  border: 2px solid #ef4444;
}

.tiktok-delete-btn:active {
  background: #ef4444;
  color: #fff;
}

/* Saved card green outline */
.tiktok-card-saved {
  outline: 2px solid #22c55e;
  outline-offset: -2px;
  border-radius: 14px;
  position: relative;
}

.saved-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #22c55e;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
  z-index: 2;
}

/* Image Replace Button */
.image-btn {
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: opacity 0.2s;
  z-index: 2;
}

.image-btn:hover {
  opacity: 1;
}

/* Image Replace Modal */
.image-replace-modal {
  background: var(--card);
  border-radius: 20px;
  max-width: 400px;
  width: 100%;
  padding: 24px;
  position: relative;
}

.image-replace-modal h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.image-replace-title {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.image-replace-current {
  width: 100%;
  aspect-ratio: 3/2;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 16px;
  background: #222;
}

.image-replace-current img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-replace-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.image-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border: 2px dashed #444;
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.image-upload-label:hover {
  border-color: var(--accent);
}

.image-google-btn {
  padding: 12px;
  border: 1px solid #3b82f6;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s;
}

.image-google-btn:hover {
  background: rgba(59, 130, 246, 0.2);
}

.image-url-section {
  margin-top: 4px;
}

.image-url-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.4;
}

.image-url-row {
  display: flex;
  gap: 6px;
}

.image-url-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #333;
  border-radius: 10px;
  background: #1a1a1a;
  color: #fff;
  font-size: 13px;
  outline: none;
  min-width: 0;
}

.image-url-input:focus {
  border-color: #3b82f6;
}

.image-url-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  background: #22c55e;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.image-reset-btn {
  padding: 12px;
  border: 1px solid #444;
  border-radius: 12px;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}
