:root {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #111827;
  background-color: #fff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

input {
  font: inherit;
}

/* --- Boot / maintenance --- */

.boot-container {
  max-width: 780px;
  margin: 40px auto;
  padding: 0 16px;
}

.boot-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
}

.maintenance-banner {
  padding: 12px 14px;
  border-bottom: 1px solid #b91c1c;
  background: #ef4444;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-align: center;
}

/* --- Shell --- */

.shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.rail {
  width: 64px;
  flex-shrink: 0;
  border-right: 1px solid #f3f4f6;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.rail-btn {
  width: 100%;
  padding: 14px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #4b5563;
  font-size: 9px;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.rail-btn:hover {
  background: #f9fafb;
  color: #111827;
}

.rail-btn.active {
  color: #2563eb;
}

.rail-more {
  padding: 16px 0;
  display: flex;
  justify-content: center;
  color: #4b5563;
}

.rail-more:hover {
  background: #f9fafb;
}

.rail-nav {
  flex: 1;
}

.rail-foot {
  margin-top: auto;
  border-top: 1px solid #f3f4f6;
}

/* --- Settings popover (gear icon quick menu) --- */

.settings-popover {
  position: fixed;
  left: 70px;
  bottom: 12px;
  width: 240px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.16);
  padding: 8px;
  z-index: 50;
}

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

.settings-popover-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 6px;
  font-size: 13px;
  color: #111827;
}

.settings-popover-divider {
  height: 1px;
  background: #f3f4f6;
  margin: 6px 0;
}

.settings-popover-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #111827;
  cursor: pointer;
}

.settings-popover-link:hover {
  background: #f9fafb;
}

/* --- Settings view: category picker + content --- */

.settings-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.settings-nav {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: left;
  color: #374151;
  cursor: pointer;
}

.settings-nav-item:hover {
  background: #f9fafb;
}

.settings-nav-item.active {
  background: #eff6ff;
  color: #1d4ed8;
}

.settings-nav-icon {
  flex-shrink: 0;
  display: flex;
}

.settings-nav-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.settings-nav-label {
  font-size: 13px;
  font-weight: 600;
}

.settings-nav-desc {
  font-size: 11px;
  color: #9ca3af;
}

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

.settings-empty {
  padding: 32px 16px;
  text-align: center;
}

/* --- Drawer --- */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.35);
  z-index: 40;
}

.drawer-backdrop[hidden],
.modal-backdrop[hidden] {
  display: none;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.12);
  z-index: 41;
  padding: 16px;
  overflow-y: auto;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.drawer-title {
  font-size: 14px;
  font-weight: 800;
}

.drawer-section {
  margin-bottom: 20px;
}

.drawer-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 8px;
}

.drawer-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  text-align: left;
}

.drawer-item:hover {
  background: #f3f4f6;
  color: #111827;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 8px;
  color: #6b7280;
}

.icon-btn:hover {
  background: #f3f4f6;
  color: #111827;
}

/* --- Main column --- */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 56px;
  flex-shrink: 0;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: #fff;
  z-index: 20;
}

.repo-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.logo-mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crumb-owner {
  color: #6b7280;
}

.pill-g {
  background: #fef3c7;
  color: #b45309;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.searchbox {
  position: relative;
  flex: 1;
  max-width: 640px;
}

.searchbox-inner {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  display: flex;
}

.search-input {
  width: 100%;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 7px 44px 7px 36px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: #fff;
}

.search-go {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-go:hover {
  background: #dc2626;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.12);
  padding: 8px;
  z-index: 30;
  max-height: 380px;
  overflow-y: auto;
}

.search-dropdown[hidden] {
  display: none;
}

.search-hint {
  padding: 8px 10px;
  font-size: 12px;
  color: #6b7280;
}

.search-result {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: left;
}

.search-result:hover,
.search-result.selected {
  background: #f3f4f6;
}

.search-result-kind {
  color: #6b7280;
  display: flex;
  flex-shrink: 0;
}

.search-result-body {
  min-width: 0;
  flex: 1;
}

.search-result-title {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-detail {
  font-size: 11px;
  color: #9ca3af;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-score {
  font-size: 10px;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.search-meta {
  border-top: 1px solid #f3f4f6;
  margin-top: 6px;
  padding: 8px 10px 4px;
  font-size: 10px;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  transition: background-color 0.15s ease;
}

.btn:hover {
  background: #f9fafb;
}

.btn-round {
  border: 0;
  border-radius: 999px;
  padding: 6px 14px;
}

.btn-round:hover {
  background: #f3f4f6;
}

.btn-fill {
  background: #f3f4f6;
  border: 0;
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 600;
  color: #111827;
}

.btn-fill:hover {
  background: #e5e7eb;
}

.btn-dark {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.btn-dark:hover {
  background: #1f2937;
}

.btn-blue-outline {
  border-color: #bfdbfe;
  color: #2563eb;
}

.btn-blue-outline:hover {
  background: #eff6ff;
}

.btn-group {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.btn-group .btn {
  border: 0;
  border-radius: 0;
  border-right: 1px solid #e5e7eb;
}

.btn-group .btn:last-child {
  border-right: 0;
}

.count {
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}

/* --- Content / repo nav --- */

.content {
  flex: 1;
  overflow-y: auto;
  background: #fff;
}

.repo-nav {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid #f3f4f6;
  padding: 24px 48px 0;
  z-index: 10;
}

.repo-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
}

.tab:hover {
  color: #111827;
}

.tab.active {
  color: #2563eb;
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: #2563eb;
}

.tab-count {
  background: #f3f4f6;
  color: #4b5563;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

.repo-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.layout {
  display: flex;
  gap: 32px;
  padding: 32px 48px 48px;
  align-items: flex-start;
}

.col-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 24px;
}

.col-side {
  width: 300px;
  flex-shrink: 0;
  display: grid;
  gap: 28px;
}

/* --- Code tab --- */

.hero {
  position: relative;
  height: 168px;
  border-radius: 16px;
  border: 1px solid #dbeafe;
  background: linear-gradient(90deg, #eff6ff, #eef2ff);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
}

.hero-body {
  position: relative;
  z-index: 1;
}

.hero-cta {
  background: #ef4444;
  color: #fff;
  font-weight: 800;
  padding: 10px 32px;
  border-radius: 8px;
  margin-bottom: 14px;
}

.hero-cta:hover {
  background: #dc2626;
}

.hero-sub {
  margin: 0;
  color: #4b5563;
  font-weight: 500;
  font-size: 14px;
}

.hero-shape-a {
  position: absolute;
  top: 0;
  right: -80px;
  width: 240px;
  height: 100%;
  background: rgba(191, 219, 254, 0.35);
  transform: skewX(-12deg);
}

.hero-shape-b {
  position: absolute;
  bottom: -60px;
  left: -60px;
  width: 140px;
  height: 140px;
  border-radius: 999px;
  background: rgba(199, 210, 254, 0.5);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.field-inline {
  position: relative;
}

.field-inline .search-icon {
  left: 10px;
}

.input-sm {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 12px 6px 32px;
  font-size: 13px;
  outline: none;
  background: #fff;
}

.input-sm:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.input-w-lg {
  width: 320px;
}

.panel {
  border: 1px solid #f3f4f6;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

.panel-head {
  background: #f9fafb;
  border-bottom: 1px solid #f3f4f6;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  color: #6b7280;
  flex-wrap: wrap;
}

.panel-head-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-head-group.wide {
  gap: 24px;
}

.avatar {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-round {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fb923c;
  font-size: 10px;
}

.strong {
  color: #111827;
  font-weight: 600;
}

.link {
  color: #2563eb;
}

.link:hover {
  text-decoration: underline;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.inline-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  text-align: left;
  font-weight: 500;
  color: #9ca3af;
  padding: 10px 16px;
  border-bottom: 1px solid #f9fafb;
  font-size: 12px;
}

.table td {
  padding: 10px 16px;
  border-top: 1px solid #f9fafb;
  vertical-align: middle;
}

.table tbody tr:hover {
  background: #f9fafb;
}

.table .right {
  text-align: right;
  white-space: nowrap;
  color: #9ca3af;
}

.cell-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.folder-icon {
  color: #60a5fa;
}

.file-icon {
  color: #9ca3af;
}

.cell-commit {
  color: #6b7280;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- List rows (issues / PRs / pipeline / discussions) --- */

.list-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-top: 1px solid #f9fafb;
  width: 100%;
  text-align: left;
}

.list-row:first-child {
  border-top: 0;
}

.list-row:hover {
  background: #f9fafb;
}

.list-row-body {
  flex: 1;
  min-width: 0;
}

.list-row-title {
  margin: 0 0 5px;
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.list-row:hover .list-row-title {
  color: #2563eb;
}

.list-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #9ca3af;
  flex-wrap: wrap;
}

.list-row-side {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: #9ca3af;
  flex-shrink: 0;
}

.state-open {
  color: #22c55e;
  flex-shrink: 0;
  margin-top: 2px;
}

.state-merged {
  color: #a855f7;
  flex-shrink: 0;
  margin-top: 2px;
}

.state-closed {
  color: #ef4444;
  flex-shrink: 0;
  margin-top: 2px;
}

.countdown {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #2563eb;
  white-space: nowrap;
}

.countdown.ended {
  color: #9ca3af;
  font-weight: 500;
}

.badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.chip {
  padding: 3px 10px;
  border-radius: 999px;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  color: #6b7280;
  font-size: 11px;
}

.add-count {
  color: #16a34a;
  font-weight: 600;
}

.del-count {
  color: #dc2626;
  font-weight: 600;
}

.flag-group {
  margin-bottom: 14px;
}

.flag-group:last-child {
  margin-bottom: 0;
}

.flag-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9ca3af;
  padding: 10px 0 6px;
}

.flag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
}

.flag-row:last-child {
  border-bottom: 0;
}

.flag-row-desc {
  font-size: 12px;
  margin-top: 2px;
}

.flag-row .chip {
  color: #16a34a;
  border-color: #dcfce7;
  background: #f0fdf4;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.flag-row .chip.flag-off {
  color: #dc2626;
  border-color: #fee2e2;
  background: #fef2f2;
}

.subnav {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.subnav-btn {
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  padding-bottom: 2px;
}

.subnav-btn.active {
  color: #111827;
  font-weight: 700;
  border-bottom: 2px solid #2563eb;
}

.subnav-count {
  color: #9ca3af;
  font-weight: 400;
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}

.sorters {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: #6b7280;
  flex-wrap: wrap;
}

.sorter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #6b7280;
}

.sorter:hover {
  color: #111827;
}

/* --- Diff viewer --- */

.diff-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: #f9fafb;
  border-bottom: 1px solid #f3f4f6;
  font-size: 12px;
  flex-wrap: wrap;
}

.diff-table {
  width: 100%;
  border-collapse: collapse;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
}

.diff-table td {
  padding: 0 10px;
  white-space: pre-wrap;
  word-break: break-word;
  vertical-align: top;
}

.diff-gutter {
  width: 48px;
  text-align: right;
  color: #9ca3af;
  user-select: none;
  background: #fcfcfd;
  border-right: 1px solid #f3f4f6;
  font-variant-numeric: tabular-nums;
}

.diff-sign {
  width: 20px;
  text-align: center;
  color: #6b7280;
  user-select: none;
}

.diff-row-add {
  background: #f0fdf4;
}

.diff-row-add .diff-sign {
  color: #16a34a;
}

.diff-row-del {
  background: #fef2f2;
}

.diff-row-del .diff-sign {
  color: #dc2626;
}

.diff-empty {
  padding: 24px 16px;
  font-size: 13px;
  color: #6b7280;
}

/* --- Analysis --- */

.stat-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.stat {
  border: 1px solid #f3f4f6;
  border-radius: 12px;
  padding: 14px;
}

.stat-label {
  font-size: 11px;
  color: #6b7280;
  margin: 0 0 6px;
}

.stat-value {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 12px;
}

.chart-bar {
  flex: 1;
  min-width: 2px;
  background: #93c5fd;
  border-radius: 3px 3px 0 0;
  transition: background-color 0.15s ease;
}

.chart-bar:hover {
  background: #2563eb;
}

.mini-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 96px;
  padding: 8px;
  background: #f9fafb;
  border-radius: 12px;
}

.mini-chart-bar {
  flex: 1;
  background: rgba(59, 130, 246, 0.25);
  border-radius: 3px 3px 0 0;
}

.author-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid #f9fafb;
  font-size: 13px;
}

.author-row:first-child {
  border-top: 0;
}

.author-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: #f3f4f6;
  overflow: hidden;
}

.author-bar-fill {
  height: 100%;
  background: #2563eb;
}

.author-count {
  font-variant-numeric: tabular-nums;
  color: #6b7280;
  font-size: 12px;
  width: 88px;
  text-align: right;
  flex-shrink: 0;
}

/* --- Side column --- */

.side-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 12px;
}

.side-text {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.6;
  margin: 0 0 12px;
}

.side-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.side-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  padding: 6px 0;
}

.side-link:hover {
  color: #2563eb;
}

.side-link .muted-icon {
  color: #9ca3af;
}

.trending-row {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 0;
  border-top: 1px solid #f3f4f6;
}

.trending-row:first-of-type {
  border-top: 0;
}

.trending-name {
  font-size: 12px;
  font-weight: 700;
  color: #2563eb;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trending-desc {
  font-size: 11px;
  color: #6b7280;
  margin: 4px 0 6px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.trending-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  color: #9ca3af;
}

/* --- Modal --- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.modal-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.25);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.modal-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: #6b7280;
}

.form {
  display: grid;
  gap: 14px;
}

.form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

.form input {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  outline: none;
}

.form input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.submit-btn {
  width: 100%;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  padding: 11px;
  border-radius: 8px;
}

.submit-btn:hover {
  background: #1d4ed8;
}

.modal-foot {
  margin: 16px 0 0;
  font-size: 12px;
  color: #6b7280;
  text-align: center;
}

.form-note {
  margin: 0;
  font-size: 12px;
  color: #b91c1c;
  min-height: 16px;
}

/* --- Runtime panel --- */

.runtime {
  border-top: 1px solid #f3f4f6;
  padding: 24px 48px 48px;
  background: #fcfcfd;
}

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

.runtime-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.runtime-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.runtime-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.runtime-output {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #eef2ff;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

#benchmark-output {
  background: #f3f4f6;
}

.bench-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bench-btn {
  background: #0f766e;
  color: #fff;
  border-color: #0f766e;
}

.bench-btn:hover {
  background: #115e59;
}

.io-input {
  width: 84px;
  padding-left: 10px;
}

.muted {
  color: #9ca3af;
}

@media (max-width: 1100px) {
  .layout {
    flex-direction: column;
    padding: 24px;
  }

  .col-side {
    width: 100%;
  }

  .repo-nav,
  .runtime {
    padding-left: 24px;
    padding-right: 24px;
  }
}
