@font-face {
  font-family: 'SF Pro Display';
  src: url('https://cdn.jsdelivr.net/gh/nicolo-ribaudo/sf-pro-display-font@main/SF-Pro-Display-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'SF Pro Display';
  src: url('https://cdn.jsdelivr.net/gh/nicolo-ribaudo/sf-pro-display-font@main/SF-Pro-Display-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'SF Pro Display';
  src: url('https://cdn.jsdelivr.net/gh/nicolo-ribaudo/sf-pro-display-font@main/SF-Pro-Display-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-primary: #FFFFFF;
  --bg-secondary: #F2F2F7;
  --bg-tertiary: #E5E5EA;
  --text-primary: #1C1C1E;
  --text-secondary: #8E8E93;
  --text-tertiary: #AEAEB2;
  --separator: #E5E5EA;
  --card-bg: #F2F2F7;
  --accent: #5CE0D6;
  --accent-light: #E0F9F7;
  --accent-dark: #40C9C0;
  --accent-gradient: linear-gradient(135deg, #7AECE4 0%, #5CE0D6 50%, #40C9C0 100%);
  --overlay: rgba(0, 0, 0, 0.4);
  --nav-bg: rgba(255, 255, 255, 0.85);
  --tab-bg: rgba(249, 249, 249, 0.94);
  --modal-bg: #FFFFFF;
  --toggle-bg: #E5E5EA;
  --toggle-active: #5CE0D6;
  --input-bg: #F2F2F7;
  --placeholder-bg: #D1D1D6;
  --danger: #FF3B30;
}

body.dark-mode {
  --bg-primary: #000000;
  --bg-secondary: #1C1C1E;
  --bg-tertiary: #2C2C2E;
  --text-primary: #FFFFFF;
  --text-secondary: #98989D;
  --text-tertiary: #636366;
  --separator: #38383A;
  --card-bg: #1C1C1E;
  --accent: #6FE8DF;
  --accent-light: #1A3F3D;
  --accent-dark: #8AEEE7;
  --accent-gradient: linear-gradient(135deg, #8AEEE7 0%, #6FE8DF 50%, #5CE0D6 100%);
  --overlay: rgba(0, 0, 0, 0.6);
  --nav-bg: rgba(28, 28, 30, 0.85);
  --tab-bg: rgba(28, 28, 30, 0.94);
  --modal-bg: #1C1C1E;
  --toggle-bg: #38383A;
  --toggle-active: #6FE8DF;
  --input-bg: #2C2C2E;
  --placeholder-bg: #48484A;
  --danger: #FF453A;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-tertiary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }
body.dark-mode ::-webkit-scrollbar-thumb { background: var(--bg-tertiary); }
body.dark-mode ::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }
* { scrollbar-width: thin; scrollbar-color: var(--text-tertiary) transparent; }

html { font-size: 16px; scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1), color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.anim-fade-up { animation: fadeUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) both; }
.anim-delay-1 { animation-delay: 0.1s; }
.anim-delay-2 { animation-delay: 0.2s; }
.anim-delay-3 { animation-delay: 0.3s; }
.anim-delay-4 { animation-delay: 0.4s; }

.scroll-reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.scroll-reveal.revealed { opacity: 1; transform: translateY(0); }

/* ===== HELPERS ===== */
.text-secondary { color: var(--text-secondary); }
.text-small { font-size: 13px; }
.hidden { display: none !important; }

/* Desktop Navigation */
.desktop-nav {
  display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--nav-bg); backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--separator);
  transition: background 0.5s ease, border-color 0.5s ease;
}
.desktop-nav-inner {
  max-width: 900px; margin: 0 auto; padding: 0 24px;
  height: 52px; display: flex; align-items: center; justify-content: space-between;
}
.desktop-logo { cursor: pointer; transition: opacity 0.2s; display: flex; align-items: center; }
.desktop-logo:hover { opacity: 0.7; }
.nav-logo { height: 36px; width: 36px; transition: filter 0.5s ease; }
body.dark-mode .nav-logo { filter: invert(1); }

.desktop-links { display: flex; gap: 28px; }
.desktop-links a {
  font-size: 15px; font-weight: 500; color: var(--text-secondary);
  text-decoration: none; cursor: pointer; transition: color 0.3s ease; position: relative;
}
.desktop-links a:hover, .desktop-links a.active { color: var(--accent); }
.desktop-links a.active::after {
  content: ''; position: absolute; bottom: -4px; left: 0; right: 0;
  height: 2px; background: var(--accent); border-radius: 1px; animation: scaleIn 0.3s ease;
}

.theme-toggle {
  background: none; border: none; color: var(--text-secondary); cursor: pointer;
  padding: 6px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  transition: color 0.3s, background 0.3s, transform 0.3s;
}
.theme-toggle:hover { background: var(--bg-secondary); color: var(--text-primary); transform: rotate(15deg); }

/* Language Switcher */
.lang-switch { display: flex; gap: 2px; background: var(--card-bg); border-radius: 8px; padding: 2px; }
.lang-btn {
  padding: 4px 10px; font-size: 12px; font-weight: 600; font-family: inherit;
  background: none; border: none; border-radius: 6px; cursor: pointer;
  color: var(--text-secondary); transition: all 0.2s ease;
}
.lang-btn.active { background: var(--bg-primary); color: var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.lang-btn:hover:not(.active) { color: var(--text-primary); }
body.dark-mode .lang-btn.active { background: var(--bg-tertiary); }
.settings-lang-item { cursor: default; }
.settings-lang-item .lang-switch { background: var(--bg-primary); }
body.dark-mode .settings-lang-item .lang-switch { background: var(--bg-tertiary); }
.icon-sun, .icon-moon { transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s; }
.icon-moon { display: none; }
body.dark-mode .icon-sun { display: none; }
body.dark-mode .icon-moon { display: block; }

/* App Container */
.app-container { min-height: 100vh; padding-bottom: 90px; position: relative; width: 100%; }

/* Pages */
.page {
  display: none; opacity: 0; transform: translateX(30px);
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.page.active { display: block; }
.page.visible { opacity: 1; transform: translateX(0); }
.page.slide-out-left { opacity: 0; transform: translateX(-30px); }

.page-content { max-width: 900px; margin: 0 auto; padding: 16px 16px 32px; word-break: break-word; }
.page-header { padding: 8px 0 4px; }
.page-subtitle { font-size: 15px; color: var(--text-secondary); margin-top: -12px; margin-bottom: 16px; }

.back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: none; color: var(--text-secondary);
  font-size: 15px; font-family: inherit; cursor: pointer;
  padding: 4px 0; margin-bottom: 8px; transition: color 0.2s, transform 0.2s;
}
.back-btn:hover { color: var(--text-primary); transform: translateX(-3px); }

.large-title { font-size: 34px; font-weight: 700; letter-spacing: -0.5px; line-height: 1.1; margin-bottom: 20px; }

/* Hero */
.hero { text-align: center; padding: 60px 0 40px; position: relative; overflow: visible; }
.hero::before, .hero::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none;
  filter: blur(100px); -webkit-filter: blur(100px); z-index: -1;
}
.hero::before {
  width: 700px; height: 700px; top: -200px; left: -100px;
  background: radial-gradient(circle, rgba(92, 224, 214, 0.45) 0%, rgba(92, 224, 214, 0) 70%);
}
.hero::after {
  width: 600px; height: 600px; top: 0; right: -100px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.35) 0%, rgba(167, 139, 250, 0) 70%);
}
body.dark-mode .hero::before {
  background: radial-gradient(circle, rgba(92, 224, 214, 0.35) 0%, rgba(92, 224, 214, 0) 70%);
}
body.dark-mode .hero::after {
  background: radial-gradient(circle, rgba(167, 139, 250, 0.25) 0%, rgba(167, 139, 250, 0) 70%);
}
.hero-logo { width: 140px; height: 140px; margin: 0 auto 20px; display: block; transition: filter 0.5s ease; }
body.dark-mode .hero-logo { filter: invert(1); }
.hero-title { font-size: 48px; font-weight: 700; letter-spacing: -1.5px; margin-bottom: 12px; }
.hero-slogan { font-size: 20px; font-weight: 500; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.4; }
.hero-desc { font-size: 15px; color: var(--text-secondary); max-width: 480px; margin: 0 auto; line-height: 1.5; }

/* Hero Cards */
.hero-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 40px; }
.hero-card {
  background: var(--card-bg); border-radius: 16px; padding: 24px 20px; cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}
.hero-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.hero-card:active { transform: scale(0.96); }
.hero-card-icon {
  color: var(--accent); margin-bottom: 16px; transition: transform 0.3s ease;
  width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
  background: var(--accent-light); border-radius: 14px;
}
.hero-card:hover .hero-card-icon { transform: scale(1.1); }
.hero-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.hero-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }
.hero-card-arrow { position: absolute; top: 24px; right: 20px; color: var(--accent); transition: transform 0.3s ease; }
.hero-card:hover .hero-card-arrow { transform: translateX(4px); }

/* Section Block */
.section-block { margin-bottom: 40px; }
.section-title { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; margin-bottom: 16px; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.step {
  background: var(--card-bg); border-radius: 16px; padding: 20px 16px; text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.step:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.step-icon {
  color: var(--accent); margin-bottom: 12px; transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 52px; height: 52px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-light); border-radius: 14px;
}
.step:hover .step-icon { transform: scale(1.15) rotate(-5deg); }
.step h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.step p { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }

/* No Commission Banner */
.no-commission-banner {
  display: flex; align-items: center; gap: 16px;
  background: var(--accent-light); border: 1px solid var(--accent);
  border-radius: 16px; padding: 20px; transition: background 0.5s, border-color 0.5s;
  overflow: hidden; word-break: break-word;
}
.no-commission-banner h3 { font-size: 17px; font-weight: 700; margin-bottom: 4px; color: var(--accent-dark); }
.no-commission-banner p { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
.no-commission-icon {
  width: 56px; height: 56px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; border-radius: 14px;
}

/* ===== ORDERS ===== */
.btn-create { margin-bottom: 20px; }

.order-card {
  background: var(--card-bg); border-radius: 16px; padding: 16px; margin-bottom: 12px;
  transition: background 0.5s ease, transform 0.2s;
}
.order-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.order-author { display: flex; align-items: center; gap: 12px; }
.order-avatar {
  width: 44px; height: 44px; border-radius: 22px; background: var(--accent-gradient); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; flex-shrink: 0;
}
.order-details { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.order-tag {
  font-size: 12px; font-weight: 500; color: var(--text-secondary); background: var(--bg-primary);
  padding: 4px 10px; border-radius: 8px; transition: background 0.5s;
}
body.dark-mode .order-tag { background: var(--bg-tertiary); }
.order-about { font-size: 14px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 12px; }

.badge-own {
  font-size: 11px; font-weight: 600; color: var(--accent);
  background: var(--accent-light); padding: 4px 10px; border-radius: 8px;
}

.btn-sm { padding: 10px 16px; font-size: 15px; }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

/* ===== LISTINGS ===== */
.listings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.listing-card {
  background: var(--card-bg); border-radius: 16px; overflow: hidden; cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.listing-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.1); }
.listing-card:active { transform: scale(0.97); }
.listing-image { width: 100%; aspect-ratio: 4/3; background: var(--placeholder-bg); object-fit: cover; transition: transform 0.4s ease; }
.listing-card:hover .listing-image { transform: scale(1.03); }
.listing-image-wrapper { overflow: hidden; border-radius: 16px 16px 0 0; }
.listing-info { padding: 12px 14px 14px; }
.listing-price { font-size: 17px; font-weight: 700; margin-bottom: 2px; }
.listing-address { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.listing-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.listing-tag {
  font-size: 11px; font-weight: 500; color: var(--text-secondary);
  background: var(--bg-primary); padding: 3px 8px; border-radius: 6px; transition: background 0.5s;
}
body.dark-mode .listing-tag { background: var(--bg-tertiary); }
.listing-author-line { font-size: 12px; color: var(--text-tertiary); margin-top: 6px; }

.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.filter-group { flex-shrink: 0; }
.filter-range { flex: 1; min-width: 200px; }
.filter-range label { font-size: 13px; color: var(--text-secondary); display: block; margin-bottom: 8px; }
.filter-range input[type="range"] {
  width: 100%; -webkit-appearance: none; appearance: none;
  height: 4px; background: var(--separator); border-radius: 2px; outline: none; transition: background 0.3s;
}
.filter-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 24px; height: 24px; border-radius: 12px;
  background: var(--accent); cursor: pointer; border: 3px solid var(--bg-primary);
  box-shadow: 0 1px 4px rgba(92, 224, 214, 0.3); transition: transform 0.2s;
}
.filter-range input[type="range"]::-webkit-slider-thumb:active { transform: scale(1.15); }

.segment-control {
  display: inline-flex; background: var(--card-bg); border-radius: 10px; padding: 2px; gap: 0;
  transition: background 0.5s ease;
}
.segment {
  padding: 7px 16px; font-size: 13px; font-weight: 500; font-family: inherit;
  background: none; border: none; border-radius: 8px; color: var(--text-secondary);
  cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); white-space: nowrap;
}
.segment.active { background: var(--bg-primary); color: var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,0.08); font-weight: 600; }
body.dark-mode .segment.active { background: var(--bg-tertiary); }

/* ===== MESSENGER ===== */
.chat-list { display: flex; flex-direction: column; }
.chat-list-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--card-bg); cursor: pointer; transition: background 0.2s, transform 0.2s;
  border-bottom: 0.5px solid var(--separator);
}
.chat-list-item:first-child { border-radius: 16px 16px 0 0; }
.chat-list-item:last-child { border-radius: 0 0 16px 16px; border-bottom: none; }
.chat-list-item:only-child { border-radius: 16px; }
.chat-list-item:active { background: var(--bg-tertiary); transform: scale(0.98); }
.chat-list-avatar {
  width: 48px; height: 48px; border-radius: 24px; background: var(--accent-gradient); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; flex-shrink: 0;
}
.chat-list-info { flex: 1; min-width: 0; }
.chat-list-name { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.chat-list-last { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-unread-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--danger); color: #fff; font-size: 12px; font-weight: 700;
  line-height: 20px; text-align: center; flex-shrink: 0; box-sizing: border-box;
}
.chat-list-item.has-unread .chat-list-last { color: var(--text-primary); font-weight: 600; }

.chat-header {
  display: flex; align-items: center; gap: 12px; padding: 8px 0 16px;
  border-bottom: 0.5px solid var(--separator); margin-bottom: 8px;
}
.chat-header .back-btn { margin-bottom: 0; }
.chat-header-info { flex: 1; }
.chat-header-info h3 { font-size: 17px; font-weight: 600; }
.chat-header-rating { font-size: 13px; }

.btn-rate-small {
  background: var(--card-bg); border: none; width: 36px; height: 36px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--text-secondary); transition: background 0.2s, transform 0.2s;
}
.btn-rate-small:hover { background: var(--bg-tertiary); transform: scale(1.1); }

.chat-messages {
  min-height: 300px; max-height: 50vh; overflow-y: auto; padding: 8px 0;
  display: flex; flex-direction: column; gap: 6px;
  -webkit-overflow-scrolling: touch;
}
.chat-bubble { max-width: 80%; padding: 10px 14px; border-radius: 18px; animation: fadeUp 0.3s ease; }
.chat-bubble.mine {
  align-self: flex-end; background: var(--accent-gradient); color: #FFFFFF;
  border-bottom-right-radius: 6px;
}
.chat-bubble.theirs {
  align-self: flex-start; background: var(--card-bg); color: var(--text-primary);
  border-bottom-left-radius: 6px;
}
.bubble-text { font-size: 15px; line-height: 1.4; word-wrap: break-word; }
.bubble-time { font-size: 11px; opacity: 0.6; margin-top: 4px; text-align: right; }

.chat-empty-hint { text-align: center; padding: 60px 20px; color: var(--text-tertiary); font-size: 15px; }

.chat-input-bar {
  display: flex; gap: 8px; padding: 12px 0; border-top: 0.5px solid var(--separator); margin-top: 8px;
}
.chat-input-bar input {
  flex: 1; padding: 10px 16px; font-size: 16px; font-family: inherit;
  background: var(--card-bg); border: none; border-radius: 20px; color: var(--text-primary); outline: none;
  transition: background 0.3s;
}
.chat-input-bar input:focus { background: var(--bg-tertiary); }
body.dark-mode .chat-input-bar input { background: var(--bg-tertiary); }
body.dark-mode .chat-input-bar input:focus { background: var(--bg-secondary); }

.chat-send-btn {
  width: 40px; height: 40px; border-radius: 20px; background: var(--accent-gradient); color: #FFFFFF;
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s, opacity 0.2s;
}
.chat-send-btn:hover { opacity: 0.8; }
.chat-send-btn:active { transform: scale(0.9); }

/* ===== RATINGS ===== */
.rating-badge { display: inline-block; margin-left: 6px; vertical-align: middle; }
.rating-mini { font-size: 12px; color: #FFB800; font-weight: 600; }

.stars-row { display: inline-flex; align-items: center; gap: 1px; }
.star-icon { font-size: 14px; color: var(--text-tertiary); }
.star-icon.filled { color: #FFB800; }
.rating-num { font-size: 12px; color: var(--text-secondary); margin-left: 4px; }

.rating-modal-content { text-align: center; }
.rating-modal-content p { font-size: 15px; color: var(--text-secondary); margin-bottom: 16px; }
.rating-stars { display: flex; justify-content: center; gap: 8px; margin-bottom: 20px; }
.rating-star { font-size: 40px; color: var(--text-tertiary); cursor: pointer; transition: color 0.2s, transform 0.2s; }
.rating-star.active { color: #FFB800; transform: scale(1.15); }
.rating-star:hover { transform: scale(1.2); }

.rating-textarea {
  width: 100%; padding: 12px 14px; font-size: 15px; font-family: inherit;
  background: var(--input-bg); border: 2px solid transparent; border-radius: 12px;
  color: var(--text-primary); outline: none; resize: vertical; margin-bottom: 16px;
  transition: border-color 0.3s;
}
.rating-textarea:focus { border-color: var(--text-tertiary); }
body.dark-mode .rating-textarea { background: var(--bg-tertiary); }

/* ===== FORMS ===== */
.demo-form, .modal-form {
  background: var(--card-bg); border-radius: 16px; padding: 20px 16px;
  transition: background 0.5s ease;
}
.modal-form { background: transparent; padding: 0; }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 14px; font-size: 17px; font-family: inherit;
  background: var(--input-bg); border: 2px solid transparent; border-radius: 12px;
  color: var(--text-primary); outline: none; transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
  max-width: 100%; box-sizing: border-box;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(92, 224, 214, 0.15);
}
body.dark-mode .form-group input, body.dark-mode .form-group select, body.dark-mode .form-group textarea {
  background: var(--bg-tertiary);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-tertiary); }
.form-group select {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238E8E93' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
.form-group textarea { resize: vertical; min-height: 100px; }
.no-commission-check {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  font-size: 13px !important; color: var(--text-secondary); line-height: 1.5;
  text-transform: none !important; letter-spacing: 0 !important;
}
.no-commission-check input[type="checkbox"] {
  width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px;
  accent-color: var(--accent); cursor: pointer;
}
.role-badge {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 8px; margin-left: 8px; vertical-align: middle;
}
.role-badge.buyer { background: var(--accent-light); color: var(--accent); }
.role-badge.seller { background: #FFF3E0; color: #F57C00; }
body.dark-mode .role-badge.seller { background: #3E2C1A; color: #FFB74D; }
.file-input-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-upload-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 20px; background: var(--input-bg); border: 2px dashed var(--separator);
  border-radius: 14px; cursor: pointer; color: var(--text-secondary);
  font-size: 15px; font-weight: 500; transition: border-color 0.3s, background 0.3s, color 0.3s;
}
.file-upload-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.file-preview { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.file-preview-img {
  width: 80px; height: 80px; object-fit: cover; border-radius: 10px;
  border: 2px solid var(--separator); animation: scaleIn 0.3s ease;
}

/* Buttons */
.btn-primary {
  width: 100%; padding: 16px; font-size: 17px; font-weight: 600; font-family: inherit;
  background: var(--accent-gradient); color: #FFFFFF; border: none; border-radius: 14px;
  cursor: pointer; transition: opacity 0.2s, transform 0.2s, box-shadow 0.3s;
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(92, 224, 214, 0.35); }
.btn-primary:active { transform: scale(0.96); opacity: 0.85; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  padding: 10px 20px; font-size: 15px; font-weight: 500; font-family: inherit;
  background: var(--card-bg); color: var(--text-primary); border: 1px solid var(--separator);
  border-radius: 12px; cursor: pointer; transition: background 0.2s, transform 0.2s;
}
.btn-secondary:active { background: var(--bg-tertiary); transform: scale(0.96); }

.btn-link {
  display: block; width: 100%; text-align: center; margin-top: 12px; padding: 10px;
  font-size: 15px; font-family: inherit; color: var(--text-secondary);
  background: none; border: none; cursor: pointer; transition: color 0.2s;
}
.btn-link:hover { color: var(--accent); }

/* ===== HELP ===== */
.help-intro { text-align: center; padding: 20px 0 32px; }
.help-icon { color: var(--text-secondary); margin-bottom: 16px; }
.help-intro h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.help-intro p { font-size: 15px; color: var(--text-secondary); }
.help-form { margin-bottom: 40px; }

.faq-list { background: var(--card-bg); border-radius: 16px; overflow: hidden; transition: background 0.5s ease; }
.faq-item { border-bottom: 0.5px solid var(--separator); cursor: pointer; transition: background 0.2s; }
.faq-item:last-child { border-bottom: none; }
.faq-item:active { background: var(--bg-tertiary); }
.faq-question { display: flex; align-items: center; justify-content: space-between; padding: 16px; font-size: 16px; font-weight: 500; }
.faq-chevron { color: var(--text-tertiary); transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); flex-shrink: 0; }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-answer {
  max-height: 0; overflow: hidden; padding: 0 16px;
  font-size: 15px; color: var(--text-secondary); line-height: 1.5;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
}
.faq-item.open .faq-answer { max-height: 200px; padding: 0 16px 16px; }

/* ===== AUTH ===== */
.auth-container { text-align: center; padding: 20px 0; }
.auth-icon { color: var(--text-tertiary); margin-bottom: 16px; }
.auth-container h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.auth-container > p { font-size: 15px; color: var(--text-secondary); margin-bottom: 24px; }
.auth-tabs { display: flex; justify-content: center; margin-bottom: 24px; }
.auth-segment { width: 100%; max-width: 300px; display: flex; }
.auth-segment .segment { flex: 1; text-align: center; }

.auth-form {
  text-align: left; background: var(--card-bg); border-radius: 16px; padding: 20px 16px;
  transition: background 0.5s ease; animation: fadeUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.auth-form.hidden { display: none; }

.verify-message { text-align: center; margin-bottom: 24px; color: var(--text-secondary); }
.verify-message svg { margin-bottom: 12px; color: var(--text-tertiary); }
.verify-message h3 { font-size: 18px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.verify-message p { font-size: 14px; }

.code-inputs { display: flex; gap: 8px; justify-content: center; }
.code-input {
  width: 48px !important; height: 56px; text-align: center; font-size: 24px !important;
  font-weight: 700; font-family: inherit; background: var(--input-bg);
  border: 2px solid var(--separator); border-radius: 12px; color: var(--text-primary);
  outline: none; transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
  caret-color: var(--text-primary);
}
.code-input:focus { border-color: var(--text-primary); box-shadow: 0 0 0 3px rgba(142, 142, 147, 0.2); transform: scale(1.05); }
body.dark-mode .code-input { background: var(--bg-tertiary); }

/* ===== PROFILE ===== */
.profile-header {
  display: flex; align-items: center; gap: 16px; margin-bottom: 32px;
  animation: fadeUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.profile-avatar {
  width: 72px; height: 72px; border-radius: 36px; background: var(--accent-light);
  display: flex; align-items: center; justify-content: center; color: var(--accent);
  transition: background 0.5s, transform 0.3s; position: relative; cursor: pointer; overflow: hidden; flex-shrink: 0;
}
.profile-avatar:hover { transform: scale(1.05); }
.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.4); color: #fff;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s; border-radius: 50%;
}
.profile-avatar:hover .avatar-overlay { opacity: 1; }
.profile-info { min-width: 0; }
.profile-info h2 { font-size: 22px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.profile-info p { font-size: 15px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; }
.profile-rating { margin-top: 4px; }

.profile-section { margin-bottom: 28px; }
.profile-section-title {
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; padding: 0 4px;
}

.profile-item {
  background: var(--card-bg); border-radius: 12px; padding: 14px 16px; margin-bottom: 8px;
  transition: background 0.5s;
}

/* Empty State */
.empty-state {
  background: var(--card-bg); border-radius: 16px; padding: 40px 20px;
  text-align: center; color: var(--text-tertiary); transition: background 0.5s;
}
.empty-state svg { margin-bottom: 12px; }
.empty-state p { font-size: 15px; color: var(--text-secondary); margin-bottom: 16px; }

/* Settings List */
.settings-list { background: var(--card-bg); border-radius: 16px; overflow: hidden; transition: background 0.5s; }
.settings-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 0.5px solid var(--separator);
  cursor: pointer; transition: background 0.2s; font-size: 17px;
}
.settings-item:last-child { border-bottom: none; }
.settings-item:active { background: var(--bg-tertiary); }
.settings-item.disabled { opacity: 0.5; pointer-events: none; }
.settings-value { font-size: 15px; color: var(--text-secondary); }

/* Toggle */
.toggle {
  width: 51px; height: 31px; border-radius: 16px; background: var(--toggle-bg);
  position: relative; transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1); cursor: pointer;
}
.toggle.active { background: var(--toggle-active); }
.toggle-knob {
  width: 27px; height: 27px; border-radius: 14px; background: #FFFFFF;
  position: absolute; top: 2px; left: 2px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle.active .toggle-knob { transform: translateX(20px); }
body.dark-mode .toggle .toggle-knob { background: #1C1C1E; }
body.dark-mode .toggle.active .toggle-knob { background: #000000; }

/* ===== TAB BAR (Mobile) ===== */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-around; align-items: center;
  padding: 4px 0; padding-bottom: max(4px, env(safe-area-inset-bottom));
  background: var(--tab-bg); backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--separator); transition: background 0.5s ease, border-color 0.5s ease;
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: none; border: none; color: var(--text-tertiary);
  font-size: 10px; font-family: inherit; font-weight: 500; cursor: pointer;
  padding: 4px 8px; transition: color 0.3s, transform 0.2s;
}
.tab.active { color: var(--accent); }
.tab:active { transform: scale(0.9); }
.tab svg { transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.tab.active svg { transform: scale(1.1); }
.tab-icon-wrap { position: relative; display: inline-flex; }

.unread-badge {
  display: none; position: absolute; top: -6px; right: -10px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 9px; line-height: 18px; text-align: center;
  box-sizing: border-box; pointer-events: none;
}
.unread-badge.visible { display: inline-block; }
.desktop-links a { position: relative; }
.desktop-links .unread-badge { top: -8px; right: -14px; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200; background: var(--overlay);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.35s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--modal-bg); border-radius: 20px 20px 0 0;
  width: 100%; max-width: 600px; max-height: 85vh; overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1), background 0.5s;
  -webkit-overflow-scrolling: touch;
}
.modal-overlay.active .modal { transform: translateY(0); }

.modal-handle { width: 36px; height: 5px; background: var(--text-tertiary); border-radius: 3px; margin: 8px auto 0; opacity: 0.4; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; position: sticky; top: 0;
  background: var(--modal-bg); z-index: 1; transition: background 0.5s;
}
.modal-header h2 { font-size: 20px; font-weight: 700; }
.modal-close {
  background: var(--card-bg); border: none; width: 32px; height: 32px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--text-secondary); transition: background 0.2s, transform 0.2s;
}
.modal-close:hover { transform: rotate(90deg); }
.modal-close:active { background: var(--bg-tertiary); }

.modal-body { padding: 0 20px 32px; }
.modal-body .detail-row {
  display: flex; justify-content: space-between; padding: 12px 0;
  border-bottom: 0.5px solid var(--separator); font-size: 15px;
}
.modal-body .detail-label { color: var(--text-secondary); }
.modal-body .detail-value { font-weight: 500; text-align: right; }
.modal-body .detail-comment {
  margin-top: 16px; padding: 16px; background: var(--card-bg);
  border-radius: 12px; font-size: 15px; line-height: 1.5; color: var(--text-secondary);
}
.modal-body .listing-gallery {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  margin-bottom: 16px; border-radius: 12px; overflow: hidden;
}
.modal-body .listing-gallery-item { aspect-ratio: 1; background: var(--placeholder-bg); object-fit: cover; }
.modal-body .listing-gallery-item:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--accent-gradient); color: #FFFFFF;
  padding: 12px 24px; border-radius: 12px; font-size: 15px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 300; white-space: nowrap; max-width: 90vw; text-align: center;
  box-shadow: 0 4px 16px rgba(92, 224, 214, 0.3);
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
  .page-content { padding: 20px 24px 40px; }
  .hero { padding: 80px 0 48px; }
  .hero-title { font-size: 56px; }
  .hero-slogan { font-size: 24px; }
  .tab-bar { display: none; }
  .desktop-nav { display: block; }
  .app-container { padding-top: 52px; padding-bottom: 0; }
  .back-btn { display: none; }
  .chat-header .back-btn { display: inline-flex; }
  .modal { border-radius: 20px; margin: auto; max-height: 80vh; }
  .modal-overlay { align-items: center; padding: 40px; }
  .modal { transform: translateY(40px) scale(0.92); }
  .modal-overlay.active .modal { transform: translateY(0) scale(1); }
  .modal-handle { display: none; }
  .toast { bottom: 40px; }
  .chat-messages { max-height: 60vh; }
}

@media (min-width: 1024px) {
  .hero-title { font-size: 64px; }
  .hero-slogan { font-size: 26px; }
  .hero-cards { max-width: 600px; margin: 0 auto 48px; }
  .steps { gap: 16px; }
  .listings-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 767px) {
  .hero-cards { grid-template-columns: 1fr; }
  .hero-title { font-size: 40px; }
  .hero-slogan { font-size: 18px; }
  .hero-desc { font-size: 14px; padding: 0 8px; }
  .steps { grid-template-columns: 1fr; gap: 8px; }
  .listings-grid { grid-template-columns: 1fr; }
  .filters { flex-direction: column; }
  .code-input { width: 42px !important; height: 50px; font-size: 20px !important; }
  .chat-messages { max-height: 45vh; }
  .modal { max-width: 100vw; }
  .modal-body { padding: 0 16px 24px; word-break: break-word; }
  .order-card { word-break: break-word; }
  .no-commission-banner { flex-direction: column; text-align: center; }
  .large-title { font-size: 30px; }
  .section-title { font-size: 20px; }
  .profile-header { gap: 12px; }
}

@media (max-width: 375px) {
  .hero-title { font-size: 36px; }
  .hero-slogan { font-size: 17px; }
  .large-title { font-size: 28px; }
  .code-input { width: 36px !important; height: 44px; font-size: 18px !important; }
  .code-inputs { gap: 5px; }
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--bg-secondary); border-top: 0.5px solid var(--separator);
  padding: 32px 16px 100px; transition: background 0.5s, border-color 0.5s;
}
.footer-inner {
  max-width: 900px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-logo { width: 28px; height: 28px; transition: filter 0.5s; }
body.dark-mode .footer-logo { filter: invert(1); }
.footer-copy { font-size: 13px; color: var(--text-secondary); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a {
  font-size: 13px; color: var(--text-secondary); text-decoration: none;
  cursor: pointer; transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent); }

@media (max-width: 767px) {
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
}
@media (min-width: 768px) {
  .site-footer { padding-bottom: 40px; }
}

/* ===== COOKIE BANNER ===== */
.cookie-banner {
  position: fixed; bottom: 70px; left: 16px; right: 16px; z-index: 150;
  background: var(--modal-bg); border-radius: 16px; padding: 16px 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15); border: 0.5px solid var(--separator);
  display: flex; align-items: center; gap: 12px;
  animation: fadeUp 0.5s cubic-bezier(0.4,0,0.2,1) both;
  transition: background 0.5s, border-color 0.5s;
}
.cookie-banner.hidden { display: none !important; }
.cookie-text { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.cookie-text svg { flex-shrink: 0; margin-top: 1px; }
.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; white-space: nowrap; }
.cookie-btn {
  padding: 8px 16px; font-size: 13px; font-weight: 600; font-family: inherit;
  border-radius: 10px; border: none; cursor: pointer; transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
}
.cookie-btn:active { transform: scale(0.95); }
.cookie-accept { background: var(--accent-gradient); color: #fff; }
.cookie-decline { background: var(--card-bg); color: var(--text-secondary); border: 1px solid var(--separator); }

@media (min-width: 768px) {
  .cookie-banner { bottom: 24px; left: 50%; right: auto; transform: translateX(-50%); max-width: 700px; width: calc(100% - 48px); }
}
@media (max-width: 600px) {
  .cookie-banner { flex-direction: column; text-align: center; bottom: 70px; }
  .cookie-text { justify-content: center; }
  .cookie-actions { width: 100%; justify-content: center; }
}

/* ===== LEGAL MODAL CONTENT ===== */
.legal-content { font-size: 14px; line-height: 1.7; color: var(--text-secondary); }
.legal-content h3 { font-size: 17px; font-weight: 600; color: var(--text-primary); margin: 20px 0 8px; }
.legal-content h3:first-child { margin-top: 0; }
.legal-content p { margin-bottom: 10px; }
.legal-content ul { padding-left: 20px; margin-bottom: 10px; }
.legal-content li { margin-bottom: 4px; }
.legal-content a { color: var(--accent); text-decoration: underline; }
