.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}
.shell-main { flex: 1; min-width: 0; }
.side-nav {
  background: #f8faf9;
  border-right: 1px solid var(--line);
  display: flex;
  flex: 0 0 280px;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  width: 280px;
  z-index: 80;
}
.side-head { padding: 20px 16px 12px; position: relative; }
.side-head .brand { margin: 0 8px 22px; }
.side-close { display: none; }
.new-chat-btn {
  align-items: center;
  background: var(--green);
  border-radius: 10px;
  color: #fff;
  display: flex;
  font-size: 13px;
  font-weight: 750;
  gap: 8px;
  justify-content: center;
  padding: 11px 14px;
  text-decoration: none;
}
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 12px 20px; }
.side-label {
  color: #85918d;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .13em;
  margin: 21px 10px 7px;
  text-transform: uppercase;
}
.side-link, .history-link {
  align-items: center;
  border-radius: 9px;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  text-decoration: none;
}
.side-link:hover, .history-link:hover, .side-link.active, .history-link.active {
  background: #e9f3ee;
  color: var(--deep);
}
.side-link span, .history-link span { color: var(--green); flex: 0 0 17px; text-align: center; }
.history-link { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-empty { color: #98a39f; font-size: 11px; margin: 10px; }
.side-user {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  padding: 14px 16px;
}
.avatar {
  background: var(--mint);
  border-radius: 50%;
  color: var(--deep);
  display: grid;
  flex: 0 0 32px;
  font-size: 12px;
  font-weight: 800;
  height: 32px;
  place-items: center;
}
.side-user-copy { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.side-user-copy strong, .side-user-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-copy strong { font-size: 11px; }
.side-user-copy small { color: var(--muted); font-size: 9px; margin-top: 2px; }
.side-user > a { color: var(--muted); text-decoration: none; }
.mobile-menu-btn {
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  display: none;
  font-size: 22px;
  padding: 7px;
}
.left-overlay { background: rgba(9, 27, 21, .38); display: none; inset: 0; position: fixed; z-index: 70; }
.mobile-header { align-items: center; border-bottom: 1px solid var(--line); display: none; min-height: 62px; padding: 0 14px; }
.signed-in { color: var(--muted); font-size: 11px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.language-switcher { position: relative; z-index: 90; }
.side-head > .language-switcher { position: absolute; right: 16px; top: 19px; }
.side-head .language-name { display: none; }
.language-switcher summary { align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); cursor: pointer; display: flex; font-size: 11px; gap: 6px; list-style: none; padding: 6px 9px; user-select: none; }
.language-switcher summary::-webkit-details-marker { display: none; }
.language-menu { background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 16px 40px rgba(16,57,45,.14); display: flex; flex-direction: column; min-width: 135px; padding: 4px; position: absolute; right: 0; top: calc(100% + 6px); }
.language-option { align-items: center; border-radius: 7px; color: var(--muted); display: flex; font-size: 11px; gap: 8px; padding: 7px 9px; text-decoration: none; }
.language-option:hover, .language-option.active { background: var(--mint); color: var(--deep); font-weight: 700; }
.auth-language { position: fixed; right: 20px; top: 18px; z-index: 100; }

@media (max-width: 900px) {
  .side-nav {
    box-shadow: 18px 0 50px rgba(8, 35, 26, .13);
    left: 0;
    position: fixed;
    transform: translateX(-105%);
    transition: transform .22s ease;
  }
  .side-nav.open { transform: translateX(0); }
  .side-close {
    background: transparent;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    display: block;
    font-size: 25px;
    position: absolute;
    right: 12px;
    top: 15px;
  }
  .side-head > .language-switcher { right: 50px; }
  .left-overlay.open { display: block; }
  .mobile-menu-btn { display: inline-grid; place-items: center; }
  .mobile-header { display: flex; gap: 8px; }
  .side-nav .brand { font-size: 19px; }
  .signed-in { display: none; }
}
