:root {
  --bg: #0f172a;
  --panel: #111827;
  --muted: #94a3b8;
  --accent: #fbbf24;
  --accent-strong: #f59e0b;
  --surface: #1f2937;
  --border: #1e293b;
  --text: #e2e8f0;
  --radius: 12px;
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.3);
}

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

body {
  margin: 0;
  padding: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(251, 191, 36, 0.08), transparent 25%),
    radial-gradient(circle at 80% 0%, rgba(94, 234, 212, 0.08), transparent 30%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

h1,
h2,
h3 {
  margin: 0;
}

p {
  margin: 0 0 0.5rem;
  color: var(--muted);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease, text-shadow 0.15s ease;
}

a:hover {
  color: var(--accent-strong);
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.25);
}

.page {
  max-width: 1100px;
  margin: 0 auto 32px;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: flex-end;
  gap: 16px;
  padding: 6px 20px 0;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(251, 191, 36, 0.45);
  z-index: 0;
}

.brand {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding-bottom: 0;
}
.brand-logo {
  display: block;
  height: 32px;
  width: auto;
}
.brand.brand-interactive {
  cursor: pointer;
  border-radius: 8px;
  padding: 4px 8px 8px;
  margin: -4px -8px 0;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.brand.brand-interactive:hover {
  background: rgba(251, 191, 36, 0.08);
}
.brand.brand-interactive:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.5);
}

.active-jobs-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 20px;
  width: min(460px, calc(100vw - 40px));
  max-height: min(70vh, 560px);
  overflow: auto;
  background: rgba(17, 24, 39, 0.98);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px;
  z-index: 20;
}
.active-jobs-popover h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}
.active-jobs-status {
  margin-bottom: 8px;
}
.active-jobs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(62vh, 540px);
  overflow-y: auto;
  padding-right: 4px;
}
.active-job-card {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.65);
}
.active-job-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.active-job-meta,
.active-job-updated,
.active-job-duration {
  margin: 0;
  font-size: 0.84rem;
}
.active-job-title-link {
  color: #93c5fd;
  text-decoration: none;
}
.active-job-title-link:hover {
  color: #bfdbfe;
  text-decoration: underline;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.8);
}

.tabstrip {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  justify-self: center;
  align-self: flex-end;
  padding: 6px 8px 0;
  margin-bottom: 0;
  z-index: 1;
}

.req-tabstrip {
  justify-content: flex-start;
  align-self: stretch;
  background: #0b0f18;
  border-radius: 12px 12px 0 0;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-top: none;
  margin-bottom: -1.5px;
  position: relative;
}

.req-tabstrip::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(251, 191, 36, 0.55);
}

.auth-links {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  justify-self: end;
  min-width: 140px;
  justify-content: flex-end;
}

.auth-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: color 0.1s ease, background 0.1s ease, border-color 0.1s ease, box-shadow 0.1s ease;
}

.auth-links a:hover {
  color: var(--text);
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.08);
}

.kv-list {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px 16px;
  font-size: 0.95rem;
}

.kv-key {
  color: var(--muted);
  font-weight: 600;
}

.kv-value {
  color: var(--text);
  word-break: break-word;
}

.is-hidden {
  display: none;
}

[hidden] {
  display: none !important;
}

.welcome-hero {
  margin-top: 48px;
  text-align: center;
  display: block;
}

.welcome-content {
  width: 100%;
  text-align: center;
}

.welcome-logo {
  width: 140px;
  height: auto;
  margin: 10px auto 6px;
  display: block;
}

.about-logo {
  width: 140px;
  height: auto;
}

.welcome-actions {
  margin-top: 16px;
}

.welcome-hero .lede {
  margin: 0 auto;
}

.about-hero {
  display: flex;
  align-items: center;
  gap: 24px;
}

.about-eyebrow {
  margin-bottom: 12px;
}

.about-logo {
  width: 140px;
  max-width: 30vw;
  height: auto;
  flex-shrink: 0;
}

.about-text .lede {
  max-width: 560px;
}

.tabstrip a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 16px 9px;
  border-radius: 10px 10px 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  background: rgba(17, 24, 39, 0.6);
  transform: translateY(-1px);
  box-shadow: inset 0 -1px rgba(251, 191, 36, 0.15);
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.req-tabstrip a {
  background: transparent;
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.12);
  box-shadow: none;
  padding: 8px 14px 7px;
  border-radius: 8px 8px 0 0;
}

.req-tabstrip a:hover {
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.2);
}

.req-tabstrip a.active {
  background: #111827;
  border-color: rgba(148, 163, 184, 0.35);
  color: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.25);
  z-index: 1;
}

.req-tabstrip a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: #111827;
}

.tabstrip a:hover {
  color: var(--text);
  background: rgba(31, 41, 55, 0.9);
}

.tabstrip a.active {
  z-index: 2;
  color: var(--text);
  background: var(--surface);
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.25);
  transform: translateY(0);
}

.api-config {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  box-shadow: var(--shadow);
}

.api-config input {
  width: 220px;
}

.hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 32px 0 12px;
  gap: 24px;
}

.hero h1 {
  font-size: 28px;
  letter-spacing: -0.02em;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  margin-bottom: 8px;
}

.lede {
  max-width: 620px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.context-scroll-panel {
  max-height: clamp(220px, 38vh, 360px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

#req-tabs-panel {
  width: 100%;
}

.panel.panel-muted {
  background: #0b0f18;
  border: 1px dashed var(--border);
  box-shadow: none;
  font-size: 14px;
}

.panel.panel-muted h2 {
  font-size: 18px;
  color: var(--muted);
}

.panel.panel-muted .item {
  background: #0b0f18;
  border-color: var(--border);
}

.panel.panel-muted .item:hover {
  border-color: var(--accent);
  transform: none;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.tab-panel.is-active {
  display: flex;
}

.enhancement-item.collapsed .enhancement-body,
.enhancement-item.collapsed .item-actions {
  display: none;
}

.tab-panel-header {
  display: flex;
  border-bottom: 1px solid rgba(251, 191, 36, 0.55);
  padding-bottom: 0px;
}

.graph-container {
  width: 100%;
  min-height: 640px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0b0f18;
  display: flex;
  align-items: center;
  justify-content: center;
}

.graph-container > p {
  margin: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header.panel-header-tree {
  align-items: flex-start;
  gap: 16px;
}

.panel-header.panel-header-tree .taxonomy-tree {
  flex: 1;
  min-width: 0;
}

.panel-header.panel-header-tree .panel-actions {
  align-self: flex-start;
}

#req-tabs-panel .req-tabs-header {
  border-bottom: 1px solid rgba(251, 191, 36, 0.55);
  padding-bottom: 0;
  align-items: flex-end;
  position: relative;
  width: 100%;
}

#req-tabs-panel .req-tabs-header::after {
  content: "";
  position: absolute;
  left: -20px;
  right: -20px;
  bottom: -1px;
  height: 1px;
  background: rgba(251, 191, 36, 0.55);
}

.panel-meta {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.panel-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

#project-detail-panel {
  position: relative;
}

#project-detail-panel .panel-header,
#project-detail-panel #project-description {
  padding-right: 180px;
}

#project-detail-panel .project-detail-floating-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

#project-detail-panel .project-detail-floating-actions a.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  border-radius: 10px;
}

#project-detail-panel .project-detail-floating-actions a.small {
  padding: 6px 10px;
  font-size: 13px;
}

.panel-actions.align-right {
  margin-left: auto;
  justify-content: flex-end;
}

.panel-actions .filters {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-right: 8px;
  border-right: 1px solid var(--border);
  margin-right: 8px;
}

#req-tabs-panel .panel-actions .filters {
  border-right: none;
  padding-right: 0;
  margin-right: 0;
}

.status-filters {
  display: flex;
  gap: 6px;
  align-items: center;
}

.panel-actions input[type="search"] {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0b1220;
  color: var(--text);
}

.panel-actions button.active {
  border-color: var(--accent);
  color: var(--accent);
}

#epic-status-toggle button[data-status="final"].active {
  border-color: rgba(74, 222, 128, 0.6);
  color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
}

#design-status-toggle button[data-status="final"].active {
  border-color: rgba(74, 222, 128, 0.6);
  color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
}

#constraint-status-toggle button[data-status="final"].active {
  border-color: rgba(74, 222, 128, 0.6);
  color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
}

#design-global-toggle button[data-global="true"].active {
  border-color: rgba(148, 163, 184, 0.6);
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.2);
}

#design-global-toggle button[data-global="false"].active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(251, 191, 36, 0.15);
}
.stacked {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.stacked.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-row input {
  flex: 1;
}

.field-help {
  font-size: 12px;
  color: var(--muted);
}

.field-help.is-success {
  color: #4ade80;
}

.field-help.is-error {
  color: #fca5a5;
}

.field-help.is-pending {
  color: #facc15;
}

label {
  font-weight: 600;
  color: var(--text);
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.vertical-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

input,
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0b1220;
  color: var(--text);
  font-size: 14px;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent-strong);
}

.panel-query {
  margin-bottom: 12px;
}

.panel-query-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.panel-query-row input {
  flex: 1;
}

.tree-view {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0b1220;
}

.diagram-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.diagram-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.diagram-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0b1220;
  padding: 12px;
  min-height: 260px;
  overflow: auto;
}

.diagram-card-entities {
  min-height: 174px;
}

.diagram-card-modules {
  min-height: 346px;
}

.diagram-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.cy-graph {
  width: 100%;
  min-height: 0;
  flex: 1;
}

.diagram-card-entities .cy-graph {
  min-height: 160px;
}

.diagram-card-modules .cy-graph {
  min-height: 320px;
}

.edgeLabel {
  padding: 4px;
}

.tree-node {
  margin-left: 8px;
}

.tree-label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--text);
}

.tree-key {
  font-weight: 600;
  color: #e2e8f0;
}

.tree-value {
  color: var(--muted);
  word-break: break-word;
}

.tree-children {
  margin-left: 14px;
  padding-left: 10px;
  border-left: 1px dashed var(--border);
}

button {
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #0b0b0b;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.3);
}

button:disabled,
button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: saturate(0.55);
}

button:disabled:hover,
button[disabled]:hover {
  transform: none;
  box-shadow: none;
}

button.ai-new-btn.is-generating:disabled,
button.ai-new-btn.is-generating[disabled] {
  opacity: 0.78;
  filter: saturate(0.72);
  background: linear-gradient(135deg, #79a6df, #3a6fb7);
  color: #eff6ff;
  border: 1px solid rgba(96, 165, 250, 0.55);
}

button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

button.ghost.ai-new-btn {
  border-color: rgba(59, 130, 246, 0.65);
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
}

button.ghost.ai-new-btn:hover {
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.28);
  border-color: rgba(59, 130, 246, 0.9);
}

button.ai-new-btn:not(.ghost) {
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #eff6ff;
}

button.ai-new-btn:not(.ghost):hover {
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.35);
}

.ai-new-btn sup {
  font-size: 0.6em;
  vertical-align: super;
}

.req-tabstrip a.ai-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.req-tabstrip a.ai-new-btn:hover {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.7);
}

.req-tabstrip a.ai-new-btn.active {
  color: #eff6ff;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.28), rgba(37, 99, 235, 0.28)), #111827;
  border-color: rgba(59, 130, 246, 0.85);
  box-shadow: none;
}

#build-tabs.req-tabstrip::after {
  background: rgba(59, 130, 246, 0.58);
}

#build-tabs-panel .tab-panel-header {
  border-bottom-color: rgba(59, 130, 246, 0.58);
}

.button-link {
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

button.small {
  padding: 6px 10px;
  font-size: 13px;
}

button.danger {
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

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

.list {
  display: grid;
  gap: 8px;
}

.load-more-controls {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.list-sentinel {
  width: 100%;
  height: 1px;
}

.list.dropdown-list {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.item {
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #0c1625;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.1s ease, transform 0.1s ease;
}

.item:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.item-main {
  flex: 1;
}

.item-actions {
  display: flex;
  align-self: stretch;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
}

.item-actions.align-right {
  justify-content: flex-end;
  width: 100%;
}

.item.active {
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(251, 191, 36, 0.18);
}

.pill {
  background: rgba(251, 191, 36, 0.15);
  color: var(--accent);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.pill.pill-removable {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-right: 6px;
}

.pill-remove {
  border: none;
  background: rgba(251, 191, 36, 0.2);
  color: var(--accent);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.pill-remove:hover {
  background: rgba(251, 191, 36, 0.35);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 4px;
}

.pill-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.08);
  cursor: pointer;
  white-space: nowrap;
}

.pill-link:hover {
  border-color: var(--accent);
}

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

.bullet-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  display: grid;
  gap: 4px;
}

.feature-flag-list {
  list-style: none;
  padding-left: 0;
  width: 100%;
}

.feature-flag-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  column-gap: 12px;
  row-gap: 2px;
}

.feature-flag-list .pill {
  justify-self: end;
  align-self: start;
  width: auto;
}

.feature-flag-list li .muted {
  grid-column: 1 / -1;
  font-size: 12px;
}

.feature-flag-list li .pill {
  grid-row: 1;
  grid-column: 2;
}

.tenant-setting-example {
  margin-top: 6px;
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
}

.tenant-setting-key {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono-font);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.instructions-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
}

.meta-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}

#build-error-block {
  margin-top: 10px;
}

.text-block {
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.5;
}

.text-block.empty {
  color: var(--muted);
}

.text-block.error-block {
  background: rgba(127, 29, 29, 0.2);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fca5a5;
}

.text-block-compact {
  font-size: 12px;
  line-height: 1.4;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
}

#build-error-block .text-block-compact {
  max-height: none;
  overflow: visible;
}

.error-text {
  color: #fca5a5;
}

.log-output {
  font-family: "Space Mono", "SFMono-Regular", ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 12px;
  white-space: pre;
  max-height: 520px;
  overflow-y: auto;
}

.log-line {
  padding: 2px 0;
}

.build-file-item {
  cursor: default;
  padding: 8px 10px;
}

.build-file-item:hover {
  border-color: rgba(59, 130, 246, 0.7);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
}

.build-file-path {
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.3;
  min-width: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.build-file-details {
  color: #cbd5e1;
  font-size: 12px;
}

.build-file-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.build-file-inline-meta {
  color: #cbd5e1;
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.file-change-pill {
  text-transform: capitalize;
}

.file-change-pill.file-change-added {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

.file-change-pill.file-change-modified {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.file-change-pill.file-change-deleted {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.file-change-pill.file-change-renamed {
  background: rgba(14, 165, 233, 0.2);
  color: #7dd3fc;
}

.final-text-input {
  width: 100%;
  min-height: 200px;
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--text);
  line-height: 1.5;
  resize: vertical;
  font: inherit;
}

.final-text-input.empty {
  color: var(--muted);
}

.is-hidden {
  display: none;
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

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

.ai-usage-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 20px;
  align-items: stretch;
}

.usage-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 140px;
}

.usage-chart-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.usage-chart-header h3 {
  margin: 0;
  font-size: 1rem;
}

.usage-chart-body {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.usage-controls {
  display: grid;
  gap: 12px;
  align-content: end;
  min-width: 220px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}

.control-group label {
  color: var(--muted);
  font-size: 0.85rem;
}

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

.kpi-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kpi-card span {
  color: var(--muted);
  font-size: 0.85rem;
}

.kpi-card strong {
  font-size: 1.3rem;
}

.system-map-grid {
  margin-top: 12px;
}

.system-map-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.system-map-card h3 {
  margin: 0;
}

.system-map-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.taxonomy-tree {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tree-node {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tree-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tree-row.tree-highlight {
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 10px;
  padding: 6px 10px;
}

.tree-row.tree-highlight .tree-value {
  color: var(--muted);
}


.tree-label {
  color: var(--muted);
  font-size: 0.85rem;
  min-width: 140px;
}

.tree-value {
  font-weight: 600;
}

.tree-children {
  margin-left: 14px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-tree-list .item {
  align-items: stretch;
}

.project-tree-list .project-taxonomy-tree {
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.project-tree-list .item-actions {
  align-self: stretch;
  flex-direction: row;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
}

.table-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.table-card header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.6);
}

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

.table-card th,
.table-card td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.table-card th {
  color: var(--muted);
  font-weight: 600;
}

.term-map-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: rgba(15, 23, 42, 0.55);
}

.term-map-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(59, 130, 246, 0.25);
  border-top-color: rgba(59, 130, 246, 0.9);
  animation: term-map-spin 0.8s linear infinite;
}

.term-map-error {
  border-radius: var(--radius);
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.term-map-results {
  display: grid;
  gap: 14px;
}

#term-map-panel .panel-actions {
  align-items: flex-start;
  width: 100%;
}

#term-map-panel .panel-actions .filters.term-map-controls-row {
  border-right: none;
  padding-right: 0;
  margin-right: 0;
}

#term-map-panel .term-map-controls-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

#term-map-panel .term-map-controls-row {
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
}

#term-map-panel .term-map-controls-row label {
  white-space: nowrap;
}

#term-map-panel .term-map-controls-secondary {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
  flex-wrap: nowrap;
}

#term-map-panel #term-map-include {
  min-width: 260px;
  flex: 1 1 280px;
}

#term-map-panel #term-map-granularity {
  min-width: 110px;
}

.term-map-granularity-guidance {
  margin: 0;
  line-height: 1.35;
  max-width: none;
  white-space: nowrap;
}

.term-map-granularity-guidance p {
  margin: 0;
}

.term-map-granularity-guidance strong {
  color: var(--text, #e5e7eb);
  font-weight: 700;
}

#term-map-guidance-details {
  display: block;
}

#term-map-toggle-btn.is-ready {
  border-color: rgba(16, 185, 129, 0.7);
  color: #86efac;
  background: rgba(16, 185, 129, 0.12);
}

#term-map-toggle-btn.is-ready:hover {
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.25);
  border-color: rgba(16, 185, 129, 0.9);
}

.term-map-cluster {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0c1625;
  padding: 12px;
  display: grid;
  gap: 12px;
}

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

.term-map-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#term-map-include {
  min-width: 260px;
}

.term-map-section-label {
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.term-map-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.term-map-pill {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}

.term-map-cohesion.high {
  background: rgba(16, 185, 129, 0.2);
  color: #86efac;
  cursor: help;
}

.term-map-cohesion.medium {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  cursor: help;
}

.term-map-cohesion.low {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  cursor: help;
}

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

.term-map-table th,
.term-map-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.term-map-table th {
  color: var(--muted);
  font-weight: 600;
}

.term-map-table a {
  color: #93c5fd;
  text-decoration: none;
}

.term-map-table a:hover {
  text-decoration: underline;
}

.term-map-toggle {
  justify-self: flex-start;
}

.term-map-members {
  display: grid;
  gap: 8px;
}

.term-map-more {
  justify-self: flex-start;
}

#gap-analysis-panel .panel-actions.gap-analysis-controls-grid {
  display: grid;
  grid-template-columns: minmax(440px, 4fr) minmax(320px, 3fr);
  grid-template-rows: auto auto auto;
  column-gap: 16px;
  row-gap: 8px;
  align-items: start;
}

#gap-analysis-panel .filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

#gap-analysis-panel .gap-controls-scope {
  grid-column: 1 / 3;
  grid-row: 1;
  flex-wrap: nowrap;
  align-items: center;
}

#gap-analysis-panel .gap-controls-scope label {
  white-space: nowrap;
}

#gap-analysis-panel .gap-controls-scope select {
  width: auto;
  flex: 1 1 360px;
}

#gap-analysis-panel .gap-controls-thresholds {
  grid-column: 1;
  grid-row: 2;
}

#gap-analysis-panel .gap-controls-run {
  grid-column: 1;
  grid-row: 3;
  justify-self: start;
}

#gap-analysis-panel .gap-controls-guidance {
  grid-column: 2;
  grid-row: 2 / 4;
  align-self: center;
}

#gap-analysis-panel input[type="number"] {
  width: 84px;
}

.gap-analysis-guidance {
  margin: 0;
  max-width: 720px;
  line-height: 1.35;
}

.gap-analysis-guidance p {
  margin: 2px 0;
}

.gap-analysis-guidance strong {
  color: var(--text, #e5e7eb);
  font-weight: 700;
}

@media (max-width: 980px) {
  #term-map-panel .term-map-controls-secondary {
    flex-wrap: wrap;
  }

  #term-map-panel .term-map-controls-row {
    flex-wrap: wrap;
  }

  #term-map-panel #term-map-include,
  #term-map-panel #term-map-granularity {
    min-width: 0;
    width: 100%;
    flex-basis: 100%;
  }

  .term-map-granularity-guidance {
    margin-top: 2px;
    border-top: 1px solid var(--border);
    padding-top: 6px;
    width: 100%;
    max-width: none;
    white-space: normal;
  }

  #gap-analysis-panel .panel-actions.gap-analysis-controls-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
  }

  #gap-analysis-panel .gap-controls-scope,
  #gap-analysis-panel .gap-controls-thresholds,
  #gap-analysis-panel .gap-controls-run,
  #gap-analysis-panel .gap-controls-guidance {
    grid-column: 1;
  }

  #gap-analysis-panel .gap-controls-scope {
    grid-row: 1;
  }

  #gap-analysis-panel .gap-controls-thresholds {
    grid-row: 2;
  }

  #gap-analysis-panel .gap-controls-run {
    grid-row: 3;
  }

  #gap-analysis-panel .gap-controls-guidance {
    grid-row: 4;
    align-self: start;
  }

  #gap-analysis-panel .gap-controls-scope {
    flex-wrap: wrap;
  }

  #gap-analysis-panel .gap-controls-scope select {
    width: 100%;
    flex-basis: 100%;
  }
}

#gap-coverage-rows td:last-child {
  white-space: nowrap;
}

#gap-coverage-rows td:last-child button + button {
  margin-left: 6px;
}

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

.tenant-settings-defaults-table th:nth-child(1),
.tenant-settings-defaults-table td:nth-child(1) {
  width: 220px;
}

.tenant-settings-defaults-table th:nth-child(3),
.tenant-settings-defaults-table td:nth-child(3) {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

#tenant-settings-defaults-panel input[data-role="key"] {
  width: 200px;
  max-width: 100%;
}

#tenant-settings-defaults-panel textarea[data-role="value"] {
  width: 100%;
  min-width: 240px;
  resize: vertical;
}

.ai-client-models-card {
  overflow-x: auto;
}

.ai-client-models-card table {
  min-width: 720px;
}

.ai-client-models-card table input {
  width: 100%;
  min-width: 120px;
  box-sizing: border-box;
}

.ai-client-models-card td {
  padding: 8px 12px;
}

.usage-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.usage-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.usage-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 6px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.16);
}

.usage-badge-reasoning {
  border-color: rgba(59, 130, 246, 0.6);
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.18);
}

.usage-badge-generation {
  border-color: rgba(16, 185, 129, 0.6);
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.18);
}

.usage-badge-structured {
  border-color: rgba(234, 179, 8, 0.6);
  color: #fde68a;
  background: rgba(234, 179, 8, 0.16);
}

.usage-badge-classification {
  border-color: rgba(236, 72, 153, 0.6);
  color: #fbcfe8;
  background: rgba(236, 72, 153, 0.16);
}

.usage-badge-embeddings {
  border-color: rgba(148, 163, 184, 0.6);
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.18);
}

.event-list {
  padding: 8px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.5);
}

.event-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.event-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 720px) {
  .ai-usage-controls {
    grid-template-columns: 1fr;
  }
  .usage-controls {
    min-width: unset;
  }
}

.item.column {
  flex-direction: column;
  align-items: stretch;
}

.item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.item-meta-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.build-meta {
  justify-content: flex-start;
}

.build-meta > div {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.meta-pair {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.meta-label {
  color: var(--muted);
  font-size: 12px;
}

.meta-value {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.timestamp {
  color: var(--muted);
  font-size: 12px;
}

.pill.status-new {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.pill.status-draft {
  background: rgba(251, 191, 36, 0.15);
  color: var(--accent);
  border: 1px solid rgba(251, 191, 36, 0.4);
}

.pill.status-final {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.4);
}

.pill.status-generated {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.4);
}

.pill.status-enhancing {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border: 1px dashed rgba(59, 130, 246, 0.6);
  font-weight: 800;
}

.pill.status-error {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.6);
}

.pill.status-executing,
.pill.status-running {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.5);
}

.pill.status-pr-created {
  background: rgba(250, 204, 21, 0.2);
  color: #facc15;
  border: 1px solid rgba(250, 204, 21, 0.5);
}

.pill.status-completed {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.5);
}

.pill.status-failed {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.pill.pill-muted {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.pill.duplicate {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.pill.instruction-type-badge.type-feature {
  background: rgba(148, 163, 184, 0.22);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.pill.instruction-type-badge.type-repo-init {
  background: rgba(251, 191, 36, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.55);
}

.pill.instruction-type-badge.type-human {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.55);
}

.source-badges {
  margin-top: 8px;
}

.instruction-item {
  cursor: default;
}

.instruction-item:hover {
  transform: none;
}

.instruction-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.instruction-item-title {
  color: #f8fafc;
  letter-spacing: 0.01em;
}

.instruction-copy-btn {
  flex-shrink: 0;
}

.instruction-rich-text {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.instruction-rich-paragraph {
  margin: 0;
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.5;
}

.instruction-rich-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  display: grid;
  gap: 4px;
}

.instruction-rich-list li {
  line-height: 1.45;
}

.instruction-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(15, 23, 42, 0.55);
}

.instruction-section-title {
  margin: 0;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #93c5fd;
}

.instruction-section-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.source-pill {
  text-decoration: none;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.source-pill:hover {
  border-color: rgba(251, 191, 36, 0.6);
  transform: translateY(-1px);
}

.source-pill.source-req {
  background: rgba(251, 191, 36, 0.16);
  color: var(--accent);
}

.source-pill.source-usecase {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.5);
}


.pill.project-context {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.pill.prompt-context {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.pill.link-suggested {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.pill.link-manual {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border: 1px dashed rgba(59, 130, 246, 0.6);
}

.project-settings-context-grid {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.project-settings-context-types .list {
  display: grid;
  gap: 8px;
}

.project-context-type-option {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.project-context-type-option:hover {
  border-color: rgba(56, 189, 248, 0.7);
}

.project-context-type-option.active {
  border-color: rgba(56, 189, 248, 0.9);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35) inset;
}

.project-settings-context-editor textarea {
  min-height: 360px;
}

@media (max-width: 900px) {
  .project-settings-context-grid {
    grid-template-columns: 1fr;
  }

  .project-settings-context-editor textarea {
    min-height: 260px;
  }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 16px;
  z-index: 20;
}

.modal.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 320px;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow);
}

.modal-content.modal-content-wide {
  max-width: 1040px;
}

.modal-content.modal-content-fullscreen {
  max-width: min(96vw, 1600px);
  width: min(96vw, 1600px);
  height: min(92vh, 1100px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.diagram-fullscreen-body {
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0b1220;
  padding: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.diagram-fullscreen-body .cy-graph {
  flex: 1 1 auto;
  min-height: 0;
}

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

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

#gap-coverage-modal .modal-content {
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#gap-coverage-modal #gap-coverage-subtitle {
  flex-shrink: 0;
}

#gap-coverage-modal .table-card {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

#gap-coverage-modal .modal-actions {
  margin-top: 8px;
  flex-shrink: 0;
}

.toast {
  position: fixed;
  top: 18px;
  left: 18px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  max-width: 320px;
  z-index: 50;
  text-align: left;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .topbar {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 0 12px;
  }
}
