:root {
  --navy: #17243d;
  --ink: #1d2a44;
  --muted: #7d8799;
  --line: #e8edf3;
  --blue: #3269c9;
  --sidebar: #fbfcfe;
  --canvas: #f5f7fa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 1100px;
  height: 100vh;
  overflow: hidden;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.auth-gate, .setup-gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; overflow-y: auto; padding: 20px; background: #f5f7fa; }
.auth-card, .setup-card { width: min(460px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 16px 50px rgba(23,36,61,.1); }
.auth-brand { margin-bottom: 20px; }
.auth-card h1, .setup-card h1 { font-size: 28px; }
.auth-card .subtitle, .setup-card .subtitle { margin-bottom: 22px; }
.auth-card label, .setup-card label { display: block; margin: 12px 0 7px; color: #56657a; font-size: 12px; font-weight: 700; }
.auth-card input, .setup-card input { width: 100%; height: 42px; margin-bottom: 5px; padding: 0 12px; border: 1px solid #dde4ec; border-radius: 7px; outline: none; font-size: 13px; }
.auth-card input:focus, .setup-card input:focus { border-color: #7893bb; box-shadow: 0 0 0 3px #edf3fb; }
.auth-card .primary-button { width: 100%; justify-content: center; }
.auth-status, .setup-status { min-height: 18px; margin: 14px 0 0; color: #7d8799; font-size: 11px; line-height: 1.5; }
.setup-privacy { margin: 15px 0; color: #758197; font-size: 11px; line-height: 1.6; }
.setup-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 16px; }
#appShell[hidden] { display: none; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 238px;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  z-index: 10;
}

.brand {
  height: 82px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 24px;
  color: var(--navy);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.7px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #1f3f76;
  color: white;
  box-shadow: 0 5px 14px rgba(31,63,118,.18);
}

.brand-mark svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.nav { padding: 16px 12px; display: grid; gap: 5px; }
.nav-item {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #68748a;
  font-size: 14px;
  text-align: left;
}
.nav-item svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { background: #f1f4f8; color: var(--ink); }
.nav-item.active { background: #edf3fc; color: #315da7; font-weight: 700; }

.sidebar-footer { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); }
.profile { height: 64px; display: flex; align-items: center; gap: 10px; padding: 10px 13px 2px; }
.profile strong, .profile span { display: block; }
.profile strong { font-size: 13px; }
.profile span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #dfe9f8; color: #4e6993; font-size: 11px; font-weight: 800; }

.main { height: 100vh; margin-left: 238px; overflow: hidden; }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; padding: 0 38px; background: white; border-bottom: 1px solid var(--line); }
.breadcrumbs { display: flex; align-items: center; gap: 9px; color: #9aa3b2; font-size: 13px; }
.breadcrumbs strong { color: #536176; }
.workspace-switcher { max-width: 220px; padding: 6px 26px 6px 9px; border: 1px solid #e1e7ef; border-radius: 6px; background: white; color: #536176; font-size: 11px; }
.sync-status { color: #8d98a8; font-size: 10px; white-space: nowrap; }
.local-mode-banner { margin: 20px 0 -7px; padding: 10px 12px; border: 1px solid #e6eaf0; border-radius: 7px; background: #fafbfd; color: #7c8797; font-size: 10px; line-height: 1.5; }
.local-mode-banner code { color: #516986; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #69758a; }
.icon-button:hover { background: #f3f5f8; }
.icon-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notification.has-unread::after { content: ""; position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border: 2px solid white; border-radius: 50%; background: #eb6a55; }
.primary-button { height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; border: 0; border-radius: 7px; background: #315da7; color: white; font-size: 13px; font-weight: 700; box-shadow: 0 4px 10px rgba(49,93,167,.16); }
.primary-button:hover { background: #274f91; }
.primary-button span { font-size: 20px; font-weight: 400; line-height: 0; }
.primary-button:disabled { cursor: wait; opacity: .7; }
.assistant-launch { height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid #dfe7f3; border-radius: 7px; background: #f7f9fd; color: #42669d; font-size: 12px; font-weight: 700; }
.assistant-launch:hover { background: #edf3fc; }
.assistant-launch svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.content { height: calc(100vh - 82px); overflow: auto; padding: 34px 38px 50px; }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; }
.eyebrow { margin: 0 0 7px; color: #8b96a7; font-size: 10px; font-weight: 800; letter-spacing: 1.5px; }
h1 { margin: 0; color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: 34px; line-height: 1.1; font-weight: 700; }
.subtitle { margin: 9px 0 0; color: #8893a4; font-size: 13px; }
.filter-button { height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid #dde3ea; border-radius: 7px; background: white; color: #66748a; font-size: 12px; }
.filter-button svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.filter-button .chevron { width: 12px; transform: rotate(90deg); margin-left: 3px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 28px; }
.stat-card { height: 92px; display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 12px; padding: 16px; background: white; border: 1px solid var(--line); border-radius: 9px; }
.stat-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 9px; }
.stat-icon svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stat-icon.blue { background: #edf3ff; color: #557bb5; }
.stat-icon.purple { background: #f4effd; color: #8068b2; }
.stat-icon.green { background: #eaf7f2; color: #4d9779; }
.stat-icon.orange { background: #fdf1e9; color: #bd7d50; }
.stat-card span { display: block; color: #929baa; font-size: 11px; }
.stat-card strong { display: block; margin-top: 5px; color: var(--navy); font-size: 23px; }
.trend { align-self: end; margin-bottom: 11px; font-size: 10px; font-weight: 700; }
.positive { color: #5c9c7e; }

.dashboard-grid { display: grid; grid-template-columns: minmax(600px, 1fr) 300px; gap: 16px; margin-top: 16px; }
.panel { background: white; border: 1px solid var(--line); border-radius: 9px; }
.panel-header { height: 73px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; color: var(--navy); font-size: 14px; }
.panel-header p { margin: 5px 0 0; color: #9aa3b1; font-size: 11px; }
.text-button { border: 0; background: transparent; color: #5d78a7; font-size: 11px; }
.text-button span { margin-left: 5px; }
.project-title-link { padding: 0; border: 0; background: none; color: #39475d; font-size: 12px; font-weight: 700; text-align: left; }
.project-title-link:hover { color: #315da7; text-decoration: underline; }

.project-row { height: 82px; display: grid; grid-template-columns: 42px minmax(180px, 1fr) 150px 70px 28px; align-items: center; gap: 11px; margin: 0 20px; border-bottom: 1px solid #f0f2f5; }
.project-row:last-child { border-bottom: 0; }
.project-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; }
.project-icon svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.project-icon.climate { background: #edf4fb; color: #5b80a9; }
.project-icon.genetics { background: #f1eef9; color: #7a68a4; }
.project-icon.materials { background: #edf7f3; color: #61967f; }
.project-info h3 { margin: 0 0 6px; color: #39475d; font-size: 12px; }
.project-info p { margin: 0; color: #a1a8b4; font-size: 10px; }
.progress-label { display: flex; justify-content: space-between; color: #9aa3b1; font-size: 9px; }
.progress-label strong { color: #69758a; }
.progress { height: 5px; margin-top: 7px; overflow: hidden; border-radius: 999px; background: #edf0f4; }
.progress span { display: block; height: 100%; border-radius: 999px; background: #7592bd; }
.team-avatars { display: flex; justify-content: flex-end; }
.team-avatars span { width: 27px; height: 27px; display: grid; place-items: center; margin-left: -7px; border: 2px solid white; border-radius: 50%; background: #dde7f3; color: #5c6f8d; font-size: 8px; font-weight: 800; }
.team-avatars span:nth-child(2) { background: #e6e0f2; color: #76698e; }
.team-avatars span:nth-child(3) { background: #f3f5f7; color: #98a1ae; }
.row-menu { border: 0; background: transparent; color: #9fa7b3; letter-spacing: 1px; }

.activity-panel { min-height: 319px; }
.activity-list { padding: 4px 18px 0; }
.activity-item { display: grid; grid-template-columns: 34px 1fr; gap: 10px; min-height: 58px; align-items: start; padding-top: 10px; }
.activity-item p { margin: 0; color: #69758a; font-size: 10.5px; line-height: 1.45; }
.activity-item p strong { color: #40506a; }
.activity-item span { display: block; margin-top: 3px; color: #adb4be; font-size: 9px; }
.mini-avatar, .activity-symbol { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; font-size: 8px; font-weight: 800; }
.purple-avatar { background: #eeeaf7; color: #7c6ba1; }
.blue-avatar { background: #e8eff8; color: #5d779a; }
.activity-symbol { border-radius: 8px; }
.green-symbol { background: #edf7f2; color: #61977e; }
.orange-symbol { background: #fbf1e9; color: #b97d50; }
.activity-button { width: calc(100% - 36px); height: 34px; margin: 7px 18px 14px; border: 1px solid #e4e8ee; border-radius: 7px; background: white; color: #637794; font-size: 10px; }
.empty-state { margin: 0; padding: 19px 16px; color: #8994a4; font-size: 12px; line-height: 1.6; }
.secondary-view { padding-bottom: 48px; }
.view-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.view-actions, .settings-actions { display: flex; align-items: center; gap: 9px; }
.secondary-button, .danger-button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid #dfe5ed; border-radius: 7px; background: white; color: #536782; font-size: 11px; font-weight: 600; text-decoration: none; cursor: pointer; }
.secondary-button:hover { background: #f5f8fc; border-color: #cdd8e7; }
.danger-button { color: #a75454; }
.danger-button:hover { background: #fff6f5; border-color: #e8c9c5; }
.library-search-label { display: block; margin: 0 0 7px; color: #637188; font-size: 11px; font-weight: 700; }
.library-search { width: 100%; max-width: 520px; height: 40px; margin-bottom: 23px; padding: 0 12px; border: 1px solid #dfe5ed; border-radius: 7px; outline: none; color: var(--ink); background: white; font-size: 12px; }
.library-search:focus { border-color: #7893bb; box-shadow: 0 0 0 3px #edf3fb; }
.view-section { margin: 0 0 23px; }
.view-section h2, .team-panel h2, .settings-card h2, .feature-card h2 { margin: 0 0 12px; color: var(--navy); font-size: 14px; }
.library-list { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: white; }
.library-item { min-height: 64px; display: flex; align-items: center; gap: 12px; padding: 11px 15px; border-bottom: 1px solid #eff2f5; }
.library-item:last-child { border-bottom: 0; }
.library-item-icon { flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: #edf3fc; color: #4f719e; font-size: 12px; font-weight: 800; }
.document-library-icon { background: #f2effa; color: #7d6ba7; }
.library-item-copy { min-width: 0; flex: 1; }
.library-item-copy strong, .library-item-copy span { display: block; }
.library-item-copy strong { overflow: hidden; color: #39475d; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.library-item-copy span { margin-top: 5px; color: #929baa; font-size: 10px; }
.team-panel, .settings-card, .feature-card { margin-bottom: 16px; padding: 20px; }
.team-panel .subtitle, .settings-card p, .feature-card p { margin: 0 0 14px; color: #7d8799; font-size: 12px; line-height: 1.6; }
.team-panel .library-item { padding-inline: 0; border: 0; }
.invite-form label, #projectNoteForm label { display: block; margin-bottom: 7px; color: #56657a; font-size: 11px; font-weight: 700; }
.invite-form > div { display: flex; gap: 8px; }
.invite-form input, #projectNoteForm textarea, .invite-link input { width: 100%; padding: 10px 12px; border: 1px solid #dde4ec; border-radius: 7px; outline: none; color: var(--ink); background: white; font-size: 12px; }
#projectNoteForm textarea { display: block; margin-bottom: 10px; resize: vertical; }
.invite-form input:focus, #projectNoteForm textarea:focus { border-color: #7893bb; box-shadow: 0 0 0 3px #edf3fb; }
.invite-link { margin-top: 16px; }
.invite-link label { display: block; margin-bottom: 7px; color: #56657a; font-size: 11px; font-weight: 700; }
.invite-link > div, .progress-edit-row { display: flex; align-items: center; gap: 8px; }
.invite-link p { margin: 7px 0 0; color: #929baa; font-size: 10px; }
.progress-edit-row input { flex: 1; accent-color: #557bb5; }
.settings-actions { flex-wrap: wrap; margin-top: 18px; }
.feature-card { display: flex; align-items: flex-start; gap: 16px; }
.feature-card .assistant-logo, .feature-card .stat-icon { flex: 0 0 42px; }
.feature-card .primary-button, .feature-card .secondary-button { margin-top: 3px; }
.notification-list .activity-item { min-height: 68px; padding: 16px; border-bottom: 1px solid #eff2f5; }
.notification-list .activity-item:last-child { border-bottom: 0; }
.notification-list .library-list { border: 0; }

.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(23,36,61,.28); backdrop-filter: blur(3px); z-index: 50; }
.modal-backdrop[hidden] { display: none; }
.modal { width: 440px; padding: 24px; border-radius: 12px; background: white; box-shadow: 0 20px 60px rgba(23,36,61,.18); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.modal-header h2 { margin: 0; color: var(--navy); font-family: Georgia, serif; }
.modal-close { width: 32px; height: 32px; border: 0; border-radius: 50%; background: #f2f4f7; color: #7c8797; font-size: 20px; }
.modal label { display: block; margin-top: 14px; color: #647188; font-size: 12px; font-weight: 700; }
.modal input, .modal textarea, .modal select { width: 100%; margin-top: 7px; padding: 10px 12px; border: 1px solid #dde4ec; border-radius: 7px; outline: none; color: var(--ink); background: white; font-size: 13px; }
.modal input:focus, .modal textarea:focus, .modal select:focus { border-color: #7893bb; box-shadow: 0 0 0 3px #edf3fb; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.cancel-button { height: 40px; padding: 0 14px; border: 1px solid #dde4ec; border-radius: 7px; background: white; color: #6d788a; font-size: 12px; }
.assistant-backdrop { z-index: 55; overflow-y: auto; padding: 24px; }
.assistant-modal { width: min(660px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; padding: 25px; border-radius: 12px; background: white; box-shadow: 0 20px 60px rgba(23,36,61,.2); }
.assistant-header, .assistant-heading { display: flex; align-items: center; }
.assistant-header { justify-content: space-between; margin-bottom: 18px; }
.assistant-heading { gap: 12px; }
.assistant-heading .eyebrow { margin-bottom: 5px; font-size: 9px; }
.assistant-heading h2 { margin: 0; color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: 23px; }
.assistant-logo { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; background: #edf3fc; color: #42669d; }
.assistant-logo svg { width: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.model-notice { display: flex; gap: 10px; padding: 12px; border: 1px solid #e1eaf4; border-radius: 8px; background: #f7fafe; }
.model-notice p { margin: 0; color: #69768a; font-size: 11px; line-height: 1.55; }
.model-notice strong { color: #3a526f; }
.privacy-icon { color: #5485a6; font-size: 19px; line-height: 1.1; }
.assistant-form label { display: block; margin: 15px 0 7px; color: #56657a; font-size: 11px; font-weight: 700; }
.assistant-form select, .assistant-form textarea, .assistant-form input { width: 100%; padding: 10px 12px; border: 1px solid #dde4ec; border-radius: 7px; outline: none; color: var(--ink); background: white; font-size: 12px; }
.assistant-form textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.assistant-form select:focus, .assistant-form textarea:focus, .assistant-form input:focus { border-color: #7893bb; box-shadow: 0 0 0 3px #edf3fb; }
.optional { color: #9aa3b1; font-weight: 400; }
.assistant-submit-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; }
.assistant-status { margin: 0; color: #8994a4; font-size: 10px; line-height: 1.5; }
.assistant-submit-row .primary-button { flex: 0 0 auto; }
.assistant-submit-row .primary-button span { font-size: 15px; }
.spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.45); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.assistant-result-wrap { margin-top: 18px; padding: 15px; border: 1px solid #e5eaf0; border-radius: 8px; background: #fbfcfe; }
.result-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.result-heading h3 { margin: 0; color: #39475d; font-size: 12px; }
.copy-button { padding: 5px 9px; border: 1px solid #e0e6ed; border-radius: 5px; background: white; color: #62738c; font-size: 10px; }
.assistant-result { margin: 0; color: #4d5b70; font: inherit; font-size: 12px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.model-progress { height: 5px; margin-top: 12px; overflow: hidden; border-radius: 999px; background: #edf0f4; }
.model-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: #6386b9; transition: width .2s ease; }
.source-hint { color: #98a2b1; font-size: 9px; }
.source-passage { padding: 10px 0; border-top: 1px solid #edf0f4; }
.source-passage strong { color: #536782; font-size: 10px; }
.source-passage p { margin: 5px 0 0; color: #68758a; font-size: 10px; line-height: 1.55; }
.research-disclaimer { margin: 15px 0 0; color: #9aa3b1; font-size: 9px; line-height: 1.5; }
.toast { position: fixed; right: 28px; bottom: 28px; transform: translateY(20px); opacity: 0; pointer-events: none; padding: 12px 16px; border-radius: 8px; background: #1e3a67; color: white; font-size: 12px; box-shadow: 0 10px 30px rgba(23,36,61,.2); transition: .25s ease; z-index: 60; }
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 1250px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) 280px; }
  .content { padding-inline: 28px; }
  .topbar { padding-inline: 28px; }
}

@media (max-width: 1050px) {
  body { min-width: 0; }
  .sidebar { width: 72px; }
  .brand { justify-content: center; padding: 0; }
  .brand > span:not(.brand-mark) { display: none; }
  .nav { padding-inline: 8px; }
  .nav-item { justify-content: center; gap: 0; padding: 0; font-size: 0; }
  .sidebar-footer { padding-inline: 8px; }
  .profile { display: none; }
  .main { margin-left: 72px; }
  .topbar, .content { padding-inline: 20px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-row { grid-template-columns: 42px minmax(0, 1fr) 120px 28px; }
  .team-avatars { display: none; }
}

@media (max-width: 720px) {
  body { height: auto; overflow: auto; }
  .sidebar { inset: auto 0 0; width: 100%; height: 64px; flex-direction: row; border-top: 1px solid var(--line); border-right: 0; }
  .brand { display: none; }
  .nav { width: 80%; flex: 0 0 80%; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 4px; }
  .nav-item { height: 54px; flex-direction: column; gap: 3px; border-radius: 6px; font-size: 9px; }
  .nav-item svg { width: 18px; }
  .sidebar-footer { width: 20%; display: flex; align-items: center; margin: 0; padding: 0 4px; border: 0; }
  .sidebar-footer .nav-item { width: 100%; }
  .main { height: auto; min-height: 100vh; margin: 0; padding-bottom: 64px; overflow: visible; }
  .topbar { position: sticky; top: 0; z-index: 8; height: 62px; padding: 0 12px; }
  .breadcrumbs { gap: 0; }
  .breadcrumbs > span:not(.sync-status), .breadcrumbs > strong { display: none; }
  .sync-status { font-size: 9px; }
  .workspace-switcher { max-width: 130px; font-size: 9px; }
  .top-actions { gap: 2px; }
  .assistant-launch { width: 36px; justify-content: center; padding: 0; overflow: hidden; font-size: 0; }
  .assistant-launch svg { flex: 0 0 18px; }
  .icon-button { width: 34px; }
  .top-actions > .primary-button { width: 38px; justify-content: center; padding: 0; font-size: 0; }
  .top-actions > .primary-button span { font-size: 20px; }
  .content { height: auto; overflow: visible; padding: 22px 14px 28px; }
  .title-row { align-items: flex-start; flex-direction: column; gap: 14px; }
  h1 { font-size: 28px; }
  .subtitle { line-height: 1.5; }
  .local-mode-banner { margin-top: 15px; }
  .stats-grid { gap: 8px; margin-top: 18px; }
  .stat-card { height: 84px; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; padding: 10px; }
  .stat-icon { width: 34px; height: 34px; }
  .stat-icon svg { width: 17px; }
  .stat-card span { font-size: 9px; }
  .stat-card strong { font-size: 20px; }
  .trend { grid-column: 2; align-self: start; margin: -4px 0 0; font-size: 8px; }
  .dashboard-grid { gap: 12px; margin-top: 12px; }
  .panel-header { height: auto; min-height: 68px; padding-inline: 14px; }
  .project-row { min-height: 72px; height: auto; grid-template-columns: 34px minmax(0, 1fr) 24px; gap: 8px; margin-inline: 12px; }
  .project-icon { width: 32px; height: 32px; }
  .project-info h3 { line-height: 1.4; }
  .project-info p { line-height: 1.4; }
  .project-row .progress-wrap, .project-row .team-avatars { display: none; }
  .view-title-row { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
  .view-actions, .settings-actions { width: 100%; flex-wrap: wrap; }
  .secondary-view { padding-bottom: 26px; }
  .feature-card { flex-direction: column; }
  .team-panel, .settings-card, .feature-card { padding: 15px; }
  .library-item { flex-wrap: wrap; }
  .library-item-copy { min-width: calc(100% - 58px); }
  .invite-form > div, .invite-link > div { align-items: stretch; flex-direction: column; }
  .modal-backdrop { padding: 12px; }
  .modal { width: 100%; max-height: calc(100vh - 24px); overflow-y: auto; padding: 18px; }
  .assistant-backdrop { padding: 8px; }
  .assistant-modal { max-height: calc(100vh - 16px); padding: 16px; }
  .assistant-heading h2 { font-size: 19px; }
  .assistant-submit-row { align-items: stretch; flex-direction: column; }
  .assistant-submit-row .primary-button { justify-content: center; }
  .toast { right: 12px; bottom: 76px; left: 12px; text-align: center; }
  .auth-gate, .setup-gate { align-items: start; padding: 14px; }
  .auth-card, .setup-card { margin: auto 0; padding: 23px; }
  .view-title-row { align-items: flex-start; flex-direction: column; }
}
