/* ══════════════════════════════════════════════════════════════
   HUDDIES — customer app (index.html + app.js)
   Loaded AFTER huddies.css, never by ops.html.

   Landing, app shell, home, composer, chat thread, account,
   language pickers, task folders, swipe-to-archive, toasts, RTL.
   ══════════════════════════════════════════════════════════════ */

.landing-pitch { width: 100%; max-width: 400px; text-align: center; }

.landing-mark {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.18));
}

.landing-tagline {
  font-family: var(--f-display);
  font-weight: 700;
  letter-spacing: -0.3px;
  font-size: 1.25rem;
  color: #FFFFFF;
  margin-top: 2px;
}

.landing-sub {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.9);
  line-height: 1.65;
  margin-top: 12px;
}

.landing-kicker {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.2px;
  line-height: 1.5;
  color: var(--cream);
  margin-top: 10px;
}

/* Offer card */
.offer-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  box-shadow: var(--lift);
}

.offer-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.offer-price { font-family: var(--f-display); display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

.offer-price s {
  font-size: 0.95rem;
  color: var(--faint);
  text-decoration-color: var(--coral);
  text-decoration-thickness: 2px;
}

.offer-price strong { font-size: 1.45rem; font-weight: 700; color: var(--teal-deep); }

.offer-hook {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 8px;
}

.offer-hook svg { width: 17px; height: 17px; color: var(--teal); flex-shrink: 0; }

.offer-fine {
  font-family: var(--f-data);
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 7px;
  padding-top: 9px;
  border-top: 1px solid var(--hairline);
}

.price-tag {
  font-family: var(--f-data);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--cream-ink);
  background: var(--cream-wash);
  border: 1px solid var(--cream);
  padding: 4px 10px;
  border-radius: var(--r-pill);
}

.auth-title { font-family: var(--f-display); font-weight: 700; font-size: 1.2rem; color: var(--ink); margin-bottom: 3px; }

.auth-sub { font-size: 0.8rem; color: var(--muted); margin-bottom: 16px; }

.form-hint { font-family: var(--f-data); font-size: 0.7rem; color: var(--muted); margin-top: 5px; }

/* New data arrived while the composer had something in it. The fetch
   already happened — this only offers the repaint. */
.live-nudge { display: flex; align-items: center; gap: 12px; }

.btn--inline {
  margin-inline-start: auto;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--cream-ink);
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}

.btn--inline:hover { color: var(--ink); }

/* ══════════════════════════════════════════════════════════════
   APP SHELL
   ══════════════════════════════════════════════════════════════ */
.shell { display: flex; min-height: 100dvh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  height: 100dvh;
  position: sticky;
  top: 0;
}

.sidebar-header { padding: 20px 18px 12px; }

.sidebar-logo {
  font-family: var(--f-brand);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--teal-deep);
  display: flex;
  align-items: center;
  gap: 9px;
}

.sidebar-newtask { padding: 4px 18px 14px; }

.sidebar-tasks {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 0 10px 10px;
  /* Reaching the end of the list used to hand the scroll to the page
     behind the drawer, which then moved under the user's finger. */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.sidebar-section-label {
  font-family: var(--f-data);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  color: var(--faint);
  padding: 8px 10px 6px;
}

.task-item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--r-md);
  transition: background var(--t-fast);
  display: block;
  margin-bottom: 2px;
}

.task-item:hover { background: var(--bg); }

.task-item.active { background: var(--cream-wash); }

.task-item-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  margin-bottom: 4px;
}

.task-item-meta { display: flex; align-items: center; gap: 8px; }

.task-item-date { font-family: var(--f-data); font-size: 0.65rem; color: var(--faint); margin-left: auto; }

.sidebar-archived { margin-top: auto; padding-top: 10px; }

.sidebar-archived:empty { display: none; }

.sidebar-empty { padding: 16px 12px; font-size: 0.78rem; color: var(--muted); line-height: 1.6; }

.sidebar-footer { border-top: 1px solid var(--hairline); padding: 12px 14px; }

.profile-chip {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  transition: background var(--t-fast);
  text-align: left;
}

.profile-chip:hover { background: var(--bg); }

.profile-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--teal);
  color: #FFFFFF;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-name { font-size: 0.8rem; font-weight: 600; line-height: 1.3; color: var(--text); }

.profile-loc {
  font-family: var(--f-data);
  font-size: 0.67rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.profile-loc svg { width: 11px; height: 11px; }

.badge--reviewing { background: var(--cream-wash); color: var(--cream-ink); }

.badge--needs_info { background: var(--coral-wash); color: var(--coral); }

.badge--estimate_sent { background: var(--teal-wash); color: var(--teal-ink); }

.badge--in_progress { background: var(--teal); color: #FFFFFF; }

.badge--in_progress::before { background: var(--cream); }

.badge--done { background: var(--ink); color: var(--cream); }

.badge--cancelled { background: rgba(28,36,38,0.07); color: var(--faint); }

/* ── Main column ── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100dvh; }

.main-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: calc(10px + var(--sat)) calc(14px + var(--sar)) 10px calc(14px + var(--sal));
  background: var(--teal);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-logo {
  font-family: var(--f-brand);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--cream);
}

.tasks-toggle { display:flex; align-items:center; gap:6px; min-height:44px; padding:8px 10px; border:1px solid rgba(255,255,255,.55); border-radius:10px; background:rgba(255,255,255,.1); color:#fff; font:600 .82rem var(--f-body); }
.tasks-toggle svg { width:21px; height:21px; flex-shrink:0; }
.tasks-toggle[aria-expanded=true] { background:rgba(255,255,255,.24); }
.tasks-toggle:focus-visible { outline:2px solid white; outline-offset:3px; }

.topbar-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar-avatar:active { transform: scale(0.94); }

.main-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 28px 24px 20px; }

.main-inner { max-width: 640px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }

.main-inner > :only-child { flex: 1; }

/* ── Home ── */
.home-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 0;
}

.home-eyebrow {
  font-family: var(--f-data);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}

.home-question {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.65rem;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: -0.4px;
  margin-bottom: 28px;
  max-width: 400px;
}

.greeting { font-family: var(--f-display); font-weight: 700; font-size: 1.4rem; color: var(--ink); letter-spacing: -0.4px; }

.greeting-sub { font-size: 0.85rem; color: var(--muted); }

.chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 200px));
  gap: 10px;
  justify-content: center;
}

.chip-card {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 13px 14px;
  text-align: left;
  box-shadow: var(--lift-soft);
  transition: border-color var(--t-fast), transform var(--t-fast), background var(--t-fast);
  min-height: 62px;
}

.chip-card:hover { border-color: var(--teal); }

.chip-card:active { transform: scale(0.97); }

.chip-card-icon {
  width: 36px; height: 36px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--teal-wash);
  color: var(--teal-deep);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chip-card-icon svg { width: 19px; height: 19px; }

.chip-card-label { font-size: 0.8rem; font-weight: 600; color: var(--text); line-height: 1.3; }

/* ── Docked composer ── */
.dock-zone {
  flex-shrink: 0;
  padding: 6px 16px calc(10px + var(--sab));
}

.dock-zone > * { max-width: 640px; margin-left: auto; margin-right: auto; }

.dock-zone .needs-hint { margin-bottom: 8px; }

.dock-composer {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 26px;
  padding: 7px;
  box-shadow: var(--lift);
  transition: border-color var(--t-fast);
}

.dock-composer:focus-within { border-color: var(--teal); }

.dock-composer textarea {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  resize: none;
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text);
  padding: 9px 4px;
  max-height: 140px;
  min-height: 24px;
}

.dock-composer textarea:focus-visible { outline: none; }

.dock-composer textarea::placeholder { color: var(--faint); }

.dock-icon {
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: background var(--t-fast), color var(--t-fast);
}

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

.dock-icon:hover { background: var(--bg); color: var(--teal-deep); }

.dock-icon:active { transform: scale(0.92); }

.dock-send {
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(28,36,38,0.1);
  color: var(--faint);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-base), color var(--t-base), transform var(--t-fast);
}

.dock-send svg { width: 18px; height: 18px; }

.dock-send:active { transform: scale(0.92); }

.dock-send:disabled { opacity: 0.6; cursor: wait; }

.dock-footrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 14px 0;
  min-height: 17px;
}

.dock-footnote { font-family: var(--f-data); font-size: 0.65rem; color: var(--faint); margin-left: auto; }

.dock-attach-name { font-family: var(--f-data); font-size: 0.65rem; color: var(--teal-deep); cursor: pointer; }

.needs-hint {
  font-family: var(--f-data);
  font-size: 0.72rem;
  color: var(--cream-ink);
  line-height: 1.55;
  background: var(--cream-wash);
  border: 1px solid var(--cream);
  border-radius: var(--r-md);
  padding: 8px 13px;
}

.needs-hint strong { color: var(--ink); font-weight: 600; }

/* ── Chat thread (task detail) ── */
.chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}

.chat-head-mid { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.chat-head-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
}

.chat-head-cat { color: var(--teal-deep); display: inline-flex; }

.chat-head-cat svg { width: 16px; height: 16px; }

/* ── Account: vertical accordion ── */
.account-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}

.acc-list { display: grid; gap: 8px; }

.acc-item {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: box-shadow var(--t-fast), border-color var(--t-fast);
  scroll-margin-top: 14px; /* breathing room when scrolled into view */
}

.acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-align: left;
  min-height: 54px;
  transition: background var(--t-fast);
}

.acc-head:hover { background: var(--bg); }

.acc-head:active { background: var(--teal-wash); }

.acc-icon {
  width: 34px; height: 34px;
  flex-shrink: 0;
  border-radius: 11px;
  background: var(--teal-wash);
  color: var(--teal-deep);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.acc-label { flex: 1; font-weight: 600; font-size: 0.88rem; color: var(--ink); }

.acc-chevron { font-size: 1.25rem; color: var(--faint); line-height: 1; transition: transform var(--t-fast), color var(--t-fast); }

.acc-body { padding: 14px 18px 18px; border-top: 1px solid var(--hairline); }

.member-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }

.pricing-headline { font-family: var(--f-display); display: flex; align-items: baseline; gap: 8px; }

.price-struck { font-size: 0.95rem; color: var(--faint); text-decoration: line-through; text-decoration-color: var(--coral); text-decoration-thickness: 2px; }

.price-free { font-weight: 700; color: var(--teal-deep); }

.member-sub { font-size: 0.78rem; color: var(--muted); line-height: 1.6; }

.member-divider { height: 1px; background: var(--hairline); margin: 15px 0; }

.free-tracker { margin-top: 13px; }

.free-tracker-label {
  font-family: var(--f-data);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: var(--faint);
  margin-bottom: 8px;
}

.free-tracker-dots { display: flex; align-items: center; gap: 8px; }

.free-dot {
  width: 27px; height: 27px;
  border-radius: 50%;
  border: 2px solid var(--hairline-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #FFFFFF;
}

.free-tracker-count { font-family: var(--f-data); font-size: 0.7rem; color: var(--muted); margin-left: 4px; }

.about-steps { list-style: none; counter-reset: step; display: grid; gap: 12px; }

.about-steps li {
  counter-increment: step;
  position: relative;
  padding-left: 36px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
}

.about-steps li strong { color: var(--text); }

.about-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 1px;
  width: 25px; height: 25px;
  border-radius: 50%;
  background: var(--teal);
  color: #FFFFFF;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-cats { display: grid; gap: 13px; }

.about-cat { display: flex; gap: 11px; align-items: flex-start; }

.about-cat-icon {
  width: 30px; height: 30px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--teal-wash);
  color: var(--teal-deep);
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-cat-icon svg { width: 16px; height: 16px; }

.about-cat-name { font-size: 0.8rem; font-weight: 600; color: var(--text); }

.about-cat-desc { font-family: var(--f-data); font-size: 0.7rem; color: var(--muted); line-height: 1.5; }

/* Support */
.support-block {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 16px 18px;
}

.support-title { font-weight: 600; font-size: 0.9rem; color: var(--ink); margin-bottom: 2px; }

.support-desc { font-size: 0.78rem; color: var(--muted); line-height: 1.6; margin-bottom: 11px; }

.support-actions { display: flex; flex-wrap: wrap; gap: 9px; }

.support-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--hairline-strong);
  color: var(--text);
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}

.support-btn svg { width: 15px; height: 15px; color: var(--teal-deep); }

.support-btn:hover { border-color: var(--teal); color: var(--teal-ink); background: var(--teal-wash); text-decoration: none; }

/* Menu footer (sign out) */
.menu-footer { display: flex; justify-content: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--hairline); }

/* ══════════════════════════════════════════════════════════════
   RIGHT-TO-LEFT (Arabic, Urdu)
   Logical properties handle most of it; these are the exceptions
   where the layout is directional by design.
   ══════════════════════════════════════════════════════════════ */
[dir="rtl"] .sidebar { border-right: none; border-left: 1px solid var(--hairline); }

[dir="rtl"] .timeline { padding-left: 0; padding-right: 26px; }

[dir="rtl"] .dock-footnote { margin-left: 0; margin-right: auto; }

[dir="rtl"] .toggle-row input:checked ~ .toggle-track .toggle-knob { transform: translateX(-18px); }

[dir="rtl"] .about-steps li { padding-left: 0; padding-right: 36px; }

[dir="rtl"] .about-steps li::before { left: auto; right: 0; }

[dir="rtl"] .pricing-lines li { padding-left: 0; padding-right: 24px; }

[dir="rtl"] .pricing-lines li::before { left: auto; right: 0; }

/* ── Language pickers ── */
.lang-switch {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.16);
  border-radius: var(--r-pill);
  padding: 4px;
}

.lang-switch button {
  font-family: var(--f-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  padding: 7px 14px;
  border-radius: var(--r-pill);
  transition: all var(--t-fast);
  min-height: 36px;
}

/* Compact variant — lives inside the white auth card, under the email
   field, so it needs card colours rather than the teal-screen ones. */
.lang-switch--mini {
  width: fit-content;
  margin: 16px auto 0;
  gap: 2px;
  padding: 3px;
  background: var(--bg);
  border: 1px solid var(--hairline);
}

.lang-switch--mini button {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 5px 10px;
  min-height: 28px;
}

.lang-switch--mini .lang-mini-flag { font-size: 0.95rem; line-height: 1; }

.lang-list { display: grid; gap: 6px; }

.lang-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--hairline);
  text-align: start;
  transition: all var(--t-fast);
  min-height: 50px;
}

.lang-row:hover { border-color: var(--teal); }

.lang-native { font-size: 0.95rem; font-weight: 600; color: var(--ink); }

.lang-label { font-family: var(--f-data); font-size: 0.73rem; color: var(--muted); }

.lang-check { margin-inline-start: auto; color: var(--teal-deep); font-weight: 700; }

/* ── iOS install hint (one-time, dismissible) ── */
.install-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--teal-wash);
  border: 1.5px solid rgba(21, 181, 176, 0.35);
  border-radius: var(--r-lg);
  padding: 11px 14px;
  margin-bottom: 16px;
  font-size: 0.8rem;
  color: var(--teal-ink);
}

.install-hint > svg { width: 18px; height: 18px; flex-shrink: 0; }

.install-hint > span { flex: 1; }

.install-hint-close {
  color: var(--teal-ink);
  font-size: 0.85rem;
  padding: 4px 6px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

.install-hint-close:hover { background: rgba(21, 181, 176, 0.15); }

/* ── Awaiting-reply signals ── */
.await-banner {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: var(--cream-wash);
  border: 1.5px solid var(--cream);
  border-radius: var(--r-lg);
  padding: 13px 16px;
  margin-bottom: 18px;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.await-banner:hover { box-shadow: var(--lift-soft); }

.await-banner:active { transform: scale(0.99); }

.await-banner > svg { width: 20px; height: 20px; color: var(--cream-ink); flex-shrink: 0; }

.await-copy { flex: 1; min-width: 0; display: grid; gap: 2px; }

.await-copy strong { font-size: 0.84rem; font-weight: 700; color: var(--ink); line-height: 1.35; }

.await-copy em {
  font-style: normal;
  font-size: 0.75rem;
  color: var(--cream-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.await-go { font-size: 1.15rem; color: var(--cream-ink); flex-shrink: 0; margin-left: 4px; }

.label-alert { color: var(--cream-ink); }

.rail-pip--wait { background: var(--coral); letter-spacing: 1px; }

/* ── Checkboxes & toggles ── */
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}

.check-row input { width: 18px; height: 18px; accent-color: var(--teal); cursor: pointer; }

.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  cursor: pointer;
  border-bottom: 1px solid var(--hairline);
}

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

.toggle-row > span:first-child { flex: 1; min-width: 0; display: grid; gap: 2px; }

.toggle-label { font-size: 0.85rem; font-weight: 600; color: var(--text); }

.toggle-sub {
  font-family: var(--f-data);
  font-size: 0.71rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }

.toggle-track {
  width: 44px; height: 26px;
  flex-shrink: 0;
  border-radius: var(--r-pill);
  background: var(--hairline-strong);
  padding: 3px;
  transition: background var(--t-base);
}

.toggle-knob {
  display: block;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--lift-soft);
  transition: transform var(--t-base);
}

.toggle-row input:checked ~ .toggle-track { background: var(--teal); }

.toggle-row input:checked ~ .toggle-track .toggle-knob { transform: translateX(18px); }

.toggle-row input:focus-visible ~ .toggle-track { outline: 2px solid var(--teal); outline-offset: 2px; }

.lang-flag { font-size: 1.15rem; line-height: 1; }

img.profile-avatar { width: 36px; height: 36px; border-radius: 50%; }

.topbar-avatar-inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 0.95rem;
}

img.topbar-avatar-inner { object-fit: cover; }

.avatar-editor {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--hairline);
}

.avatar-lg {
  width: 62px; height: 62px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--teal);
  color: #fff;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

img.avatar-lg { object-fit: cover; }

/* ── Empty state / misc ── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 0.85rem; line-height: 1.7; }

.empty-state-emoji { font-size: 1.8rem; margin-bottom: 8px; }

.config-warning {
  position: fixed;
  bottom: 16px; left: 16px; right: 16px;
  z-index: 200;
  background: #FFF6F3;
  border: 1.5px solid var(--coral);
  color: var(--coral);
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-family: var(--f-data);
  font-size: 0.74rem;
  line-height: 1.5;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: var(--lift);
}

.rail-pip {
  font-family: var(--f-data);
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--teal);
  color: #fff;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ══════════════════════════════════════════════════════════════
   MOBILE (≤ 900px)
   ══════════════════════════════════════════════════════════════ */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(28, 36, 38, 0.45);
  z-index: 90;
  opacity: 0;
  transition: opacity var(--t-base);
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    padding-top: var(--sat);
    padding-bottom: var(--sab);
    z-index: 100;
    transform: translateX(-100%);
    transition: transform var(--t-base);
    box-shadow: var(--lift);
    width: min(var(--sidebar-w), 84vw);
  }
  .shell.drawer-open .sidebar { transform: translateX(0); }
  .shell.drawer-open .drawer-overlay { display: block; opacity: 1; }
  .main-topbar { display: flex; }
  .main-scroll { padding: 20px 16px 12px; }
  .home-question { font-size: 1.45rem; }
  .chip-grid { grid-template-columns: repeat(2, 1fr); width: 100%; }
}

.dash-dest { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; font-size: 0.72rem; color: var(--muted); align-items: center; }

/* ── Load-error strip (user app) ── */
.load-error-strip {
  display: block;
  width: calc(100% - 32px);
  margin: 10px auto 0;
  max-width: 720px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--coral-wash);
  color: var(--coral);
  border: 1px solid rgba(228, 87, 61, 0.25);
  font-size: 0.8rem;
  text-align: center;
  cursor: pointer;
}

.load-error-strip strong { text-decoration: underline; }

.landing-privacy {
  color: rgba(255,255,255,0.6);
  font-size: 0.72rem;
  text-decoration: none;
}

.landing-privacy:hover { color: rgba(255,255,255,0.9); text-decoration: underline; }

.rail-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }

.dash-filter-label {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--ink);
}

/* ── Task folders (Done / Archived) ── */
.folder-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  margin-top: 6px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  min-height: 44px;
}

.folder-head:hover { background: var(--bg); }

.folder-caret { color: var(--faint); }

.folder-label { flex: 1; text-align: start; }

.folder-count {
  background: var(--bg);
  color: var(--muted);
  border-radius: var(--r-pill);
  padding: 2px 8px;
  font-size: 0.7rem;
  letter-spacing: 0;
}

/* ── Swipe to archive ── */
.task-swipe { position: relative; overflow: hidden; border-radius: var(--r-md); }

.task-swipe .task-item { position: relative; z-index: 1; background: var(--surface); will-change: transform; }

.task-swipe-action {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding-inline-end: 18px;
  background: var(--teal-wash);
  color: var(--teal-ink);
  font-size: 0.75rem;
  font-weight: 600;
}

.task-swipe-action svg { width: 16px; height: 16px; }

.task-swipe.armed .task-swipe-action { background: var(--teal); color: #fff; }

/* ── Toast with undo ── */
.app-toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + var(--sab));
  transform: translate(-50%, 20px);
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 0.82rem;
  padding: 12px 16px;
  border-radius: var(--r-pill);
  box-shadow: var(--lift);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast), transform var(--t-fast);
  z-index: 300;
  max-width: calc(100vw - 32px);
}

.app-toast-undo {
  color: var(--cream);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 4px 2px;
  min-height: 0;
}

/* Stable conversation updates preserve the mounted composer and scroll anchor. */
.chat-entry { display:flex; flex-direction:column; gap:10px; }
.dock-zone { position:relative; }
.thread-latest { position:absolute; bottom:calc(100% + 8px); left:50%; transform:translateX(-50%); z-index:3; white-space:nowrap; }

.people-dialog { width:min(700px,92vw); max-height:85dvh; overflow:auto; border:1px solid var(--hairline); border-radius:20px; padding:20px; background:var(--paper,#faf8f2); color:var(--ink); }
.people-dialog::backdrop { background:#0006; }

/* Published decisions belong with the conversation, below its messages. */
.customer-review { margin: 16px 0; padding: 16px 0; border-top: 1px solid var(--hairline); }
.customer-review[hidden] { display: none; }
.customer-review h3 { margin: 0 0 10px; font-size: 1rem; }
.customer-review-message { white-space: pre-wrap; overflow-wrap: anywhere; }
.customer-review-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.customer-review button:disabled { opacity: .55; cursor: not-allowed; }
