/* ===== CSS 변수 정의 (레벨 1) ===== */
:root {
  /* 레이아웃 */
  --header-height: 60px;
  --main-max-width: 1100px;
  --mobile-padding: 12px;
  
  /* Z-index 계층 */
  --z-header: 100;
  --z-modal: 1000;
  
  /* 색상 */
  --color-primary: #3b82f6;
  --color-text-dark: #0f172a;
  --color-text-light: #64748b;
  --color-border: #e2e8f0;
  --color-bg: #f8fafc;
  --color-bg-light: #f1f5f9;
  
  /* 모바일 */
  --mobile-breakpoint: 640px;

  /* Main shopping search composer sizing reference */
  --shopping-composer-width: min(90%, clamp(20rem, 50vw, 56.25rem));
  --shopping-composer-padding-block: clamp(0.5rem, 1.5vw, 0.75rem);
  --shopping-composer-padding-inline: clamp(0.75rem, 2.5vw, 1.5rem);
  --shopping-composer-radius: clamp(1rem, 3vw, 1.75rem);
  --shopping-composer-row-gap: clamp(0.5rem, 1.5vw, 0.875rem);
  --shopping-composer-control-gap: clamp(0.375rem, 1vw, 1.5rem);
  --shopping-composer-left-button-size: clamp(2.5rem, 8vw, 2.8125rem);
  --shopping-composer-right-button-size: clamp(2.5rem, 8vw, 3.125rem);
  --composer-focus-border: #bfdbfe;
  --composer-focus-shadow: 0 clamp(0.25rem, 1vw, 0.5rem) clamp(1rem, 3vw, 1.5rem) rgba(37, 99, 235, 0.08);
}

/* 상태 제어 클래스 */
.show {
  display: block !important;
}

.modal-overlay.show,
.img-preview.show {
  display: flex !important;
}

.hidden {
  display: none !important;
}

/* 초기 숨김 처리 */
#imgPreview,
#filterModal,
#locationSettingsModal,
#inquiryModal,
#inquiryFormArea,
#fileInput {
  display: none;
}

/* ===== 기본 HTML 요소 (레벨 2) ===== */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  font-family: 'Gowun Dodum', sans-serif;
  background: #fff;
  color: var(--color-text-dark);
}

/* ===== 헤더 (레벨 2) ===== */
.app-header {
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(12px, 2vw, 24px);
}

.header-content {
  width: 100%;
  max-width: var(--main-max-width);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 16px);
  text-decoration: none;
  color: inherit;
  justify-self: start;
}

.logo-img {
  height: clamp(32px, 4.5vw, 48px);
  width: auto;
  object-fit: contain;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.slogan {
  font-size: clamp(10px, 1vw, 13px);
  color: var(--color-text-light);
  font-weight: 600;
  display: block;
}

/* ===== 메인 콘텐츠 (레벨 2) ===== */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.landing-view,
.results-view {
  width: 100%;
  max-width: var(--main-max-width);
  margin: 0 auto;
}

.landing-view {
  display: block;
  padding: clamp(20px, 5vh, 60px) clamp(12px, 3vw, 24px);
  text-align: center;
}

.header-brand {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.header-brand-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  min-width: 0;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.header-brand-copy:focus-visible {
  outline: clamp(1px, 0.14vw, 2px) solid #93c5fd;
  outline-offset: clamp(2px, 0.3vw, 4px);
  border-radius: clamp(4px, 0.8vw, 8px);
}

.header-brand-title {
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  font-weight: 700;
  color: #334155;
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.header-brand-sub {
  font-size: clamp(0.7rem, 1.2vw, 0.8rem);
  color: #64748b;
  margin: clamp(0.15rem, 0.4vw, 0.25rem) 0 0 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.results-view {
  display: none;
  padding: clamp(12px, 3vh, 32px) clamp(12px, 3vw, 24px);
}

/* ===== 상태 관리: 검색 모드 (레벨 3) ===== */
body.search-mode .welcome-section,
body.search-mode .trending-section {
  display: none !important;
}

body.search-mode .landing-view {
  padding: 16px;
  padding-bottom: 0;
}

body.search-mode .results-view {
  display: block !important;
}

/* ===== 랜딩 페이지 콘텐츠 (레벨 4) ===== */
.shopping-home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, clamp(20rem, 62vw, 58rem));
  margin: 0 auto;
  padding: clamp(0.95rem, 3vw, 1.55rem) clamp(0.75rem, 2.6vw, 1.35rem) clamp(0.9rem, 2.4vw, 1.2rem);
  border: 0.0625rem solid rgba(191, 219, 254, 0.9);
  border-radius: clamp(1rem, 3vw, 1.5rem);
  background: linear-gradient(180deg, #eff6ff 0%, #f8fbff 48%, #ffffff 100%);
}

.shopping-mode-label,
.mode-subtitle-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  gap: clamp(0.28rem, 1vw, 0.4rem);
  margin: 0;
  padding: clamp(0.28rem, 1vw, 0.38rem) clamp(0.58rem, 1.8vw, 0.78rem);
  border: 0.0625rem solid #bfdbfe;
  border-radius: 999rem;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: clamp(0.78rem, 1.8vw, 0.88rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
  appearance: none;
  font-family: inherit;
  cursor: pointer;
  pointer-events: auto;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.mode-subtitle-badge--active {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.shopping-mode-label:hover,
.mode-subtitle-badge:hover {
  border-color: color-mix(in srgb, #1d4ed8 34%, #bfdbfe);
  box-shadow: 0 clamp(0.16rem, 0.7vw, 0.25rem) clamp(0.5rem, 1.5vw, 0.75rem) rgba(29, 78, 216, 0.12);
}

.shopping-mode-label:active,
.mode-subtitle-badge:active {
  transform: translateY(clamp(0.03rem, 0.2vw, 0.06rem));
}

.shopping-home-container .welcome-section {
  margin-bottom: clamp(0.65rem, 2vw, 0.9rem);
}

body.search-mode .shopping-home-container {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

body:not(.search-mode):not(.ai-tool-mode) .shopping-home-container .trending-list .chip {
  cursor: pointer;
  padding: clamp(0.35rem, 0.8vw, 0.5rem) clamp(0.8rem, 1.8vw, 1.1rem) !important;
  border: 1.5px solid rgba(226, 232, 240, 0.8) !important;
  border-radius: 9999px !important;
  background: #f8fafc !important;
  color: #475569 !important;
  font-weight: 500 !important;
  font-size: clamp(0.72rem, 1.5vw, 0.82rem) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
  transition:
    transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 200ms ease,
    background-color 200ms ease,
    box-shadow 200ms ease,
    color 200ms ease;
}

@media (hover: hover) and (pointer: fine) {
  body:not(.search-mode):not(.ai-tool-mode) .shopping-home-container .trending-list .chip:hover {
    transform: translateY(-2px);
    border-color: #ff6b35 !important;
    background: #fff8f5 !important;
    color: #ff6b35 !important;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.06);
  }
}

body:not(.search-mode):not(.ai-tool-mode) .shopping-home-container .trending-list .chip:focus-visible {
  outline: 2px solid rgba(255, 107, 53, 0.3);
  outline-offset: 3px;
  border-color: #ff6b35 !important;
}

body:not(.search-mode):not(.ai-tool-mode) .shopping-home-container .trending-list .chip:active {
  transform: translateY(0);
  box-shadow: none;
}

body.search-mode .shopping-mode-label,
body.search-mode .shopping-home-container .mode-subtitle-badge {
  display: none !important;
}

.shopping-identity-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  margin: 0;
  padding: 0.35rem 0.85rem;
  appearance: none;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid #e85d2c;
  border-radius: 999rem;
  background: #ff6b35;
  color: #ffffff;
  box-shadow: 0 0.35rem 0.75rem rgba(255, 107, 53, 0.18);
  font-size: clamp(0.95rem, 2vw, 1.25rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
}

.rounded-headline {
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 800;
  color: #1e293b;
  margin: clamp(1.5rem, 4.5vh, 2.5rem) 0 clamp(0.5rem, 1.2vw, 0.7rem);
  line-height: 1.3;
  letter-spacing: -0.03em;
}

.welcome-sub-headline {
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
  font-weight: 500;
  color: #64748b;
  margin: 0 0 clamp(1.2rem, 3.5vh, 1.8rem) 0;
  line-height: 1.6;
  letter-spacing: -0.01em;
  word-break: keep-all;
}

.point-text {
  color: #ff6b35;
}

.search-wrap {
  width: var(--shopping-composer-width);
  margin: 0 auto;
  position: relative;
}

.search-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: clamp(8px, 1.5vw, 12px) clamp(12px, 2.5vw, 24px);
  border: 1px solid rgba(203, 213, 225, 0.8);
  border-radius: clamp(16px, 3vw, 28px);
  background: #ffffff;
  box-sizing: border-box;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
  transition: border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-box:focus-within {
  border-color: rgba(37, 99, 235, 0.35);
  outline: none;
  box-shadow: 0 18px 46px rgba(37, 99, 235, 0.10);
}

.document-ai-composer:focus-within,
.instant-answer-composer:focus-within,
.web-search-form:focus-within,
.loveme-composer:focus-within,
.home-meal-composer:focus-within {
  border-color: var(--composer-focus-border);
  box-shadow: var(--composer-focus-shadow);
}

.input-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  width: 100%;
}

.msg-input {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 32px;
  max-height: 160px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  font-size: 14px;
  outline: none;
  resize: none;
  font-family: inherit;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.img-btn,
.send-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-light);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  position: relative;
}

.img-btn:hover {
  color: var(--color-primary);
  transform: scale(1.1);
  filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.4));
}

.img-btn {
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.send-btn:hover {
  color: #fff;
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.send-btn {
  background: var(--color-primary);
  color: #fff;
  border-radius: 8px;
  padding: 8px;
}

.icon-btn.search-help-btn {
  width: clamp(32px, 4vw, 36px);
  height: clamp(32px, 4vw, 36px);
  border-radius: 999px;
  color: var(--color-text-light);
  background: transparent;
  border: 0;
  font-size: clamp(14px, 1.6vw, 16px);
  font-weight: 800;
}

.icon-btn.search-help-btn:hover {
  color: var(--color-primary);
  background: transparent;
}

.search-help-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 4vw, 32px);
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(8px);
  z-index: var(--z-modal);
}

.search-help-overlay[hidden] {
  display: none;
}

.search-help-dialog {
  width: min(92vw, 42rem);
  max-height: min(84vh, 48rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: clamp(18px, 3vw, 28px);
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.search-help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(10px, 2vw, 16px);
  padding: clamp(18px, 4vw, 28px) clamp(18px, 4vw, 32px);
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
}

.search-help-title {
  margin: 0;
  color: #1e293b;
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.search-help-body {
  overflow-y: auto;
  padding: clamp(16px, 3vw, 28px) clamp(18px, 4vw, 32px);
}

.search-help-section {
  padding: clamp(12px, 2.4vw, 18px) 0;
  border-bottom: 1px solid #f1f5f9;
}

.search-help-section:first-child {
  padding-top: 0;
}

.search-help-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.search-help-section h4 {
  margin: 0 0 clamp(6px, 1.5vw, 10px);
  color: #334155;
  font-size: clamp(15px, 2vw, 17px);
  font-weight: 800;
}

.search-help-section p {
  margin: 0 0 clamp(10px, 2vw, 14px);
  color: var(--color-text-light);
  font-size: clamp(13px, 1.8vw, 15px);
  line-height: 1.55;
}

.search-help-examples {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.4vw, 10px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-help-example {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(9px, 2vw, 12px) clamp(12px, 2.4vw, 16px);
  border: 1px solid #dbeafe;
  border-radius: clamp(10px, 2vw, 14px);
  background: #f8fafc;
  color: #1e40af;
  font-family: inherit;
  font-size: clamp(13px, 1.8vw, 15px);
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.search-help-example:hover {
  background: #ecfeff;
  border-color: #99f6e4;
  color: #0f766e;
}

.search-help-footer {
  padding: clamp(14px, 3vw, 22px) clamp(18px, 4vw, 32px);
  border-top: 1px solid var(--color-border);
  background: #f8fafc;
  display: flex;
  justify-content: flex-end;
}

.search-help-close {
  border: 0;
  border-radius: 999px;
  padding: clamp(10px, 2vw, 12px) clamp(18px, 4vw, 26px);
  background: linear-gradient(135deg, #2563eb, #0f766e);
  color: #fff;
  font-family: inherit;
  font-size: clamp(13px, 1.8vw, 15px);
  font-weight: 800;
  cursor: pointer;
}

.new-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-size: 7px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 6px;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
  letter-spacing: 0.5px;
  animation: pulse-soft 2s infinite;
}

@keyframes pulse-soft {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.9; }
  100% { transform: scale(1); opacity: 1; }
}

.img-preview {
  display: none;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.pv-item {
  position: relative;
  width: 70px;
  height: 70px;
  transition: transform 0.2s ease;
}

.pv-item:hover {
  transform: scale(1.05);
}

.pv-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.pv-del {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff5252;
  color: #fff;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}


.recent-search-box {
  display: none;
  position: absolute;
  inset-inline: 0;
  top: calc(100% + clamp(0rem, 0.6vw, 0.25rem));
  width: 100%;
  margin-top: 0;
  padding: clamp(0.5rem, 1.6vw, 0.75rem);
  border: 1px solid var(--color-border);
  border-radius: clamp(0.625rem, 2vw, 0.875rem);
  background: #fff;
  text-align: left;
  z-index: 40;
}

.recent-search-box.show {
  display: block;
}

.recent-search-list {
  display: flex;
  flex-direction: column;
  gap: clamp(2px, 0.6vw, 4px);
}

.recent-search-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: clamp(6px, 1vw, 8px);
  border: 0;
  background: transparent;
  color: #334155;
  border-radius: clamp(8px, 1.6vw, 10px);
  font-size: clamp(11px, 1.5vw, 13px);
  text-align: left;
  padding: clamp(5px, 1vw, 8px) clamp(8px, 1.5vw, 11px);
  line-height: 1.35;
  cursor: pointer;
}

.recent-search-icon {
  width: clamp(13px, 1.6vw, 15px);
  height: clamp(13px, 1.6vw, 15px);
  color: #94a3b8;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.recent-search-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.recent-search-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-search-item:hover,
.recent-search-item:focus-visible {
  background: rgba(15, 23, 42, 0.05);
}

.settings-trigger {
  margin-top: 8px;
  width: min(90%, clamp(320px, 50vw, 900px));
  margin: 8px auto 0 auto;
  display: flex;
  justify-content: flex-end;
}

.settings-trigger button,
.settings-trigger .text-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-light);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 0;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.settings-trigger button:hover,
.settings-trigger .text-btn:hover {
  color: var(--color-primary);
}

.trending-section {
  margin-top: 32px;
  text-align: center;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.trending-list {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  width: var(--shopping-composer-width);
}

/* ===== Trust Signals Strip ===== */
.trust-signals-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  margin: 16px auto 0 auto;
  width: min(100%, clamp(20rem, 62vw, 58rem));
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 16px;
  padding: clamp(12px, 2vh, 16px) clamp(16px, 3vw, 32px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.02);
  box-sizing: border-box;
}

body.search-mode .trust-signals-strip {
  display: none !important;
}

.trust-signal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  flex: 1;
  justify-content: center;
  min-width: 0;
}

/* Border separator between items (only on desktop) */
.trust-signal-item:not(:last-child) {
  border-right: 1px solid rgba(226, 232, 240, 0.6);
  padding-right: 16px;
}

.trust-signal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.trust-signal-item:nth-child(1) .trust-signal-icon {
  background: #eff6ff;
  color: #2563eb;
}

.trust-signal-item:nth-child(2) .trust-signal-icon {
  background: #fff8f5;
  color: #ff6b35;
}

.trust-signal-item:nth-child(3) .trust-signal-icon {
  background: #f0fdf4;
  color: #16a34a;
}

.trust-signal-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.trust-signal-title {
  font-size: clamp(13px, 1.5vw, 14px);
  font-weight: 700;
  color: #334155;
  line-height: 1.2;
}

.trust-signal-desc {
  font-size: clamp(11px, 1.3vw, 12px);
  color: #64748b;
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}

@media (max-width: 640px) {
  .trust-signals-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
  }

  .trust-signal-item {
    width: 100%;
    justify-content: center;
    gap: 8px;
    min-width: 0;
  }

  .trust-signal-item:nth-child(3) {
    display: none !important;
  }

  .trust-signal-item:not(:last-child) {
    border-right: none;
    padding-right: 0;
  }

  .trust-signal-icon {
    width: 24px;
    height: 24px;
  }

  .trust-signal-icon svg {
    width: 12px;
    height: 12px;
  }

  .trust-signal-content {
    gap: 1px;
    min-width: 0;
  }

  .trust-signal-title {
    font-size: 12px;
  }

  .trust-signal-desc {
    font-size: 10px;
    line-height: 1.2;
    white-space: normal;
  }
}

/* ===== 푸터 (레벨 2) ===== */


.seo-keyword-row {
  max-width: min(100%, 47.5rem);
  margin: clamp(0.75rem, 2vw, 1rem) auto 0;
  padding: clamp(0.45rem, 1.5vw, 0.7rem) clamp(0.25rem, 1.5vw, 0.5rem) 0;
  border-top: 0.0625rem solid rgba(148, 163, 184, 0.28);
  display: flex;
  flex-direction: column;
  gap: clamp(0.18rem, 0.8vw, 0.3rem);
  text-align: center;
}

.seo-keyword-copy,
.seo-keyword-list {
  margin: 0;
  color: #94a3b8;
  font-size: clamp(0.69rem, 1.2vw, 0.75rem);
  line-height: 1.6;
  text-align: center;
}

.seo-keyword-copy {
  margin-bottom: clamp(0.12rem, 0.8vw, 0.25rem);
}

.seo-keyword-list {
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.app-footer {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: clamp(16px, 3vw, 40px) clamp(12px, 2vw, 24px);
  text-align: center;
}

.header-container {
  max-width: var(--main-max-width);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

/* 검색 모드에서도 헤더 요소 강제 노출 */
.app-header .header-actions {
  display: flex !important;
  align-items: center;
  gap: 12px;
}

.ftr-content {
  max-width: var(--main-max-width);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 20px;
  align-items: center;
}

.ftr-logo {
  font-size: 16px;
  font-weight: 900;
  color: var(--color-text-dark);
  text-decoration: none;
  letter-spacing: -1px;
}


.admin-analytics-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(1.75rem, 5vw, 1.75rem);
  height: clamp(1.75rem, 5vw, 1.75rem);
  border-radius: 999px;
  text-decoration: none;
  color: #64748b;
  opacity: 0.72;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
}

.admin-analytics-link:hover,
.admin-analytics-link:focus-visible {
  opacity: 1;
  background: #f1f5f9;
  color: #334155;
  outline: none;
}
/* ===== 모달 (레벨 2) ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
}

.modal-content {
  background: #fff;
  border-radius: clamp(16px, 3vw, 32px);
  padding: clamp(16px, 4vw, 40px);
  width: min(94%, 600px);
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.close-btn {
  background: var(--color-bg-light);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#msgContainer {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2.5vw, 24px);
  width: min(95%, 900px);
  margin: 0 auto;
}

.ai-result {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2vw, 16px);
  animation: fadeIn 0.5s ease-out;
}

.ai-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--color-primary);
  font-size: clamp(14px, 1.5vw, 16px);
}

.ai-label .dot {
  background: var(--color-primary);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.ai-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 8px;
}

.sort-options {
  display: flex;
  gap: 8px;
}

.sort-btn {
  background: #f1f5f9;
  border: 1px solid var(--color-border);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-light);
  cursor: pointer;
  transition: all 0.2s;
}

.sort-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.page-btn {
  background: #fff;
  border: 1px solid var(--color-border);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
  background: var(--color-bg-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-info {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-dark);
}

/* ===== AI 결과 한눈에 요약 블록 (AI Result Summary Blocks) ===== */
.ai-result-summary-block {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(0.5rem, 1.5vw, 0.8rem);
  padding: clamp(0.5rem, 1.2vw, 0.75rem) clamp(0.75rem, 1.8vw, 1.1rem);
  border-radius: clamp(0.5rem, 1vw, 0.65rem);
  margin-bottom: clamp(0.75rem, 1.8vw, 1rem);
  border-width: 0.0625rem;
  border-style: solid;
  width: 100%;
  box-sizing: border-box;
}

.ai-result-summary-label {
  font-size: clamp(0.7rem, 1.2vw, 0.8rem);
  font-weight: 800;
  padding: clamp(0.2rem, 0.5vw, 0.3rem) clamp(0.5rem, 1vw, 0.65rem);
  border-radius: clamp(0.25rem, 0.6vw, 0.4rem);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.ai-result-summary-text {
  font-size: clamp(0.75rem, 1.4vw, 0.875rem);
  font-weight: 600;
  line-height: 1.4;
  color: inherit;
  flex: 1;
  min-width: clamp(10rem, 40vw, 15rem);
}

/* Document AI: Blue/Indigo theme */
.ai-result-summary-document-ai {
  background: linear-gradient(135deg, hsl(215, 100%, 97%), hsl(215, 100%, 95%));
  border-color: hsl(215, 90%, 90%);
  color: hsl(215, 80%, 30%);
}
.ai-result-summary-document-ai .ai-result-summary-label {
  background: hsl(215, 90%, 45%);
  color: #ffffff;
}

/* Instant Answer: Teal/Cyan theme */
.ai-result-summary-instant-answer {
  background: linear-gradient(135deg, hsl(180, 100%, 96%), hsl(180, 100%, 94%));
  border-color: hsl(180, 70%, 88%);
  color: hsl(180, 80%, 25%);
}
.ai-result-summary-instant-answer .ai-result-summary-label {
  background: hsl(180, 85%, 38%);
  color: #ffffff;
}

/* Web Search: Green/Emerald theme */
.ai-result-summary-web-search {
  background: linear-gradient(135deg, hsl(145, 60%, 96%), hsl(145, 60%, 94%));
  border-color: hsl(145, 50%, 88%);
  color: hsl(145, 70%, 25%);
}
.ai-result-summary-web-search .ai-result-summary-label {
  background: hsl(145, 75%, 35%);
  color: #ffffff;
}

/* Home Meal: Amber/Orange theme */
.ai-result-summary-home-meal {
  background: linear-gradient(135deg, hsl(32, 100%, 96%), hsl(32, 100%, 94%));
  border-color: hsl(32, 90%, 88%);
  color: hsl(32, 85%, 28%);
}
.ai-result-summary-home-meal .ai-result-summary-label {
  background: hsl(32, 95%, 42%);
  color: #ffffff;
}

/* Loveme: Rose/Pink theme */
.ai-result-summary-loveme {
  background: linear-gradient(135deg, hsl(335, 100%, 97%), hsl(335, 100%, 95%));
  border-color: hsl(335, 80%, 90%);
  color: hsl(335, 80%, 35%);
}
.ai-result-summary-loveme .ai-result-summary-label {
  background: hsl(335, 85%, 48%);
  color: #ffffff;
}

/* ===== 모바일 반응형 (레벨 5) ===== */
@media (max-width: 640px) {
  :root {
    --header-height: 50px;
    --main-max-width: 100%;
    --mobile-padding: 12px;
  }

  .app-header {
    padding: 0 clamp(16px, 5vw, 24px);
  }

  .header-content {
    padding: 0;
  }

  .logo-img {
    height: 27px;
  }

  .slogan {
    font-size: 10px;
    display: block;
  }

  .header-brand-title {
    font-size: clamp(0.75rem, 3.4vw, 0.85rem);
    line-height: 1.1;
  }

  .header-brand-sub {
    font-size: clamp(0.55rem, 2.5vw, 0.65rem);
    line-height: 1.1;
    margin-top: 1px;
  }

  .landing-view {
    padding: 20px 12px;
  }

  .shopping-identity-title {
    font-size: clamp(0.95rem, 4vw, 1.15rem);
  }

  .rounded-headline {
    font-size: clamp(1.45rem, 6vw, 1.6rem);
    margin: clamp(1.5rem, 5vh, 2.25rem) 0 clamp(0.75rem, 3vw, 1rem);
  }

  .search-wrap {
    width: calc(100% - 24px);
    margin: 0 12px;
  }

  .results-view {
    padding: 12px;
  }

  .modal-content {
    padding: 20px;
  }

  .ai-result {
    padding: 12px;
  }

  .general-results-wrap .ai-label-row {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: clamp(6px, 2vw, 10px);
  }

  .general-results-wrap .ai-label-row .ai-label {
    flex: 1 1 clamp(12rem, 65%, 100%);
    min-width: min(100%, 12rem);
    line-height: 1.35;
  }

  .general-results-wrap .ai-label-row .ai-label span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: keep-all;
  }

  .general-results-wrap .sort-options {
    flex: 0 0 auto;
    justify-content: flex-end;
    max-width: 100%;
    margin-left: auto;
  }

  .general-results-wrap .sort-icon-btn {
    max-width: 100%;
    white-space: nowrap;
  }

  .ftr-content {
    gap: 12px;
  }
}

/* ===== 필터 모달 (레벨 4) ===== */
.filter-modal-content {
  padding: 16px;
  background: #fff;
  font-family: inherit;
}

/* ===== 기존 스타일 유지 (필요한 부분만) ===== */

