@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --primary: #FFF176;
  --primary-light: #FFEE58;
  --primary-dark: #FDD835;
  --secondary: #F9A825;
  --accent: #5D4037;
  --accent-warm: #FF6B35;
  --accent-green: #06D6A0;
  --accent-purple: #7B61FF;
  --bg: #F0F4F8;
  --bg-card: #FFFFFF;
  --bg-section: #F7FAFC;
  --text: #1A202C;
  --text-secondary: #4A5568;
  --text-muted: #A0AEC0;
  --border: #E2E8F0;
  --border-light: #EDF2F7;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --speak-color: #06D6A0;
  --speak-bg: #ECFDF5;
  --learn-color: #7B61FF;
  --learn-bg: #F0ECFF;
}

::selection {
  background: var(--accent);
  color: white;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== Loading Screen ===== */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  gap: 16px;
}

.loading-globe {
  font-size: 3rem;
  animation: spin 3s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.loading-screen p {
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== App Shell ===== */
.app-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px 100px;
}

.app-header {
  padding: 24px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-icon {
  font-size: 1.8rem;
}

.header-brand h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -0.5px;
}

.brand-tagline {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 400;
  padding-left: 6px;
  border-left: 2px solid var(--border);
}

/* ===== Tab Navigation ===== */
.tab-nav {
  display: flex;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  background: var(--border-light);
  color: var(--text);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.tab-icon {
  font-size: 1rem;
}

.tab-label {
  font-size: 0.88rem;
}

/* ===== App Main ===== */
.app-main {
  padding-top: 20px;
}

/* ===== Skeletons ===== */
.section-loading, .board-loading {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 0;
}

.board-loading {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.skeleton-block {
  height: 80px;
  background: linear-gradient(90deg, var(--border-light) 25%, var(--bg) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-card {
  padding: 24px;
  background: var(--bg-card);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, var(--border-light) 25%, var(--bg) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

.skeleton-line.wide { width: 80%; }
.skeleton-line.medium { width: 60%; }
.skeleton-line.narrow { width: 40%; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ===== Empty States ===== */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  max-width: 440px;
  margin: 0 auto;
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  animation: floatBounce 3s ease-in-out infinite;
}

@keyframes floatBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.empty-state h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 24px;
}

/* ===== Buttons ===== */
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-cta:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-add {
  padding: 10px 20px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-add:not(:disabled):hover {
  background: var(--primary-light);
}

.btn-cancel {
  padding: 12px 28px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel:hover {
  background: var(--bg-section);
}

.btn-save {
  padding: 12px 32px;
  background: linear-gradient(135deg, var(--accent-green), #00C49A);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

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

.btn-save:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-edit {
  padding: 12px 28px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-edit:hover {
  background: var(--primary-light);
}

.btn-delete {
  padding: 12px 28px;
  background: transparent;
  color: #E53E3E;
  border: 1px solid #FED7D7;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-delete:hover {
  background: #FFF5F5;
  border-color: #FEB2B2;
}

.btn-clear-filters {
  padding: 8px 16px;
  background: transparent;
  color: var(--accent-warm);
  border: 1px solid var(--accent-warm);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-clear-filters:hover {
  background: var(--accent-warm);
  color: white;
}

/* ===== Exchange Board ===== */
.board-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.board-stats {
  display: flex;
  gap: 12px;
}

.stat-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
}

.stat-badge small {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.board-filters {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-box {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.92rem;
  background: var(--bg-card);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.12);
}

.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-row select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  min-width: 160px;
}

.filter-row select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ===== Profiles Grid ===== */
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* ===== Profile Card ===== */
@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  animation: cardFadeIn 0.4s ease both;
}

.profile-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

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

.card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
}

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

.card-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-tz {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.match-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 12px;
  background: linear-gradient(135deg, var(--accent-green), #00C49A);
  border-radius: var(--radius-sm);
  color: white;
  min-width: 54px;
}

.match-score {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
}

.match-label {
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

/* ===== Card Languages ===== */
.card-languages {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.lang-section {
  flex: 1;
  min-width: 0;
}

.lang-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.lang-exchange-arrow {
  padding-top: 22px;
  color: var(--text-muted);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.lang-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.speak-pill {
  background: var(--speak-bg);
  color: #047857;
  border: 1px solid rgba(6, 214, 160, 0.3);
}

.learn-pill {
  background: var(--learn-bg);
  color: #5B3CC4;
  border: 1px solid rgba(123, 97, 255, 0.3);
}

.pill-level {
  font-size: 0.68rem;
  font-weight: 400;
  opacity: 0.7;
}

.large-pill {
  padding: 6px 14px;
  font-size: 0.88rem;
}

.large-pill .pill-level {
  font-size: 0.74rem;
}

/* Level colors */
.level-native { opacity: 1; }
.level-advanced { opacity: 0.92; }
.level-upper { opacity: 0.84; }
.level-inter { opacity: 0.76; }
.level-elem { opacity: 0.68; }
.level-begin { opacity: 0.6; }

/* ===== Card Methods ===== */
.card-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.method-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 10px;
  background: var(--bg-section);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.large-chip {
  padding: 6px 14px;
  font-size: 0.85rem;
}

/* ===== Card Bio ===== */
.card-bio {
  padding: 12px 0;
  border-top: 1px solid var(--border-light);
  margin-top: 8px;
  animation: cardFadeIn 0.3s ease both;
}

.card-bio p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.card-expand-hint {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 8px;
  font-weight: 500;
}

/* ===== Match Details ===== */
.match-details {
  padding: 12px 0;
  border-top: 1px solid var(--border-light);
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: cardFadeIn 0.3s ease both;
}

.match-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.detail-icon {
  flex-shrink: 0;
}

/* ===== Profile Setup ===== */
.profile-setup {
  max-width: 680px;
  margin: 0 auto;
  animation: cardFadeIn 0.4s ease both;
}

.setup-header {
  margin-bottom: 28px;
}

.setup-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.setup-subtitle {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-top: 4px;
}

.setup-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.setup-section h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 700;
}

.optional {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* ===== Language Tags ===== */
.lang-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  min-height: 32px;
}

.lang-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  animation: cardFadeIn 0.2s ease both;
}

.speak-tag {
  background: var(--speak-bg);
  color: #047857;
  border: 1px solid rgba(6, 214, 160, 0.4);
}

.learn-tag {
  background: var(--learn-bg);
  color: #5B3CC4;
  border: 1px solid rgba(123, 97, 255, 0.4);
}

.tag-level {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.7;
}

.tag-remove {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: inherit;
  opacity: 0.5;
  padding: 0 2px;
  line-height: 1;
  transition: opacity 0.15s;
}

.tag-remove:hover {
  opacity: 1;
}

/* ===== Language Add Row ===== */
.lang-add-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lang-add-row select {
  flex: 1;
  min-width: 140px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  background: white;
  color: var(--text);
}

.lang-add-row select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1);
}

/* ===== Method Grid ===== */
.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.method-btn {
  padding: 14px 16px;
  background: var(--bg-section);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.method-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.method-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* ===== Timezone Select ===== */
.tz-select {
  width: 100%;
  max-width: 280px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.92rem;
  background: white;
  color: var(--text);
}

.tz-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ===== Bio Textarea ===== */
.bio-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.6;
  resize: vertical;
  background: white;
  color: var(--text);
  transition: border-color 0.2s;
}

.bio-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1);
}

.char-count {
  display: block;
  text-align: right;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== Setup Actions ===== */
.setup-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 0;
}

/* ===== Matches View ===== */
.matches-view {
  animation: cardFadeIn 0.4s ease both;
}

.matches-summary {
  margin-bottom: 24px;
}

.matches-summary h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.matches-subtitle {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-top: 4px;
}

.match-section {
  margin-bottom: 32px;
}

.match-section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.section-icon {
  font-size: 1.2rem;
}

.section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: var(--accent);
  color: white;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

/* ===== My Profile ===== */
.my-profile {
  max-width: 680px;
  margin: 0 auto;
  animation: cardFadeIn 0.4s ease both;
}

.profile-hero {
  text-align: center;
  padding: 32px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.profile-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--speak-color), var(--accent), var(--learn-color));
}

.profile-avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--border-light);
  margin-bottom: 12px;
}

.profile-name-lg {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.profile-tz-lg {
  display: block;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.profile-updated {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.profile-detail-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.detail-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.detail-section h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.detail-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-bio-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.profile-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 8px 0 24px;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .app-shell {
    padding: 0 10px 100px;
  }

  .header-brand h1 {
    font-size: 1.3rem;
  }

  .brand-tagline {
    display: none;
  }

  .tab-btn {
    padding: 8px 12px;
  }

  .tab-label {
    font-size: 0.8rem;
  }

  .profiles-grid {
    grid-template-columns: 1fr;
  }

  .board-top {
    flex-direction: column;
    align-items: stretch;
  }

  .board-stats {
    justify-content: center;
  }

  .filter-row {
    flex-direction: column;
  }

  .filter-row select {
    min-width: 100%;
  }

  .lang-add-row {
    flex-direction: column;
  }

  .method-grid {
    grid-template-columns: 1fr 1fr;
  }

  .setup-actions {
    flex-direction: column-reverse;
  }

  .setup-actions button {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .profile-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-actions button {
    justify-content: center;
    text-align: center;
  }

  .card-languages {
    flex-direction: column;
    gap: 8px;
  }

  .lang-exchange-arrow {
    padding-top: 0;
    text-align: center;
  }
}

@media (max-width: 380px) {
  .tab-icon {
    font-size: 1.1rem;
  }

  .tab-label {
    display: none;
  }

  .tab-btn {
    padding: 10px 16px;
  }
}
```

<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to LangBridge — a language exchange board where you can find partners to practice languages with.", "view": "visitor", "highlight_selector": ".app-header", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "First, create your profile by clicking 'Create Your Profile'. Tell others what languages you speak and what you're learning.", "view": "visitor", "highlight_selector": ".btn-cta", "wait_for": "user_interaction"},
  {"step": 3, "narration": "Add the languages you speak fluently — these are what you can teach others.", "view": "visitor", "highlight_selector": ".setup-section:nth-child(1)", "wait_for": "user_interaction"},
  {"step": 4, "narration": "Now add languages you want to learn. The board will match you with people who speak those languages.", "view": "visitor", "highlight_selector": ".setup-section:nth-child(2)", "wait_for": "user_interaction"},
  {"step": 5, "narration": "Choose how you'd like to practice — text chat, voice calls, video calls, or meeting in person.", "view": "visitor", "highlight_selector": ".method-grid", "wait_for": "user_interaction"},
  {"step": 6, "narration": "Set your timezone so partners know when you're available, then save your profile.", "view": "visitor", "highlight_selector": ".btn-save", "wait_for": "user_interaction"},
  {"step": 7, "narration": "The Exchange Board shows everyone's profiles. Use the search and filters to find partners who speak specific languages.", "view": "visitor", "highlight_selector": ".board-filters", "wait_for": "tap_to_continue"},
  {"step": 8, "narration": "Click 'My Matches' to see people with complementary languages — they speak what you're learning and want to learn what you speak!", "view": "visitor", "highlight_selector": ".tab-btn:nth-child(2)", "wait_for": "user_interaction"},
  {"step": 9, "narration": "Mutual matches are highlighted with a match percentage. Click any card for more details about the match.", "view": "visitor", "highlight_selector": ".match-badge", "wait_for": "tap_to_continue"},
  {"step": 10, "narration": "Share the access code with others to build your language exchange community. Happy learning!", "view": "visitor", "highlight_selector": ".app-header", "wait_for": "tap_to_continue"}
]
-->

.auth-gate {
  max-width: 520px;
}

.auth-card {
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-google {
  padding: 12px 22px;
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-google:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: #dadce0;
}

.presence-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
}

.presence-status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  display: inline-block;
}

.presence-status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.presence-status-dot.offline {
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
}

.presence-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  font-size: 0.9rem;
}

.presence-badge.online {
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
}

.presence-badge.offline {
  background: rgba(148, 163, 184, 0.12);
  color: #475569;
}

.presence-roster {
  margin-top: 1rem;
}

.presence-roster-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.presence-roster-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.presence-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
}

.presence-user-avatar {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  object-fit: cover;
}

.header-user-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.header-user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-card); font-size: 0.9rem; }
.header-user-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.auth-shell .auth-card { flex-direction: column; text-align: center; gap: 14px; padding: 40px 24px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.auth-hero-icon { font-size: 3rem; }
.lounge-view { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; animation: cardFadeIn 0.4s ease both; }
.lounge-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.lounge-header h2 { font-family: 'Space Grotesk', sans-serif; font-size: 1.4rem; color: var(--primary-dark); }
.lounge-header p { color: var(--text-secondary); font-size: 0.92rem; }
.lounge-create-form { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.lounge-input { flex: 1; min-width: 220px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: 0.92rem; background: white; color: var(--text); }
.lounge-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1); }
.lounge-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; }
.lounge-panel { border: 1px solid var(--border-light); border-radius: var(--radius); padding: 16px; background: var(--bg-section); min-height: 320px; }
.lounge-panel h3 { font-family: 'Space Grotesk', sans-serif; font-size: 1.02rem; margin-bottom: 12px; }
.lounge-list { display: flex; flex-direction: column; gap: 10px; }
.lounge-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); cursor: pointer; font: inherit; }
.lounge-item.active { border-color: var(--primary-light); box-shadow: var(--shadow-sm); }
.lounge-item span { color: var(--text-secondary); font-size: 0.82rem; }
.lounge-chat-panel { display: flex; flex-direction: column; }
.lounge-messages { flex: 1; display: flex; flex-direction: column; gap: 12px; overflow: auto; margin-bottom: 14px; }
.lounge-message { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-sm); }
.lounge-message p { margin-top: 2px; color: var(--text-secondary); }
.lounge-message-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.lounge-message-avatar.placeholder { display: inline-flex; align-items: center; justify-content: center; background: var(--bg-section); }
.lounge-send-form { display: flex; gap: 10px; }
@media (max-width: 760px) { .lounge-grid { grid-template-columns: 1fr; } .lounge-send-form { flex-direction: column; } .lounge-create-form { flex-direction: column; } .lounge-create-form button, .lounge-send-form button { width: 100%; } }

.city-input {
  width: 100%;
  max-width: 420px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.92rem;
  background: white;
  color: var(--text);
}

.city-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1);
}

.city-help {
  margin-top: 8px;
  margin-bottom: 12px;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.city-map {
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-light);
  margin-top: 8px;
  background: var(--bg-section);
}

.profile-city-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-city-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 180, 216, 0.1);
  color: var(--primary-dark);
  font-size: 0.88rem;
  font-weight: 600;
}

.profile-map-wrap {
  margin-top: 12px;
}

.profile-map-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 8px;
}

.matches-view {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.matches-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.match-suggestions-list {
  display: grid;
  gap: 1rem;
}

.match-suggestion-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.match-suggestion-topline {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.match-avatar-wrap {
  flex: 0 0 auto;
}

.match-avatar,
.match-avatar.placeholder {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.06);
}

.match-main-copy {
  flex: 1;
  min-width: 0;
}

.match-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.match-score-pill {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(64, 146, 255, 0.12);
  color: #1f5fbf;
  font-weight: 700;
  white-space: nowrap;
}

.match-languages,
.match-timezone,
.match-summary {
  margin: 0.25rem 0 0;
}

.match-reasons {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.35rem;
}

.match-actions {
  display: flex;
  justify-content: flex-end;
}

.match-empty-state {
  padding: 1rem;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.03);
}

.match-error {
  margin: 0;
}

.notifications-chip { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; border-radius: 999px; background: rgba(255,255,255,0.08); }
.notifications-icon { font-size: 1rem; }
.notification-center { margin-bottom: 1rem; }
.notification-center-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.notification-badge { padding: 0.35rem 0.7rem; border-radius: 999px; background: #1f6feb; color: #fff; font-weight: 600; }
.notification-list { display: grid; gap: 0.75rem; }
.notification-item { width: 100%; text-align: left; border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 0.9rem 1rem; background: rgba(255,255,255,0.04); cursor: pointer; }
.notification-item.unread { border-color: rgba(31,111,235,0.4); background: rgba(31,111,235,0.08); }
.notification-item-topline { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.35rem; }
.notification-item p { margin: 0; opacity: 0.9; }
.notification-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: #1f6feb; }
.notification-empty-state { padding: 1rem; opacity: 0.75; }

.match-success { margin-top: 12px; color: #1e7a4d; font-weight: 600; }
.match-intro-modal-backdrop { position: fixed; inset: 0; background: rgba(12, 18, 28, 0.62); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.match-intro-modal { width: min(720px, 100%); max-height: 90vh; overflow: auto; }
.match-intro-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.match-intro-recipient { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.match-intro-actions-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.match-intro-editor-label { display: block; font-weight: 600; margin-bottom: 10px; }
.match-intro-editor { width: 100%; min-height: 220px; margin-top: 8px; padding: 12px; border-radius: 12px; border: 1px solid rgba(0,0,0,0.12); background: #fff; color: inherit; resize: vertical; }
.match-intro-help { margin-top: 10px; font-size: 0.95rem; opacity: 0.75; }
