/* Gemini-inspired portfolio theme */
:root {
  --sidebar-bg: #131314;
  --sidebar-hover: #282a2c;
  --main-bg: #0e0e0f;
  --gradient-center: #1a1f3a;
  --text-primary: #e3e3e3;
  --text-secondary: #9aa0a6;
  --text-muted: #6b7280;
  --accent: #1a73e8;
  --accent-hover: #1557b0;
  --input-bg: #1e1f20;
  --input-border: #3c4043;
  --sidebar-width: 260px;
  --radius-pill: 999px;
  --radius-md: 12px;
  --font: "Google Sans Flex", "Roboto", system-ui, sans-serif;
}

[data-theme="light"] {
  --sidebar-bg: #f0f4f9;
  --sidebar-hover: #e8ecf1;
  --main-bg: #ffffff;
  --gradient-center: #e8f0fe;
  --text-primary: #1f1f1f;
  --text-secondary: #5f6368;
  --text-muted: #80868b;
  --input-bg: #f1f3f4;
  --input-border: #dadce0;
}

[data-theme="light"] .sidebar {
  border-right-color: #dadce0;
}

[data-theme="light"] .search-profile,
[data-theme="light"] .hero-title {
  -webkit-text-fill-color: unset;
  background: none;
  color: var(--text-primary);
}

[data-theme="light"] .hero-title {
  color: #1f1f1f;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  background: var(--main-bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

.app {
  display: flex;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  border-right: 1px solid #2a2b2d;
  transition: width 0.25s ease, min-width 0.25s ease;
  overflow: hidden;
}

.app.collapsed .sidebar {
  width: 72px;
  min-width: 72px;
}

.app.collapsed .logo-text,
.app.collapsed .nav-item span,
.app.collapsed .section-label,
.app.collapsed .recent-item,
.app.collapsed .profile-info,
.app.collapsed .search-profile-text,
.app.collapsed .search-profile-icon {
  opacity: 0;
  width: 0;
  max-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
}

.app.collapsed .sidebar-top {
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px 8px;
}

.app.collapsed .logo-btn {
  gap: 0;
  padding: 6px;
  min-width: 0;
  width: 100%;
  justify-content: center;
}

.app.collapsed .sidebar-toggle {
  margin: 0 auto;
}

.app.collapsed .search-profile {
  width: 48px;
  min-width: 48px;
  margin: 4px auto 10px;
  padding: 8px;
  justify-content: center;
  gap: 0;
}

.app.collapsed .search-profile-img {
  width: 32px;
  height: 32px;
}

.app.collapsed .nav-item {
  justify-content: center;
  padding: 10px;
  gap: 0;
}

.app.collapsed .sidebar-footer {
  flex-direction: column;
  gap: 8px;
  padding: 10px 8px;
}

.app.collapsed .profile {
  justify-content: center;
}

.search-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 16px);
  margin: 4px 8px 10px;
  padding: 10px 12px;
  border: 1px solid #2a2b2d;
  border-radius: 24px;
  background: var(--sidebar-hover);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}

.search-profile:hover,
.search-profile.active {
  background: #323335;
  border-color: #3c4043;
}

.search-profile-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #3c4043;
}

.search-profile-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: opacity 0.2s;
}

.search-profile-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-profile-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.search-profile-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 14px 12px 8px;
  min-width: 0;
  flex-shrink: 0;
}

.logo-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 500;
  font-family: inherit;
}

.logo-btn:hover {
  background: var(--sidebar-hover);
}

.gemini-star {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.logo-text {
  transition: opacity 0.2s;
  font-family: "Noto Sans Devanagari", var(--font);
  font-weight: 600;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--sidebar-hover);
  color: var(--text-primary);
}

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

.app.collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

.sidebar-nav {
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  border-radius: 24px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.nav-item:hover,
.nav-item.active {
  background: var(--sidebar-hover);
}

.nav-item.active svg {
  color: var(--text-primary);
}

.sidebar-section {
  padding: 16px 16px 8px;
  flex: 0 0 auto;
}

.sidebar-section.recents {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  padding-left: 8px;
}

.recent-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.recent-item:hover,
.recent-item.active {
  background: var(--sidebar-hover);
  color: var(--text-primary);
}

.recent-item.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-top: 1px solid #2a2b2d;
  margin-top: auto;
}

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

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.avatar-img {
  object-fit: cover;
  border: 1px solid #3c4043;
}

.message-ai .profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--input-border);
}

.message-ai .profile-header img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #3c4043;
}

.message-ai .profile-header h2 {
  margin-bottom: 4px;
}

.education-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: opacity 0.2s;
}

.profile-name {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-role {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Main area */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, var(--gradient-center) 0%, var(--main-bg) 70%);
  position: relative;
}

.main-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  flex-shrink: 0;
  position: relative;
  z-index: 50;
}

.upgrade-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s;
}

.upgrade-btn:hover {
  background: var(--accent-hover);
}

.content-area {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 24px 24px;
  scroll-behavior: smooth;
}

.view {
  width: 100%;
  max-width: 720px;
}

.view-home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  padding-top: 12vh;
}

.view-home.hidden {
  display: none;
}

.hero-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  background: linear-gradient(90deg, #e8eaed, #bdc1c6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.view-response {
  padding-top: 24px;
  padding-bottom: 24px;
}

.view-response[hidden] {
  display: none;
}

.response-messages {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.message {
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-user .bubble {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 20px 20px 4px 20px;
  padding: 12px 18px;
  margin-left: auto;
  max-width: 85%;
  font-size: 0.95rem;
}

.message-user {
  display: flex;
  justify-content: flex-end;
}

.message-ai .bubble {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-primary);
}

.message-ai h2 {
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 12px;
  color: #fff;
}

.message-ai h3 {
  font-size: 0.95rem;
  font-weight: 500;
  margin: 16px 0 8px;
  color: var(--text-primary);
}

.message-ai p {
  margin-bottom: 10px;
  color: var(--text-secondary);
}

.message-ai ul {
  margin: 8px 0 12px 20px;
  color: var(--text-secondary);
}

.message-ai li {
  margin-bottom: 6px;
}

.message-ai a {
  color: #8ab4f8;
  text-decoration: none;
}

.message-ai a:hover {
  text-decoration: underline;
}

.card {
  background: rgba(30, 31, 32, 0.6);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}

.card-title {
  font-weight: 500;
  color: #fff;
  margin-bottom: 4px;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  font-size: 0.72rem;
  padding: 4px 10px;
  background: var(--sidebar-hover);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.skill-chip {
  padding: 8px 12px;
  background: var(--sidebar-hover);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.highlight-card {
  border-color: #4285f4;
  box-shadow: 0 0 0 1px rgba(66, 133, 244, 0.3);
}

.card-bullets {
  margin: 12px 0 16px 20px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.card-bullets li {
  margin-bottom: 8px;
}

.project-link-placeholder {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 12px 16px;
  background: rgba(66, 133, 244, 0.08);
  border: 1px dashed #4285f4;
  border-radius: var(--radius-md);
}

.project-link-action {
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.project-link-action:hover {
  background: rgba(66, 133, 244, 0.15);
  border-color: #8ab4f8;
}

.project-link-placeholder .placeholder-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.project-link-placeholder strong {
  color: #8ab4f8;
  font-size: 0.9rem;
  font-weight: 500;
}

.projects-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 0;
  max-width: 100%;
}

.project-title-item {
  padding: 18px 0;
  font-size: 0.95rem;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(138, 180, 248, 0.15);
  cursor: pointer;
  transition: color 0.15s;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.project-title-item:hover {
  color: #8ab4f8;
}

.project-title-item:last-child {
  border-bottom: none;
}

.resume-toggle-btn {
  color: #8ab4f8;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s;
}

.resume-toggle-btn:hover {
  text-decoration: underline;
  color: #b0d4f8;
}

/* Resume Modal */
.resume-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.resume-modal-content {
  background: var(--sidebar-bg);
  border: 1px solid var(--input-border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  max-width: 900px;
  width: 90vw;
  height: 80vh;
  max-height: 80vh;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.resume-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--input-border);
  flex-shrink: 0;
}

.resume-modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.resume-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  transition: background-color 0.15s, color 0.15s;
}

.resume-modal-close:hover {
  background-color: var(--sidebar-hover);
  color: var(--text-primary);
}

.resume-modal-close svg {
  width: 20px;
  height: 20px;
}

.resume-modal-body {
  flex: 1;
  overflow: auto;
  padding: 0;
}

.resume-modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.resume-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--input-border);
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.download-btn {
  color: #8ab4f8;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 8px;
  background: rgba(138, 180, 248, 0.1);
  transition: background-color 0.15s, color 0.15s;
  display: inline-block;
}

.download-btn:hover {
  background-color: rgba(138, 180, 248, 0.2);
  color: #b0d4f8;
}

/* Mobile modal adjustments */
@media (max-width: 768px) {
  .resume-modal {
    padding: 8px;
  }

  .resume-modal-content {
    width: 100%;
    height: calc(100dvh - 16px);
    max-height: none;
    border-radius: 12px;
  }

  .resume-modal-header {
    padding: 16px 20px;
  }

  .resume-modal-header h2 {
    font-size: 1.1rem;
  }

  .resume-modal-footer {
    padding: 12px 20px;
  }
}

/* Input bar */
.input-wrapper {
  flex-shrink: 0;
  padding: 0 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.input-bar {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 720px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-pill);
  padding: 6px 8px 6px 6px;
  gap: 4px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-bar:focus-within {
  border-color: #5f6368;
  box-shadow: 0 0 0 1px rgba(138, 180, 248, 0.2);
}

.input-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}

.input-icon:hover {
  background: var(--sidebar-hover);
  color: var(--text-primary);
}

.input-icon svg {
  width: 22px;
  height: 22px;
}

.prompt-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  padding: 10px 8px;
  outline: none;
  min-width: 0;
}

.prompt-input::placeholder {
  color: var(--text-muted);
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.model-select {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.model-select:hover {
  background: var(--sidebar-hover);
  color: var(--text-primary);
}

.model-select svg {
  width: 16px;
  height: 16px;
}

.model-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 48px;
  list-style: none;
  background: #292a2d;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  padding: 6px;
  min-width: 140px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

.model-menu[hidden] {
  display: none;
}

.model-menu li {
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.model-menu li:hover {
  background: var(--sidebar-hover);
  color: var(--text-primary);
}

.input-hint {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.mic-btn.listening {
  color: #ea4335;
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Quick prompt popover */
.quick-menu {
  position: fixed;
  background: #292a2d;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  padding: 8px;
  min-width: 260px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 100;
}

.quick-menu button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.88rem;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
}

.quick-menu button:hover {
  background: var(--sidebar-hover);
  color: var(--text-primary);
}

/* Scrollbar */
.sidebar-section.recents::-webkit-scrollbar,
.content-area::-webkit-scrollbar {
  width: 6px;
}

.sidebar-section.recents::-webkit-scrollbar-thumb,
.content-area::-webkit-scrollbar-thumb {
  background: #3c4043;
  border-radius: 3px;
}

/* Settings panel */
.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.settings-overlay[hidden] {
  display: none;
}

.settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.settings-panel {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--input-border);
}

.settings-header h2 {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.settings-list {
  list-style: none;
  padding: 8px 0;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--input-border);
}

.settings-label {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.settings-select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: var(--sidebar-bg);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  min-width: 120px;
}

.settings-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.settings-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s;
}

.settings-link:hover {
  background: var(--sidebar-hover);
}

.settings-link svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Mobile-first responsive design */

/* Mobile drawer and overlay */
.mobile-menu-btn {
  display: none;
}

.mobile-overlay {
  display: none !important;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app.mobile-menu-open .sidebar {
  transform: translateX(0);
}

.app.mobile-menu-open .mobile-overlay {
  display: block !important;
  opacity: 1;
}

/* Small phones (< 480px) - Gemini-like mobile UI */
@media (max-width: 479px) {
  .app {
    flex-direction: column;
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    margin-right: auto;
  }

  .mobile-menu-btn:active {
    background: var(--sidebar-hover);
  }

  .mobile-menu-btn svg {
    width: 24px;
    height: 24px;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    min-width: 280px;
    height: 100%;
    flex-direction: column;
    border-right: 1px solid #2a2b2d;
    z-index: 70;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .app.collapsed .sidebar {
    transform: translateX(-100%);
  }

  .sidebar-top {
    padding: 16px 12px;
  }

  .logo-btn {
    padding: 8px 12px;
  }

  .sidebar-toggle {
    display: none;
  }

  .search-profile {
    margin: 8px 8px 12px;
    padding: 12px;
  }

  .sidebar-nav {
    padding: 4px 0;
  }

  .nav-item {
    padding: 12px 16px;
    gap: 14px;
  }

  .sidebar-section {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .sidebar-section.recents {
    flex: 0 0 auto;
    overflow: visible;
    min-height: 0;
    padding: 8px 16px 12px;
    gap: 0;
  }

  .recent-item {
    padding: 10px 12px;
    font-size: 0.88rem;
    border-bottom: none;
    border-radius: 10px;
  }

  .recent-item:last-child {
    border-bottom: none;
  }

  .section-label {
    font-size: 0.7rem;
    padding: 12px 0 8px 0;
    margin-bottom: 4px;
  }

  .sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid #2a2b2d;
    margin-top: 4px;
    flex-shrink: 0;
  }

  .main {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    order: 2;
  }

  .main-header {
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--main-bg);
    border-bottom: 1px solid var(--input-border);
    position: relative;
    z-index: 30;
  }

  .upgrade-btn {
    font-size: 0.85rem;
    padding: 8px 16px;
    white-space: nowrap;
  }

  .content-area {
    padding: 16px 12px 12px;
    gap: 0;
    min-height: 0;
  }

  .view {
    width: 100%;
  }

  .view-home {
    padding-top: 0;
  }

  .resume-modal {
    padding: 0;
  }

  .resume-modal-content {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .hero-sub {
    font-size: 0.9rem;
  }

  .message {
    max-width: 100%;
  }

  .message-user .bubble {
    max-width: 90%;
    padding: 10px 14px;
    font-size: 0.9rem;
  }

  .message-ai .bubble {
    font-size: 0.9rem;
  }

  .message-ai h2 {
    font-size: 1rem;
  }

  .card {
    padding: 12px 14px;
    margin-bottom: 10px;
  }

  .card-title {
    font-size: 0.95rem;
  }

  .card-meta {
    font-size: 0.8rem;
  }

  .card-tags {
    gap: 4px;
  }

  .tag {
    font-size: 0.7rem;
    padding: 4px 8px;
  }

  .skills-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
  }

  .skill-chip {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  .profile-header img {
    width: 64px;
    height: 64px;
  }

  .education-list {
    gap: 10px;
  }

  .input-wrapper {
    padding: 12px 12px 16px;
    width: 100%;
    background: var(--main-bg);
    border-top: 1px solid var(--input-border);
  }

  .input-bar {
    max-width: 100%;
    padding: 8px 8px 8px 10px;
  }

  .input-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

  .prompt-input {
    font-size: 16px;
    padding: 10px 8px;
  }

  .model-select {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .input-hint {
    font-size: 0.75rem;
    margin-top: 8px;
  }

  .quick-menu {
    position: fixed;
    min-width: 200px;
    max-width: calc(100vw - 32px);
    left: 16px;
    right: 16px;
  }

  .settings-panel {
    max-width: calc(100vw - 32px);
  }

  .projects-list {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0;
  }

  .project-title-item {
    padding: 12px 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(138, 180, 248, 0.1);
    background: transparent;
    border-radius: 0;
  }

  .project-title-item:last-child {
    border-bottom: none;
  }

  .app.collapsed .logo-text,
  .app.collapsed .nav-item span,
  .app.collapsed .section-label,
  .app.collapsed .recent-item,
  .app.collapsed .profile-info,
  .app.collapsed .search-profile-text,
  .app.collapsed .search-profile-icon {
    display: none !important;
  }
}

/* Tablets (480px - 768px) */
@media (min-width: 480px) and (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    z-index: 50;
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
    width: 240px;
    min-width: 240px;
  }

  .app.collapsed .sidebar {
    width: 64px;
    min-width: 64px;
  }

  .main {
    margin-left: 0;
  }

  .hero-title {
    font-size: 1.4rem;
  }

  .content-area {
    padding: 16px;
  }

  .input-wrapper {
    padding: 0 16px 20px;
  }

  .message-user .bubble {
    max-width: 85%;
  }

  .card {
    padding: 14px;
  }

  .skills-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

/* Large tablets and desktops (> 768px) - existing behavior */
@media (min-width: 769px) {
  .sidebar {
    position: relative;
  }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
  .view-home {
    padding-top: 6vh;
  }

  .hero-title {
    font-size: 1.25rem;
  }

  .input-wrapper {
    padding-bottom: 12px;
  }

  .main-header {
    padding: 12px 16px;
  }
}
