/* ============================================================
   FarmsLink One — Mobile-First Gateway App
   Korean swine farming service ecosystem hub
   ============================================================ */

/* ---- Custom Properties ---- */
:root {
  /* Brand Blue — from FarmsLink logo */
  --blue-50: #EFF5FC;
  --blue-100: #D6E5F8;
  --blue-200: #ADC9F0;
  --blue-300: #7DADE6;
  --blue-400: #4D91DC;
  --blue-500: #3572B9;
  --blue-600: #2B5C9C;
  --blue-700: #204680;
  --blue-800: #183462;
  --blue-900: #0F2244;

  /* Cool Cream */
  --cream-50: #FBFCFD;
  --cream-100: #F5F7FA;
  --cream-200: #ECEFF4;
  --cream-300: #DDE2EA;

  /* Neutral */
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  /* Service Accent Colors */
  --farmsfix: #D4722A;
  --farmsfix-bg: #FFF4EB;
  --farmseco: #2878A8;
  --farmseco-bg: #EBF5FC;
  --farmsai: #3B6EC2;
  --farmsai-bg: #EDF3FC;
  --farmswork: #B08D18;
  --farmswork-bg: #FFF9E6;
  --farmsmedia: #C4383A;
  --farmsmedia-bg: #FCEBEB;
  --farmsstore: #248F7F;
  --farmsstore-bg: #E6F7F4;
  --farmsair: #4090B5;
  --farmsair-bg: #E8F4FA;

  /* Semantic */
  --color-primary: var(--blue-500);
  --color-primary-hover: var(--blue-600);
  --color-primary-light: var(--blue-50);
  --color-surface: #FFFFFF;
  --color-background: var(--cream-50);
  --color-text: var(--gray-800);
  --color-text-secondary: var(--gray-500);
  --color-text-inverse: #FFFFFF;
  --color-border: var(--gray-200);
  --color-border-light: var(--gray-100);
  --color-danger: #DC3545;
  --color-warning: #F59E0B;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-sheet: 0 -6px 32px rgba(0,0,0,0.08);

  /* Layout */
  --topbar-height: 56px;
  --nav-height: 64px;
  --input-height: 52px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}


/* ---- Reset ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
    system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo',
    'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-background);
  overflow: hidden;
  overscroll-behavior: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  font-size: inherit;
  color: inherit;
}

input, textarea {
  font-family: inherit;
  font-size: 16px; /* Prevent iOS zoom */
  border: none;
  outline: none;
  background: transparent;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }


/* ============================================================
   SPLASH SCREEN
   ============================================================ */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(145deg, var(--blue-800) 0%, var(--blue-900) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash.fade-out {
  opacity: 0;
  visibility: hidden;
}

.splash-mark {
  width: 72px;
  height: 72px;
  animation: gentle-float 2.5s ease-in-out infinite;
}

.splash-mark svg {
  width: 100%;
  height: 100%;
}

.splash-wordmark {
  font-size: 22px;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  letter-spacing: -0.5px;
}

.splash-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  font-weight: 400;
  margin-top: -4px;
}

.splash-loader {
  width: 28px;
  height: 28px;
  margin-top: var(--space-xl);
  border: 2.5px solid rgba(255,255,255,0.15);
  border-top-color: rgba(255,255,255,0.8);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}


/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-background);
  overflow: hidden;
}


/* ============================================================
   TOP BAR — Zone C
   ============================================================ */
.top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--topbar-height) + var(--safe-top));
  padding-top: var(--safe-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
  background: rgba(254, 253, 251, 0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(0,0,0,0.04);
  z-index: 50;
}

.top-bar-left {
  display: flex;
  align-items: center;
}

.top-bar-logo {
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-bar-logo svg {
  width: 26px;
  height: 26px;
}

.top-bar-logo span {
  font-size: 15px;
  font-weight: 800;
  color: var(--blue-600);
  letter-spacing: -0.5px;
}

.top-bar-center {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  background: var(--blue-50);
  transition: background 0.15s;
}

.top-bar-center:active {
  background: var(--blue-100);
}

.farm-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-700);
}

.farm-chevron {
  width: 14px;
  height: 14px;
  color: var(--blue-400);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: background 0.15s;
}

.icon-btn:active {
  background: var(--gray-100);
}

.icon-btn svg {
  width: 21px;
  height: 21px;
  color: var(--gray-600);
}

.badge {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  background: var(--color-danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-background);
  animation: badge-pop 0.4s ease-out;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--blue-100);
  color: var(--blue-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.3px;
}


/* ============================================================
   CHAT AREA — Zone A
   ============================================================ */
.chat-area {
  position: absolute;
  top: calc(var(--topbar-height) + var(--safe-top));
  left: 0;
  right: 0;
  bottom: calc(var(--nav-height) + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.chat-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
}

/* Welcome / Greeting */
.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-xl) 0 var(--space-lg);
  gap: var(--space-sm);
}

.ai-avatar-large {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-2xl);
  background: var(--farmsai-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-sm);
  animation: gentle-pulse 3s ease-in-out infinite;
}

.ai-avatar-large svg {
  width: 32px;
  height: 32px;
  color: var(--farmsai);
}

.chat-greeting {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.8px;
  line-height: 1.3;
}

.chat-subtitle {
  font-size: 15px;
  color: var(--color-text-secondary);
  font-weight: 400;
}

/* Chat Messages */
.chat-messages-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
}

.message {
  display: flex;
  gap: var(--space-sm);
  max-width: 90%;
}

.message-ai { align-self: flex-start; }
.message-user { align-self: flex-end; flex-direction: row-reverse; }

.message-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.message-ai .message-avatar {
  background: var(--farmsai-bg);
}

.message-ai .message-avatar svg {
  width: 16px;
  height: 16px;
  color: var(--farmsai);
}

.message-bubble {
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.65;
  word-break: keep-all;
}

.message-ai .message-bubble {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--space-xs);
  color: var(--color-text);
}

.message-user .message-bubble {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-radius: var(--radius-lg) var(--radius-lg) var(--space-xs) var(--radius-lg);
}

/* Suggestion Chips */
.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: var(--space-md) 0 var(--space-sm);
  justify-content: center;
}

.suggestion-chip {
  padding: 10px 18px;
  border: 1.5px solid var(--blue-200);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  font-size: 14px;
  font-weight: 500;
  color: var(--blue-600);
  white-space: nowrap;
  transition: all 0.15s;
}

.suggestion-chip:active {
  background: var(--blue-50);
  border-color: var(--blue-400);
  transform: scale(0.96);
}

/* Chat Input */
.chat-input-area {
  flex-shrink: 0;
  padding: var(--space-sm) var(--space-md) var(--space-md);
  background: linear-gradient(to bottom, transparent, var(--color-background) 30%);
}

.chat-input-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 5px 5px 5px 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input-wrapper:focus-within {
  border-color: var(--blue-300);
  box-shadow: 0 0 0 3px rgba(46,107,58,0.08);
}

.camera-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  color: var(--gray-400);
  transition: color 0.15s, background 0.15s;
}

.camera-btn:active {
  color: var(--color-primary);
  background: var(--blue-50);
}

.camera-btn svg { width: 20px; height: 20px; }

.chat-input {
  flex: 1;
  height: var(--input-height);
  padding: 0 4px;
  color: var(--color-text);
  min-width: 0;
}

.chat-input::placeholder {
  color: var(--gray-400);
}

.mic-btn,
.send-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.mic-btn {
  background: var(--color-primary);
  color: white;
}

.mic-btn:active {
  background: var(--color-primary-hover);
  transform: scale(0.93);
}

.mic-btn.recording {
  background: var(--color-danger);
  animation: mic-pulse 1s ease-in-out infinite;
}

.mic-btn svg { width: 22px; height: 22px; }

.mic-btn.hidden {
  width: 0;
  padding: 0;
  opacity: 0;
  overflow: hidden;
}

.send-btn {
  background: var(--color-primary);
  color: white;
  width: 0;
  padding: 0;
  opacity: 0;
  overflow: hidden;
}

.send-btn.visible {
  width: 44px;
  opacity: 1;
}

.send-btn:active {
  background: var(--color-primary-hover);
  transform: scale(0.93);
}

.send-btn svg { width: 20px; height: 20px; }


/* ============================================================
   BOTTOM NAV
   ============================================================ */
.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-light);
  display: flex;
  align-items: stretch;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 0 4px;
  position: relative;
  transition: background 0.12s;
  min-width: 0;
}

.nav-item:active {
  background: var(--gray-50);
}

.nav-icon {
  position: relative;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 20px;
  height: 20px;
}

.nav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--color-danger);
  color: white;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-surface);
  animation: badge-pop 0.4s ease-out;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: center;
  padding: 0 2px;
}

/* Service-specific nav colors */
.service-farmsfix .nav-icon svg { color: var(--farmsfix); }
.service-farmseco .nav-icon svg { color: var(--farmseco); }
.service-farmswork .nav-icon svg { color: var(--farmswork); }
.service-farmsmedia .nav-icon svg { color: var(--farmsmedia); }
.service-farmsstore .nav-icon svg { color: var(--farmsstore); }
.service-farmsair .nav-icon svg { color: var(--farmsair); }

/* Coming soon state */
.nav-item.coming-soon {
  opacity: 0.45;
  cursor: default;
}

.nav-item.coming-soon:active {
  background: transparent;
}

.coming-soon-badge {
  position: absolute;
  top: -6px;
  right: -12px;
  background: var(--gray-400);
  color: white;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 1px 4px;
  border-radius: 4px;
  border: 1.5px solid var(--color-surface);
  line-height: 1.4;
}


/* ============================================================
   NOTIFICATIONS PANEL
   ============================================================ */
.notif-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.25);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.notif-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.notifications-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0,0,0,0.08);
}

.notifications-panel.open {
  transform: translateX(0);
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-md) var(--space-md);
  padding-top: calc(var(--space-lg) + var(--safe-top));
  flex-shrink: 0;
}

.notif-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.notif-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--gray-500);
  transition: background 0.15s;
}

.notif-close:active { background: var(--gray-100); }
.notif-close svg { width: 22px; height: 22px; }

.notif-filters {
  display: flex;
  gap: var(--space-sm);
  padding: 0 var(--space-md) var(--space-md);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.notif-filters::-webkit-scrollbar { display: none; }

.notif-filter {
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  background: var(--gray-50);
  white-space: nowrap;
  transition: all 0.15s;
}

.notif-filter.active {
  background: var(--blue-50);
  color: var(--color-primary);
}

.notif-filter:active { transform: scale(0.95); }

.notif-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 var(--space-md);
}

.notif-card {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-sm);
  border-radius: var(--radius-md);
  border-bottom: 1px solid var(--color-border-light);
  transition: background 0.15s;
  cursor: pointer;
}

.notif-card:last-child { border-bottom: none; }
.notif-card:active { background: var(--gray-50); }

.notif-card.unread {
  background: var(--blue-50);
  border-radius: var(--radius-md);
  border-bottom-color: transparent;
  margin-bottom: 4px;
}

.notif-card.unread:active { background: var(--blue-100); }

.notif-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-icon svg { width: 20px; height: 20px; }

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

.notif-service {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 1px;
}

.notif-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
  line-height: 1.3;
}

.notif-summary {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-time {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 4px;
}

.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  color: var(--gray-400);
  text-align: center;
  gap: var(--space-sm);
}


/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes gentle-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes gentle-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(53,114,185,0.15); }
  50% { transform: scale(1.03); box-shadow: 0 0 0 12px rgba(53,114,185,0); }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes badge-pop {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,53,69,0.4); }
  50% { box-shadow: 0 0 0 10px rgba(220,53,69,0); }
}

/* Entrance choreography (after splash) */
.app-ready .top-bar { animation: fade-in 0.35s ease-out 0.05s both; }
.app-ready .chat-welcome { animation: slide-up 0.5s ease-out 0.1s both; }
.app-ready .chat-messages-list { animation: slide-up 0.5s ease-out 0.2s both; }
.app-ready .suggestion-chips { animation: slide-up 0.45s ease-out 0.3s both; }
.app-ready .chat-input-area { animation: slide-up 0.4s ease-out 0.35s both; }
.app-ready .bottom-nav { animation: fade-in 0.3s ease-out 0.4s both; }


/* ============================================================
   UTILITIES
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  background: var(--color-primary);
  color: white;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-lg);
  transition: all 0.15s;
  min-height: 48px;
}

.btn-primary:active {
  background: var(--color-primary-hover);
  transform: scale(0.98);
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Dynamic viewport height for mobile browsers */
@supports (height: 100dvh) {
  .app-shell { height: 100dvh; }
  .splash { height: 100dvh; }
}

/* ---- Tablet / Desktop: phone-frame preview ---- */
@media (min-width: 481px) {
  body {
    background: var(--gray-100);
  }

  .app-shell {
    left: 50%;
    right: auto;
    width: 100%;
    max-width: 430px;
    transform: translateX(-50%);
    box-shadow:
      0 0 0 1px rgba(0,0,0,0.04),
      0 8px 40px rgba(0,0,0,0.08);
    border-radius: 0;
  }

  .splash {
    max-width: 430px;
    left: 50%;
    right: auto;
    width: 100%;
    transform: translateX(-50%);
  }

  .splash.fade-out {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%);
  }

  .notifications-panel {
    max-width: 430px;
  }
}

/* ---- Large desktop: side label ---- */
@media (min-width: 768px) {
  body::before {
    content: 'FarmsLink One';
    position: fixed;
    top: 50%;
    left: calc(50% - 280px);
    transform: translate(-100%, -50%);
    font-family: 'Pretendard Variable', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-300);
    letter-spacing: -0.5px;
    pointer-events: none;
  }

  body::after {
    content: 'Mobile Preview';
    position: fixed;
    top: 50%;
    left: calc(50% - 280px);
    transform: translate(-100%, -50%) translateY(28px);
    font-family: 'Pretendard Variable', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: var(--gray-400);
    pointer-events: none;
  }
}

/* ---- Small phones (iPhone SE, Galaxy S) ---- */
@media (max-width: 374px) {
  :root {
    --topbar-height: 48px;
    --nav-height: 56px;
    --input-height: 46px;
  }

  .chat-greeting {
    font-size: 19px;
  }

  .chat-subtitle {
    font-size: 14px;
  }

  .suggestion-chip {
    padding: 8px 14px;
    font-size: 13px;
  }

  .top-bar-logo span {
    font-size: 13px;
  }

  .top-bar-center {
    padding: 5px 10px;
  }

  .farm-name {
    font-size: 12px;
  }

  .ai-avatar-large {
    width: 56px;
    height: 56px;
    border-radius: 18px;
  }

  .ai-avatar-large svg {
    width: 28px;
    height: 28px;
  }

  .nav-icon svg {
    width: 18px;
    height: 18px;
  }

  .nav-label {
    font-size: 9px;
  }

  .message-bubble {
    font-size: 14px;
    padding: 10px 14px;
  }

  .chat-input-wrapper {
    padding: 4px 4px 4px 8px;
  }

  .mic-btn, .send-btn {
    width: 40px;
    height: 40px;
  }
}

/* ---- Mid-size phones (375-413px) ---- */
@media (min-width: 375px) and (max-width: 413px) {
  .nav-label {
    font-size: 10px;
  }
}

/* ---- Larger phones (414px+) ---- */
@media (min-width: 414px) and (max-width: 480px) {
  .chat-scroll {
    padding: var(--space-md) var(--space-lg);
  }

  .suggestion-chips {
    gap: 10px;
  }

  .suggestion-chip {
    padding: 11px 20px;
  }

  .chat-input-area {
    padding: var(--space-sm) var(--space-lg) var(--space-md);
  }
}

/* ---- Landscape prevention ---- */
@media (max-height: 480px) and (orientation: landscape) {
  .chat-welcome {
    padding: var(--space-md) 0 var(--space-sm);
    gap: var(--space-xs);
  }

  .ai-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .ai-avatar-large svg {
    width: 24px;
    height: 24px;
  }

  .chat-greeting {
    font-size: 18px;
  }

  .suggestion-chips {
    padding: var(--space-sm) 0 0;
  }
}
