.brand-link,
.app-nav a {
  color: inherit;
  text-decoration: none;
}

.app-nav {
  display: flex;
  gap: 1rem;
}

.app-nav a:hover {
  text-decoration: underline;
}

.app-header form {
  margin-left: auto;
}

.form-field select,
.form-field textarea {
  border: 1px solid #aebbd0;
  border-radius: 0.55rem;
  box-sizing: border-box;
  font: inherit;
  padding: 0.72rem 0.8rem;
  width: 100%;
}

.form-field select:focus,
.form-field textarea:focus {
  border-color: #245db4;
  box-shadow: 0 0 0 3px rgb(36 93 180 / 18%);
  outline: none;
}

.page-head,
.section-head {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.page-lead,
.empty-state {
  color: #637089;
  line-height: 1.55;
}

.eyebrow {
  color: #315fa9;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  margin: 0 0 0.4rem;
  text-transform: uppercase;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.button-link {
  background: #245db4;
  border-radius: 0.6rem;
  color: white;
  display: inline-block;
  font-weight: 700;
  padding: 0.7rem 0.9rem;
  text-decoration: none;
}

.button-secondary {
  background: white;
  border: 1px solid #aebbd0;
  color: #245db4;
}

.panel {
  background: white;
  border: 1px solid #d8e0ec;
  border-radius: 0.85rem;
  box-shadow: 0 0.35rem 1.4rem rgb(23 32 51 / 6%);
  margin-bottom: 1rem;
  padding: 1.15rem;
}

.form-panel {
  max-width: 48rem;
}

.card-grid,
.two-column,
.party-grid {
  display: grid;
  gap: 1rem;
}

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

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

.metric-card {
  display: flex;
  flex-direction: column;
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 800;
}

.party-grid div {
  background: #f4f7fb;
  border-radius: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.8rem;
}

.party-grid span {
  color: #637089;
  font-size: 0.8rem;
}

.table-wrap {
  overflow-x: auto;
}

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

.data-table th,
.data-table td {
  border-bottom: 1px solid #e4e9f1;
  padding: 0.75rem 0.6rem;
  text-align: left;
}

.data-table th {
  color: #526078;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.status-badge {
  background: #eef3fa;
  border-radius: 999px;
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 750;
  padding: 0.2rem 0.5rem;
}

.compact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.compact-list li {
  align-items: baseline;
  border-bottom: 1px solid #e4e9f1;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.65rem 0;
}

.message-stack {
  padding-bottom: 0;
}

.pagination,
.workspace-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  margin-top: 1rem;
}

.workspace-tabs {
  justify-content: flex-start;
  margin-bottom: 1rem;
}

.workspace-tab {
  background: #eef3fa;
  border-radius: 999px;
  color: #526078;
  font-size: 0.82rem;
  font-weight: 750;
  padding: 0.45rem 0.75rem;
  text-decoration: none;
}

.workspace-tab.active {
  background: #245db4;
  color: white;
}

.filter-bar {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.filter-bar label {
  color: #526078;
  display: grid;
  flex: 1 1 12rem;
  font-size: 0.8rem;
  gap: 0.3rem;
}

.filter-bar input,
.filter-bar select {
  border: 1px solid #aebbd0;
  border-radius: 0.55rem;
  font: inherit;
  padding: 0.65rem;
}

.requirement-board {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.requirement-card { border-top: 0.3rem solid #64748b; }
.requirement-card.status-received { border-top-color: #2563eb; }
.requirement-card.status-valid { border-top-color: #15803d; }
.requirement-card.status-needs_correction { border-top-color: #b45309; }
.document-card code { overflow-wrap: anywhere; }
.binding-form { margin-top: 1rem; }
.binding-form summary {
  color: #245db4;
  cursor: pointer;
  font-weight: 700;
  margin-bottom: 1rem;
}

.blocker-list {
  line-height: 1.55;
  margin-bottom: 0;
}

.readiness-panel {
  border-left: 0.35rem solid #b45309;
}

.readiness-ready {
  border-left-color: #15803d;
}

.planner-summary {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.planner-metric {
  background: white;
  border: 1px solid #d8e0ec;
  border-radius: 0.75rem;
  color: #526078;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  text-decoration: none;
}

.planner-metric:hover {
  border-color: #245db4;
}

.planner-metric strong {
  color: #172033;
  font-size: 1.65rem;
}

.planner-metric.metric-danger strong {
  color: #a11d1d;
}

.planner-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.planner-panel {
  scroll-margin-top: 1rem;
}

.planner-panel .section-head {
  align-items: center;
}

.alert-panel {
  border-left: 0.35rem solid #b91c1c;
}

.status-danger {
  background: #fee2e2;
  color: #991b1b;
}

.planner-note {
  margin-top: 0;
}

.work-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.work-item {
  align-items: flex-start;
  border-left: 0.25rem solid transparent;
  border-top: 1px solid #e4e9f1;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.9rem 0.75rem;
}

.work-item:first-child {
  border-top: 0;
}

.work-item-overdue {
  background: #fff1f2;
  border-left-color: #b91c1c;
}

.work-item-critical {
  background: #fff7ed;
  border-left-color: #ea580c;
}

.work-item-review {
  background: #f5f3ff;
  border-left-color: #7c3aed;
}

.work-item-today {
  border-left-color: #245db4;
}

.work-item-main {
  min-width: 0;
}

.work-item-heading,
.work-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.work-item-heading strong {
  overflow-wrap: anywhere;
}

.work-meta {
  color: #637089;
  font-size: 0.78rem;
  margin-top: 0.35rem;
}

.work-meta span:not(:last-child)::after {
  content: "·";
  margin-left: 0.45rem;
}

.work-meta a {
  color: #245db4;
  font-weight: 700;
}

.priority-badge,
.timing-badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.18rem 0.45rem;
  white-space: nowrap;
}

.priority-p0 {
  background: #b91c1c;
  color: white;
}

.priority-p1 {
  background: #ea580c;
  color: white;
}

.priority-p2 {
  background: #facc15;
  color: #422006;
}

.priority-p3,
.priority-p4 {
  background: #e2e8f0;
  color: #334155;
}

.timing-badge {
  background: #eef3fa;
  color: #315fa9;
}

.work-item-overdue .timing-badge {
  background: #fecaca;
  color: #991b1b;
}

.work-due {
  align-items: flex-end;
  color: #526078;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  font-size: 0.8rem;
  gap: 0.3rem;
  text-align: right;
}

@media (max-width: 40rem) {
  .app-header,
  .page-head,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .app-header form {
    margin-left: 0;
  }

  .card-grid,
  .two-column,
  .party-grid,
  .requirement-board,
  .planner-summary,
  .planner-grid {
    grid-template-columns: 1fr;
  }

  .work-item {
    flex-direction: column;
  }

  .work-due {
    align-items: flex-start;
    text-align: left;
  }
}
