/* ══════════════════════════════════════════
   AUTH SCREEN
══════════════════════════════════════════ */
.auth-screen {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 20px 48px; gap: 28px; background: var(--bg);
}
.auth-brand {
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
}
.auth-logo { max-width: 160px; max-height: 90px; object-fit: contain; }
.auth-slogan { max-width: 280px; max-height: 60px; object-fit: contain; opacity: 0.85; }
.auth-tagline { font-size: 15px; color: var(--ink-2); margin-top: 4px; }
.auth-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border-radius: var(--radius); padding: 28px 24px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 20px;
}

/* ══════════════════════════════════════════
   MOBILE LAYOUT (default)
══════════════════════════════════════════ */
.app-shell {
  min-height: 100dvh; display: flex; flex-direction: column;
}
.app-shell.is-hidden { display: none !important; }

/* desktop banner hidden on mobile */
.desktop-banner { display: none; }

/* sidebar hidden on mobile */
.sidebar { display: none !important; }

.workspace {
  display: flex; flex-direction: column; flex: 1; min-height: 0;
}

/* Mobile top bar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--topbar-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; gap: 12px;
}
.topbar__brand { display: flex; align-items: center; gap: 8px; }
.topbar__logo { height: 32px; max-width: 120px; object-fit: contain; }
.topbar__name { font-size: 16px; font-weight: 700; color: var(--ink); }
.topbar__actions { display: flex; align-items: center; gap: 6px; }

.app-main {
  flex: 1; overflow-y: auto;
  padding-top: var(--topbar-h);
  padding-bottom: var(--tabs-h);
}

.view-root {
  max-width: 680px; margin: 0 auto; padding: 20px 16px 32px;
}

/* Mobile bottom tabs */
.bottom-tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  height: var(--tabs-h); background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex; align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; font-size: 10px; font-weight: 500;
  color: var(--ink-3); transition: color 0.13s; border: none; background: none; cursor: pointer;
  letter-spacing: 0.01em;
}
.tab-item svg { width: 21px; height: 21px; }
.tab-item.is-active { color: var(--brand); font-weight: 600; }

/* ══════════════════════════════════════════
   DESKTOP LAYOUT (≥768px)
══════════════════════════════════════════ */
@media (min-width: 768px) {
  /* Banner visible on desktop */
  .desktop-banner { display: flex; }

  /* Sidebar visible on desktop */
  .sidebar {
    display: flex !important; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
    width: var(--sidebar-w); background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto; overflow-x: hidden;
  }

  /* Hide mobile topbar and bottom tabs on desktop */
  .topbar { display: none !important; }
  .bottom-tabs { display: none !important; }

  /* Workspace shifts right */
  .workspace {
    margin-left: var(--sidebar-w);
  }

  .app-main {
    padding-top: 0;
    padding-bottom: 0;
  }

  .view-root {
    max-width: 780px;
    padding: 28px 28px 40px;
  }
}

/* ══════════════════════════════════════════
   FORCE MOBILE MODE (body.force-mobile)
══════════════════════════════════════════ */
body.force-mobile .sidebar { display: none !important; }
body.force-mobile .topbar { display: flex !important; }
body.force-mobile .bottom-tabs { display: flex !important; }
body.force-mobile .workspace { margin-left: 0 !important; }
body.force-mobile .app-main {
  padding-top: var(--topbar-h) !important;
  padding-bottom: var(--tabs-h) !important;
}
body.force-mobile .desktop-banner { display: none !important; }

/* ══════════════════════════════════════════
   FORCE DESKTOP MODE (body.force-desktop)
══════════════════════════════════════════ */
body.force-desktop .sidebar { display: flex !important; }
body.force-desktop .topbar { display: none !important; }
body.force-desktop .bottom-tabs { display: none !important; }
body.force-desktop .workspace { margin-left: var(--sidebar-w) !important; }
body.force-desktop .app-main {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
body.force-desktop .desktop-banner { display: flex !important; }

/* ══════════════════════════════════════════
   SIDEBAR COMPONENTS
══════════════════════════════════════════ */
.sidebar__brand {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
}
.sidebar__logo { max-width: 130px; max-height: 46px; object-fit: contain; }
.sidebar__slogan { max-width: 150px; max-height: 32px; object-fit: contain; opacity: 0.6; }
.sidebar__name { font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }

.sidebar__nav {
  flex: 1; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  height: 40px; padding: 0 10px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 400; color: var(--ink-2);
  cursor: pointer; transition: background 0.12s, color 0.12s; border: none; background: none; text-align: left;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.8; }
.nav-item:hover { background: var(--hover); color: var(--ink); }
.nav-item.is-active {
  background: var(--brand-bg); color: var(--brand); font-weight: 600;
}
.nav-item.is-active svg { opacity: 1; }

.sidebar__footer {
  padding: 10px 14px 18px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 7px;
}
.view-toggle { text-align: center; }

/* ══════════════════════════════════════════
   PLANNER LAYOUT
══════════════════════════════════════════ */
.planner-wrap { display: flex; flex-direction: column; gap: 16px; }
.chat-workbench {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.planner-heading { font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.planner-subtext { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.planner-input-card {
  background: var(--surface); border-radius: var(--radius-sm);
  padding: 12px; box-shadow: none;
  border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 14px;
}
.planner-result-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.planner-map-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* ── 聊天输入区：固定在聊天工作台内，不再撑长页面 ── */
.chat-input-dock {
  position: static;
  z-index: auto;
  background: transparent;
  padding: 0;
  border-top: none;
}
@media (min-width: 768px) {
  .chat-input-dock {
    left: auto;
    bottom: auto;
    padding: 0;
  }
}
body.force-mobile .chat-input-dock {
  left: auto !important;
  bottom: auto !important;
  padding: 0 !important;
}
body.force-desktop .chat-input-dock {
  left: auto !important;
  bottom: auto !important;
  padding: 0 !important;
}

.planner-wrap {
  padding-bottom: 24px;
}

/* textarea for big input */
.plan-textarea {
  width: 100%; min-height: 80px; resize: none;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 15px; line-height: 1.6;
  background: var(--surface); outline: none; transition: border-color 0.15s;
}
.plan-textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(232,72,10,0.1); }

.input-row {
  display: flex; gap: 10px; align-items: flex-end;
}
.input-row .plan-textarea { flex: 1; min-height: 52px; }
.input-row .btn--primary { height: 52px; width: 72px; flex-shrink: 0; }

.style-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.style-row .field-label { flex: 1; font-size: 13px; }
.location-field { flex: 1.2; }

@media (min-width: 768px) {
  .planner-heading { font-size: 26px; }
}
