:root {
  --ink: #17202a;
  --muted: #667085;
  --line: #d9e0e8;
  --panel: #ffffff;
  --page: #f5f7fa;
  --blue: #1d4ed8;
  --green: #15803d;
  --amber: #b45309;
  --rose: #be123c;
  --shadow: 0 16px 40px rgba(23, 32, 42, 0.08);
  --sidebar-width: 300px;
  --detail-width: 420px;
  --sidebar-column: var(--sidebar-width);
  --detail-column: var(--detail-width);
}

* {
  box-sizing: border-box;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

.hosted-gate,
.database-home {
  min-height: 100vh;
  overflow-y: auto;
  padding: 40px;
}

.hosted-gate {
  display: grid;
  place-items: center;
}

.hosted-panel {
  width: min(480px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 32px;
}

.hosted-panel h1,
.database-home h1 {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
}

.hosted-copy,
.database-home-header p {
  margin: 10px 0 0;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.hosted-status,
.hosted-empty {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
}

.database-home {
  background: var(--page);
}

.database-home-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  max-width: 1120px;
  margin: 0 auto 24px;
}

.database-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
}

.database-card {
  display: grid;
  gap: 10px;
  min-height: 170px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 12px 28px rgba(23, 32, 42, 0.06);
  cursor: pointer;
}

.database-card:hover {
  border-color: #93b4e8;
  transform: translateY(-1px);
}

.database-card span {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.database-card strong {
  font-size: 1.08rem;
}

.database-card p {
  margin: 0;
  color: var(--muted);
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-column) minmax(640px, 1fr) var(--detail-column);
  height: 100vh;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.app-shell.sidebar-collapsed {
  --sidebar-column: 0px;
}

.app-shell.detail-collapsed {
  --detail-column: 0px;
}

.app-shell.sidebar-collapsed.detail-collapsed {
  --sidebar-column: 0px;
  --detail-column: 0px;
}

.sidebar,
.detail-panel {
  background: #fbfcfe;
  border-color: var(--line);
  border-style: solid;
}

.sidebar {
  border-width: 0 1px 0 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 20px;
  overflow-y: auto;
}

.sidebar-collapsed .sidebar {
  visibility: hidden;
  overflow: hidden;
  border-width: 0;
  padding: 0;
}

.detail-panel {
  min-width: 0;
  height: 100vh;
  border-width: 0 0 0 1px;
  padding: 24px;
  overflow-y: auto;
}

.detail-collapsed .detail-panel {
  visibility: hidden;
  overflow: hidden;
  border-width: 0;
  padding: 0;
}

.workspace {
  height: 100vh;
  padding: 24px;
  overflow-x: hidden;
  overflow-y: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-mark {
  display: block;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px;
  background: #fff;
  object-fit: contain;
}

.brand-copy {
  min-width: 0;
}

.brand-wordmark {
  margin-top: auto;
  padding-top: 28px;
}

.brand-wordmark img {
  display: block;
  width: min(190px, 100%);
  height: auto;
  object-fit: contain;
  opacity: 0.72;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 17px;
}

h2 {
  font-size: 26px;
  line-height: 1.15;
}

h3 {
  font-size: 15px;
}

.brand p,
.eyebrow,
.result-count,
.muted,
.metric p {
  color: var(--muted);
}

.eyebrow {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-label,
.filter-title,
.form-label {
  display: block;
  margin-bottom: 8px;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.search-input,
.field,
textarea.field,
select.field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.search-input,
.field,
select.field {
  height: 42px;
  padding: 0 12px;
}

textarea.field {
  min-height: 100px;
  padding: 10px 12px;
  resize: vertical;
}

.search-input:focus,
.field:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.filter-block {
  margin-top: 24px;
}

.filter-list,
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.type-filter,
.chip,
.tag {
  border: 1px solid transparent;
  border-radius: 999px;
  background: #edf2f7;
  color: #253142;
  white-space: nowrap;
}

.type-filter {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  cursor: pointer;
}

.type-filter.active {
  border-color: #17324d;
  background: #dce8f5;
}

.chip,
.tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.chip {
  cursor: pointer;
}

.chip.active {
  outline: 2px solid rgba(23, 32, 42, 0.2);
}

.compact {
  max-height: 190px;
  overflow-y: auto;
  padding-right: 4px;
}

.tag-tree {
  display: grid;
  gap: 12px;
  width: 100%;
}

.tag-group {
  display: grid;
  gap: 7px;
}

.tag-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.tag-group-title span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tag-group-title strong {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.toggle-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 24px;
  color: #344054;
  font-size: 14px;
}

.topbar,
.table-header,
.panel-heading,
.detail-heading,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.icon-button {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.icon-button {
  width: 38px;
  padding: 0;
  border-color: var(--line);
  background: #fff;
  color: #253142;
  font-size: 22px;
  line-height: 1;
}

.panel-toggle {
  position: fixed;
  top: 24px;
  z-index: 20;
  width: 34px;
  min-height: 34px;
  height: 34px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(23, 32, 42, 0.16);
}

.sidebar-toggle {
  left: calc(var(--sidebar-column) - 17px);
}

.sidebar-collapsed .sidebar-toggle {
  left: 10px;
}

.detail-toggle {
  right: auto;
  /* Match the grid divider even when the center column minimum clips the detail panel. */
  left: max(calc(100vw - var(--detail-column) - 17px), calc(var(--sidebar-column) + 640px - 17px));
}

.detail-collapsed .detail-toggle {
  left: auto;
  right: 10px;
}

.resize-handle {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 18;
  width: 10px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
}

.resize-handle::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 2px;
  background: transparent;
}

.resize-handle:hover::after,
.resize-handle:focus-visible::after,
.resizing-panels .resize-handle::after {
  background: rgba(29, 78, 216, 0.45);
}

.sidebar-resize-handle {
  left: calc(var(--sidebar-column) - 5px);
}

.detail-resize-handle {
  right: auto;
  left: max(calc(100vw - var(--detail-column) - 5px), calc(var(--sidebar-column) + 640px - 5px));
}

.sidebar-collapsed .sidebar-resize-handle,
.detail-collapsed .detail-resize-handle {
  display: none;
}

.primary-button {
  background: #17324d;
  color: #fff;
}

.secondary-button,
.ghost-button {
  border-color: var(--line);
  background: #fff;
  color: #253142;
}

.danger-button {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
}

.stats-grid,
.visuals {
  display: grid;
  gap: 14px;
}

.stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 24px 0 14px;
}

.metric,
.visual-panel,
.table-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
  border-top: 4px solid #17324d;
}

.metric span {
  display: block;
  margin-bottom: 4px;
  font-size: 30px;
  font-weight: 900;
}

.accent-blue {
  border-top-color: var(--blue);
}

.accent-amber {
  border-top-color: var(--amber);
}

.accent-rose {
  border-top-color: var(--rose);
}

.visuals {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.visual-panel,
.table-panel {
  padding: 16px;
}

.table-panel {
  margin-top: 14px;
}

.bar-chart {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(110px, 2fr) minmax(34px, auto);
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.bar-label {
  min-width: 0;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f6;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
}

.timeline-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.timeline-chart-card {
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 182px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.timeline-chart-card:hover,
.timeline-chart-card:focus-visible {
  border-color: #bfdbfe;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
  outline: none;
}

.timeline-chart-title {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.timeline-chart-figure {
  min-width: 0;
  margin: 0;
}

.timeline-chart {
  display: block;
  width: 100%;
  height: auto;
}

.timeline-axis {
  stroke: #cbd5e1;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.timeline-axis-label {
  fill: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.timeline-grid-line {
  stroke: #e5edf6;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.timeline-y-tick line {
  stroke: #e5edf6;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.timeline-y-tick text {
  fill: var(--muted);
  font-size: 8px;
  font-weight: 800;
}

.timeline-year-tick line {
  stroke: #cbd5e1;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.timeline-year-tick text {
  fill: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.timeline-area {
  fill: rgba(29, 78, 216, 0.14);
  stroke: none;
}

.timeline-line {
  fill: none;
  stroke: var(--blue);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.timeline-point circle {
  fill: #fff;
  stroke: var(--blue);
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.timeline-point text {
  fill: #253142;
  font-size: 8.5px;
  font-weight: 900;
}

.timeline-point-label {
  paint-order: stroke;
  stroke: #fff;
  stroke-linejoin: round;
  stroke-width: 3px;
}

.timeline-chart-empty {
  display: grid;
  min-height: 132px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.chart-dialog {
  width: min(860px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(23, 32, 42, 0.28);
}

.chart-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.chart-dialog-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.chart-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chart-dialog-body .timeline-chart-empty {
  min-height: 320px;
}

.timeline-chart-figure-large .timeline-chart {
  max-height: 70vh;
}

.table-scroll {
  margin-top: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 1340px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid #edf1f5;
  padding: 12px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #475467;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

tr.company-row {
  cursor: pointer;
}

tr.company-row:hover,
tr.company-row.active {
  background: #f4f8fc;
}

.company-name {
  font-weight: 900;
}

.website-link {
  color: var(--blue);
  font-size: 12px;
  text-decoration: none;
  word-break: break-all;
}

.established-cell {
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
}

.investment-total-cell {
  color: var(--green);
  font-weight: 900;
  white-space: nowrap;
}

.team-total-cell {
  color: #0f766e;
  font-weight: 900;
  white-space: nowrap;
}

.team-total-external {
  color: var(--muted);
}

.review-cell {
  width: 64px;
  text-align: center;
}

.maturity-cell {
  width: 74px;
  text-align: center;
}

.maturity-icon {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 17px;
  line-height: 1;
}

.maturity-icon:not(.maturity-unclassified) {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.maturity-unclassified {
  color: var(--muted);
}

.review-stack {
  display: inline-grid;
  justify-items: center;
  gap: 4px;
}

.review-status {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.review-status-validated {
  border-color: #bbf7d0;
  background: #dcfce7;
  color: var(--green);
}

.review-status-partial {
  border-color: #fed7aa;
  background: #fff7ed;
  color: var(--amber);
}

.review-status-invalid {
  border-color: #fecdd3;
  background: #fff1f2;
  color: var(--rose);
}

.review-status-on-hold {
  color: var(--muted);
}

.review-question-indicator {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  background: #fff7ed;
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.comment-cell {
  display: -webkit-box;
  max-width: 210px;
  overflow: hidden;
  color: #344054;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.comment-empty {
  white-space: nowrap;
}

.attachment-count {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.attachment-count.has-attachments {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--blue);
}

.detail-content {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.empty-detail {
  display: grid;
  min-height: 260px;
  place-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.hidden {
  display: none !important;
}

.maturity-tooltip {
  position: fixed;
  z-index: 40;
  max-width: 240px;
  padding: 8px 10px;
  border: 1px solid #1e293b;
  border-radius: 6px;
  background: #0f172a;
  color: #fff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.22);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(2px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.maturity-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.maturity-tooltip[hidden] {
  display: none;
}

.detail-heading {
  align-items: flex-start;
}

.detail-heading h3 {
  font-size: 22px;
}

.detail-field-summary,
.detail-section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.detail-field-summary {
  margin-top: 2px;
}

.maturity-summary {
  margin-top: 10px;
}

.maturity-summary .form-label {
  margin-bottom: 0;
}

.detail-section-heading .form-label {
  margin-bottom: 0;
}

.detail-section {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.detail-section p {
  color: #344054;
  font-size: 14px;
  line-height: 1.5;
}

.comment-field {
  min-height: 120px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.chip-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 170px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.field-validation {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.field-validation-readonly,
.maturity-readonly {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.field-validation-button {
  display: grid;
  width: 28px;
  min-height: 24px;
  place-items: center;
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.field-validation-button:last-child {
  border-right: 0;
}

.field-validation-button:hover {
  background: #f8fafc;
}

.field-validation-button.validation-validated.active {
  background: #dcfce7;
  color: var(--green);
}

.field-validation-button.validation-on_hold.active {
  background: #fff7ed;
  color: var(--amber);
}

.field-validation-button.validation-invalid.active {
  background: #fff1f2;
  color: var(--rose);
}

.maturity-control {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.maturity-button {
  display: grid;
  width: 34px;
  min-height: 30px;
  place-items: center;
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.maturity-button:last-child {
  border-right: 0;
}

.maturity-button:hover {
  background: #f8fafc;
}

.maturity-button.active {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.source-list,
.tag-evidence-list,
.tag-evidence-fields,
.attachment-list,
.investment-round-list,
.investment-fields,
.team-list,
.hiring-event-list,
.team-member-fields,
.hiring-event-fields {
  display: grid;
  gap: 10px;
}

.source-item,
.tag-evidence,
.tag-evidence-field,
.attachment-item,
.investment-round,
.investment-round-field,
.team-member,
.hiring-event,
.team-member-field,
.hiring-event-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.source-item a,
.tag-evidence-item a,
.attachment-item a,
.investment-round a,
.team-member a,
.hiring-event a {
  color: var(--blue);
  font-size: 12px;
  word-break: break-all;
}

.investment-total-badge,
.team-total-badge {
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 4px 8px;
  background: #dcfce7;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.investment-round,
.team-member,
.hiring-event {
  display: grid;
  gap: 8px;
}

.hiring-event.external {
  border-color: #d8dee8;
  background: #f8fafc;
  color: var(--muted);
}

.investment-round-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.investment-round-heading strong {
  color: #344054;
}

.investment-round-heading span,
.investment-investor-group span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.investment-investor-group {
  display: grid;
  gap: 4px;
}

.investment-investor-group ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.investment-source-link {
  justify-self: start;
}

.investment-round-field {
  display: grid;
  gap: 8px;
}

.investment-round-field legend {
  padding: 0 4px;
  font-size: 12px;
  font-weight: 900;
}

.investment-field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px 82px minmax(0, 1fr);
  gap: 8px;
}

.team-member-grid,
.hiring-event-grid {
  display: grid;
  gap: 8px;
}

.team-member-grid {
  grid-template-columns: minmax(0, 1fr) 96px;
}

.hiring-event-grid {
  grid-template-columns: 96px 110px minmax(0, 1fr);
}

.team-position-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.team-position-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.team-position-option input,
.checkbox-line input {
  margin: 0;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.team-member-field,
.hiring-event-field {
  display: grid;
  gap: 8px;
}

.team-member-field legend,
.hiring-event-field legend {
  padding: 0 4px;
  font-size: 12px;
  font-weight: 900;
}

.investment-investor-list {
  display: grid;
  gap: 8px;
}

.investment-investor {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.compact-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.attachment-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.attachment-item img {
  width: 56px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
}

.attachment-item-file {
  grid-template-columns: minmax(0, 1fr) auto;
}

.attachment-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.attachment-delete {
  min-height: 30px;
  padding: 0 10px;
  color: var(--rose);
}

.attachment-upload {
  display: grid;
  gap: 8px;
  align-items: start;
}

.attachment-upload-status {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
}

.attachment-upload-status-uploading {
  border-color: #fed7aa;
  background: #fff7ed;
  color: var(--amber);
}

.attachment-upload-status-success {
  border-color: #bbf7d0;
  background: #dcfce7;
  color: var(--green);
}

.attachment-upload-status-error {
  border-color: #fecdd3;
  background: #fff1f2;
  color: var(--rose);
}

.tag-evidence {
  display: grid;
  gap: 8px;
}

.tag-evidence-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tag-review-controls {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  margin-left: auto;
}

.tag-validation-button,
.tag-question-button,
.tag-delete-button {
  display: grid;
  width: 28px;
  min-height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.tag-validation-button:hover,
.tag-validation-button.active {
  border-color: #bbf7d0;
  background: #dcfce7;
  color: var(--green);
}

.tag-question-button:hover,
.tag-question-button.active {
  border-color: #fed7aa;
  background: #fff7ed;
  color: var(--amber);
}

.tag-delete-button:hover {
  border-color: #fecdd3;
  background: #fff1f2;
  color: var(--rose);
}

.tag-evidence-item {
  display: grid;
  gap: 5px;
  padding-left: 8px;
  border-left: 3px solid #d9e0e8;
}

.tag-evidence-item p {
  margin: 0;
}

.source-type {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.tag-evidence-field {
  display: grid;
  gap: 8px;
}

.tag-evidence-field legend {
  padding: 0 4px;
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 1220px) {
  body {
    height: auto;
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 280px minmax(0, 1fr);
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar-toggle {
    left: calc(280px - 17px);
  }

  .sidebar-collapsed .sidebar-toggle {
    left: 10px;
  }

  .detail-toggle {
    left: auto;
    right: 16px;
  }

  .resize-handle {
    display: none;
  }

  .app-shell.detail-collapsed {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .app-shell.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-shell.sidebar-collapsed.detail-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-panel {
    grid-column: 1 / -1;
    height: auto;
    border-width: 1px 0 0;
    max-height: none;
  }

  .sidebar,
  .workspace {
    height: auto;
  }

  .detail-collapsed .detail-panel {
    display: none;
  }

  .sidebar-collapsed .sidebar {
    display: none;
  }
}

@media (max-width: 820px) {
  body {
    overflow: auto;
  }

  .app-shell {
    display: block;
  }

  .sidebar-toggle {
    left: 12px;
    top: 12px;
  }

  .detail-toggle {
    left: auto;
    right: 12px;
    top: 12px;
  }

  .sidebar,
  .workspace,
  .detail-panel {
    padding: 16px;
  }

  .workspace {
    padding-top: 58px;
  }

  .topbar,
  .table-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-grid,
  .visuals,
  .timeline-chart-grid,
  .team-member-grid,
  .hiring-event-grid {
    grid-template-columns: 1fr;
  }

  h2 {
    font-size: 22px;
  }
}
