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

:root {
  --blue:       #1B6FE8;
  --blue-dark:  #1558C0;
  --blue-light: #e8f0fe;
  --blue-grad:  linear-gradient(135deg, #0D2E6B 0%, #1B6FE8 100%);
  --accent:     #1B6FE8;
  --card-bg:    #f2f4f7;
  --input-bg:   #dde3ed;
  --white:      #ffffff;
  --text:       #1a1a1a;
  --muted:      #718096;
  --green:      #48bb78;
  --orange:     #ed8936;
  --red:        #e53e3e;
  --border:     #e2e8f0;
}

html, body {
  height: 100%;
  height: -webkit-fill-available;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--white);
  overflow: hidden;
  color: var(--text);
}

.hidden { display: none !important; }

/* ══════════════════════════════
   LOGIN SCREEN
   ══════════════════════════════ */
#loginScreen {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}

#loginScreen > .login-card {
  margin: 40px auto 60px;
  width: calc(100% - 40px);
}

#loginScreen::before {
  content: '';
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  width: 800px; height: 200px;
  background: rgba(0,0,0,0.04);
  border-radius: 100px 20px 100px 20px;
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  overflow: visible;
  position: relative;
  z-index: 1;
}

.login-header {
  background: var(--blue-grad);
  padding: 30px 20px;
  text-align: center;
}

.login-header h1 {
  font-size: 30px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 6px;
}

.login-header p {
  color: rgba(255,255,255,0.85);
  font-size: 15px;
}

.login-body { padding: 28px 20px; }

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 7px;
}

.label-hint { font-weight: 400; color: var(--muted); }

.form-control {
  width: 100%;
  padding: 13px 16px;
  background: var(--input-bg);
  border: 2px solid var(--input-bg);
  border-radius: 8px;
  font-size: 17px;
  color: var(--text);
  -webkit-appearance: none;
  transition: border-color 0.2s;
}

.form-control:focus { outline: none; border-color: var(--blue); }
.form-control::placeholder { color: var(--muted); }

select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23718096' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.error-banner {
  background: #fff5f5;
  border: 1px solid #fc8181;
  color: #c53030;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
}

.btn-primary {
  width: 100%;
  background: var(--blue-grad);
  color: var(--white);
  border: none;
  padding: 15px;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.btn-primary:hover  { background: var(--blue-dark); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.dev-banner {
  margin-top: 18px;
  background: var(--blue-light);
  border: 1px solid #90cdf4;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--blue-dark);
  text-align: center;
  line-height: 1.5;
}

/* ── Phone row with country code ── */
.phone-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.country-select {
  flex-shrink: 0;
  width: 100px;
  height: 48px;
  padding: 0 6px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  padding-right: 20px;
}
.country-select:focus { outline: none; border-color: var(--blue); }
.phone-input { flex: 1; min-width: 0; }

/* ── OTP method tabs ── */
.otp-method-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.otp-method-tab {
  flex: 1;
  padding: 10px 0;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.otp-method-tab.active {
  background: var(--blue-grad);
  color: #fff;
  border-color: transparent;
}

/* ── OTP login steps ── */
.otp-hint {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.5;
  text-align: center;
}
.otp-hint strong { color: var(--text); }

.otp-code-input {
  font-size: 32px;
  letter-spacing: 10px;
  text-align: center;
  font-weight: 700;
  padding: 14px 10px;
}

.btn-ghost {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  border-radius: 10px;
  transition: color .15s, background .15s;
}
.btn-ghost:hover { color: var(--text); background: var(--blue-light); }

/* ══════════════════════════════
   CHAT SCREEN SHELL
   ══════════════════════════════ */
#chatScreen {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  display: flex;
  flex-direction: column;
  background: var(--white);
  /* dvh collapses with browser chrome on mobile; vh fallback for older browsers */
  height: 100vh;
  height: 100dvh;
}

/* ── Header ── */
.app-header {
  background: var(--blue-grad);
  padding: 14px 16px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-plane {
  color: #ffffff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.6));
}

.header-title {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
  letter-spacing: -0.3px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.3);
}

.header-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.88);
  margin-top: 1px;
}

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

.header-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}

.avatar-circle {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: #d0d8e4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #2d3748;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }

.avatar-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
}

.stop-sharing-btn {
  background: var(--red);
  color: var(--white);
  border: none;
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* ── Tab Panes ── */
.tab-pane {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Messages pane overrides overflow so inner layout controls scroll */
#messagesPane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#groupView, #dmChatView {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#privateView {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#dmListView {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Bottom Nav ── */
.bottom-nav {
  display: flex;
  background: var(--white);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 9px 8px;
  background: none;
  border: none;
  border-top: 3px solid transparent;
  cursor: pointer;
  gap: 3px;
  position: relative;
  transition: background 0.15s;
}

.nav-tab.active {
  border-top-color: var(--blue);
  background: var(--blue-light);
}

.nav-icon  { font-size: 22px; line-height: 1; }

.nav-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

.nav-tab.active .nav-label { color: var(--blue); font-weight: 700; }

.nav-badge {
  position: absolute;
  top: 5px;
  right: calc(50% - 20px);
  background: var(--red);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ══════════════════════════════
   MESSAGES TAB
   ══════════════════════════════ */
.sub-tab-bar {
  padding: 12px 16px;
  background: var(--white);
  flex-shrink: 0;
}

.sub-tab-group {
  display: flex;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.sub-tab {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  transition: background 0.2s, color 0.2s;
}

.sub-tab.active { background: var(--blue-grad); color: var(--white); }

/* Messages scroll area */
.messages-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: #eef1f5;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Bubbles */
.msg-system {
  align-self: center;
  background: #dde3ed;
  color: #4a5568;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 20px;
  max-width: 85%;
  text-align: center;
}

.msg-own {
  align-self: flex-end;
  background: var(--blue-grad);
  color: var(--white);
  padding: 10px 14px;
  border-radius: 18px 18px 4px 18px;
  max-width: 78%;
  font-size: 15px;
  line-height: 1.4;
}

.msg-other {
  align-self: flex-start;
  background: var(--white);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 18px 18px 18px 4px;
  max-width: 78%;
  font-size: 15px;
  line-height: 1.4;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.msg-sender { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.msg-meta   { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 5px; }
.msg-time   { font-size: 11px; opacity: 0.6; }
.msg-receipt { font-size: 12px; opacity: 0.7; color: rgba(255,255,255,0.6); transition: color 0.3s; }
.msg-receipt.read { color: #90cdf4; }

.msg-photo  { max-width: 200px; border-radius: 10px; display: block; margin-bottom: 4px; cursor: pointer; }

/* Input bar */
.input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--white);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.attach-wrap { position: relative; }

.attach-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--blue-grad);
  color: var(--white);
  border: none;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.attach-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  min-width: 160px;
  overflow: hidden;
  z-index: 50;
}

.attach-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}

.attach-item:hover { background: #f7fafc; }

.attach-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.gif-icon { font-size: 11px; font-weight: 700; }

.msg-input {
  flex: 1;
  background: var(--input-bg);
  border: none;
  border-radius: 22px;
  padding: 10px 16px;
  font-size: 15px;
  color: var(--text);
  outline: none;
}

.msg-input::placeholder { color: var(--muted); }

.send-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--blue-grad);
  color: var(--white);
  border: none;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* Private Messages */
.section-pad { padding: 16px; }
.section-title { font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.empty-state   { color: var(--muted); font-size: 15px; padding: 10px 0; }

.dm-actions { display: flex; gap: 10px; margin-bottom: 14px; }

.dm-btn {
  background: var(--blue);
  color: var(--white);
  border: none;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.dm-btn.secondary { background: var(--input-bg); color: #4a5568; }
.dm-btn:disabled  { opacity: 0.4; cursor: not-allowed; }

/* DM conversation cards */
.dm-convo-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.dm-convo-card:hover { background: var(--input-bg); }

.dm-convo-name    { font-weight: 600; font-size: 15px; }
.dm-convo-preview { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Selectable crew */
.selectable-member {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.15s;
}

.selectable-member:hover    { background: var(--input-bg); }
.selectable-member.selected { background: var(--blue-light); border-color: var(--blue); }

/* DM chat header */
.dm-chat-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  flex-shrink: 0;
}

.back-btn    { background: none; border: none; font-size: 26px; color: var(--blue); cursor: pointer; margin-right: 8px; }
.dm-chat-title { flex: 1; font-weight: 600; font-size: 16px; }
.archive-btn { background: var(--input-bg); border: none; padding: 6px 12px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.delete-dm-btn { background: none; border: none; font-size: 16px; cursor: pointer; padding: 4px 6px; opacity: .6; }
.room-qr-btn { background: var(--accent); color: #fff; border: none; padding: 6px 10px; border-radius: 8px; font-size: 16px; cursor: pointer; line-height: 1; }
.delete-dm-btn:hover { opacity: 1; }
.archived-inline-btn {
  margin-left: auto; background: var(--input-bg); border: none; border-radius: 8px;
  padding: 6px 10px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.archived-inline-btn:hover { color: var(--text); }
.archived-list-wrap { padding: 0 16px 12px; }

/* ══════════════════════════════
   CREW TAB
   ══════════════════════════════ */
.page-title { font-size: 22px; font-weight: 700; margin-bottom: 16px; }

.crew-card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.crew-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.crew-avatar img { width: 100%; height: 100%; object-fit: cover; }
.crew-info     { flex: 1; }
.crew-name     { font-size: 16px; font-weight: 700; }
.crew-you      { font-weight: 400; color: var(--muted); font-size: 14px; }
.crew-role     { font-size: 13px; color: var(--muted); margin-top: 2px; }

.status-dot    { width: 13px; height: 13px; border-radius: 50%; flex-shrink: 0; }
.status-online { background: var(--green); }
.status-away   { background: var(--orange); }
.status-offline{ background: var(--muted); }

/* ══════════════════════════════
   LAYOVER TAB
   ══════════════════════════════ */
.card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
}

.card-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; }

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
}

.border-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.border-row:last-of-type { border-bottom: none; }

.info-label { color: var(--muted); }
.info-value { font-weight: 600; }

.airport-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0 10px;
}

.airport-cell { position: relative; }
.airport-label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 5px; }

.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  max-height: 180px;
  overflow-y: auto;
  z-index: 100;
  margin-top: 4px;
}

.autocomplete-item {
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: var(--blue-light); }

.autocomplete-item strong { color: var(--blue-dark); }

.airport-input {
  width: 100%;
  background: var(--input-bg);
  border: none;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 14px;
  color: var(--text);
  outline: none;
}

.airport-input::placeholder { color: var(--muted); }
.airport-input:focus { box-shadow: 0 0 0 2px var(--blue); }

.airport-note { font-size: 12px; color: var(--muted); }

.btn-clear-route {
  margin-top: 12px;
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 10px;
  background: var(--blue-grad);
  color: var(--white);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.btn-clear-route:hover  { opacity: 0.88; }
.btn-clear-route:active { transform: scale(0.98); }

.no-layovers {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  padding: 6px 0 14px;
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.search-btn {
  background: var(--blue);
  color: var(--white);
  border: none;
  padding: 11px 6px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.3;
}

.search-btn:hover { background: var(--blue-dark); }

/* Rideshare dropdown */
.rideshare-wrap { position: relative; }

.rideshare-btn { width: 100%; }

.rideshare-menu {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  min-width: 140px;
  overflow: hidden;
  z-index: 120;
}

.rideshare-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.rideshare-item:last-child { border-bottom: none; }
.rideshare-item:hover { background: var(--blue-light); }

.rideshare-logo {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.uber-logo  { background: #000000; }
.lyft-logo  { background: #FF00BF; }
.waymo-logo { background: #00A8E0; }

.time-input {
  background: var(--input-bg);
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 16px;
  font-weight: 600;
  width: 110px;
  text-align: right;
  outline: none;
}

.time-input::placeholder { color: var(--muted); font-weight: 400; }

.duty-group { margin-bottom: 12px; }
.duty-label { font-size: 14px; font-weight: 600; display: block; margin-bottom: 6px; }

.duty-input {
  width: 100%;
  background: var(--input-bg);
  border: none;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  outline: none;
}

.duty-input::placeholder { color: var(--muted); }
.duty-input:focus { box-shadow: 0 0 0 2px var(--blue); }

.duty-time-row { display: flex; gap: 8px; }
.duty-time-row .duty-input { flex: 0 0 90px; width: 90px; }
.duty-tz-wrap {
  flex: 1;
  position: relative;
}
.duty-tz-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--input-bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 8px;
  font-size: 13px;
  color: var(--text);
  outline: none;
}
.duty-tz-input:focus { border-color: var(--blue); }
.duty-tz-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 200;
}
.duty-tz-banner {
  font-size: 12px;
  color: #fff;
  background: var(--blue-grad);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
  line-height: 1.4;
}

.btn-full {
  width: 100%;
  background: var(--blue-grad);
  color: var(--white);
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-full:hover { background: var(--blue-dark); }
.btn-full.secondary { background: var(--input-bg); color: #4a5568; }

/* ══════════════════════════════
   PROFILE TAB
   ══════════════════════════════ */
.profile-avatar-wrap { text-align: center; margin-bottom: 14px; }

.profile-avatar {
  width: 90px; height: 90px;
  border-radius: 50%;
  background: var(--input-bg);
  border: 3px solid var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  color: #4a5568;
  margin: 0 auto 12px;
  overflow: hidden;
}

.profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* Toggle switch */
.toggle { position: relative; width: 50px; height: 28px; display: inline-block; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }

.slider {
  position: absolute;
  inset: 0;
  background: #cbd5e0;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.3s;
}

.slider::before {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  background: var(--white);
  border-radius: 50%;
  left: 3px; top: 3px;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle input:checked + .slider { background: var(--blue); }
.toggle input:checked + .slider::before { transform: translateX(22px); }

.logout-btn {
  width: 100%;
  background: none;
  border: none;
  padding: 14px;
  font-size: 16px;
  color: var(--muted);
  cursor: pointer;
  margin-top: 6px;
}

.logout-btn:hover { color: var(--red); }

/* Emergency contacts */
.emergency-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.emergency-row:last-child { border-bottom: none; }

.emerg-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.3;
}

.emerg-name[contenteditable="true"] {
  border-bottom: 1.5px solid var(--blue);
  outline: none;
  padding-bottom: 2px;
}

.emerg-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.emerg-input {
  flex: 1;
  min-width: 0;
  background: var(--input-bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--text);
  outline: none;
}

.emerg-input:focus { border-color: var(--blue); }

.call-btn {
  background: var(--blue-grad);
  color: var(--white);
  border: none;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-shrink: 0;
  line-height: 1.2;
}

.call-btn span { font-size: 12px; font-weight: 600; }

.emerg-edit-btn {
  background: var(--blue-light);
  color: var(--blue);
  border: 1.5px solid var(--blue);
  border-radius: 8px;
  padding: 0 10px;
  height: 40px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.emerg-edit-btn.saving { background: var(--blue-grad); color: #fff; border-color: transparent; }

/* ══════════════════════════════
   MODAL
   ══════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal-card {
  background: var(--white);
  border-radius: 16px;
  padding: 28px 24px;
  width: 100%;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.modal-card p  { font-size: 14px; color: var(--muted); margin-bottom: 20px; line-height: 1.5; }
.modal-sub     { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 8px !important; }
.loc-perm-icon { font-size: 44px; margin-bottom: 12px; }
.location-targets { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.location-target {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px;
  cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text);
  transition: border-color .15s, background .15s;
}
.location-target.selected { border-color: var(--blue); background: var(--blue-light); }
.location-target input[type="checkbox"] { width: 17px; height: 17px; cursor: pointer; accent-color: var(--blue); flex-shrink: 0; }

/* ══════════════════════════════
   SHARED AVATAR (small, in DM list)
   ══════════════════════════════ */
.sm-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ══════════════════════════════
   LOGIN TRANSITION
   ══════════════════════════════ */
@keyframes screenFadeOut {
  to { opacity: 0; transform: translateY(-16px); }
}
@keyframes screenFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
#loginScreen.screen-fade-out { animation: screenFadeOut 0.4s ease forwards; }
#chatScreen.screen-fade-in   { animation: screenFadeIn  0.4s ease forwards; }

/* ══════════════════════════════
   OFFLINE BANNER
   ══════════════════════════════ */
.offline-banner {
  background: #d97706;
  color: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  flex-shrink: 0;
  letter-spacing: 0.2px;
}

/* ══════════════════════════════
   REPLY PREVIEW (above input bar)
   ══════════════════════════════ */
.reply-preview {
  flex-shrink: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 8px 14px;
}
.reply-preview-inner {
  display: flex;
  align-items: center;
  background: var(--blue-light);
  border-left: 3px solid var(--blue-dark);
  border-radius: 6px;
  padding: 6px 10px;
  gap: 8px;
}
.reply-info { flex: 1; min-width: 0; }
.reply-sender { font-size: 12px; font-weight: 700; color: var(--blue-dark); display: block; }
.reply-text   { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.reply-clear  { background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 2px 4px; flex-shrink: 0; }

/* Reply bubble inside message */
.reply-bubble {
  background: rgba(0,0,0,0.08);
  border-left: 3px solid rgba(0,0,0,0.18);
  border-radius: 6px;
  padding: 5px 8px;
  margin-bottom: 6px;
  font-size: 12px;
}
.reply-bubble .reply-sender { font-weight: 700; display: block; margin-bottom: 2px; color: inherit; opacity: 0.85; }
.reply-bubble .reply-text   { opacity: 0.7; }
.msg-own .reply-bubble { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.4); }

/* ══════════════════════════════
   REACTIONS
   ══════════════════════════════ */
.reaction-picker {
  position: fixed;
  background: var(--white);
  border-radius: 40px;
  box-shadow: 0 6px 28px rgba(0,0,0,0.18);
  padding: 10px 16px;
  display: flex;
  gap: 6px;
  z-index: 300;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%);
  animation: reactionPop 0.15s ease;
}
@keyframes reactionPop {
  from { transform: translateX(-50%) scale(0.75); opacity: 0; }
  to   { transform: translateX(-50%) scale(1);    opacity: 1; }
}
.reaction-emoji {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  line-height: 1;
  transition: transform 0.1s;
}
.reaction-emoji:hover { transform: scale(1.3); }

.reaction-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.reaction-btn {
  background: var(--blue-light);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 3px 9px;
  font-size: 14px;
  cursor: pointer;
}
.reaction-btn:hover { background: var(--input-bg); }

/* ══════════════════════════════
   UNREAD SCROLL INDICATOR
   ══════════════════════════════ */
#groupView,
#dmChatView { position: relative; }

.new-msg-btn {
  position: absolute;
  bottom: 66px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.22);
  z-index: 20;
  white-space: nowrap;
  animation: reactionPop 0.2s ease;
}
.new-msg-btn:hover { background: var(--blue-dark); }

/* ══════════════════════════════
   WEATHER WIDGET
   ══════════════════════════════ */
.weather-main {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}
.weather-temp { font-size: 38px; font-weight: 700; color: var(--text); line-height: 1; }
.weather-desc { font-size: 15px; color: var(--muted); }
.weather-detail {
  display: flex;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}
.weather-loading { font-size: 14px; color: var(--muted); padding: 4px 0; }
.weather-rule { border: none; border-top: 1px solid var(--border); margin: 12px -16px 14px; }

/* ══════════════════════════════
   TRANSLATION
   ══════════════════════════════ */
.trans-lang-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.trans-select {
  flex: 1; padding: 9px 6px; border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--input-bg); color: var(--text); font-size: 13px; font-weight: 500;
}
.trans-swap-btn {
  padding: 9px 11px; border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--card-bg); color: var(--text); font-size: 16px; cursor: pointer; flex-shrink: 0;
}
.trans-textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--input-bg); color: var(--text); font-size: 14px; resize: none;
  font-family: inherit; box-sizing: border-box;
}
.trans-textarea:focus { outline: none; border-color: var(--blue); }
.trans-result {
  margin-top: 10px; padding: 12px 14px; background: var(--blue-light);
  border-radius: 10px; border-left: 3px solid var(--blue);
}
.trans-result.hidden { display: none; }
.trans-result.trans-loading { color: var(--muted); font-size: 14px; }
.trans-result.trans-error { color: var(--red); font-size: 13px; border-left-color: var(--red); background: #fff0f0; }
.trans-translated { font-size: 17px; font-weight: 600; color: var(--text); line-height: 1.4; }
.trans-note { font-size: 11px; color: var(--muted); margin-top: 4px; }
.trans-phrases-label {
  font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .5px; margin: 14px 0 8px;
}
.trans-phrases-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.trans-phrase-btn {
  padding: 8px 4px; border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--card-bg); color: var(--text); font-size: 11px; font-weight: 500;
  cursor: pointer; text-align: center; transition: background .15s;
}
.trans-phrase-btn:active { background: var(--blue-light); }

/* ══════════════════════════════
   CURRENCY
   ══════════════════════════════ */
.curr-rate-badge { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.curr-refresh-btn {
  background: none; border: none; color: var(--muted); font-size: 14px; cursor: pointer;
  padding: 0 0 0 4px; vertical-align: middle; line-height: 1; transition: color .2s;
}
.curr-refresh-btn:hover { color: var(--blue); }
.curr-refresh-btn.spinning { animation: spin .6s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.curr-row { display: flex; align-items: center; gap: 8px; }
.curr-amount-input {
  flex: 1; padding: 11px 13px; border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--input-bg); color: var(--text); font-size: 20px; font-weight: 700;
  width: 0; font-variant-numeric: tabular-nums;
}
.curr-amount-input:focus { outline: none; border-color: var(--blue); }
.curr-select {
  flex: 1; padding: 11px 8px; border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--input-bg); color: var(--text); font-size: 14px; font-weight: 600;
}
.curr-divider-row { display: flex; align-items: center; justify-content: center; padding: 8px 0; }
.curr-swap-btn {
  padding: 7px 20px; border: 1.5px solid var(--border); border-radius: 20px;
  background: var(--card-bg); color: var(--text); font-size: 18px; cursor: pointer;
}
.curr-result {
  flex: 1; padding: 11px 13px; background: var(--blue-light); border-radius: 10px;
  font-size: 20px; font-weight: 700; color: var(--blue); min-height: 46px;
  display: flex; align-items: center; font-variant-numeric: tabular-nums; word-break: break-all;
}
.curr-info { margin-top: 8px; font-size: 12px; color: var(--muted); text-align: center; }

/* ══════════════════════════════
   VAN COUNTDOWN
   ══════════════════════════════ */
.van-countdown {
  text-align: center;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--blue);
  padding: 12px 0 4px;
  font-variant-numeric: tabular-nums;
}

/* ══════════════════════════════
   LOCAL TIME CLOCK
   ══════════════════════════════ */
.clock-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 0 6px;
  gap: 8px;
}
.clock-block { flex: 1; text-align: center; }
.clock-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 2px;
}
.clock-time {
  font-size: 26px;
  font-weight: 700;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.clock-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.clock-divider {
  color: var(--border);
  font-size: 28px;
  font-weight: 200;
  line-height: 1;
  padding: 0 4px;
}

/* ══════════════════════════════
   DUTY CALCULATOR (upgraded)
   ══════════════════════════════ */
.duty-type-bar { display: flex; gap: 6px; margin-bottom: 14px; }

.duty-type-btn {
  flex: 1;
  padding: 9px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
}

.duty-type-btn.active { background: var(--blue-grad); color: #fff; border-color: transparent; }

.duty-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.duty-result-row:last-child { border-bottom: none; }

.duty-ok   { color: #22863a !important; }
.duty-fail { color: var(--red) !important; }
.info-icon { background:none; border:none; color:var(--blue); font-size:14px; cursor:pointer; padding:0 2px; vertical-align:middle; line-height:1; }
.fdp-info  { font-size:12px; color:var(--muted); background:var(--blue-light); border-radius:8px; padding:8px 10px; margin:4px 0 2px; line-height:1.5; }

/* ══════════════════════════════
   REST TIMER
   ══════════════════════════════ */
.rest-timer-display {
  text-align: center;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--blue);
  padding: 10px 0 4px;
  font-variant-numeric: tabular-nums;
}

.rest-status {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 0;
  min-height: 24px;
}

.rest-status.ok   { color: #22863a; }
.rest-status.warn { color: #d97706; }

/* ══════════════════════════════
   WHO'S IN POLL
   ══════════════════════════════ */
.poll-card { padding: 2px 0; min-width: 200px; }

.poll-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: inherit;
}

.poll-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.1);
  color: inherit;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.poll-option:last-child { margin-bottom: 0; }
.poll-option.voted { background: rgba(255,255,255,.25); border-color: rgba(255,255,255,.6); }

.poll-count {
  background: rgba(255,255,255,.2);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
}

/* ══════════════════════════════
   DARK MODE  (Facebook palette)
   ══════════════════════════════ */
html.dark {
  --card-bg:    #242526;
  --input-bg:   #3a3b3c;
  --border:     #3e4042;
  --text:       #e4e6eb;
  --muted:      #b0b3b8;
  --blue-light: #1d2327;
  --accent:     #5B9EF7;
}

html.dark body          { background: #18191a; color: #e4e6eb; }
html.dark #loginScreen  { background: #18191a; }
html.dark .login-card   { background: #242526; }
html.dark .form-control { background: #3a3b3c; color: #e4e6eb; border-color: #3e4042; }
html.dark #chatScreen   { background: #18191a; }
html.dark .app-header   { background: var(--blue-grad); }

html.dark .bottom-nav        { background: #1c1c1e; border-top: 1px solid rgba(255,255,255,0.08); box-shadow: 0 -4px 24px rgba(0,0,0,0.5); }
html.dark .nav-tab           { color: #8e8e93; }
html.dark .nav-tab.active    { color: #5B9EF7; border-top-color: #5B9EF7; background: rgba(91,158,247,0.1); border-radius: 0; }
html.dark .nav-label         { color: #8e8e93; }
html.dark .nav-tab.active .nav-label { color: #5B9EF7; }

html.dark .sub-tab-bar   { background: #242526; }
html.dark .sub-tab-group { background: #3a3b3c; }
html.dark .sub-tab       { color: #b0b3b8; }

html.dark .messages-scroll { background: #18191a; }
html.dark .msg-other       { background: #3a3b3c; color: #e4e6eb; }
html.dark .msg-system      { background: #3a3b3c; color: #b0b3b8; }

html.dark .input-bar    { background: #242526; border-top-color: #3e4042; }
html.dark .msg-input    { background: #3a3b3c; color: #e4e6eb; }
html.dark .attach-menu  { background: #242526; border: 1px solid #3e4042; }
html.dark .attach-item  { color: #e4e6eb; }
html.dark .attach-item:hover { background: #3a3b3c; }

html.dark .reaction-picker { background: #3a3b3c; }
html.dark .reaction-btn    { background: #3a3b3c; border-color: #3e4042; }

html.dark .reply-preview       { background: #242526; border-top-color: #3e4042; }
html.dark .reply-preview-inner { background: #1d2327; }

html.dark .card          { background: #242526; }
html.dark .duty-input     { background: #3a3b3c; color: #e4e6eb; }
html.dark .duty-tz-input  { background: #3a3b3c; color: #e4e6eb; border-color: #3e4042; }
html.dark .time-input    { background: #3a3b3c; color: #e4e6eb; }
html.dark .airport-input { background: #3a3b3c; color: #e4e6eb; }
html.dark .emerg-input     { background: #3a3b3c; color: #e4e6eb; border-color: #3e4042; }
html.dark .emerg-edit-btn  { background: #3a3b3c; color: #4e9eff; border-color: #4e9eff; }

html.dark .autocomplete-list { background: #242526; border-color: #3e4042; }
html.dark .autocomplete-item { color: #e4e6eb; border-bottom-color: #3e4042; }
html.dark .autocomplete-item:hover { background: #3a3b3c; }

html.dark .duty-type-btn { background: #3a3b3c; color: #b0b3b8; border-color: #3e4042; }
html.dark .duty-type-btn.active { background: var(--blue-grad); color: #fff; }
html.dark .duty-result-row { border-bottom-color: #3e4042; }

html.dark .van-countdown      { color: var(--accent); }
html.dark .rest-timer-display { color: var(--accent); }
html.dark .trans-select,
html.dark .trans-textarea,
html.dark .curr-select,
html.dark .curr-amount-input  { background: #3a3b3c; color: #e4e6eb; border-color: #3e4042; }
html.dark .trans-swap-btn,
html.dark .curr-swap-btn      { background: #3a3b3c; color: #e4e6eb; border-color: #3e4042; }
html.dark .trans-phrase-btn   { background: #3a3b3c; color: #e4e6eb; border-color: #3e4042; }
html.dark .trans-result       { background: #1d2d3e; border-left-color: var(--accent); }
html.dark .trans-result.trans-error { background: #2a1a1a; }
html.dark .trans-translated   { color: #e4e6eb; }
html.dark .curr-result        { background: #1d2d3e; color: var(--accent); }
html.dark .clock-time         { color: var(--accent); }
html.dark .clock-divider      { color: #3e4042; }
html.dark .weather-rule       { border-top-color: #3e4042; }

html.dark .crew-card       { background: #2f3031; }
html.dark .dm-chat-header      { background: #242526; border-bottom-color: #3e4042; }
html.dark .archive-btn         { background: #3a3b3c; color: #e4e6eb; }
html.dark .archived-inline-btn { background: #3a3b3c; color: #b0b3b8; }
html.dark .back-btn        { color: #ffffff; }
html.dark .selectable-member { background: #2f3031; }
html.dark .selectable-member:hover { background: #3a3b3c; }
html.dark .selectable-member.selected { background: #1d2327; border-color: var(--accent); }
html.dark .dm-convo-card   { background: #2f3031; }
html.dark .dm-convo-card:hover { background: #3a3b3c; }
html.dark .dm-btn          { background: var(--accent); color: #fff; }
html.dark .dm-btn.secondary { background: transparent; border: 1.5px solid #6b7280; color: #e4e6eb; }

html.dark .new-msg-btn { background: var(--accent); }
html.dark .search-btn  { background: #3a3b3c; color: #e4e6eb; border: 1px solid #3e4042; }
html.dark .search-btn:hover { background: #4a4b4c; }
html.dark .rideshare-menu { background: #242526; border: 1px solid #3e4042; }
html.dark .rideshare-item { color: #e4e6eb; border-bottom-color: #3e4042; }
html.dark .rideshare-item:hover { background: #3a3b3c; }

html.dark .btn-clear-route { background: #3a3b3c; color: #e4e6eb; }
html.dark .modal-card { background: #242526; color: #e4e6eb; }
html.dark .modal-card p { color: #b0b3b8; }
html.dark .location-target { border-color: #3e4042; color: #e4e6eb; }
html.dark .location-target.selected { background: #1d2d3e; border-color: var(--accent); }
html.dark #offlineBanner { background: #78350f; }

/* ── Rotation Tab ── */
.rotation-leg-card { background:var(--card-bg); border-radius:12px; padding:14px; margin-bottom:10px; box-shadow:0 1px 4px rgba(0,0,0,.06); }
.rotation-leg-card.active-leg { border:2px solid var(--accent); }
.leg-card-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.leg-flight-badge { background:var(--blue-grad); color:#fff; border-radius:20px; padding:3px 10px; font-size:12px; font-weight:600; }
.leg-remove-btn { background:none; border:none; color:var(--muted); font-size:16px; cursor:pointer; padding:4px; }
.leg-fields { display:flex; flex-direction:column; gap:8px; }
.leg-row { display:flex; gap:6px; align-items:center; }
.leg-input { flex:1; background:var(--bg); border:1px solid var(--border); border-radius:8px; padding:8px 10px; font-size:13px; color:var(--text); min-width:0; }
.leg-arrow { color:var(--muted); font-size:16px; flex-shrink:0; }
.rot-day-header { font-size:12px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.5px; padding:12px 0 6px; }
.hotel-strip { background:var(--card-bg); border:1px dashed var(--border); border-radius:10px; padding:12px 14px; margin:6px 0 10px; display:flex; align-items:center; justify-content:space-between; cursor:pointer; }
.hotel-strip-left { display:flex; align-items:center; gap:10px; }
.hotel-strip-icon { font-size:22px; }
.hotel-name { font-size:13px; font-weight:600; color:var(--text); }
.hotel-addr { font-size:11px; color:var(--muted); margin-top:2px; }
.hotel-hours { font-size:12px; color:var(--muted); white-space:nowrap; }
.rot-sticky-footer { position:fixed; bottom:62px; left:0; right:0; background:var(--card-bg); border-top:1px solid var(--border); padding:10px 16px; display:flex; gap:8px; z-index:100; }
.rot-nav-btn { flex:1; background:var(--bg); border:1.5px solid var(--border); border-radius:8px; padding:10px 0; font-size:13px; font-weight:600; color:var(--text); cursor:pointer; }
.rot-new-btn { flex:1; background:var(--blue-grad); color:#fff; border:none; border-radius:8px; padding:10px 0; font-size:13px; font-weight:600; cursor:pointer; }
.add-leg-btn { width:100%; margin-top:8px; padding:12px; border:2px dashed var(--accent); background:rgba(27,111,232,.06); border-radius:10px; color:var(--accent); font-size:14px; font-weight:600; cursor:pointer; }
.rot-summary { font-size:12px; color:var(--muted); padding-bottom:8px; line-height:1.8; }
.rot-num-row { display:flex; align-items:center; gap:8px; margin:6px 0 10px; }
.rot-num-label { font-size:11px; font-weight:700; color:var(--muted); white-space:nowrap; text-transform:uppercase; letter-spacing:.5px; }
/* ── Shared editable field pattern (pencil → inline save/cancel) ── */
.editable-edit    { display:flex; align-items:center; gap:6px; flex:1; }
.edit-pencil-btn  { background:none; border:none; font-size:15px; cursor:pointer; padding:2px 4px; line-height:1; color:var(--muted); flex-shrink:0; }
.inline-save-btn  { background:var(--accent); color:#fff; border:none; border-radius:7px; padding:7px 13px; font-size:13px; font-weight:700; cursor:pointer; white-space:nowrap; }
.inline-cancel-btn{ background:none; border:1.5px solid var(--border); border-radius:7px; padding:6px 9px; font-size:13px; color:var(--muted); cursor:pointer; }

/* Rotation number row */
.rot-fields-display { display:flex; align-items:center; gap:6px; }
.rot-fields-edit    { display:flex; align-items:center; gap:6px; flex:1; }
.rot-display-box { background:var(--input-bg); border:1.5px solid var(--border); border-radius:8px; padding:7px 10px; font-family:monospace; font-weight:700; color:var(--text); }
.rot-display-main { font-size:16px; width:80px; }
.rot-display-dupe { font-size:13px; width:70px; }
.rot-dupe-empty   { color:var(--muted); font-weight:400; }
.rot-num-input    { background:var(--input-bg); border:1.5px solid var(--border); border-radius:8px; padding:7px 10px; font-size:16px; font-weight:700; color:var(--text); font-family:monospace; width:80px; }
.rot-num-input:focus { outline:none; border-color:var(--accent); }
.rot-num-input::placeholder { font-weight:400; font-size:13px; color:var(--muted); letter-spacing:0; }
.rot-dupe-input   { background:var(--input-bg); border:1.5px solid var(--border); border-radius:8px; padding:7px 8px; font-size:13px; font-weight:600; color:var(--text); font-family:monospace; width:70px; }
.rot-dupe-input:focus { outline:none; border-color:var(--accent); }
.rot-dupe-input::placeholder { font-weight:400; font-size:12px; color:var(--muted); letter-spacing:0; }
.leg-divider { text-align:center; margin:10px 0; }
.leg-divider-inner { display:inline-block; background:var(--blue-grad); color:#fff; border-radius:20px; padding:4px 14px; font-size:12px; font-weight:600; }
html.dark .leg-input { background:#3a3b3c; color:#e4e6eb; border-color:#3e4042; }
html.dark .hotel-strip { background:#2d2e2f; border-color:#3e4042; }
html.dark .rotation-leg-card { background:#2d2e2f; }

/* ── Calendar Sync Screens ── */
.rot-back-btn { background:none; border:none; color:var(--muted); font-size:22px; cursor:pointer; padding:0; margin-bottom:16px; display:block; line-height:1; }
.provider-card { background:var(--card-bg); border-radius:12px; padding:14px 16px; margin-bottom:10px; display:flex; align-items:center; gap:14px; cursor:pointer; border:2px solid transparent; transition:border-color .2s, background .2s; }
.provider-card.selected { border-color:var(--accent); background:rgba(27,111,232,.04); }
.provider-logo { width:36px; height:36px; display:flex; align-items:center; justify-content:center; flex-shrink:0; font-size:22px; }
.provider-info { flex:1; min-width:0; }
.provider-name { font-size:15px; font-weight:600; color:var(--text); }
.provider-sub { font-size:12px; color:var(--muted); margin-top:2px; }
.provider-check { width:22px; height:22px; border-radius:50%; border:2px solid var(--border); flex-shrink:0; transition:all .2s; display:flex; align-items:center; justify-content:center; font-size:13px; color:#fff; }
.provider-check.checked { background:var(--accent); border-color:var(--accent); }
.cal-tip-box { background:var(--card-bg); border-radius:10px; padding:14px 16px; margin:14px 0; border-left:3px solid var(--accent); }
.cal-tip-title { font-size:13px; font-weight:700; color:var(--text); margin-bottom:6px; }
.cal-tip-box p { font-size:12px; color:var(--muted); line-height:1.6; }
.oauth-card { background:var(--card-bg); border-radius:16px; padding:28px 20px; text-align:center; }
.oauth-logo { font-size:52px; margin-bottom:14px; }
.oauth-title { font-size:20px; font-weight:800; margin-bottom:6px; }
.oauth-sub { font-size:14px; color:var(--muted); margin-bottom:18px; }
.oauth-perms { text-align:left; display:flex; flex-direction:column; gap:10px; }
.oauth-perm { font-size:13px; color:var(--text); }
.oauth-perm-no { font-size:13px; color:var(--muted); }
.scan-emoji { font-size:56px; margin-bottom:16px; }
.scan-title { font-size:20px; font-weight:800; margin-bottom:6px; }
.scan-sub { font-size:14px; color:var(--muted); margin-bottom:28px; }
.scan-progress-wrap { background:var(--card-bg); border-radius:8px; height:8px; overflow:hidden; margin:0 auto; max-width:240px; }
.scan-progress-bar { height:100%; background:var(--blue-grad); border-radius:8px; width:0%; transition:width .5s ease; }
.scan-pct { font-size:13px; color:var(--muted); margin-top:10px; }
.detected-day-chip { font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.5px; padding:12px 0 6px; }
.detected-flight { background:var(--card-bg); border-radius:10px; padding:12px 14px; margin-bottom:8px; display:flex; align-items:center; gap:12px; cursor:pointer; border:2px solid transparent; transition:all .2s; }
.detected-flight.selected { border-color:var(--accent); background:rgba(27,111,232,.05); }
.detected-flight-info { flex:1; min-width:0; }
.detected-flight-num { font-size:13px; font-weight:700; color:var(--text); }
.detected-flight-route { font-size:12px; color:var(--muted); margin-top:2px; }
.detected-flight-time { font-size:12px; color:var(--muted); white-space:nowrap; flex-shrink:0; }
.detected-flight-check { width:22px; height:22px; border-radius:50%; border:2px solid var(--border); flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:13px; color:#fff; transition:all .2s; }
.detected-flight.selected .detected-flight-check { background:var(--accent); border-color:var(--accent); }
.rot-back-link { background:none; border:none; color:var(--accent); font-size:13px; cursor:pointer; padding:4px; }
.sync-badge { background:rgba(27,111,232,.1); border-radius:8px; padding:8px 12px; font-size:12px; color:var(--accent); font-weight:600; margin-bottom:10px; display:block; }

/* ── Rotation Switcher Tiles ── */
.rot-switcher-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:14px 0 6px; }
.rot-tile { background:var(--card-bg); border:1.5px solid var(--border); border-radius:12px; padding:12px 10px 10px; position:relative; cursor:pointer; transition:border-color .15s, transform .1s, box-shadow .1s, background .1s; min-height:90px; -webkit-tap-highlight-color:transparent; user-select:none; }
.rot-tile.active { border-color:var(--accent); background:rgba(27,111,232,.06); }
html.dark .rot-tile.active { background:rgba(91,158,247,.08); }
.rot-tile:active { transform:scale(0.96); box-shadow:0 1px 4px rgba(0,0,0,.12); background:rgba(27,111,232,.08); border-color:var(--accent); }
.rot-tile-date    { font-size:13px; font-weight:800; color:var(--text); line-height:1.3; padding-right:18px; }
.rot-tile-num     { font-size:12px; color:var(--muted); margin-top:2px; }
.rot-tile-flights { font-size:11px; color:var(--muted); margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rot-tile-cities  { font-size:11px; color:var(--accent); font-weight:700; margin-top:6px; letter-spacing:.2px; }
.rot-tile-del { position:absolute; top:6px; right:6px; background:none; border:none; color:var(--muted); font-size:13px; cursor:pointer; padding:2px 4px; line-height:1; }
.rot-tile-del:hover { color:#e05c2a; }
.rot-tile-join { display:block; width:100%; margin-top:8px; padding:5px 0; background:var(--accent); color:#fff; border:none; border-radius:8px; font-size:12px; font-weight:700; cursor:pointer; letter-spacing:.3px; -webkit-tap-highlight-color:transparent; }
.rot-tile-join:active { opacity:.8; }
.rot-switcher-new { border:2px dashed var(--border); border-radius:12px; padding:10px; text-align:center; color:var(--muted); font-size:24px; cursor:pointer; display:flex; align-items:center; justify-content:center; min-height:90px; transition:border-color .15s, transform .1s, color .1s; -webkit-tap-highlight-color:transparent; user-select:none; }
.rot-switcher-new:hover { border-color:var(--accent); color:var(--accent); }
.rot-switcher-new:active { transform:scale(0.96); border-color:var(--accent); color:var(--accent); }

/* ── List / Calendar Toggle ── */
.rot-view-toggle { display:flex; gap:6px; padding:8px 0 4px; }
.rot-view-btn { flex:1; padding:8px 0; border:1.5px solid var(--border); border-radius:8px; background:var(--bg); color:var(--muted); font-size:13px; font-weight:600; cursor:pointer; transition:all .15s; }
.rot-view-btn.active { background:var(--accent); color:#fff; border-color:var(--accent); }

/* ── Calendar View ── */
.cal-day-row { margin-bottom:18px; }
.cal-day-label { font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.5px; margin-bottom:5px; }
.cal-timeline { position:relative; }
.cal-ruler { display:flex; justify-content:space-between; font-size:9px; color:var(--muted); margin-bottom:3px; padding:0 1px; }
.cal-bars { position:relative; height:38px; background:var(--bg); border-radius:8px; border:1px solid var(--border); overflow:hidden; }
.cal-bar { position:absolute; top:5px; height:28px; background:var(--blue-grad); border-radius:6px; display:flex; align-items:center; padding:0 6px; cursor:default; transition:opacity .15s; }
.cal-bar.cal-bar-active { box-shadow:0 0 0 2px #fff, 0 0 0 3.5px var(--accent); }
.cal-bar-label { font-size:9px; font-weight:700; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; }
html.dark .cal-bars { background:#2d2e2f; border-color:#3e4042; }

/* ── Crew Header + QR Button ── */
.crew-header { display:flex; align-items:center; justify-content:space-between; padding:4px 0 12px; }
.crew-qr-btn { background:var(--blue-grad); color:#fff; border:none; border-radius:8px; padding:8px 14px; font-size:13px; font-weight:600; cursor:pointer; }

/* ── Verification Badges ── */
.crew-badge { display:inline-block; font-size:9px; font-weight:700; border-radius:20px; padding:2px 7px; margin-left:6px; vertical-align:middle; line-height:1.5; }
.crew-badge-rotation { background:rgba(27,111,232,.12); color:var(--accent); }
.crew-badge-qr { background:rgba(34,197,94,.15); color:#16a34a; }
.crew-badge-you { background:rgba(190,24,93,.12); color:#be185d; }
.crew-badge-verified { background:rgba(34,197,94,.15); color:#16a34a; }
.crew-badge-unverified { background:rgba(234,179,8,.15); color:#a16207; }

/* ── Security card badges ── */
.sec-badge { display:inline-block; font-size:11px; font-weight:600; border-radius:12px; padding:2px 8px; margin-top:2px; }
.sec-badge-ok { background:rgba(34,197,94,.15); color:#16a34a; }
.sec-badge-warn { background:rgba(234,179,8,.15); color:#a16207; }

/* ── QR Modal styles ── */
.crew-qr-sub { font-size:13px; color:var(--muted); font-family:monospace; letter-spacing:1px; margin:4px 0; }

/* ── Profile QR Button ── */
.profile-qr-btn { background:none; border:1.5px solid var(--border); border-radius:8px; padding:6px 12px; font-size:12px; font-weight:600; color:var(--text); cursor:pointer; white-space:nowrap; }
.link-phone-btn { background:none; border:1.5px solid var(--border); border-radius:8px; padding:6px 12px; font-size:12px; font-weight:600; color:var(--blue); cursor:pointer; white-space:nowrap; }

/* ── MiCrew-style Monthly Calendar ── */
.micrew-cal { padding:0 0 8px; }
.micrew-nav { display:flex; align-items:center; justify-content:space-between; padding:6px 0 10px; }
.micrew-month-title { font-size:17px; font-weight:800; color:var(--text); letter-spacing:-.2px; }
.micrew-nav-btn { background:none; border:none; font-size:13px; color:var(--accent); font-weight:700; cursor:pointer; padding:4px 6px; }
.micrew-dow-row { display:grid; grid-template-columns:repeat(7,1fr); border-bottom:1px solid var(--border); padding-bottom:4px; margin-bottom:2px; }
.micrew-dow { text-align:center; font-size:10px; font-weight:700; color:var(--muted); padding:2px 0 4px; }
.micrew-week { display:grid; grid-template-columns:repeat(7,1fr); position:relative; }
.micrew-cell { position:relative; z-index:2; text-align:center; padding:5px 0 2px; display:flex; flex-direction:column; align-items:center; gap:1px; }
.micrew-lay-code { font-size:9px; font-weight:900; color:var(--accent); letter-spacing:.5px; line-height:1.2; }
.micrew-day-num { font-size:13px; font-weight:400; color:var(--text); line-height:1.5; min-width:24px; text-align:center; }
.micrew-day-num.mcn-other { color:var(--muted); opacity:.55; }
.micrew-day-today { font-size:13px; font-weight:700; color:#fff; background:#c0392b; border-radius:50%; width:24px; height:24px; display:flex; align-items:center; justify-content:center; }
.micrew-rot-bar { position:absolute; z-index:1; height:22px; background:var(--accent); display:flex; align-items:center; cursor:pointer; overflow:hidden; transition:opacity .15s; }
.micrew-rot-bar:hover { opacity:.85; }
.micrew-rot-num { font-size:11px; font-weight:700; color:#fff; padding:0 6px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; letter-spacing:.1px; }
html.dark .micrew-month-title { color:var(--text); }
html.dark .micrew-day-num { color:var(--text); }

/* ── QR Code modals ── */
.qr-countdown { font-size:12px; font-weight:700; color:var(--accent); letter-spacing:.3px; margin:4px 0 2px; min-height:18px; }
.qr-user-name { font-size:15px; font-weight:700; color:var(--text); margin:4px 0 2px; }
.qr-app-url   { font-size:13px; font-weight:600; color:var(--accent); margin-bottom:2px; }
.qr-scan-hint { font-size:11px; color:var(--muted); margin-bottom:14px; }

/* ── Inline QR thumbnails ── */
.qr-inline-thumb { width:42px; height:42px; border-radius:6px; cursor:pointer; border:1.5px solid var(--border); display:block; image-rendering:pixelated; flex-shrink:0; }
.qr-inline-thumb:hover { opacity:.8; }

/* ── QR thumb with label ── */
.qr-thumb-stack { display:flex; flex-direction:column; align-items:center; gap:3px; cursor:pointer; }
.qr-thumb-label { font-size:10px; font-weight:700; color:var(--accent); letter-spacing:.2px; }

/* ── Profile Pane ── */
.profile-identity-card { text-align:center; position:relative; padding-top:20px; }
.profile-qr-icon-btn { position:absolute; top:14px; right:14px; width:40px; height:40px; background:var(--input-bg); border:1.5px solid var(--border); border-radius:10px; display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--text); }
.profile-qr-icon-btn:active { opacity:.7; }
.profile-change-photo { font-size:13px; color:var(--accent); font-weight:600; cursor:pointer; display:inline-block; margin-top:2px; }
.profile-badges { display:flex; gap:8px; justify-content:center; margin-top:12px; flex-wrap:wrap; }
.profile-pill { background:var(--input-bg); border:1.5px solid var(--border); border-radius:20px; padding:4px 12px; font-size:12px; font-weight:600; color:var(--text); }
.profile-view-btn { background:none; border:none; color:var(--accent); font-size:14px; font-weight:600; cursor:pointer; padding:0; }
.profile-edit-btn { background:none; border:1px solid var(--border); border-radius:8px; color:var(--muted); font-size:13px; font-weight:600; cursor:pointer; padding:6px 16px; margin-top:10px; }
.setting-label { font-size:14px; font-weight:700; color:var(--text); }
.setting-desc  { font-size:12px; color:var(--muted); margin-top:1px; }
.profile-signout-btn { width:100%; padding:16px; border-radius:14px; border:2px solid rgba(229,62,62,.3); background:rgba(229,62,62,.06); color:#e53e3e; font-size:16px; font-weight:700; cursor:pointer; margin-top:8px; }
.profile-signout-btn:active { background:rgba(229,62,62,.14); }
.delete-account-btn { width:100%; padding:12px; border-radius:14px; border:none; background:none; color:var(--muted); font-size:13px; cursor:pointer; margin-top:4px; text-decoration:underline; }
.delete-account-btn:active { color:var(--text); }

/* ── Profile Rotation Summary ── */
.profile-rot-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:12px; }
.profile-rot-tile { background:var(--input-bg); border-radius:10px; padding:12px; text-align:center; }
.profile-rot-tile-val { font-size:22px; font-weight:800; color:var(--text); }
.profile-rot-tile-label { font-size:11px; color:var(--muted); margin-top:2px; font-weight:600; text-transform:uppercase; letter-spacing:.4px; }
.profile-current-leg { background:var(--input-bg); border-radius:10px; padding:10px 14px; display:flex; justify-content:space-between; align-items:center; }
.profile-leg-route { font-size:14px; font-weight:700; color:var(--text); }
.profile-leg-meta  { font-size:12px; color:var(--muted); }

/* ── Modal close X button ── */
.modal-close-x { position:absolute; top:12px; right:12px; width:32px; height:32px; border-radius:50%; background:var(--input-bg); border:none; font-size:16px; cursor:pointer; color:var(--muted); display:flex; align-items:center; justify-content:center; }

/* ── FOS-style Rotation List View ── */
.fos-main-card { background:var(--card-bg); border:1px solid var(--border); border-radius:16px; overflow:hidden; margin-bottom:12px; }
html.dark .fos-main-card { background:#242526; }

.fos-banner { background:var(--blue-grad); color:#fff; padding:12px 16px; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.fos-banner-date { font-size:15px; font-weight:700; letter-spacing:.5px; }
.fos-banner-base { font-size:13px; font-weight:600; opacity:.85; }
.fos-banner-rotnum { font-size:17px; font-weight:900; letter-spacing:.5px; }
.fos-banner-type { font-size:11px; font-weight:800; background:rgba(255,255,255,.22); border-radius:6px; padding:2px 7px; letter-spacing:.5px; }
.fos-banner-chat-wrap { margin-left:auto; display:flex; flex-direction:column; align-items:flex-end; gap:2px; }
.fos-banner-room-label { font-size:10px; font-weight:700; letter-spacing:.8px; opacity:.75; font-family:monospace; color:#fff; line-height:1; }
.fos-banner-chat-btn { background:none; color:#fff; border:none; padding:0; font-size:17px; font-weight:900; letter-spacing:.5px; cursor:pointer; white-space:nowrap; -webkit-tap-highlight-color:transparent; opacity:.9; }
.fos-banner-chat-btn:active { opacity:.6; }

.fos-summary { background:#f4f5f7; padding:12px 16px; border-bottom:1px solid var(--border); }
html.dark .fos-summary { background:#1e1f20; }
.fos-sync-badge { font-size:11px; color:var(--muted); margin-bottom:6px; }
.fos-sum-days { font-size:13px; font-weight:800; color:var(--text); margin-bottom:6px; text-transform:uppercase; letter-spacing:.4px; }
.fos-sum-grid { display:flex; flex-direction:column; gap:3px; }
.fos-sum-row { display:flex; align-items:center; gap:6px; font-size:12px; }
.fos-sum-lbl { font-weight:700; color:var(--muted); min-width:60px; }
.fos-sum-val { color:var(--text); font-family:monospace; font-size:12px; }
.fos-sum-edit-row { align-items:center; }
.fos-sum-time-input { background:var(--input-bg,#1e293b); border:1px solid var(--border); border-radius:6px; color:var(--text); font-size:12px; font-family:monospace; padding:3px 6px; width:96px; }
.fos-sum-date { color:var(--muted); font-size:11px; font-family:monospace; }
.leg-save-btn { width:100%; margin-top:10px; padding:10px; background:var(--blue-grad); color:#fff; border:none; border-radius:10px; font-size:14px; font-weight:700; cursor:pointer; }

.fos-flight-list { padding:0 16px 12px; }

.fos-day-header { font-size:13px; font-weight:900; color:var(--muted); text-transform:uppercase; letter-spacing:.8px; margin-bottom:8px; padding-top:14px; }
.fos-day-header-mid { margin-top:14px; padding-top:14px; border-top:1px solid var(--border); }

.fos-leg-row { display:flex; align-items:center; gap:0; padding:8px 0; border-bottom:1px solid var(--border); }
.fos-leg-row.fos-leg-last { border-bottom:none; }
.fos-leg-row.fos-leg-current { background:rgba(27,111,232,.07); border-radius:8px; padding:8px 8px; margin:0 -8px; border-bottom:none; }
html.dark .fos-leg-row.fos-leg-current { background:rgba(91,158,247,.1); }
.fos-leg-flight { font-size:13px; font-weight:800; color:var(--text); min-width:70px; }
.fos-leg-route { flex:1; font-size:13px; font-weight:600; color:var(--text); }
.fos-leg-times { font-size:12px; color:var(--muted); font-family:monospace; white-space:nowrap; margin-right:4px; }
.fos-leg-equip { font-size:11px; color:var(--muted); font-family:monospace; margin-right:4px; opacity:.7; }
.fos-leg-edit-btn { background:none; border:none; font-size:15px; cursor:pointer; padding:4px; color:var(--muted); flex-shrink:0; }
.fos-leg-edit-form { padding:10px 4px 6px; }
.fos-leg-edit-form.hidden { display:none; }

.fos-layover-row { display:flex; align-items:center; gap:10px; padding:10px 2px 4px; border-top:1px solid var(--border); margin-top:4px; }
.fos-layover-lbl { font-size:11px; font-weight:900; color:var(--muted); text-transform:uppercase; letter-spacing:.8px; min-width:60px; }
.fos-layover-detail { font-size:12px; font-weight:600; color:var(--text); font-family:monospace; }

.fos-hotel-row { font-size:12px; font-weight:600; color:var(--accent); padding:4px 2px 2px; cursor:pointer; }
.fos-hotel-row:active { opacity:.7; }
.fos-hotel-phone { color:var(--accent); font-weight:700; text-decoration:none; margin-left:6px; }


/* ── Toast notifications ── */
.app-toast {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #1b1b1b;
  color: #fff;
  padding: 10px 20px;
  border-radius: 22px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
  max-width: calc(100vw - 40px);
}
.app-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
html.dark .app-toast { background: #e4e6eb; color: #1b1b1b; }

/* ─── Phone country code selector ─── */
.phone-row { display: flex; gap: 8px; align-items: stretch; }
.phone-row .form-control { flex: 1; min-width: 0; }
.country-code-select {
  flex: 0 0 auto;
  background: var(--input-bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0 10px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  cursor: pointer;
  height: 48px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}
.country-code-select:focus { border-color: var(--blue); }
html.dark .country-code-select { background-color: #3a3b3c; color: #e4e6eb; border-color: #3e4042; }

/* ─── Password show/hide toggle ─── */
.pw-wrap { position: relative; display: flex; align-items: center; }
.pw-wrap .form-control { flex: 1; padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 12px;
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--muted); line-height: 0;
  display: flex; align-items: center; justify-content: center;
}
.pw-toggle:hover { color: var(--text); }
.pw-toggle svg { width: 20px; height: 20px; }

/* ─── Layover Room tab header ─── */
.layover-room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 6px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  min-height: 38px;
}
.layover-room-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .3px;
  font-family: monospace;
}
.layover-members-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.layover-members-btn:hover { background: var(--hover); }
.layover-empty-state {
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
html.dark .layover-room-header { background: #1e1f20; }

/* ─── Room members modal ─── */
.room-member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.room-member-row:last-child { border-bottom: none; }
.room-member-info { flex: 1; min-width: 0; }
.room-member-name { font-size: 14px; font-weight: 600; color: var(--text); }
.room-member-role { font-size: 12px; color: var(--muted); }
.room-member-dm-btn {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

/* ─── Room switcher (multi-room navigation) ─── */
#roomSwitcher {
  overflow-x: auto;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  flex-shrink: 0;
  scrollbar-width: none;
}
#roomSwitcher::-webkit-scrollbar { display: none; }
.room-tab-scroll {
  display: flex;
  gap: 6px;
  min-width: min-content;
}
.room-tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border: none;
  border-radius: 9px;
  background: var(--card-bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  font-family: monospace;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: .3px;
  transition: background 0.15s, color 0.15s;
}
.room-tab-btn.active { background: var(--blue-grad); color: #fff; }
.room-tab-x {
  font-size: 14px;
  font-weight: 400;
  opacity: 0.65;
  line-height: 1;
  padding: 0 2px;
  margin-left: 2px;
}
.room-tab-x:hover { opacity: 1; }
html.dark #roomSwitcher { background: #242526; }
html.dark .room-tab-btn { background: #3a3b3c; color: #b0b3b8; }
html.dark .room-tab-btn.active { background: var(--blue-grad); color: #fff; }

/* ── Manual Entry Card ── */
.me-card {
  background: var(--card-bg);
  border: 2px solid var(--accent);
  border-radius: 14px;
  padding: 16px 16px 20px;
  margin-bottom: 16px;
}
.me-dates-row { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; }
.me-date-input {
  background: transparent; border: none; outline: none;
  font-size: 16px; font-weight: 800; color: var(--text);
  width: 58px; padding: 2px 0;
}
.me-dash { font-size: 16px; font-weight: 800; color: var(--text); }
.me-field-input {
  display: block; width: 100%; box-sizing: border-box;
  background: transparent; border: none;
  border-bottom: 1px solid var(--border);
  outline: none; padding: 9px 0; margin-top: 2px;
  font-size: 13px; color: var(--text);
}
.me-layover-input {
  color: var(--accent); font-weight: 700; text-transform: uppercase;
  border-bottom: none; letter-spacing: 1px;
}
.me-add-leg-btn {
  display: inline-block; margin: 6px 0 10px; padding: 6px 0;
  background: none; border: none; outline: none;
  color: var(--accent); font-size: 13px; font-weight: 600;
  cursor: pointer; letter-spacing: .2px;
}
.me-add-leg-btn:active { opacity: .7; }
.me-submit-btn {
  display: block; width: 100%; padding: 14px;
  background: var(--blue-grad); color: #fff; border: none;
  border-radius: 12px; font-size: 16px; font-weight: 700;
  cursor: pointer; letter-spacing: .3px;
}
.me-submit-btn:active { opacity: .85; }
html.dark .me-card { background: #2d2e2f; }

/* Rotation picker cards */
.rot-pick-card { background:var(--card-bg); border-radius:10px; padding:12px 14px; margin-bottom:8px; display:flex; align-items:center; gap:12px; cursor:pointer; border:2px solid transparent; transition:all .2s; }
.rot-pick-card.selected { border-color:var(--accent); background:rgba(27,111,232,.05); }
.rot-pick-check { width:22px; height:22px; border-radius:50%; border:2px solid var(--border); flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:13px; color:#fff; transition:all .2s; }
.rot-pick-card.selected .rot-pick-check { background:var(--accent); border-color:var(--accent); }
.rot-pick-info { flex:1; min-width:0; }
.rot-pick-num { font-size:13px; font-weight:700; color:var(--text); }
.rot-pick-meta { font-size:12px; color:var(--muted); margin-top:2px; }

/* Device rows in recognized devices modal */
.device-row { display:flex; align-items:center; justify-content:space-between; padding:10px 0; border-bottom:1px solid var(--border); }
.device-row:last-child { border-bottom:none; }
.device-row-label { font-size:14px; font-weight:600; color:var(--text); }
.device-row-meta { font-size:12px; color:var(--muted); margin-top:2px; }

/* 2FA recommendation row */
.twofa-row { background: rgba(27,111,232,.05); border-radius: 8px; margin: 8px -4px -4px; padding: 4px; }
.twofa-enable-btn { background: var(--blue-grad) !important; color: #fff !important; border: none !important; }
html.dark .twofa-row { background: rgba(27,111,232,.1); }
