*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  :root {
    --bg: #171717;
    --surface: #202020;
    --surface-hover: #171717;
    --surface-active: #404040;
    --border: rgba(255,255,255,0.07);
    --text-primary: #e0e0e0;
    --text-secondary: #d0d0d0;
    --text-muted: #d0d0de;
    --accent: #c96a2e;
    --accent-soft: rgba(201, 106, 46, 0.12);
    --sidebar-width: 280px;
    --header-height: 52px;
    --radius: 10px;
    --transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }

    @font-face {
        font-family: "bladerunner"; /* A name you choose to reference the font later */
        src: url("../fonts/BLADRMF_.TTF");;
        font-weight: normal;
        font-style: normal;
        font-display: swap; /* Controls font loading behavior */
    }

  body {
    background: var(--bg);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
  }

  /* ── Overlay ── */
  #overlay {
    position: fixed; inset: 0; z-index: 40;
    background: rgba(0,0,0,0.5);
    opacity: 0; pointer-events: none;
    transition: opacity var(--transition);
    backdrop-filter: blur(2px);
  }
  #overlay.visible { opacity: 1; pointer-events: all; }

  /* ── Sidebar ── */
  #sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 50;
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    transform: translateX(calc(-1 * var(--sidebar-width)));
    transition: transform var(--transition);
    will-change: transform;
  }
  #sidebar.open { transform: translateX(0); }

  /* ── Sidebar Header ── */
  .sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    /* border-bottom: 1px solid var(--border); */
    flex-shrink: 0;
  }
  .brand {
    display: flex; align-items: center; gap: 10px;
    font-size: 15px; font-weight: 500; color: var(--text-primary);
    letter-spacing: -0.01em;
  }
  .brand-icon {
    width: 51px; height: 28px; border-radius: 3px;
    background: #ffffff;
    color: #000000;
    display: grid; place-items: center;
    font-size: 25px;
    line-height: 20px;
    font-family: bladerunner;
    text-align: center;
    padding-right:2px;
  }
  .btn-icon {
    width: 32px; height: 32px; border-radius: 8px;
    border: none; cursor: pointer;
    background: transparent; color: var(--text-secondary);
    display: grid; place-items: center;
    transition: background 0.15s, color 0.15s;
    font-size: 16px;
  }
  .btn-icon:hover { background: var(--surface-hover); color: var(--text-primary); }

  /* ── New Chat Button ── */
  .new-chat-btn {
    margin: 12px; padding: 9px 14px;
    background: var(--accent-soft);
    border: 1px solid rgba(201,106,46,0.2);
    border-radius: var(--radius);
    color: var(--accent);
    font-family: inherit; font-size: 13.5px; font-weight: 500;
    cursor: pointer; display: flex; align-items: center; gap: 8px;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
  }
  .new-chat-btn:hover {
    background: rgba(201,106,46,0.18);
    border-color: rgba(201,106,46,0.35);
  }
  .new-chat-btn svg { flex-shrink: 0; }

  /* ── Search ── */
  .search-wrap {
    padding: 20px 12px 8px;
    flex-shrink: 0;
  }
  .search-input {
    width: 100%; padding: 8px 12px 8px 8px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text-primary);
    font-family: inherit; font-size: 13px;
    outline: none; transition: border-color 0.15s;
    position: relative;
  }
  .search-input::placeholder { color: var(--text-muted); }
  .search-input:focus { border-color: rgba(255,255,255,0.18); }
  .search-wrap-inner {
    position: relative;
  }
  .search-icon {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none; font-size: 13px;
    z-index: 1;
  }

  /* ── Sections ── */
  .sidebar-scroll {
    flex: 1; overflow-y: auto; padding: 4px 0 8px;
  }
  .sidebar-scroll::-webkit-scrollbar { width: 4px; }
  .sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
  .sidebar-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

  .section-label {
    padding: 24px 16px 4px;
    font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--text-muted);
  }

  /* ── Nav items ── */
  .nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; margin: 1px 8px;
    border-radius: 8px; cursor: pointer;
    color: var(--text-secondary); font-size: 13.5px;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap; overflow: hidden;
    position: relative;
    text-decoration: none;
  }
  .nav-item:hover { background: var(--surface-hover); color: var(--text-primary); }
  .nav-item.active { background: var(--surface-active); color: var(--text-primary); }
  .nav-item .nav-icon { font-size: 14px; flex-shrink: 0; width: 18px; text-align: center; }
  .nav-item .nav-text { flex: 1; overflow: hidden; text-overflow: ellipsis; padding-left: 4px; }
  .nav-item .nav-badge {
    font-size: 10px; font-weight: 600;
    background: var(--accent); color: white;
    border-radius: 10px; padding: 1px 6px;
    flex-shrink: 0;
  }
  .nav-item .nav-time {
    font-size: 11px; color: var(--text-muted);
    flex-shrink: 0;
  }
  .nav-item .nav-actions {
    display: none; gap: 2px; flex-shrink: 0;
  }
  .nav-item:hover .nav-actions { display: flex; }
  .nav-item:hover .nav-time { display: none; }
  .nav-action-btn {
    width: 22px; height: 22px; border-radius: 5px;
    background: transparent; border: none;
    color: var(--text-muted); cursor: pointer;
    display: grid; place-items: center; font-size: 11px;
    transition: background 0.1s, color 0.1s;
  }
  .nav-action-btn:hover { background: var(--surface-hover); color: var(--text-primary); }

  /* ── Sidebar Footer ── */
  .sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 8px;
    flex-shrink: 0;
  }
  .user-profile {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: var(--radius);
    cursor: pointer; transition: background 0.12s;
  }
  .user-profile:hover { background: var(--surface-hover); }
  .avatar {
    width: 30px; height: 30px; border-radius: 6px;
    background: linear-gradient(135deg, #fff, #e8944a);
    display: grid; place-items: center;
    font-size: 14px; font-weight: 600; color: #202020;
    flex-shrink: 0;
  }
  .user-info { flex: 1; min-width: 0; }
  .user-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
  .user-plan { font-size: 11px; color: var(--text-muted); }

  /* ── Main Content ── */
  #main {
    flex: 1; display: flex; flex-direction: column;
    transition: margin-left var(--transition);
    min-width: 0;
  }
  /* Suppress all transitions during initial page load */
  .no-transition, .no-transition * {
    transition: none !important;
  }
  #main.shifted { margin-left: var(--sidebar-width); }

  /* ── Top Bar ── */
  .topbar {
    height: var(--header-height); display: flex; align-items: center;
    padding: 0 20px; gap: 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .menu-btn {
    width: 36px; height: 36px; border-radius: 9px;
    border: 1px solid var(--border);
    background: transparent; color: var(--text-secondary);
    cursor: pointer; display: grid; place-items: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-size: 15px; flex-shrink: 0;
  }
  .menu-btn:hover { background: var(--surface-hover); color: var(--text-primary); border-color: rgba(255,255,255,0.14); }

  .topbar-title {
    font-size: 14px; font-weight: 500; color: var(--text-secondary);
    letter-spacing: -0.01em;
  }
  .topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
  .topbar-btn {
    padding: 7px 14px; border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent; color: var(--text-secondary);
    font-family: inherit; font-size: 13px; cursor: pointer;
    transition: background 0.15s, color 0.15s;
  }
  .topbar-btn:hover { background: var(--surface-hover); color: var(--text-primary); }
  .topbar-btn.primary {
    background: rgba(234,146,36,0.15); border-color: rgba(234,146,36,0.4); color: #f0a050;
  }
  .topbar-btn.primary:hover { background: rgba(234,146,36,0.25); border-color: rgba(234,146,36,0.5); }

  /* ── Content Area ── */
  .content {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 16px; padding: 40px 20px;
  }
  .content-icon {
    width: 52px; height: 52px; border-radius: 14px;
    background: var(--accent); display: grid; place-items: center;
    font-size: 22px; margin-bottom: 4px;
  }
  .content h1 {
    font-family: 'Tiempos Text', Georgia, serif;
    font-size: clamp(22px, 4vw, 32px); font-weight: 400;
    color: var(--text-primary); letter-spacing: -0.02em;
    text-align: center;
  }
  .content p {
    font-size: 14px; color: var(--text-secondary);
    text-align: center; max-width: 400px; line-height: 1.6;
  }
  .demo-chips {
    display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px;
  }
  .chip {
    padding: 7px 14px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 20px; font-size: 12.5px; color: var(--text-secondary);
    cursor: pointer; transition: all 0.15s;
  }
  .chip:hover { background: var(--surface-hover); color: var(--text-primary); border-color: rgba(255,255,255,0.14); }

  /* ── Input Area ── */
  .input-area {
    padding: 16px 20px; border-top: 1px solid var(--border);
    flex-shrink: 0;
  }
  .input-box {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 12px 16px;
    display: flex; align-items: center; gap: 10px;
    transition: border-color 0.15s;
  }
  .input-box:focus-within { border-color: rgba(255,255,255,0.16); }
  .input-box textarea {
    flex: 1; background: none; border: none; outline: none;
    color: var(--text-primary); font-family: inherit; font-size: 14px;
    resize: none; height: 22px; line-height: 1.5;
  }
  .input-box textarea::placeholder { color: var(--text-muted); }
  .send-btn {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--accent); border: none;
    color: white; cursor: pointer; display: grid; place-items: center;
    font-size: 14px; flex-shrink: 0;
    transition: background 0.15s;
  }
  .send-btn:hover { background: #b85e27; }

  /* ── Desktop ── */
  @media (min-width: 769px) {
    #overlay { display: none; }
  }