/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --wine-red: #8b1a1a;
  --wine-dark: #5a0e0e;
  --wine-light: #f5e6e6;
  --gold: #c9a84c;
  --gold-light: #f5e6c0;
  --text: #1a1a1a;
  --text-muted: #666;
  --border: #e0d0d0;
  --bg: #faf8f7;
  --card-bg: #fff;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --shadow-hover: 0 4px 20px rgba(0,0,0,.14);
}

html { font-size: 16px; }
body {
  font-family: 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* ===== Header ===== */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--wine-red);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.25rem;
  height: 52px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.header-logo {
  display: flex; align-items: center; gap: .4rem;
  color: #fff; font-weight: 700; font-size: 1.1rem;
}
.logo-icon { font-size: 1.3rem; }
.header-nav { display: flex; gap: 1rem; }
.nav-link { color: rgba(255,255,255,.8); font-size: .9rem; padding: .25rem .5rem; border-radius: 6px; }
.nav-link.active, .nav-link:hover { color: #fff; background: rgba(255,255,255,.15); }

/* ===== Main ===== */
.app-main { max-width: 520px; margin: 0 auto; padding: 1.25rem 1rem 5rem; }

/* ===== Bottom Nav ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(0,0,0,.08);
  height: 60px;
}
.bnav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  font-size: .65rem;
  transition: color .15s;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bnav-item.active { color: var(--wine-red); }
.bnav-item:hover { color: var(--wine-red); }
.bnav-icon { font-size: 1.3rem; line-height: 1; }
.bnav-label { font-weight: 500; }

/* Badge on nav icon */
.bnav-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bnav-badge {
  position: absolute;
  top: -5px; right: -8px;
  min-width: 16px; height: 16px;
  background: #dc2626;
  color: #fff;
  font-size: .6rem; font-weight: 700;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  line-height: 1;
}

/* ===== Alert ===== */
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .9rem; }
.alert-error { background: #fde8e8; color: #c0392b; }

/* ===== Hero ===== */
.hero { text-align: center; padding: 1.5rem 0 1rem; }
.hero-title { font-size: 1.4rem; font-weight: 700; color: var(--wine-dark); }
.hero-sub { margin-top: .4rem; font-size: .875rem; color: var(--text-muted); }

/* ===== Input Card ===== */
.input-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

/* Tabs */
.input-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  flex: 1;
  padding: .75rem;
  background: none; border: none;
  font-size: .9rem; font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all .2s;
}
.tab-btn.active { color: var(--wine-red); border-bottom-color: var(--wine-red); }
.tab-btn:hover:not(.active) { background: var(--wine-light); }

/* Tab Panels */
.tab-panel { padding: 1.25rem; }
.tab-panel.hidden { display: none; }

/* Upload Area */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: 10px;
  min-height: 180px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .2s;
  margin-bottom: 1rem;
}
.upload-area:hover, .upload-area.drag-over { border-color: var(--wine-red); }
.upload-placeholder {
  text-align: center; padding: 2rem 1rem;
  border: 2px dashed var(--border);
  border-radius: 10px;
  margin-bottom: 1rem;
}
.upload-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.upload-hint { font-size: .875rem; color: var(--text-muted); }
.preview-img { width: 100%; max-height: 320px; object-fit: contain; }

.upload-buttons { display: flex; gap: .75rem; margin-bottom: 1rem; }
.btn-camera, .btn-gallery {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .625rem .75rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .875rem; font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  background: #fff;
}
.btn-camera:hover, .btn-gallery:hover { border-color: var(--wine-red); color: var(--wine-red); }
.btn-disabled { opacity: .4; pointer-events: none; }

/* Thumbnail grid */
.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: .5rem;
  margin-bottom: 1rem;
}
.thumb-wrap {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
}
.thumb-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.thumb-del {
  position: absolute; top: 3px; right: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  border: none;
  font-size: .85rem; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.thumb-del:hover { background: rgba(139,26,26,.85); }

/* Text Input */
.wine-text-input {
  width: 100%;
  padding: .875rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
  margin-bottom: 1rem;
}
.wine-text-input:focus { border-color: var(--wine-red); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .75rem 1.25rem;
  border-radius: 10px;
  font-size: .95rem; font-weight: 600;
  border: none; outline: none;
  transition: all .2s;
}
.btn-primary {
  background: var(--wine-red);
  color: #fff;
  width: 100%;
}
.btn-primary:hover:not(:disabled) { background: var(--wine-dark); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-analyze { gap: .5rem; }

/* ===== Recent Section ===== */
.section-title { font-size: 1rem; font-weight: 700; color: var(--text-muted); margin-bottom: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.recent-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.recent-item { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); }
.recent-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: .875rem 1rem;
  gap: .75rem;
}
.recent-link:hover { background: var(--wine-light); border-radius: var(--radius); }
.recent-info { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.recent-name { font-weight: 600; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-producer { font-size: .8rem; color: var(--text-muted); }
.recent-meta { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; flex-shrink: 0; }
.recent-date { font-size: .75rem; color: var(--text-muted); }

/* Action badges */
.recent-action-badge {
  font-size: .7rem; font-weight: 600; padding: .15rem .5rem;
  border-radius: 20px; width: fit-content;
}
.action-discovered { background: #e8f0fe; color: #1a56db; }
.action-considering { background: #fef3c7; color: #92400e; }
.action-purchased { background: #d1fae5; color: #065f46; }
.action-drank { background: var(--wine-light); color: var(--wine-dark); }
.action-gifted { background: #fce7f3; color: #9d174d; }

/* Tier badges */
.tier-badge {
  font-size: .7rem; font-weight: 700; padding: .2rem .6rem;
  border-radius: 20px; letter-spacing: .03em;
}
.tier-table { background: #f3f4f6; color: #374151; }
.tier-everyday { background: #fef3e8; color: #92400e; }
.tier-premium { background: var(--gold-light); color: #78350f; }
.tier-super_premium { background: #ede9fe; color: #5b21b6; }
.tier-ultra { background: var(--wine-light); color: var(--wine-dark); border: 1px solid var(--wine-red); }
.tier-icon { background: #1a0a0a; color: var(--gold); border: 1px solid var(--gold); }

/* ===== Result Page ===== */
.result-wrap { padding-top: .5rem; }

/* Header */
.wine-header {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

/* 배지 행 */
.badge-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }

/* 와인 타입 배지 */
.type-badge {
  font-size: .75rem; font-weight: 700; padding: .25rem .7rem;
  border-radius: 20px; letter-spacing: .03em;
}
.type-badge.type-red        { background: var(--wine-light); color: var(--wine-dark); }
.type-badge.type-white      { background: #fefce8; color: #713f12; }
.type-badge.type-rosé       { background: #fce7f3; color: #9d174d; }
.type-badge.type-sparkling  { background: #e0f2fe; color: #075985; }
.type-badge.type-dessert    { background: #fef9c3; color: #854d0e; }
.type-badge.type-fortified  { background: #fdf4ff; color: #6b21a8; }
.type-badge.type-orange     { background: #fff7ed; color: #9a3412; }

.wine-name { font-size: 1.5rem; font-weight: 800; color: var(--wine-dark); line-height: 1.3; }
.wine-producer { color: var(--text-muted); font-size: .9rem; margin-top: .3rem; }

.wine-meta-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
.meta-chip {
  font-size: .8rem; padding: .2rem .65rem;
  background: #f3f4f6; border-radius: 20px; color: #374151;
}
.vintage-chip { background: var(--gold-light); color: #78350f; font-weight: 600; }

.official-class {
  font-size: .83rem; color: var(--text-muted);
  margin-top: .6rem; padding-top: .6rem;
  border-top: 1px solid var(--border);
}

/* Wine Images */
.wine-images { margin-bottom: 1rem; display: flex; gap: .5rem; overflow-x: auto; justify-content: center; }
.wine-img { height: 220px; width: auto; max-width: 100%; object-fit: contain; border-radius: var(--radius); flex-shrink: 0; }

/* Info section */
.info-section {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .25rem 1.25rem;
  margin-bottom: 1rem;
}
.info-row { display: flex; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.info-row:last-child { border-bottom: none; }
.info-label { font-size: .8rem; font-weight: 600; color: var(--text-muted); width: 48px; flex-shrink: 0; padding-top: .1rem; }
.info-value { font-size: .9rem; }

/* Tasting Profile — 별점 */
.tasting-card, .beginner-card, .pairing-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card-title { font-size: .8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .875rem; }

/* 레이더 차트 */
.chart-wrap {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: .25rem auto 0;
}

/* Beginner note */
.beginner-text { font-size: .95rem; line-height: 1.7; color: var(--text); }

/* Pairing */
.pairing-text { font-size: .95rem; line-height: 1.7; }

/* Tags */
.tags-section { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.tag { font-size: .78rem; padding: .25rem .65rem; border-radius: 20px; }
.tag-region { background: #e0f2fe; color: #075985; }
.tag-grape { background: var(--wine-light); color: var(--wine-dark); }
.tag-style { background: #d1fae5; color: #065f46; }
.tag-term { background: #ede9fe; color: #5b21b6; }

/* Confidence */
.confidence-note { font-size: .78rem; color: var(--text-muted); text-align: right; margin-top: .75rem; margin-bottom: .5rem; }

/* ===== Result Action Buttons ===== */
.result-actions {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.act-btn {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .8rem 1rem;
  border-radius: 10px;
  font-size: .9rem; font-weight: 600;
  border: 1.5px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
  width: 100%;
}
.act-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.act-wish { border-color: var(--gold); color: #78350f; }
.act-wish.act-active { background: var(--gold-light); border-color: var(--gold); opacity: .75; cursor: default; }
.act-buy { border-color: #16a34a; color: #15803d; }
.act-buy.act-in-cellar { background: #dcfce7; }
.act-drank { border-color: var(--wine-red); color: var(--wine-red); }
.act-close { border-color: var(--border); color: var(--text-muted); background: #f9fafb; }

/* ===== Pages (Cellar / Wishlist / History) ===== */
.page-wrap { padding-top: .25rem; }
.page-header { margin-bottom: 1rem; }
.page-title { font-size: 1.3rem; font-weight: 800; color: var(--wine-dark); }

/* Summary card */
.summary-card {
  display: flex; align-items: center;
  background: var(--wine-red);
  color: #fff;
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  margin-bottom: 1.25rem;
  gap: 1rem;
}
.summary-item { display: flex; flex-direction: column; align-items: center; flex: 1; }
.summary-num { font-size: 1.6rem; font-weight: 800; line-height: 1.2; }
.summary-label { font-size: .75rem; opacity: .85; margin-top: .1rem; }
.summary-divider { width: 1px; height: 40px; background: rgba(255,255,255,.3); }

/* Item list */
.item-list { list-style: none; display: flex; flex-direction: column; gap: .6rem; }
.item-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; align-items: stretch;
  overflow: hidden;
}
.item-link {
  flex: 1; padding: .875rem 1rem;
  min-width: 0;
}
.item-link:hover { background: var(--wine-light); }
.item-badges { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .4rem; }
.item-name { font-weight: 700; font-size: .95rem; color: var(--text); }
.item-vintage { font-weight: 400; color: var(--text-muted); font-size: .88rem; }
.item-sub { font-size: .8rem; color: var(--text-muted); margin-top: .15rem; }
.item-meta { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .4rem; }
.item-meta span { font-size: .75rem; color: var(--text-muted); }
.item-price { color: var(--wine-dark) !important; font-weight: 600 !important; }
.item-source { background: #f3f4f6; padding: .1rem .4rem; border-radius: 10px; }

/* Item right panel */
.item-right {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: .75rem .75rem .75rem .5rem;
  gap: .5rem;
  border-left: 1px solid var(--border);
  flex-shrink: 0;
  min-width: 90px;
}
.item-right-col { min-width: 80px; }

/* Qty */
.qty-wrap { display: flex; align-items: baseline; gap: .2rem; }
.qty-num { font-size: 1.6rem; font-weight: 800; color: var(--wine-dark); line-height: 1; }
.qty-label { font-size: .75rem; color: var(--text-muted); }

/* Small action buttons */
.act-sm {
  display: block; width: 100%;
  padding: .35rem .4rem;
  border-radius: 7px;
  font-size: .75rem; font-weight: 600;
  border: 1.5px solid var(--border);
  background: #fff; cursor: pointer;
  transition: all .15s;
  text-align: center;
  white-space: nowrap;
}
.act-sm:hover { border-color: var(--wine-red); color: var(--wine-red); }
.act-drank { border-color: var(--wine-red); color: var(--wine-red); }
.act-gift { border-color: #9d174d; color: #9d174d; }
.act-buy  { border-color: #16a34a; color: #15803d; }
.act-del  { border-color: #d1d5db; color: #6b7280; }
.act-del:hover { border-color: #dc2626; color: #dc2626; }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-icon { font-size: 3rem; margin-bottom: .75rem; }
.empty-msg { font-size: 1rem; font-weight: 600; color: var(--text-muted); margin-bottom: .5rem; }
.empty-sub { font-size: .875rem; color: var(--text-muted); margin-bottom: 1.25rem; }

/* ===== History ===== */
.filter-section { margin-bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.filter-row { display: flex; gap: .4rem; flex-wrap: wrap; }
.filter-chip {
  font-size: .78rem; padding: .3rem .75rem;
  border-radius: 20px; border: 1.5px solid var(--border);
  background: #fff; color: var(--text-muted);
  font-weight: 500; cursor: pointer; transition: all .15s;
}
.filter-chip.active { background: var(--wine-red); color: #fff; border-color: var(--wine-red); }
.filter-chip:hover:not(.active) { border-color: var(--wine-red); color: var(--wine-red); }
.result-count { font-size: .8rem; color: var(--text-muted); margin-bottom: .75rem; }
.history-card { align-items: flex-start; }
.log-date { font-size: .75rem; color: var(--text-muted); }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0));
  width: 100%; max-width: 520px;
  max-height: 85vh; overflow-y: auto;
}
.modal-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 1rem; }
.modal-desc { font-size: .9rem; color: var(--text-muted); margin-bottom: .875rem; }
.modal-field { margin-bottom: .875rem; }
.modal-field label { display: block; font-size: .8rem; font-weight: 600; color: var(--text-muted); margin-bottom: .3rem; }
.modal-input {
  width: 100%; padding: .7rem .875rem;
  border: 1.5px solid var(--border); border-radius: 9px;
  font-size: .95rem; font-family: inherit; outline: none;
  transition: border-color .15s;
}
.modal-input:focus { border-color: var(--wine-red); }
.modal-btns { display: flex; gap: .6rem; margin-top: 1rem; }
.modal-btns .btn { flex: 1; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 72px; left: 50%; transform: translateX(-50%);
  background: #1a1a1a; color: #fff;
  padding: .6rem 1.25rem; border-radius: 24px;
  font-size: .875rem; font-weight: 500;
  z-index: 600;
  animation: toast-in .2s ease, toast-out .3s ease 1.5s forwards;
  white-space: nowrap;
}
@keyframes toast-in  { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; } }

/* ===== Records page ===== */
.records-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.records-section-header {
  display: flex; align-items: center; gap: .5rem;
  margin-bottom: .875rem;
}
.records-section-header-right {
  display: flex; align-items: center; gap: .5rem; margin-left: auto;
}
.records-history-link {
  font-size: .75rem; color: var(--wine-red);
  text-decoration: none; white-space: nowrap;
  opacity: .8;
}
.records-history-link:hover { opacity: 1; text-decoration: underline; }
.records-section-title {
  font-size: .9rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
  flex: 1;
}
.records-count-badge {
  min-width: 20px; height: 20px;
  background: var(--wine-red); color: #fff;
  font-size: .7rem; font-weight: 700;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
}
.records-empty {
  font-size: .875rem; color: #4ade80; font-weight: 500;
  padding: .5rem 0;
}
.records-date { color: var(--text-muted) !important; font-size: .75rem !important; }

/* ===== Star Rating Input ===== */
.star-rating {
  display: flex; gap: .3rem;
  margin-bottom: .25rem;
}
.sr-btn {
  font-size: 1.6rem; line-height: 1;
  background: none; border: none;
  color: #d1d5db;
  cursor: pointer;
  transition: color .1s, transform .1s;
  padding: 0;
}
.sr-btn:hover, .sr-btn.sr-active { color: var(--gold); }
.sr-btn:hover { transform: scale(1.15); }

/* Modal textarea */
.modal-textarea {
  resize: vertical;
  min-height: 70px;
}

/* Ghost button */
.btn-ghost {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  width: 100%;
}
.btn-ghost:hover { border-color: var(--wine-red); color: var(--wine-red); }

/* ===== Header right (user + logout) ===== */
.header-right { display: flex; align-items: center; }

/* Header dropdown menu */
.header-menu-wrap { position: relative; }
.header-menu-btn {
  display: flex; align-items: center; gap: .4rem;
  background: none; border: none;
  color: rgba(255,255,255,.9); font-size: .85rem;
  padding: .35rem .6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s;
}
.header-menu-btn:hover { background: rgba(255,255,255,.15); }
.header-user-name { font-weight: 600; }
.header-login-btn {
  color: #fff; font-size: .85rem; font-weight: 600;
  border: 1.5px solid rgba(255,255,255,.6);
  border-radius: 20px; padding: .3rem .85rem;
  text-decoration: none;
  transition: background .15s;
}
.header-login-btn:hover { background: rgba(255,255,255,.15); }
.header-menu-icon { font-size: .95rem; opacity: .75; }
.header-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  min-width: 160px;
  z-index: 200;
  overflow: hidden;
}
.header-dropdown-item {
  display: block;
  padding: .7rem 1rem;
  font-size: .88rem;
  color: var(--text);
  transition: background .1s;
}
.header-dropdown-item:hover { background: var(--bg); }
.header-dropdown-divider { height: 1px; background: var(--border); margin: .2rem 0; }
.header-dropdown-logout { color: var(--wine-red); }

/* ===== Auth pages ===== */
.auth-body {
  background: var(--bg);
  display: flex; align-items: flex-start; justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem 3rem;
}
.auth-wrap {
  width: 100%; max-width: 400px;
  display: flex; flex-direction: column; align-items: center;
}
.auth-logo {
  display: flex; align-items: center; gap: .4rem;
  font-size: 1.2rem; font-weight: 700; color: var(--wine-dark);
  margin-bottom: 2rem;
}
.auth-title { font-size: 1.4rem; font-weight: 800; color: var(--wine-dark); text-align: center; margin-bottom: .4rem; }
.auth-sub { font-size: .875rem; color: var(--text-muted); text-align: center; margin-bottom: 1.5rem; }

.auth-notice {
  width: 100%;
  background: #fef9c3; border: 1px solid #fde047; border-radius: 10px;
  padding: .875rem 1rem; margin-bottom: 1.25rem;
  font-size: .82rem; color: #854d0e; line-height: 1.6;
}
.auth-error {
  width: 100%;
  background: #fde8e8; border: 1px solid #fca5a5; border-radius: 10px;
  padding: .75rem 1rem; margin-bottom: 1rem;
  font-size: .875rem; color: #c0392b;
}

.auth-form { width: 100%; }
.auth-field { margin-bottom: 1rem; }
.auth-field label {
  display: block; font-size: .8rem; font-weight: 600;
  color: var(--text-muted); margin-bottom: .4rem;
}
.auth-input {
  width: 100%; padding: .8rem 1rem;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 1rem; font-family: inherit; outline: none;
  transition: border-color .2s;
}
.auth-input:focus { border-color: var(--wine-red); }
.auth-submit { margin-top: .5rem; }
.auth-back {
  margin-top: .5rem; width: 100%;
  background: none; border: none; color: var(--text-muted);
  font-size: .875rem; padding: .5rem; cursor: pointer;
}
.auth-back:hover { color: var(--wine-red); }
.auth-footer { margin-top: 1.5rem; text-align: center; }
.auth-link { font-size: .875rem; color: var(--wine-red); font-weight: 500; }
.auth-link:hover { text-decoration: underline; }

.auth-success-card {
  text-align: center; padding: 1.5rem;
  background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow);
  width: 100%;
}
.success-icon { font-size: 2.5rem; margin-bottom: .5rem; }

/* User list (login page) */
.user-list {
  width: 100%;
  display: flex; flex-direction: column; gap: .5rem;
  margin-bottom: 1rem;
}
.user-card {
  display: flex; align-items: center; gap: .875rem;
  padding: .875rem 1rem;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer; width: 100%;
  text-align: left;
  transition: all .15s;
  font-family: inherit;
}
.user-card:hover { border-color: var(--wine-red); box-shadow: var(--shadow); }
.user-card-pending { cursor: default; opacity: .65; }
.user-card-pending:hover { border-color: var(--border); box-shadow: none; }
.user-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--wine-red); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 700; flex-shrink: 0;
}
.user-avatar-pending { background: #9ca3af; }
.user-name { font-weight: 600; font-size: .95rem; flex: 1; }
.user-role-badge {
  font-size: .65rem; font-weight: 700; padding: .15rem .5rem;
  border-radius: 20px; background: var(--wine-light); color: var(--wine-dark);
  margin-left: .3rem;
}
.pending-tag {
  font-size: .72rem; color: #92400e;
  background: #fef3c7; padding: .2rem .5rem; border-radius: 20px;
  flex-shrink: 0;
}

/* PIN input */
.pin-section { width: 100%; text-align: center; }
.pin-label { font-size: 1rem; font-weight: 600; color: var(--wine-dark); margin-bottom: 1rem; }
.pin-boxes {
  display: flex; gap: .6rem; justify-content: center;
  margin-bottom: 1.25rem;
}
.pin-register { justify-content: flex-start; }
.pin-box {
  width: 52px; height: 60px;
  border: 2px solid var(--border); border-radius: 10px;
  text-align: center; font-size: 1.4rem; font-weight: 700;
  outline: none; transition: border-color .15s;
  font-family: inherit;
  -webkit-text-security: disc;
}
.pin-box:focus { border-color: var(--wine-red); }

/* ===== Admin page ===== */
.admin-section {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.admin-section-header {
  display: flex; align-items: center; gap: .5rem;
  margin-bottom: .875rem;
}
.admin-section-title {
  font-size: .9rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em; flex: 1;
}
.admin-user-list { list-style: none; display: flex; flex-direction: column; gap: .75rem; }
.admin-user-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 0; border-bottom: 1px solid var(--border);
}
.admin-user-row:last-child { border-bottom: none; padding-bottom: 0; }
.admin-user-full { flex-wrap: wrap; }
.admin-user-info {
  display: flex; align-items: center; gap: .6rem;
  flex: 1; min-width: 0;
}
.admin-user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--wine-red); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; font-weight: 700; flex-shrink: 0;
}
.avatar-muted { background: #9ca3af; }
.admin-user-name { font-weight: 600; font-size: .9rem; }
.admin-user-meta { font-size: .73rem; color: var(--text-muted); margin-top: .1rem; }
.admin-user-actions { display: flex; gap: .4rem; flex-shrink: 0; }
.admin-user-stats {
  display: flex; gap: .5rem; width: 100%;
  margin: .35rem 0 .1rem 2.6rem;
}
.stat-item {
  display: flex; flex-direction: column; align-items: center;
  background: #f9fafb; border-radius: 8px;
  padding: .3rem .5rem; min-width: 42px;
}
.stat-num { font-size: .95rem; font-weight: 700; color: var(--wine-dark); line-height: 1; }
.stat-label { font-size: .62rem; color: var(--text-muted); margin-top: .15rem; }

/* Admin daily limit row */
.admin-limit-row {
  display: flex; align-items: center; gap: .5rem;
  width: 100%; margin: .3rem 0 .1rem 2.6rem;
  flex-wrap: wrap;
}
.limit-label { font-size: .72rem; color: var(--text-muted); flex-shrink: 0; }
.limit-form { display: flex; gap: .3rem; align-items: center; }
.limit-input {
  width: 72px; padding: .25rem .4rem;
  border: 1.5px solid var(--border); border-radius: 6px;
  font-size: .8rem; font-family: inherit; outline: none;
  transition: border-color .15s;
}
.limit-input:focus { border-color: var(--wine-red); }
.btn-limit-save {
  font-size: .72rem; font-weight: 600; padding: .25rem .55rem;
  border-radius: 6px; border: 1.5px solid var(--wine-red);
  background: var(--wine-light); color: var(--wine-dark);
  cursor: pointer; font-family: inherit;
}
.btn-limit-save:hover { background: var(--wine-red); color: #fff; }
.limit-hint { font-size: .68rem; color: #9ca3af; }
.limit-saved { font-size: .72rem; color: #16a34a; font-weight: 600; }

/* Daily usage stat (over-limit highlight) */
.stat-daily { }
.stat-over .stat-num { color: #dc2626 !important; }

.btn-admin {
  font-size: .75rem; font-weight: 600; padding: .3rem .65rem;
  border-radius: 7px; border: 1.5px solid; cursor: pointer;
  font-family: inherit; transition: all .15s; white-space: nowrap;
}
.btn-approve  { border-color: #16a34a; color: #15803d; background: #f0fdf4; }
.btn-approve:hover { background: #dcfce7; }
.btn-reject   { border-color: #d97706; color: #b45309; background: #fffbeb; }
.btn-reject:hover { background: #fef3c7; }
.btn-block    { border-color: #d97706; color: #b45309; background: #fffbeb; }
.btn-block:hover { background: #fef3c7; }
.btn-delete   { border-color: #dc2626; color: #dc2626; background: #fef2f2; }
.btn-delete:hover { background: #fee2e2; }

/* Status badges */
.status-badge {
  font-size: .65rem; font-weight: 700; padding: .1rem .45rem;
  border-radius: 20px; margin-left: .3rem;
}
.status-pending   { background: #fef3c7; color: #92400e; }
.status-approved  { background: #d1fae5; color: #065f46; }
.status-rejected  { background: #fee2e2; color: #991b1b; }
.status-blocked   { background: #f3f4f6; color: #6b7280; }

/* ===== Utilities ===== */
.hidden { display: none !important; }

/* ===== Mobile tweaks ===== */
@media (max-width: 400px) {
  .wine-name { font-size: 1.25rem; }
  .upload-buttons { flex-direction: column; }
}

/* ===== Price card ===== */
.price-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--gold);
}
.price-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .6rem;
}
.price-source {
  font-size: .7rem; color: var(--text-muted);
  background: #f3f4f6; padding: .15rem .5rem;
  border-radius: 20px;
}
.price-range {
  display: flex; align-items: center; gap: .5rem;
  font-size: 1.4rem; font-weight: 700; color: var(--wine-red);
  margin-bottom: .4rem;
}
.price-sep { font-weight: 400; color: var(--text-muted); font-size: 1rem; }
.price-hi { color: #b45309; }
.price-summary { font-size: .85rem; color: var(--text-muted); line-height: 1.5; margin-top: .3rem; }
.price-none { font-size: .85rem; color: var(--text-muted); }
.price-loading { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--text-muted); }
.price-disclaimer {
  font-size: .72rem; color: #9ca3af;
  margin-top: .6rem; line-height: 1.5;
}
.guide-disclaimer {
  font-size: .75rem; color: #9ca3af;
  text-align: center; line-height: 1.6;
  padding: 0 .5rem .5rem;
}

.tier-price-hint {
  font-size: .72rem; font-weight: 500;
  opacity: .85;
}

/* Spinner */
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--wine-red);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Validation badge ===== */
.validation-badge { margin-top: .5rem; }
.val-ok {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .8rem; font-weight: 600; color: #065f46;
  background: #d1fae5; padding: .2rem .65rem; border-radius: 20px;
}
.val-warn {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .8rem; font-weight: 600; color: #92400e;
  background: #fef3c7; padding: .2rem .65rem; border-radius: 20px;
}
.val-model {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  font-size: .65rem; font-weight: 800; line-height: 1;
  flex-shrink: 0;
}
.val-model-ok   { background: #059669; color: #fff; }
.val-model-fail { background: #dc2626; color: #fff; }

/* ===== Chat (공통) ===== */
.wine-chat-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 5rem;
  box-shadow: var(--shadow);
}
.chat-messages {
  min-height: 120px;
  max-height: 400px;
  overflow-y: auto;
  padding: .5rem 0;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.chat-msg { display: flex; }
.chat-msg-user { justify-content: flex-end; }
.chat-msg-assistant { justify-content: flex-start; }
.chat-bubble {
  max-width: 82%;
  padding: .55rem .85rem;
  border-radius: 14px;
  font-size: .9rem;
  line-height: 1.55;
  word-break: break-word;
}
.chat-msg-user .chat-bubble {
  background: var(--wine-red);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg-assistant .chat-bubble {
  background: #f3f4f6;
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-empty {
  padding: 1rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: .9rem;
}
.chat-empty-hint { font-size: .8rem; margin-top: .4rem; opacity: .8; }
.chat-input-row {
  display: flex; gap: .5rem; margin-top: .75rem;
}
.chat-input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  padding: .55rem 1rem;
  font-size: .9rem;
  font-family: inherit;
  outline: none;
}
.chat-input:focus { border-color: var(--wine-red); }
.chat-send-btn {
  background: var(--wine-red);
  color: #fff;
  border: none;
  border-radius: 22px;
  padding: .55rem 1.1rem;
  font-size: .9rem;
  font-weight: 600;
  transition: background .15s;
}
.chat-send-btn:hover { background: var(--wine-dark); }
.chat-send-btn:disabled { background: #ccc; cursor: not-allowed; }

/* Typing indicator */
.typing-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  margin: 0 2px;
  animation: typing-bounce .9s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: .15s; }
.typing-dot:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .5; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* ===== Advisor page ===== */
.advisor-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 52px - 56px); /* header + nav */
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1rem;
}
.advisor-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 0 .5rem;
}
.advisor-title { font-size: 1.1rem; font-weight: 700; }
.advisor-clear-btn {
  background: none; border: none;
  font-size: 1.1rem; color: var(--text-muted);
  padding: .25rem .5rem;
}
.advisor-chat {
  flex: 1;
  max-height: none;
  overflow-y: auto;
  padding: .5rem 0;
}
.advisor-input-row {
  padding: .5rem 0 .75rem;
  border-top: 1px solid var(--border);
}
.advisor-suggestions {
  display: flex; flex-wrap: wrap; gap: .4rem;
  justify-content: center; margin-top: .75rem;
}
.suggestion-chip {
  background: var(--wine-light); color: var(--wine-dark);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .35rem .75rem;
  font-size: .8rem;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}
.suggestion-chip:hover { background: #ebd5d5; }

/* Advisor button on home page */
.advisor-btn {
  display: flex; align-items: center; gap: .75rem;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 0 0 1rem;
  box-shadow: var(--shadow);
  transition: box-shadow .15s, border-color .15s;
}
.advisor-btn:hover { box-shadow: var(--shadow-hover); border-color: var(--wine-red); }
.advisor-btn-icon { font-size: 1.8rem; flex-shrink: 0; }
.advisor-btn-text { flex: 1; }
.advisor-btn-text strong { display: block; font-size: 1rem; font-weight: 700; margin-bottom: .15rem; }
.advisor-btn-text small { font-size: .78rem; color: var(--text-muted); }
.advisor-btn-arrow { color: var(--text-muted); font-size: 1.1rem; }

/* Advisor session list */
.advisor-new-btn {
  background: var(--wine-red); color: #fff;
  border: none; border-radius: 20px;
  padding: .35rem .9rem; font-size: .85rem;
  font-family: inherit; cursor: pointer;
  transition: opacity .15s;
}
.advisor-new-btn:hover { opacity: .85; }
.advisor-back-btn {
  background: none; border: none;
  color: var(--wine-red); font-size: .9rem;
  font-family: inherit; cursor: pointer;
  padding: .25rem .5rem .25rem 0;
}
.advisor-chat-title { flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.advisor-session-list { display: flex; flex-direction: column; gap: .5rem; padding: .25rem 0 1rem; }
.advisor-session-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .75rem 1rem;
  cursor: pointer; transition: box-shadow .15s, border-color .15s;
}
.advisor-session-item:hover { box-shadow: var(--shadow-hover); border-color: var(--wine-red); }
.advisor-session-info { flex: 1; min-width: 0; }
.advisor-session-title {
  font-size: .95rem; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin: 0 0 .2rem;
}
.advisor-session-date { font-size: .78rem; color: var(--text-muted); margin: 0; }
.advisor-session-del {
  background: none; border: none;
  font-size: 1rem; color: var(--text-muted);
  padding: .25rem .4rem; cursor: pointer; flex-shrink: 0;
  transition: color .15s;
}
.advisor-session-del:hover { color: var(--wine-red); }
.advisor-session-empty {
  text-align: center; padding: 2.5rem 1rem;
  color: var(--text-muted); font-size: .95rem;
}
.advisor-session-empty p { margin: .25rem 0; }

/* ===== Tier guide ===== */
.tier-guide-list {
  display: flex; flex-direction: column; gap: 1rem;
  margin-bottom: 1.25rem;
}
.tier-guide-card {
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 4px 18px rgba(0,0,0,.1);
  border: 2px solid transparent;
  transition: transform .15s, box-shadow .15s;
}
.tier-guide-card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,.14); }

/* Per-tier card colors */
.tier-guide-table {
  background: #f6f6f6;
  border-color: #d1d5db;
}
.tier-guide-everyday {
  background: #fffbf5;
  border-color: #d4b896;
}
.tier-guide-premium {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #e8a838;
}
.tier-guide-super_premium {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border-color: #7c3aed;
}
.tier-guide-ultra {
  background: linear-gradient(135deg, #3b1111 0%, #5a0e0e 100%);
  border-color: #8b1a1a;
}
.tier-guide-icon {
  background: linear-gradient(135deg, #120606 0%, #2a0e0e 100%);
  border-color: var(--gold);
}

.tg-badge-row { margin-bottom: .5rem; }
.tg-price {
  font-size: 1.7rem; font-weight: 900;
  color: var(--wine-red);
  margin: .4rem 0 .6rem;
  letter-spacing: -.02em;
  line-height: 1;
}
.tier-guide-premium .tg-price { color: #b45309; }
.tier-guide-super_premium .tg-price { color: #5b21b6; }
.tier-guide-ultra .tg-price,
.tier-guide-icon .tg-price { color: var(--gold); }

.tg-desc {
  font-size: .88rem; line-height: 1.6; margin-bottom: .7rem;
  color: var(--text);
}
.tier-guide-ultra .tg-desc,
.tier-guide-icon .tg-desc { color: #f5e6e6; }

.tg-examples {
  display: flex; gap: .35rem; flex-wrap: wrap; align-items: center;
  margin-top: .1rem;
}
.tg-example-label {
  font-size: .7rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
  flex-shrink: 0; margin-right: .1rem;
}
.tier-guide-ultra .tg-example-label,
.tier-guide-icon .tg-example-label { color: rgba(245,230,230,.6); }

.tg-chip {
  display: inline-block;
  padding: .18rem .55rem;
  border-radius: 20px;
  font-size: .76rem; font-weight: 500;
  background: rgba(0,0,0,.07);
  color: var(--text);
  white-space: nowrap;
}
.tier-guide-premium .tg-chip { background: rgba(234,170,56,.18); color: #78350f; }
.tier-guide-super_premium .tg-chip { background: rgba(124,58,237,.12); color: #5b21b6; }
.tier-guide-ultra .tg-chip { background: rgba(245,230,230,.12); color: #f5e6e6; }
.tier-guide-icon .tg-chip { background: rgba(201,168,76,.18); color: var(--gold); }

.tier-guide-note {
  background: linear-gradient(135deg, var(--wine-light) 0%, #fff 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--wine-red);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  font-size: .88rem;
  line-height: 1.65;
  margin-bottom: .75rem;
  color: var(--wine-dark);
  box-shadow: 0 2px 10px rgba(139,26,26,.06);
}

/* ===== Tasting Flow ===== */
.tasting-flow { display: flex; flex-direction: column; gap: .75rem; }
.tasting-step-label {
  font-size: .8rem; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: .25rem;
}
.tasting-q { display: flex; flex-direction: column; gap: .35rem; }
.tasting-q-label { font-size: .9rem; font-weight: 600; color: var(--text); }
.taste-group {
  display: flex; gap: .4rem;
}
.taste-group-wrap { flex-wrap: wrap; }
.taste-btn {
  flex: 1;
  padding: .45rem .5rem;
  font-size: .85rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.taste-group-wrap .taste-btn { flex: none; }
.taste-btn:hover { border-color: var(--wine-red); }
.taste-btn.selected {
  background: var(--wine-red);
  border-color: var(--wine-red);
  color: #fff;
  font-weight: 600;
}

/* ===== Tasting Note Card (result page) ===== */
.tasting-note-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.tasting-raw-note {
  font-size: .9rem;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: .75rem;
  padding: .75rem 1rem;
  background: var(--bg);
  border-radius: 8px;
  border-left: 3px solid var(--border);
}
.tasting-ai-interp {
  display: flex; flex-direction: column; gap: .3rem;
}
.tasting-ai-label {
  font-size: .75rem; font-weight: 700;
  color: var(--wine-red);
  text-transform: uppercase; letter-spacing: .05em;
}
.tasting-ai-interp p {
  font-size: .88rem; line-height: 1.65; color: var(--text-muted);
}
.tasting-note-actions {
  display: flex; gap: .5rem; flex-wrap: wrap;
  margin-top: 1rem; padding-top: .875rem;
  border-top: 1px solid var(--border);
}
.tasting-note-actions .btn { flex: 1; min-width: 120px; font-size: .85rem; padding: .6rem .75rem; }

/* ===== Tasting chat (modal step 4) ===== */
.tasting-chat-wrap { display: flex; flex-direction: column; gap: .75rem; }
.tasting-chat-msgs {
  min-height: 160px; max-height: 320px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: .5rem;
  padding: .25rem 0;
}
.tasting-chat-loading {
  display: flex; align-items: center; gap: 3px;
  padding: .5rem .85rem;
  background: #f3f4f6; border-radius: 14px;
  width: fit-content;
}
.tasting-chat-input-row {
  display: flex; gap: .5rem;
}
.tasting-chat-actions {
  display: flex; gap: .5rem;
}
.tasting-summarize-btn { flex: 2; }
.tasting-skip-btn { flex: 1; }

/* Tasting conversation (result page) */
.tasting-conversation {
  margin-top: .75rem;
  display: flex; flex-direction: column; gap: .5rem;
  max-height: 320px; overflow-y: auto;
  padding: .5rem 0;
  border-top: 1px solid var(--border);
}
.tasting-conv-toggle {
  background: none; border: none;
  font-size: .82rem; color: var(--wine-red);
  font-weight: 600; cursor: pointer;
  padding: .3rem 0; text-align: left;
  margin-top: .5rem;
}
.tasting-conv-toggle:hover { text-decoration: underline; }

/* ===== Profile Stats (history page) ===== */
.profile-stats {
  margin-bottom: 1.25rem;
}
.stat-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .6rem;
  margin-bottom: 1rem;
}
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center;
  gap: .2rem;
}
.stat-num {
  font-size: 1.4rem; font-weight: 700;
  color: var(--wine-red);
  line-height: 1;
}
.stat-label {
  font-size: .75rem; color: var(--text-muted);
  text-align: center;
}
.stats-charts { display: flex; flex-direction: column; gap: .75rem; }
.stats-chart-block {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
}
.stats-chart-title {
  font-size: .9rem; font-weight: 700;
  color: var(--text);
  margin-bottom: .6rem;
}

/* ===== Feedback page ===== */
.feedback-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-field { display: flex; flex-direction: column; gap: .4rem; }
.form-label { font-size: .9rem; font-weight: 700; color: var(--text); }
.form-textarea {
  width: 100%; padding: .75rem .9rem;
  font-size: .92rem; font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  resize: vertical; min-height: 120px;
  transition: border-color .15s;
}
.form-textarea:focus { outline: none; border-color: var(--wine-red); }
.form-hint { font-size: .78rem; color: var(--text-muted); }
.btn-full { width: 100%; }
.feedback-cats {
  display: flex; gap: .5rem; flex-wrap: wrap;
}
.feedback-cat-label { cursor: pointer; }
.feedback-cat-radio { display: none; }
.feedback-cat-btn {
  display: inline-block;
  padding: .45rem .9rem;
  font-size: .85rem;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--card-bg);
  color: var(--text);
  transition: all .12s;
}
.feedback-cat-radio:checked + .feedback-cat-btn {
  background: var(--wine-red);
  border-color: var(--wine-red);
  color: #fff;
  font-weight: 600;
}
.feedback-thanks {
  display: flex; flex-direction: column; align-items: center;
  padding: 3rem 1rem;
  text-align: center;
}
.feedback-thanks-icon { font-size: 3rem; margin-bottom: .75rem; }
.feedback-thanks-title { font-size: 1.3rem; font-weight: 700; color: var(--text); margin-bottom: .5rem; }
.feedback-thanks-desc { font-size: .9rem; color: var(--text-muted); line-height: 1.6; }

/* ===== Guide page ===== */
.guide-wrap {
  max-width: 480px; margin: 0 auto; padding: 0 1rem 5rem;
  word-break: keep-all; overflow-wrap: break-word;
}
.guide-welcome-banner {
  display: flex; flex-direction: column; align-items: center;
  gap: .5rem;
  padding: 1.75rem 0 1rem;
  text-align: center;
}
.guide-welcome-icon { font-size: 3rem; line-height: 1; }
.guide-welcome-text { font-size: 1.15rem; font-weight: 700; color: var(--wine-dark); }

.guide-section {
  background: var(--card-bg);
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(90,14,14,.09);
  border-top: 4px solid var(--wine-red);
  padding: 1.75rem 1.5rem 1.5rem;
  margin-bottom: 1.25rem;
  display: flex; flex-direction: column; align-items: center;
}
.guide-section-icon {
  font-size: 3rem; line-height: 1;
  margin-bottom: .875rem;
  width: auto; text-align: center;
  padding-top: 0; flex-shrink: 0;
}
.guide-section-body { width: 100%; }
.guide-section-title {
  font-size: 1.15rem; font-weight: 800;
  color: var(--wine-dark);
  margin-bottom: .5rem;
  text-align: left;
}
.guide-section-desc {
  font-size: .9rem; color: var(--text-muted);
  line-height: 1.65; margin-bottom: .875rem;
  text-align: left;
}
.guide-bullets { list-style: none; display: flex; flex-direction: column; gap: 0; }
.guide-bullets li {
  display: flex; align-items: flex-start; gap: .55rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--border);
}
.guide-bullets li:last-child { border-bottom: none; padding-bottom: 0; }
.guide-step-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: .2rem;
}
.guide-step-name {
  font-size: .9rem; font-weight: 700; color: var(--text);
  word-break: keep-all;
}
.guide-step-desc {
  font-size: .85rem; color: var(--text-muted);
  line-height: 1.6; word-break: keep-all; overflow-wrap: break-word;
}
.guide-step-num {
  width: 22px; height: 22px; min-width: 22px;
  border-radius: 50%;
  background: var(--wine-red); color: #fff;
  font-size: .7rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: .15rem;
}
.guide-divider { display: none; }
.guide-link-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .55rem 1.1rem;
  font-size: .88rem;
  background: var(--wine-red); color: #fff;
  border-radius: 22px; font-weight: 600;
  transition: background .15s;
  margin-top: .5rem;
}
.guide-link-btn:hover { background: var(--wine-dark); }
.guide-cta {
  padding: 1.5rem 0 .5rem;
  display: flex; flex-direction: column; gap: .75rem; align-items: center;
}
.guide-nosee-label {
  display: flex; align-items: center; gap: .5rem;
  font-size: .88rem; color: var(--text-muted); cursor: pointer;
}
.guide-nosee-check { width: 1rem; height: 1rem; cursor: pointer; accent-color: var(--wine-red); }
.guide-start-btn { max-width: 320px; width: 100%; }

@media (max-width: 400px) {
  .guide-section { padding: 1.5rem 1.1rem 1.25rem; border-radius: 14px; }
  .guide-section-icon { font-size: 2.5rem; }
  .guide-section-title { font-size: 1.05rem; }
  .guide-bullets li { font-size: .85rem; }
  .tg-price { font-size: 1.4rem; }
}

/* ===== Admin feedback list ===== */
.feedback-admin-list { display: flex; flex-direction: column; gap: .75rem; }
.feedback-admin-row {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex; flex-direction: column; gap: .5rem;
}
.fb-header { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.fb-cat {
  font-size: .75rem; font-weight: 700;
  padding: .15rem .5rem; border-radius: 4px;
}
.fb-cat-불편사항 { background: #fee2e2; color: #b91c1c; }
.fb-cat-기능-요청 { background: #dbeafe; color: #1d4ed8; }
.fb-cat-기타 { background: #f3f4f6; color: #374151; }
.fb-cat-upgrade_request { background: #fef9c3; color: #92400e; }
.fb-status {
  font-size: .75rem; font-weight: 600;
  padding: .15rem .5rem; border-radius: 4px;
}
.fb-status-pending { background: #fef9c3; color: #92400e; }
.fb-status-reviewing { background: #dbeafe; color: #1e40af; }
.fb-status-done { background: #dcfce7; color: #15803d; }
.fb-meta { font-size: .78rem; color: var(--text-muted); margin-left: auto; }
.fb-content { font-size: .9rem; color: var(--text); line-height: 1.6; white-space: pre-wrap; }
.fb-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.fb-status-select {
  padding: .3rem .5rem; font-size: .85rem; font-family: inherit;
  border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg);
}
.fb-memo-input {
  flex: 1; padding: .3rem .6rem;
  font-size: .85rem; font-family: inherit;
  border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg);
  min-width: 0;
}
.fb-admin-memo { font-size: .82rem; color: var(--text-muted); font-style: italic; }

/* ===== Pricing page ===== */
.plan-current {
  text-align: center;
  font-size: .88rem; font-weight: 600;
  padding: .5rem 1rem;
  border-radius: 20px;
  margin-bottom: 1.25rem;
  display: inline-block;
}
.plan-current-free { background: #f3f4f6; color: #374151; }
.plan-current-premium { background: #fef9c3; color: #92400e; }
.plan-current-admin { background: var(--wine-light); color: var(--wine-dark); }

.pricing-table {
  display: flex; gap: .75rem;
  margin-bottom: 1rem;
}
@media (max-width: 480px) {
  .pricing-table { flex-direction: column; }
}
.pricing-col {
  flex: 1;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  position: relative;
  display: flex; flex-direction: column; gap: .85rem;
}
.pricing-col-active { border-color: var(--gold); }
.pricing-col-premium { border-color: var(--wine-red); }
.pricing-col-badge {
  position: absolute; top: -.7rem; left: 50%; transform: translateX(-50%);
  background: var(--wine-red); color: #fff;
  font-size: .72rem; font-weight: 700;
  padding: .2rem .65rem; border-radius: 12px;
  letter-spacing: .03em;
}
.pricing-col-header { display: flex; flex-direction: column; gap: .3rem; }
.pricing-plan-name { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.pricing-price { display: flex; align-items: baseline; gap: .2rem; }
.pricing-price-num { font-size: 1.5rem; font-weight: 800; color: var(--wine-red); }
.pricing-price-unit { font-size: .82rem; color: var(--text-muted); }

.pricing-features { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.feat-row {
  display: flex; align-items: center; gap: .45rem;
  font-size: .88rem; line-height: 1.45;
}
.feat-ok::before {
  content: '✓';
  color: #16a34a; font-weight: 700; font-size: .85rem; flex-shrink: 0;
}
.feat-no { color: var(--text-muted); }
.feat-no::before {
  content: '—';
  color: #9ca3af; flex-shrink: 0;
}

.pricing-badge-current {
  text-align: center; font-size: .82rem; font-weight: 600;
  color: var(--text-muted);
  padding: .4rem; background: var(--bg);
  border-radius: 8px;
}
.pricing-upgrade-btn {
  width: 100%; margin-top: auto;
}
.pricing-upgrade-note {
  font-size: .75rem; color: var(--text-muted);
  text-align: center; line-height: 1.5;
}
.pricing-upgrade-pending {
  text-align: center;
  font-size: .82rem; font-weight: 600;
  color: #15803d;
  background: #dcfce7;
  border-radius: 8px;
  padding: .6rem .75rem;
  line-height: 1.5;
}
.pricing-upgrade-pending small { font-weight: 400; color: #166534; }
.pricing-footnote {
  font-size: .78rem; color: var(--text-muted);
  text-align: center; margin-top: .5rem;
}
.upgrade-badge { background: var(--wine-red) !important; color: #fff !important; }
.page-sub { font-size: .9rem; color: var(--text-muted); margin-top: .25rem; }
