/* SITE-HOME-NAV-01 — LOTBI Conversational Navigation + Input Foundation */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chat-home-page {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: #fff;
}

.chat-app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.chat-sidebar {
  background: #f7f8fb;
  color: #303642;
}

.chat-sidebar-desktop {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 18px 12px;
  overflow-y: auto;
  border-right: 1px solid #e2e6ee;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-section-title {
  margin: 0 10px 7px;
  color: #737b88;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #353c48;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
}

.nav-item-primary {
  border: 1px solid #d9dee8;
  background: #fff;
  color: var(--brand-navy);
  box-shadow: 0 1px 4px rgba(24, 42, 70, .04);
}

.nav-item:disabled {
  cursor: default;
  opacity: .72;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: #eceff5;
}

.nav-status {
  flex: 0 0 auto;
  color: #8a919d;
  font-size: 11px;
  font-weight: 700;
}

.nav-history-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  list-style: none;
}

.nav-history-list li {
  min-height: 34px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #555d69;
  font-size: 13px;
}

.nav-actions {
  margin-top: auto;
}

.chat-home-shell {
  min-height: 100vh;
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  flex-direction: column;
}

.chat-topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.topbar-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-brand {
  font-size: 22px;
}

.mobile-menu-button,
.mobile-drawer-close {
  border: 0;
  background: transparent;
  color: var(--brand-navy);
}

.mobile-menu-button {
  width: 40px;
  height: 40px;
  padding: 0;
  display: none;
  place-items: center;
  border-radius: 10px;
}

.mobile-menu-button:hover,
.mobile-menu-button:focus-visible,
.mobile-drawer-close:hover,
.mobile-drawer-close:focus-visible {
  background: #f0f2f7;
}

.mobile-menu-button svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.account-action:hover {
  transform: translateY(-1px);
}

.account-login {
  border: 1px solid var(--brand-line);
  background: rgba(255, 255, 255, .72);
  color: var(--brand-navy);
}

.account-signup {
  border: 1px solid var(--brand-navy);
  background: var(--brand-navy);
  color: #fff;
}

.account-signup:hover,
.account-signup:focus-visible {
  background: #243b61;
}

.chat-hero {
  flex: 1;
  min-height: calc(100vh - 82px);
  min-height: calc(100svh - 82px);
  padding: clamp(36px, 6vh, 68px) 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.chat-character-wrap {
  width: 206px;
  height: 270px;
  margin: 52px 0 28px;
  overflow: hidden;
  flex: 0 0 auto;
}

.chat-character-logo {
  display: block;
  width: auto;
  max-width: none;
  height: 270px;
}

.chat-composer {
  width: min(820px, 100%);
  margin-top: auto;
  margin-bottom: 0;
  padding: 12px 12px 10px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
  border: 1px solid #d8deea;
  border-radius: 26px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 18px 50px rgba(24, 42, 70, .10), 0 2px 8px rgba(24, 42, 70, .05);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.chat-composer:focus-within {
  border-color: #aeb9cc;
  box-shadow: 0 18px 50px rgba(24, 42, 70, .12), 0 2px 10px rgba(24, 42, 70, .08);
}

.chat-input {
  width: 100%;
  min-height: 92px;
  max-height: 180px;
  resize: none;
  overflow-y: auto;
  border: 0;
  outline: 0;
  padding: 10px 4px 8px;
  background: transparent;
  color: #303642;
  font: inherit;
  font-size: 17px;
  line-height: 1.55;
}

.chat-input::placeholder {
  color: #8a919d;
  opacity: 1;
}

.chat-input:focus-visible {
  outline: 0;
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 2px;
}

.composer-button {
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--brand-line);
  background: #f6f8fc;
  color: var(--brand-navy);
}

.composer-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.composer-button:disabled {
  cursor: not-allowed;
  opacity: .54;
}

.send-button {
  background: var(--brand-navy);
  border-color: var(--brand-navy);
  color: #fff;
}

.chat-home-footer {
  margin-top: auto;
}

.mobile-nav-backdrop,
.mobile-nav-drawer {
  display: none;
}

@media (max-width: 900px) {
  .chat-app-shell {
    display: block;
  }

  .chat-sidebar-desktop {
    display: none;
  }

  .mobile-menu-button {
    display: inline-grid;
  }

  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: block;
    background: rgba(22, 29, 40, .28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
  }

  .mobile-nav-drawer {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: min(86vw, 320px);
    padding: 16px 12px 22px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid #e0e4ec;
    background: #f7f8fb;
    box-shadow: 18px 0 52px rgba(24, 42, 70, .16);
    transform: translateX(-104%);
    transition: transform 180ms ease;
  }

  .nav-drawer-open {
    overflow: hidden;
  }

  .nav-drawer-open .mobile-nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .nav-drawer-open .mobile-nav-drawer {
    transform: translateX(0);
  }

  .mobile-drawer-header {
    min-height: 48px;
    margin-bottom: 12px;
    padding: 0 6px 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--brand-navy);
  }

  .mobile-drawer-header strong {
    font-size: 18px;
    letter-spacing: -.02em;
  }

  .mobile-drawer-close {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 10px;
    font-size: 26px;
    line-height: 1;
  }

  .mobile-nav-drawer .sidebar-nav {
    min-height: calc(100% - 60px);
  }
}

@media (max-width: 760px) {
  .chat-home-shell {
    padding: 0 18px;
  }

  .chat-topbar {
    min-height: 68px;
    gap: 10px;
  }

  .topbar-left {
    gap: 6px;
  }

  .chat-brand {
    font-size: 19px;
  }

  .mobile-menu-button {
    width: 36px;
    height: 36px;
  }

  .account-actions {
    gap: 6px;
  }

  .account-action {
    min-height: 36px;
    padding: 7px 11px;
    font-size: 12px;
  }

  .chat-hero {
    min-height: calc(100vh - 68px);
    min-height: calc(100svh - 68px);
    padding: 22px 0 14px;
  }

  .chat-character-wrap {
    width: 164px;
    height: 216px;
    margin-top: 178px;
    margin-bottom: 20px;
  }

  .chat-character-logo {
    height: 216px;
  }

  .chat-composer {
    margin-top: auto;
    margin-bottom: 0;
    padding: 10px 10px 9px 14px;
    grid-template-columns: 1fr;
    gap: 6px;
    border-radius: 22px;
  }

  .chat-input {
    min-height: 76px;
    padding: 8px 2px 0;
    font-size: 16px;
  }

  .composer-actions {
    justify-content: flex-end;
  }

  .composer-button {
    width: 40px;
    height: 40px;
  }

  .chat-home-footer {
    padding-top: 22px;
  }
}

@media (max-width: 390px) {
  .chat-home-shell {
    padding: 0 14px;
  }

  .account-action {
    padding-inline: 9px;
  }

  .chat-character-wrap {
    width: 153px;
    height: 202px;
  }

  .chat-character-logo {
    height: 202px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-nav-backdrop,
  .mobile-nav-drawer,
  .chat-composer {
    transition: none !important;
  }
}
