/* [project]/tgos-bidforge-v2/app/globals.css [app-client] (css) */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #fafafa;
  --surface: #fff;
  --border: #e2e2e2;
  --text: #1a1a1a;
  --text-muted: #666;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --highlight: #fef9c3;
  --critical: #dc2626;
  --major: #f59e0b;
  --minor: #6b7280;
  --success: #16a34a;
  --sidebar-width: 380px;
  --nav-height: 56px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, sans-serif;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.nav {
  height: var(--nav-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  display: flex;
  position: sticky;
  top: 0;
}

.nav-brand {
  color: var(--text);
  letter-spacing: -.02em;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
}

.nav-brand:hover {
  text-decoration: none;
}

.nav-brand-text {
  background: linear-gradient(135deg, #1e293b, #2563eb);
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
}

.nav-separator {
  color: var(--border);
  -webkit-user-select: none;
  user-select: none;
  font-size: 16px;
  font-weight: 300;
}

.nav-section-title {
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
}

.nav-links {
  align-items: center;
  gap: 4px;
  margin-left: auto;
  display: flex;
}

.nav-link-item {
  color: var(--text-muted);
  border-radius: 6px;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  text-decoration: none;
  transition: all .15s;
  display: flex;
}

.nav-link-item:hover {
  color: var(--text);
  background: var(--bg);
  text-decoration: none;
}

.nav-badge {
  color: #fff;
  text-align: center;
  background: #ef4444;
  border-radius: 9px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  animation: .3s navBadgePop;
  box-shadow: 0 1px 3px #ef444466;
}

@keyframes navBadgePop {
  0% {
    transform: scale(0);
  }

  60% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

.nav-burger-wrapper {
  margin-left: auto;
  display: none;
  position: relative;
}

.nav-burger {
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  width: 36px;
  height: 36px;
  color: var(--text);
  border-radius: 8px;
  justify-content: center;
  align-items: center;
  transition: background .15s;
  display: flex;
}

.nav-burger:hover {
  background: var(--bg);
}

.nav-burger-menu {
  background: var(--surface);
  border: 1px solid var(--border);
  z-index: 200;
  border-radius: 10px;
  min-width: 180px;
  padding: 6px;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  box-shadow: 0 8px 24px #0000001f;
}

.nav-burger-item {
  color: var(--text);
  border-radius: 6px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 14px;
  text-decoration: none;
  transition: background .1s;
  display: flex;
}

.nav-burger-item:hover {
  background: var(--bg);
  text-decoration: none;
}

.project-pill-wrapper {
  position: relative;
}

.project-pill {
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  color: var(--text);
  border-radius: 20px;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  transition: all .15s;
  display: flex;
}

.project-pill:hover {
  border-color: var(--accent);
  background: #f0f4ff;
}

.project-pill-name {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.project-pill-dropdown {
  background: var(--surface);
  border: 1px solid var(--border);
  z-index: 200;
  border-radius: 10px;
  min-width: 200px;
  padding: 6px;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  box-shadow: 0 8px 24px #0000001f;
}

.project-pill-option {
  width: 100%;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  background: none;
  border: none;
  border-radius: 6px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  transition: background .1s;
  display: flex;
}

.project-pill-option:hover {
  background: var(--bg);
}

@media (max-width: 768px) {
  .nav-links-desktop {
    display: none;
  }

  .nav-burger-wrapper {
    display: block;
  }

  .nav-section-title {
    display: none;
  }

  .project-pill {
    max-width: 140px;
  }
}

.nav-links a, .nav-links button {
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  font-size: 14px;
}

.nav-links a:hover, .nav-links button:hover {
  color: var(--text);
}

.page {
  max-width: 2400px;
  margin: 0 auto;
  padding: 32px 24px;
}

.page-title {
  margin-bottom: 24px;
  font-size: 24px;
  font-weight: 700;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 20px;
  transition: box-shadow .15s;
}

.card:hover {
  box-shadow: 0 2px 8px #0000000f;
}

.card-title {
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 600;
}

.card-meta {
  color: var(--text-muted);
  font-size: 13px;
}

.section-layout {
  min-height: calc(100vh - var(--nav-height));
  gap: 0;
  display: flex;
}

.section-nav {
  border-right: 1px solid var(--border);
  background: var(--surface);
  width: 220px;
  min-width: 220px;
  height: calc(100vh - var(--nav-height));
  top: var(--nav-height);
  flex-direction: column;
  display: flex;
  position: sticky;
}

.section-nav-links {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.section-nav-footer {
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 0 16px 16px;
  display: flex;
}

.section-nav-logo {
  height: 24px;
}

.section-nav-title {
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  padding: 4px 16px 8px;
  font-size: 11px;
  font-weight: 700;
}

.section-nav-item {
  color: var(--text);
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  font-size: 13px;
  line-height: 1.3;
  text-decoration: none;
  transition: background .1s;
  display: flex;
}

.section-nav-item:hover {
  background: var(--bg);
  text-decoration: none;
}

.section-nav-active {
  color: var(--accent);
  background: #dbeafe;
  font-weight: 600;
}

.section-nav-active:hover {
  background: #dbeafe;
}

.section-nav-num {
  color: var(--text-muted);
  min-width: 18px;
  font-size: 11px;
  font-weight: 500;
}

.section-nav-active .section-nav-num {
  color: var(--accent);
}

.section-nav-label {
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  overflow: hidden;
}

.section-nav-pages {
  color: var(--text-muted);
  background: var(--bg);
  opacity: .7;
  border-radius: 8px;
  flex-shrink: 0;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 600;
}

.section-nav-active .section-nav-pages {
  color: var(--accent);
  opacity: 1;
  background: #2563eb1f;
}

.section-nav-downloads {
  border-top: 1px solid var(--border);
  width: 100%;
  padding: 10px 0;
}

.section-nav-downloads-label {
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  display: block;
}

.section-nav-downloads-btns {
  gap: 6px;
  display: flex;
}

.section-nav-dl-btn {
  color: var(--accent);
  background: var(--bg);
  border-radius: 10px;
  justify-content: center;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  transition: all .15s;
  display: inline-flex;
}

.section-nav-dl-btn:hover {
  background: #dbeafe;
  text-decoration: none;
}

.section-nav-total {
  border-top: 1px solid var(--border);
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 8px;
  padding: 10px 0;
  display: flex;
}

.section-nav-total-label {
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.section-nav-total-count {
  color: var(--text);
  background: var(--bg);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}

.section-content {
  min-width: 0;
  max-width: calc(100% - var(--sidebar-width)  - 220px);
  flex: 1;
  padding: 32px 48px;
}

.section-content h1 {
  margin: 0 0 16px;
  font-size: 28px;
}

.section-content h2 {
  margin: 24px 0 12px;
  font-size: 22px;
}

.section-content h3 {
  margin: 20px 0 8px;
  font-size: 18px;
}

.section-content p {
  margin: 0 0 12px;
}

.section-content ul, .section-content ol {
  margin: 0 0 12px;
  padding-left: 24px;
}

.section-content li {
  margin: 0 0 4px;
}

.section-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
}

.section-content th, .section-content td {
  border: 1px solid var(--border);
  text-align: left;
  padding: 8px 12px;
}

.section-content th {
  background: var(--bg);
  font-weight: 600;
}

.section-content pre {
  background: #f4f4f5;
  border-radius: 6px;
  margin: 12px 0;
  padding: 16px;
  overflow-x: auto;
}

.section-content code {
  font-size: 14px;
}

.section-content img {
  border-radius: 4px;
  max-width: 100%;
  margin: 8px 0;
}

.section-content blockquote {
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
  margin: 12px 0;
  padding-left: 16px;
}

.comment-highlight {
  background: var(--highlight);
  cursor: pointer;
  border-bottom: 2px solid #facc15;
  position: relative;
}

.comment-highlight:hover {
  background: #fde68a;
}

.comment-sidebar {
  width: var(--sidebar-width);
  border-left: 1px solid var(--border);
  background: var(--surface);
  height: calc(100vh - var(--nav-height));
  top: var(--nav-height);
  padding: 8px 16px;
  position: sticky;
  overflow-y: auto;
}

.comment-sidebar h3 {
  letter-spacing: .01em;
  margin-bottom: 0;
  font-size: 14px;
  font-weight: 600;
}

.comment-card {
  border: 1px solid var(--border);
  cursor: pointer;
  border-radius: 6px;
  margin-bottom: 8px;
  padding: 12px;
  font-size: 13px;
  transition: background .1s;
}

.comment-card:hover {
  background: var(--bg);
}

.comment-card .reviewer {
  margin-bottom: 4px;
  font-weight: 600;
}

.comment-card .selected-text {
  background: var(--highlight);
  border-radius: 2px;
  margin-bottom: 6px;
  padding: 2px 4px;
  font-size: 12px;
  font-style: italic;
  display: block;
}

.comment-card .comment-body {
  margin-bottom: 6px;
}

.comment-card .comment-meta {
  color: var(--text-muted);
  font-size: 11px;
}

.badge {
  text-transform: uppercase;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
  display: inline-block;
}

.badge-critical {
  color: var(--critical);
  background: #fee2e2;
}

.badge-major {
  color: #92400e;
  background: #fef3c7;
}

.badge-minor {
  color: var(--minor);
  background: #f3f4f6;
}

.badge-pending {
  color: var(--accent);
  background: #dbeafe;
}

.badge-processing {
  color: #92400e;
  background: #fef3c7;
}

.badge-applied {
  color: var(--success);
  background: #dcfce7;
}

.badge-deferred {
  color: var(--minor);
  background: #f3f4f6;
}

.badge-rejected {
  color: var(--critical);
  background: #fee2e2;
}

.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  transition: all .15s;
  display: inline-flex;
}

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

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

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

.btn-danger {
  color: var(--critical);
  border-color: #fca5a5;
}

.btn-danger:hover {
  background: #fef2f2;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.text-popover {
  background: var(--surface);
  border: 1px solid var(--border);
  z-index: 200;
  border-radius: 8px;
  width: 340px;
  padding: 16px;
  position: fixed;
  box-shadow: 0 4px 16px #0000001f;
}

.text-popover textarea {
  border: 1px solid var(--border);
  resize: vertical;
  border-radius: 4px;
  width: 100%;
  min-height: 80px;
  margin-bottom: 8px;
  padding: 8px;
  font-family: inherit;
  font-size: 14px;
}

.text-popover select, .text-popover input {
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 100%;
  margin-bottom: 8px;
  padding: 6px 8px;
  font-size: 14px;
}

.review-type-toggle {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  gap: 2px;
  margin-bottom: 8px;
  padding: 2px;
  display: flex;
}

.review-type-btn {
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 4px;
  flex: 1;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  transition: all .15s;
  display: flex;
}

.review-type-btn:hover {
  color: var(--text);
}

.review-type-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px #00000014;
}

.badge-review-type {
  padding: 0 6px;
  font-size: 10px;
}

.badge-review-ai {
  color: #6d28d9;
  background: #ede9fe;
}

.badge-review-human {
  color: var(--accent);
  background: #dbeafe;
}

.text-popover .popover-actions {
  justify-content: flex-end;
  gap: 8px;
  display: flex;
}

.editor-layout {
  height: calc(100vh - var(--nav-height));
  grid-template-columns: 1fr 1fr;
  gap: 0;
  display: grid;
}

.editor-pane {
  padding: 16px;
  overflow-y: auto;
}

.editor-pane textarea {
  border: 1px solid var(--border);
  resize: none;
  border-radius: 4px;
  width: 100%;
  height: calc(100% - 40px);
  padding: 16px;
  font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
  font-size: 14px;
  line-height: 1.5;
}

.editor-pane .preview {
  border: 1px solid var(--border);
  border-radius: 4px;
  height: calc(100% - 40px);
  padding: 16px;
  overflow-y: auto;
}

.section-grid {
  gap: 8px;
  display: grid;
}

.section-item {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  text-decoration: none;
  transition: box-shadow .15s;
  display: flex;
}

.section-item:hover {
  text-decoration: none;
  box-shadow: 0 2px 8px #0000000f;
}

.section-num {
  color: var(--text-muted);
  width: 32px;
  font-size: 13px;
  font-weight: 500;
}

.comment-count {
  color: var(--text-muted);
  background: var(--bg);
  border-radius: 10px;
  padding: 2px 10px;
  font-size: 12px;
}

.download-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding: 16px 20px;
  display: flex;
}

.download-bar-label {
  color: var(--text-muted);
  margin-right: 4px;
  font-size: 14px;
  font-weight: 500;
}

.download-bar a {
  text-decoration: none;
}

.project-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  display: grid;
}

.job-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 16px;
}

.job-card .job-header {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  display: flex;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 500;
  display: block;
}

.form-group input, .form-group select {
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
}

.data-table {
  border-collapse: collapse;
  width: 100%;
}

.data-table th, .data-table td {
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
}

.data-table th {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: .6s linear infinite spin;
  display: inline-block;
}

.alert {
  border-radius: 6px;
  margin-bottom: 16px;
  padding: 12px 16px;
  font-size: 14px;
}

.alert-info {
  color: #1e40af;
  background: #dbeafe;
}

.alert-success {
  color: #166534;
  background: #dcfce7;
}

.alert-error {
  color: #991b1b;
  background: #fef2f2;
}

.section-content-toolbar {
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  display: flex;
}

.edit-blocked-hint {
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
}

.novel-editor-wrapper {
  height: calc(100vh - var(--nav-height));
  flex-direction: column;
  width: 100%;
  display: flex;
}

.novel-editor-toolbar {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  justify-content: space-between;
  align-items: center;
  padding: 8px 24px;
  display: flex;
}

.novel-editor-toolbar-left {
  align-items: center;
  gap: 12px;
  display: flex;
}

.novel-editor-toolbar-right {
  gap: 8px;
  display: flex;
}

.novel-editor-content {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 48px;
  overflow-y: auto;
}

.novel-editor-prose {
  outline: none;
  min-height: 400px;
  font-size: 16px;
  line-height: 1.6;
}

.novel-editor-prose h1 {
  margin: 0 0 16px;
  font-size: 28px;
  font-weight: 700;
}

.novel-editor-prose h2 {
  margin: 24px 0 12px;
  font-size: 22px;
  font-weight: 600;
}

.novel-editor-prose h3 {
  margin: 20px 0 8px;
  font-size: 18px;
  font-weight: 600;
}

.novel-editor-prose p {
  margin: 0 0 12px;
}

.novel-editor-prose ul, .novel-editor-prose ol {
  margin: 0 0 12px;
  padding-left: 24px;
}

.novel-editor-prose li {
  margin: 0 0 4px;
}

.novel-editor-prose table {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
}

.novel-editor-prose th, .novel-editor-prose td {
  border: 1px solid var(--border);
  text-align: left;
  padding: 8px 12px;
}

.novel-editor-prose th {
  background: var(--bg);
  font-weight: 600;
}

.novel-editor-prose pre {
  background: #f4f4f5;
  border-radius: 6px;
  margin: 12px 0;
  padding: 16px;
  overflow-x: auto;
}

.novel-editor-prose code {
  font-size: 14px;
}

.novel-editor-prose img {
  border-radius: 4px;
  max-width: 100%;
  margin: 8px 0;
}

.novel-editor-prose blockquote {
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
  margin: 12px 0;
  padding-left: 16px;
}

.novel-editor-prose p.is-editor-empty:first-child:before {
  content: "Type \"/\" for commands...";
  color: var(--text-muted);
  float: left;
  pointer-events: none;
  height: 0;
}

.bubble-menu {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  gap: 2px;
  padding: 4px;
  display: flex;
  box-shadow: 0 4px 12px #0000001f;
}

.bubble-btn {
  cursor: pointer;
  width: 32px;
  height: 32px;
  color: var(--text);
  background: none;
  border: none;
  border-radius: 4px;
  justify-content: center;
  align-items: center;
  font-family: inherit;
  font-size: 14px;
  display: flex;
}

.bubble-btn:hover {
  background: var(--bg);
}

.bubble-btn[data-active] {
  color: var(--accent);
  background: #dbeafe;
}

.slash-command-menu {
  z-index: 300;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 280px;
  max-height: 320px;
  padding: 4px;
  overflow-y: auto;
  box-shadow: 0 4px 16px #0000001f;
}

.slash-command-menu [cmdk-item] {
  cursor: pointer;
  border-radius: 6px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 14px;
  display: flex;
}

.slash-command-menu [cmdk-item][data-selected="true"], .slash-command-menu [cmdk-item]:hover {
  background: var(--bg);
}

.slash-command-icon {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 6px;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  display: flex;
}

.slash-icon {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.slash-command-title {
  font-size: 14px;
  font-weight: 500;
}

.slash-command-desc {
  color: var(--text-muted);
  font-size: 12px;
}

.requirements-header {
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  display: flex;
}

.requirements-stats {
  gap: 8px;
  display: flex;
}

.req-stat {
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
}

.req-stat-done {
  color: var(--success);
  background: #dcfce7;
}

.req-stat-partial {
  color: #92400e;
  background: #fef3c7;
}

.req-stat-open {
  color: var(--critical);
  background: #fee2e2;
}

.req-stat-total {
  background: var(--bg);
  color: var(--text-muted);
}

.requirements-progress-bar {
  background: #fee2e2;
  border-radius: 4px;
  height: 8px;
  margin-bottom: 24px;
  display: flex;
  overflow: hidden;
}

.req-bar-done {
  background: var(--success);
}

.req-bar-partial {
  background: #f59e0b;
}

.requirements-content {
  max-width: 100%;
}

.requirements-content table {
  font-size: 13px;
}

.requirements-content td, .requirements-content th {
  vertical-align: top;
  padding: 6px 10px;
}

.accordion-section, .accordion-section:first-child {
  border-bottom: 1px solid var(--border);
}

.accordion-header {
  cursor: pointer;
  width: 100%;
  color: var(--text);
  font: inherit;
  background: none;
  border: none;
  border-radius: 6px;
  justify-content: space-between;
  align-items: center;
  margin: 0 -4px;
  padding: 12px 4px;
  transition: background .15s;
  display: flex;
}

.accordion-header-left {
  align-items: center;
  gap: 8px;
  display: flex;
}

.accordion-header-left h3 {
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.accordion-header:hover .accordion-header-left h3 {
  color: var(--text);
}

.accordion-count {
  background: var(--bg);
  color: var(--text-muted);
  text-align: center;
  border-radius: 10px;
  min-width: 20px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
}

.accordion-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform .2s;
}

.accordion-content {
  padding: 4px 0 16px;
  animation: .15s accordionSlideDown;
}

@keyframes accordionSlideDown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.accordion-empty {
  color: var(--text-muted);
  background: var(--bg);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 13px;
}

.sidebar-todos-header {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  display: flex;
}

.todo-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  padding: 10px 12px;
  font-size: 13px;
  transition: border-color .15s;
}

.todo-card:hover {
  border-color: #c5c5c5;
}

.todo-card-done {
  opacity: .5;
}

.todo-card-done .todo-title {
  text-decoration: line-through;
}

.todo-card-top {
  align-items: flex-start;
  gap: 8px;
  display: flex;
}

.todo-check {
  border: 2px solid var(--border);
  cursor: pointer;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  background: none;
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  margin-top: 1px;
  padding: 0;
  font-size: 10px;
  transition: all .15s;
  display: flex;
}

.todo-check:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.todo-check-done {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.todo-check-blocked {
  border-color: var(--critical);
  color: var(--critical);
}

.todo-check-needs_review {
  border-color: var(--major);
  color: var(--major);
}

.todo-title {
  flex: 1;
  font-weight: 500;
  line-height: 1.4;
}

.todo-priority-dot {
  border-radius: 50%;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 6px;
}

.todo-priority-low {
  background: var(--minor);
}

.todo-priority-medium {
  background: var(--major);
}

.todo-priority-high {
  background: var(--critical);
}

.todo-card-meta {
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding-left: 28px;
  display: flex;
}

.todo-assignee-badge {
  color: var(--accent);
  background: #eff6ff;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 500;
}

.todo-status-select {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
  padding: 1px 4px;
  font-size: 11px;
}

.todo-add-form {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 8px;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding: 12px;
  display: flex;
}

.todo-form-input {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 6px;
  width: 100%;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 13px;
}

.todo-form-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px #2563eb1a;
}

.todo-add-form-row {
  gap: 6px;
  display: flex;
}

.todo-form-select {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  flex: 1;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 12px;
}

.todo-add-form-actions {
  justify-content: flex-end;
  gap: 6px;
  display: flex;
}

.todo-add-btn {
  border: 2px dashed var(--border);
  width: 100%;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border-radius: 8px;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  display: flex;
}

.todo-add-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: #f8faff;
}

.todos-header {
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  display: flex;
}

.todos-header .page-title {
  margin-bottom: 0;
}

.todos-header-actions {
  align-items: center;
  gap: 12px;
  display: flex;
}

.todos-filter {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  gap: 2px;
  padding: 3px;
  display: flex;
}

.todos-filter-btn {
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 6px;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  display: flex;
}

.todos-filter-btn:hover {
  color: var(--text);
}

.todos-filter-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px #00000014;
}

.todos-filter-count {
  background: var(--bg);
  color: var(--text-muted);
  text-align: center;
  border-radius: 10px;
  min-width: 18px;
  padding: 0 6px;
  font-size: 11px;
}

.todos-filter-active .todos-filter-count {
  color: var(--accent);
  background: #dbeafe;
}

.todo-new-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  padding: 20px;
  display: flex;
  box-shadow: 0 2px 8px #0000000a;
}

.todo-new-title-input {
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 100%;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
}

.todo-new-title-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px #2563eb1a;
}

.todo-new-fields {
  gap: 12px;
  display: flex;
}

.todo-new-field {
  flex: 1;
}

.todo-new-field label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  display: block;
}

.todo-new-field select {
  border: 1px solid var(--border);
  width: 100%;
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 13px;
}

.todo-new-actions {
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
  display: flex;
}

.todo-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 24px;
  font-size: 14px;
}

.todo-list {
  flex-direction: column;
  gap: 0;
  display: flex;
}

.todo-section-group {
  margin-bottom: 24px;
}

.todo-section-label {
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
}

.todo-section-label a {
  text-decoration: none;
}

.todo-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  padding: 12px 16px;
  transition: border-color .15s, box-shadow .15s;
  display: flex;
}

.todo-row:hover {
  border-color: #c5c5c5;
  box-shadow: 0 1px 4px #0000000a;
}

.todo-row-done {
  opacity: .5;
}

.todo-row-main {
  flex: 1;
  min-width: 0;
}

.todo-row-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  display: block;
}

.todo-row-done .todo-row-title {
  text-decoration: line-through;
}

.todo-row-meta {
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  display: flex;
}

.todo-priority-pill {
  text-transform: uppercase;
  letter-spacing: .03em;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 600;
}

.todo-priority-low {
  color: var(--minor);
  background: #f3f4f6;
}

.todo-priority-medium {
  color: #92400e;
  background: #fef3c7;
}

.todo-priority-high {
  color: var(--critical);
  background: #fee2e2;
}

.todo-row-actions {
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  display: flex;
}

.todo-status-select-page, .todo-assignee-select-page {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 12px;
}

.todo-delete-btn {
  width: 28px;
  height: 28px;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 6px;
  justify-content: center;
  align-items: center;
  transition: all .15s;
  display: flex;
}

.todo-delete-btn:hover {
  color: var(--critical);
  background: #fef2f2;
}

.history-dropdown-wrapper {
  display: inline-block;
  position: relative;
}

.history-dropdown {
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 340px;
  max-height: 320px;
  margin-top: 4px;
  position: absolute;
  top: 100%;
  left: 0;
  overflow-y: auto;
  box-shadow: 0 4px 16px #0000001f;
}

.history-entry {
  border-bottom: 1px solid var(--border);
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  display: flex;
}

.history-entry:last-child {
  border-bottom: none;
}

.history-message {
  color: var(--text);
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  overflow: hidden;
}

.history-date {
  color: var(--text-muted);
  font-size: 11px;
}

.project-layout {
  height: calc(100vh - var(--nav-height));
  display: flex;
  overflow: hidden;
}

.project-layout-left {
  background: var(--surface);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  transition: width .15s;
  overflow: hidden auto;
}

.project-layout-left.collapsed {
  border-right: none;
  overflow: hidden;
  width: 0 !important;
}

.project-layout-center {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}

.project-layout-right {
  background: var(--surface);
  border-left: 1px solid var(--border);
  flex-direction: column;
  flex-shrink: 0;
  transition: width .15s;
  display: flex;
  overflow: hidden;
}

.project-layout-right.collapsed {
  border-left: none;
  overflow: hidden;
  width: 0 !important;
}

.resize-handle {
  cursor: col-resize;
  z-index: 10;
  background: none;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  width: 6px;
  display: flex;
  position: relative;
}

.resize-handle:hover {
  background: var(--accent);
  opacity: .2;
}

.collapse-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  width: 16px;
  height: 32px;
  color: var(--text-muted);
  opacity: 0;
  z-index: 11;
  border-radius: 4px;
  justify-content: center;
  align-items: center;
  font-size: 8px;
  transition: opacity .15s;
  display: flex;
  position: absolute;
}

.resize-handle:hover .collapse-btn, .collapse-btn:hover {
  opacity: 1;
}

.section-index {
  padding: 12px 0;
}

.section-index-header {
  justify-content: space-between;
  align-items: center;
  padding: 0 16px 8px;
  display: flex;
}

.section-index-header h3 {
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.section-index-count {
  color: var(--text-muted);
  background: var(--bg);
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 11px;
}

.section-index-list {
  flex-direction: column;
  display: flex;
}

.section-index-item {
  color: var(--text);
  cursor: pointer;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 13px;
  text-decoration: none;
  transition: background .1s;
  display: flex;
}

.section-index-item:hover {
  background: var(--bg);
  text-decoration: none;
}

.section-index-item.active {
  color: var(--accent);
  background: #eef2ff;
  font-weight: 500;
}

.section-index-num {
  color: var(--text-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 20px;
  font-size: 11px;
}

.section-index-title {
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  overflow: hidden;
}

.section-index-pages {
  color: var(--text-muted);
  font-size: 11px;
}

.section-index-footer {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding: 12px 16px;
}

.section-index-downloads {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  display: flex;
}

.section-index-downloads-label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-size: 11px;
}

.section-index-downloads-btns {
  gap: 4px;
  display: flex;
}

.section-index-dl-btn {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 11px;
  text-decoration: none;
}

.section-index-dl-btn:hover {
  background: var(--accent);
  color: #fff;
}

.section-index-total {
  color: var(--text-muted);
  text-align: center;
  font-size: 12px;
}

.section-layout-no-nav {
  display: block;
}

.section-layout-no-nav .section-content {
  width: 100%;
  max-width: 100%;
}

.workflow-tracker {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding: 12px 0;
}

.workflow-tracker-header {
  justify-content: space-between;
  align-items: center;
  padding: 0 16px 8px;
  display: flex;
}

.workflow-tracker-header h3 {
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.workflow-progress {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.workflow-progress-bar {
  background: var(--border);
  border-radius: 2px;
  height: 3px;
  margin: 0 16px 8px;
  overflow: hidden;
}

.workflow-progress-fill {
  background: var(--success);
  border-radius: 2px;
  height: 100%;
  transition: width .3s;
}

.workflow-phase {
  margin-bottom: 2px;
}

.workflow-phase-header {
  cursor: pointer;
  width: 100%;
  color: var(--text);
  text-align: left;
  background: none;
  border: none;
  align-items: center;
  gap: 6px;
  padding: 4px 16px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
}

.workflow-phase-header:hover {
  background: var(--bg);
}

.workflow-phase-arrow {
  color: var(--text-muted);
  width: 10px;
  font-size: 8px;
}

.workflow-phase-label {
  flex: 1;
}

.workflow-phase-count {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 400;
}

.workflow-steps {
  padding: 2px 0 4px;
}

.workflow-step {
  align-items: flex-start;
  gap: 8px;
  padding: 3px 16px 3px 32px;
  font-size: 12px;
  display: flex;
}

.workflow-step.in_progress {
  background: #eef2ff;
}

.workflow-step-icon {
  flex-shrink: 0;
  font-size: 10px;
  line-height: 18px;
}

.workflow-step-content {
  flex: 1;
  min-width: 0;
}

.workflow-step-title {
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  display: block;
  overflow: hidden;
}

.workflow-step.complete .workflow-step-title {
  color: var(--text-muted);
}

.workflow-step-summary {
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  display: block;
  overflow: hidden;
}

.right-panel-accordion {
  background: var(--bg);
  flex-direction: column;
  height: 100%;
  display: flex;
  overflow: hidden;
}

.accordion-section {
  border-bottom: 1px solid var(--border);
  flex-direction: column;
  min-height: 0;
  display: flex;
}

.accordion-section:last-child {
  border-bottom: none;
}

.accordion-section-active {
  flex: 1;
  overflow: hidden;
}

.accordion-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  flex-shrink: 0;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  transition: background .1s;
  display: flex;
}

.accordion-header:hover {
  background: var(--bg);
}

.accordion-header:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.accordion-header-left {
  color: var(--text);
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
}

.accordion-header-label {
  white-space: nowrap;
}

.accordion-header-badge {
  background: var(--accent);
  color: #fff;
  text-align: center;
  border-radius: 10px;
  min-width: 20px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.accordion-chevron {
  color: var(--text-muted);
  font-size: 8px;
  transition: transform .15s;
  transform: rotate(-90deg);
}

.accordion-chevron-open {
  transform: rotate(0);
}

.accordion-body {
  flex-direction: column;
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.accordion-body .chat-panel {
  height: 100%;
}

.accordion-body .issue-sidebar {
  border-left: none;
  width: 100%;
  height: 100%;
  position: static;
  overflow-y: auto;
}

.chat-panel {
  background: var(--bg);
  flex-direction: column;
  height: 100%;
  display: flex;
}

.chat-panel-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  display: flex;
}

.chat-panel-title {
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
}

.chat-panel-icon {
  color: var(--accent);
  font-size: 10px;
}

.chat-status {
  color: var(--text-muted);
  background: var(--border);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px;
}

.chat-status.connected {
  color: var(--success);
  background: #dcfce7;
}

.chat-messages {
  flex-direction: column;
  flex: 1;
  gap: 12px;
  padding: 12px;
  display: flex;
  overflow-y: auto;
}

.chat-message {
  gap: 8px;
  max-width: 100%;
  display: flex;
}

.chat-message-user {
  flex-direction: row-reverse;
}

.chat-message-avatar {
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  width: 28px;
  height: 28px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
}

.chat-message-body {
  min-width: 0;
  max-width: 85%;
}

.chat-message-text {
  word-wrap: break-word;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.5;
}

.chat-message-user .chat-message-text {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-message-assistant .chat-message-text {
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-message-system {
  text-align: center;
  color: var(--text-muted);
  padding: 8px;
  font-size: 12px;
  font-style: italic;
}

.chat-markdown {
  font-size: 13px;
  line-height: 1.5;
}

.chat-markdown p {
  margin: 0 0 8px;
}

.chat-markdown p:last-child {
  margin-bottom: 0;
}

.chat-markdown code {
  background: var(--bg);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 12px;
}

.chat-markdown pre {
  color: #e2e8f0;
  background: #1e293b;
  border-radius: 6px;
  margin: 4px 0;
  padding: 8px;
  font-size: 12px;
  overflow-x: auto;
}

.chat-markdown ul, .chat-markdown ol {
  margin: 4px 0;
  padding-left: 20px;
}

.chat-markdown li {
  margin: 2px 0;
}

.chat-markdown strong {
  font-weight: 600;
}

.chat-markdown h1, .chat-markdown h2, .chat-markdown h3 {
  margin: 8px 0 4px;
  font-size: 14px;
  font-weight: 600;
}

.chat-typing-indicator {
  gap: 3px;
  padding: 4px 0;
  display: inline-flex;
}

.chat-typing-indicator span {
  background: var(--text-muted);
  border-radius: 50%;
  width: 6px;
  height: 6px;
  animation: 1.2s ease-in-out infinite typing-bounce;
}

.chat-typing-indicator span:nth-child(2) {
  animation-delay: .2s;
}

.chat-typing-indicator span:nth-child(3) {
  animation-delay: .4s;
}

@keyframes typing-bounce {
  0%, 80%, 100% {
    opacity: .4;
    transform: scale(.6);
  }

  40% {
    opacity: 1;
    transform: scale(1);
  }
}

.chat-tool-call {
  color: var(--text-muted);
  background: var(--bg);
  border-radius: 4px;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 4px 8px;
  font-size: 11px;
  display: flex;
}

.chat-tool-call.running .chat-tool-icon {
  animation: 1s linear infinite chat-tool-spin;
}

@keyframes chat-tool-spin {
  from {
    transform: rotate(0);
  }

  to {
    transform: rotate(360deg);
  }
}

.chat-tool-call.complete .chat-tool-icon {
  color: var(--success);
}

.chat-tool-call.error .chat-tool-icon {
  color: var(--critical);
}

.chat-tool-name {
  font-family: SF Mono, monospace;
}

.chat-approval {
  background: #fefce8;
  border: 1px solid #fde047;
  border-radius: 8px;
  margin-top: 8px;
  padding: 12px;
}

.chat-approval-prompt {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
}

.chat-approval-buttons {
  gap: 8px;
  display: flex;
}

.chat-approval-btn {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
}

.chat-approval-btn.approve {
  background: var(--success);
  color: #fff;
}

.chat-approval-btn.reject {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.chat-approval-btn:hover {
  opacity: .9;
}

.chat-input-wrapper {
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  padding: 12px;
  position: relative;
}

.chat-input-wrapper.drag-over {
  background: #eef2ff;
}

.chat-file-list {
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  display: flex;
}

.chat-file-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 12px;
  display: flex;
}

.chat-file-icon {
  font-size: 14px;
}

.chat-file-name {
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
}

.chat-file-remove {
  cursor: pointer;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0 2px;
  font-size: 14px;
  line-height: 1;
}

.chat-file-remove:hover {
  color: var(--critical);
}

.chat-input-row {
  align-items: flex-end;
  gap: 8px;
  display: flex;
}

.chat-attach-btn, .chat-send-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  width: 36px;
  height: 36px;
  color: var(--text-muted);
  border-radius: 8px;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  display: flex;
}

.chat-attach-btn:hover, .chat-send-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.chat-send-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.chat-input {
  border: 1px solid var(--border);
  resize: none;
  background: var(--bg);
  border-radius: 8px;
  flex: 1;
  min-height: 36px;
  max-height: 120px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  overflow-y: auto;
}

.chat-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px #2563eb1a;
}

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

.chat-drop-overlay {
  border: 2px dashed var(--accent);
  z-index: 10;
  background: #2563eb1a;
  border-radius: 8px;
  justify-content: center;
  align-items: center;
  display: flex;
  position: absolute;
  inset: 0;
}

.chat-drop-text {
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
}

.index-manager {
  max-width: 800px;
  margin: 0 auto;
}

.index-manager-header {
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  display: flex;
}

.index-manager-header h2 {
  flex: 1 0 100%;
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.index-manager-desc {
  color: var(--text-secondary);
  flex: 1;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.index-manager-error {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 16px;
  font-size: 14px;
  display: flex;
}

.index-manager-error-dismiss {
  color: #991b1b;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 13px;
  text-decoration: underline;
}

.index-create-form {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  gap: 8px;
  margin-bottom: 24px;
  padding: 16px;
  display: flex;
}

.index-create-input {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 6px;
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
}

.index-create-input:focus {
  border-color: var(--accent);
  outline: none;
}

.index-loading, .index-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 16px;
  font-size: 14px;
}

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

.index-card {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 8px;
  padding: 16px;
}

.index-card-header {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  display: flex;
}

.index-card-name {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.index-card-status {
  text-transform: uppercase;
  letter-spacing: .5px;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
}

.index-card-status.active {
  color: #166534;
  background: #dcfce7;
}

.index-card-meta {
  color: var(--text-muted);
  gap: 16px;
  margin-bottom: 12px;
  font-size: 13px;
  display: flex;
}

.index-card-actions {
  margin-bottom: 8px;
}

.index-card-id {
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-mono);
  text-overflow: ellipsis;
  overflow: hidden;
}

.issue-highlight {
  background: var(--highlight);
  cursor: pointer;
  border-bottom: 2px solid #facc15;
  position: relative;
}

.issue-highlight:hover {
  background: #fde68a;
}

.issue-highlight-fuzzy {
  opacity: .85;
  border-bottom-style: dashed;
}

.issue-sidebar {
  width: var(--sidebar-width);
  border-left: 1px solid var(--border);
  background: var(--surface);
  height: calc(100vh - var(--nav-height));
  top: var(--nav-height);
  padding: 8px 16px;
  position: sticky;
  overflow-y: auto;
}

.issue-sidebar-header {
  align-items: center;
  gap: 8px;
  padding: 8px 0 12px;
  display: flex;
}

.issue-sidebar-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.issue-sidebar-count {
  background: var(--bg);
  color: var(--text-muted);
  text-align: center;
  border-radius: 10px;
  min-width: 20px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
}

.issue-sidebar-empty {
  color: var(--text-muted);
  background: var(--bg);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 13px;
}

.issue-group {
  margin-bottom: 16px;
}

.issue-group-label {
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
}

.issue-card {
  border: 1px solid var(--border);
  cursor: pointer;
  border-radius: 6px;
  margin-bottom: 6px;
  padding: 10px 12px;
  font-size: 13px;
  transition: background .1s;
}

.issue-card:hover {
  background: var(--bg);
}

.issue-card-resolved {
  opacity: .5;
}

.issue-card-header {
  align-items: flex-start;
  gap: 8px;
  display: flex;
}

.issue-status-icon {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 12px;
}

.issue-status-open {
  color: var(--accent);
}

.issue-status-in_progress {
  color: var(--major);
}

.issue-status-needs_review {
  color: #7c3aed;
}

.issue-status-resolved {
  color: var(--success);
}

.issue-status-reopened {
  color: var(--major);
}

.issue-status-closed {
  color: var(--minor);
}

.issue-status-blocked {
  color: var(--critical);
}

.issue-card-title {
  flex: 1;
  font-weight: 500;
  line-height: 1.4;
}

.issue-card-title-resolved {
  text-decoration: line-through;
}

.issue-priority-dot {
  border-radius: 50%;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 6px;
}

.issue-card-desc {
  color: var(--text-muted);
  margin: 4px 0 4px 20px;
  font-size: 12px;
  line-height: 1.4;
}

.issue-card-anchor {
  background: var(--highlight);
  border-radius: 2px;
  margin: 4px 0 4px 20px;
  padding: 2px 4px;
  font-size: 12px;
  font-style: italic;
  display: block;
}

.issue-card-meta {
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding-left: 20px;
  display: flex;
}

.issue-card-time {
  color: var(--text-muted);
  font-size: 11px;
}

.issue-assignee-badge {
  color: var(--accent);
  background: #eff6ff;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 500;
}

.issue-assignee-agent {
  color: #6d28d9;
  background: #ede9fe;
}

.issue-label {
  color: var(--minor);
  background: #f3f4f6;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 10px;
}

.issue-comment-count {
  color: var(--text-muted);
  align-items: center;
  gap: 3px;
  font-size: 11px;
  display: flex;
}

.issue-card-labels {
  gap: 4px;
  display: flex;
}

.issue-card-wrapper {
  position: relative;
}

.issue-card-actions {
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 4px 12px 8px;
  display: flex;
}

.btn-xs {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
}

.btn-xs:hover {
  background: var(--bg);
}

.btn-xs.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

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

.issue-thread-toggle {
  align-items: center;
  gap: 3px;
  display: flex;
}

.issue-status-select {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
  padding: 1px 4px;
  font-size: 11px;
}

.issue-thread {
  border-top: 1px solid var(--border);
  margin: 0 12px 8px;
  padding-top: 8px;
}

.issue-thread-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 8px;
  font-size: 12px;
}

.issue-thread-comment {
  border-bottom: 1px solid var(--border);
  padding: 6px 0;
}

.issue-thread-comment:last-of-type {
  border-bottom: none;
}

.issue-thread-agent {
  background: #faf5ff;
  border-radius: 6px;
  margin-bottom: 4px;
  padding: 6px 8px;
}

.issue-thread-author {
  color: var(--text-muted);
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
}

.issue-thread-status-change {
  background: var(--bg);
  border-radius: 8px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 400;
}

.issue-thread-body {
  font-size: 13px;
  line-height: 1.5;
}

.issue-thread-input {
  gap: 6px;
  margin-top: 8px;
  display: flex;
}

.issue-thread-input input {
  border: 1px solid var(--border);
  border-radius: 4px;
  flex: 1;
  padding: 5px 8px;
  font-family: inherit;
  font-size: 12px;
}

.issue-create-form {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 8px;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding: 12px;
  display: flex;
}

.issue-form-input {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 6px;
  width: 100%;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 13px;
}

.issue-form-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px #2563eb1a;
}

.issue-form-textarea {
  border: 1px solid var(--border);
  background: var(--surface);
  resize: vertical;
  border-radius: 6px;
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 13px;
}

.issue-form-fields {
  align-items: center;
  gap: 6px;
  display: flex;
}

.issue-form-select {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  flex: 1;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 12px;
}

.issue-form-toggle {
  align-items: center;
  display: flex;
}

.issue-form-toggle-label {
  color: var(--text-muted);
  cursor: pointer;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  display: flex;
}

.issue-form-toggle-label input {
  cursor: pointer;
}

.issue-form-actions {
  justify-content: flex-end;
  gap: 6px;
  display: flex;
}

.issue-add-btn {
  border: 2px dashed var(--border);
  width: 100%;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border-radius: 8px;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  display: flex;
}

.issue-add-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: #f8faff;
}

.issues-header {
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  display: flex;
}

.issues-header .page-title {
  margin-bottom: 0;
}

.issues-header-actions {
  align-items: center;
  gap: 12px;
  display: flex;
}

.issues-filter {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  gap: 2px;
  padding: 3px;
  display: flex;
}

.issues-filter-btn {
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 6px;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  display: flex;
}

.issues-filter-btn:hover {
  color: var(--text);
}

.issues-filter-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px #00000014;
}

.issues-filter-count {
  background: var(--bg);
  color: var(--text-muted);
  text-align: center;
  border-radius: 10px;
  min-width: 18px;
  padding: 0 6px;
  font-size: 11px;
}

.issues-filter-active .issues-filter-count {
  color: var(--accent);
  background: #dbeafe;
}

.issue-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 24px;
  font-size: 14px;
}

.issue-list {
  flex-direction: column;
  gap: 0;
  display: flex;
}

.issue-section-group {
  margin-bottom: 24px;
}

.issue-section-label {
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
}

.issue-section-label a {
  text-decoration: none;
}

.issue-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  padding: 12px 16px;
  transition: border-color .15s, box-shadow .15s;
  display: flex;
}

.issue-row:hover {
  border-color: #c5c5c5;
  box-shadow: 0 1px 4px #0000000a;
}

.issue-row-resolved {
  opacity: .5;
}

.issue-row-main {
  flex: 1;
  min-width: 0;
}

.issue-row-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  display: block;
}

.issue-row-resolved .issue-row-title {
  text-decoration: line-through;
}

.issue-row-meta {
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  display: flex;
}

.issue-priority-pill {
  text-transform: uppercase;
  letter-spacing: .03em;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 600;
}

.issue-priority-low {
  color: var(--minor);
  background: #f3f4f6;
}

.issue-priority-medium {
  color: #92400e;
  background: #fef3c7;
}

.issue-priority-high {
  color: #ea580c;
  background: #fee2e2;
}

.issue-priority-critical {
  color: var(--critical);
  background: #fee2e2;
}

.issue-row-actions {
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  display: flex;
}

.issue-status-select-page, .issue-assignee-select-page {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 12px;
}

.issue-delete-btn {
  width: 28px;
  height: 28px;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 6px;
  justify-content: center;
  align-items: center;
  transition: all .15s;
  display: flex;
}

.issue-delete-btn:hover {
  color: var(--critical);
  background: #fef2f2;
}

.badge-open {
  color: var(--accent);
  background: #dbeafe;
}

.badge-in_progress {
  color: #92400e;
  background: #fef3c7;
}

.badge-needs_review {
  color: #6d28d9;
  background: #ede9fe;
}

.badge-resolved {
  color: var(--success);
  background: #dcfce7;
}

.badge-reopened {
  color: #92400e;
  background: #fef3c7;
}

.badge-closed {
  color: var(--minor);
  background: #f3f4f6;
}

.badge-blocked {
  color: var(--critical);
  background: #fee2e2;
}

.badge-high {
  color: #ea580c;
  background: #fee2e2;
}

.badge-low {
  color: var(--minor);
  background: #f3f4f6;
}

.badge-medium {
  color: #92400e;
  background: #fef3c7;
}

/*# sourceMappingURL=tgos-bidforge-v2_app_globals_9cca7dec.css.map*/