:root {
  --bg: #f5f7f8;
  --ink: #152028;
  --muted: #68737d;
  --line: #dfe5e8;
  --panel: #ffffff;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
}

.page-shell { min-height: calc(100vh - 58px); }

.dashboard-header {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.dashboard-header h1,
.project-sidebar h1 {
  font-size: clamp(1.6rem, 2.4vw, 2.35rem);
  margin: 0;
}

.dashboard-header p,
.project-sidebar p,
.project-card p {
  color: var(--muted);
  margin: 6px 0 0;
}

.project-status-button {
  background: transparent;
  border: 0;
  color: var(--muted);
  display: block;
  margin: 6px 0 0;
  padding: 0;
  text-align: left;
  width: 100%;
}
.project-status-button:hover { color: var(--ink); }

.filter-bar {
  align-items: end;
  background: transparent;
  border: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto auto auto;
  margin-bottom: 12px;
  padding: 0;
}
.filter-title { color: var(--muted); font-size: .86rem; font-weight: 600; padding-bottom: 7px; }
.filter-bar label { display: grid; gap: 3px; min-width: 0; }
.filter-bar label span { color: var(--muted); font-size: .72rem; }
.filter-bar .form-select,
.filter-bar .btn { font-size: .86rem; min-height: 36px; padding-bottom: 5px; padding-top: 5px; }
.filter-bar .btn-outline-dark { background: transparent; border-color: var(--line); color: var(--muted); }
.filter-bar .btn-outline-dark:hover,
.sort-button.active { border-color: #0d6efd; color: #0d6efd; }
.filter-reset { align-self: center; color: var(--muted); font-size: .86rem; padding-left: 0; padding-right: 0; text-decoration: none; }


.summary-band,
.attention-band,
.module-block,
.project-card,
.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.summary-band,
.attention-band { padding: 18px; margin-bottom: 18px; }
.summary-band {
  border-color: #cbd8e6;
  box-shadow: 0 10px 26px rgba(21, 32, 40, .06);
  margin-bottom: 20px;
  padding: 20px;
}
.summary-band h2,
.attention-band h2,
.module-block h2 {
  font-size: 1rem;
  margin: 0 0 14px;
}
.dashboard-section-heading { align-items: center; display: flex; gap: 10px; justify-content: space-between; margin-bottom: 16px; }
.dashboard-section-heading h2 { font-family: inherit; font-size: 1.12rem; font-weight: 700; line-height: 1.2; margin: 0; }
.module-heading { align-items: center; display: flex; gap: 10px; justify-content: space-between; margin-bottom: 14px; }
.module-heading h2 { margin: 0; }
.module-heading.dashboard-section-heading { margin-bottom: 16px; }
.description-edit-button {
  background: transparent;
  border: 0;
  color: inherit;
  display: block;
  padding: 0;
  text-align: left;
  width: 100%;
}
.description-edit-button:hover { color: #0d6efd; }
.description-edit-button .empty-state { display: block; }
.sidebar-edit-button {
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
  text-align: left;
}
.sidebar-edit-button:hover { color: #0d6efd; }
.sidebar-status-edit-button {
  background: transparent;
  border: 0;
  color: var(--muted);
  display: block;
  margin: 6px 0 0;
  padding: 0;
  text-align: left;
  width: 100%;
}
.sidebar-status-edit-button:hover { color: #0d6efd; }
.icon-add-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  font-weight: 700;
  height: 28px;
  justify-content: center;
  line-height: 1;
  width: 28px;
}
.icon-add-button:hover { border-color: #0d6efd; color: #0d6efd; }

.summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.summary-grid-compact { grid-template-columns: minmax(320px, 1.3fr) repeat(3, minmax(160px, .8fr)); }
.summary-tile {
  background: #f8fafb;
  border: 1px solid #d5e0e8;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 14px;
}
.summary-tile b { font-size: 1.42rem; line-height: 1.05; }
.summary-tile small { color: var(--muted); font-size: .8rem; }
.summary-link,
.summary-link:link,
.summary-link:visited {
  color: inherit;
  text-decoration: none;
}
.summary-link b,
.summary-link small { text-decoration: none; }
.summary-link:hover { border-color: #0d6efd; color: inherit; }
.summary-status-compact a.summary-link,
.summary-status-compact a.summary-link:link,
.summary-status-compact a.summary-link:visited,
.summary-status-compact a.summary-link:hover,
.summary-status-compact a.summary-link:focus {
  color: inherit;
  text-decoration: none;
}
.summary-status-compact a.summary-link b,
.summary-status-compact a.summary-link small {
  color: inherit;
  text-decoration: none;
}
.summary-status-compact a.summary-total.summary-link b {
  color: var(--ink);
}
.summary-status-compact a.summary-total.summary-link small {
  color: var(--muted);
}
.summary-status-compact {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
}
.summary-status-compact .summary-total {
  align-items: baseline;
  display: inline-flex;
  gap: 8px;
  margin-right: 4px;
  min-width: max-content;
}
.summary-status-compact .summary-total b { font-size: 1.55rem; }
.summary-zone {
  align-items: baseline;
  border: 1px solid currentColor;
  border-radius: 999px;
  display: inline-flex;
  gap: 6px;
  padding: 5px 9px;
}
.summary-zone b { font-size: 1rem; }
.summary-zone small { color: currentColor; font-size: .76rem; }
.summary-red { background: #fff7f7; border-color: #f0c4c4; color: #a12626; }
.summary-yellow { background: #fffaf0; border-color: #ead08a; color: #83620a; }
.summary-positive { background: #f3fbf6; border-color: #b7dfc7; color: #176c38; }
.summary-risk { background: #fff7f7; border-color: #f0c4c4; color: #a12626; }
.summary-reputation { background: #f7f8fb; border-color: #cfd6e2; color: #4f5b6a; }


.calendar-filter-bar {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(6, minmax(125px, 1fr)) auto auto;
  margin-bottom: 14px;
}
.calendar-filter-bar label { display: grid; gap: 3px; min-width: 0; }
.calendar-filter-bar label span { color: var(--muted); font-size: .72rem; }
.calendar-filter-bar .form-control,
.calendar-filter-bar .form-select,
.calendar-filter-bar .btn { font-size: .86rem; min-height: 36px; padding-bottom: 5px; padding-top: 5px; }
.calendar-upcoming,
.calendar-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 16px;
}
.upcoming-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.upcoming-item {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  display: flex;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  text-align: left;
  text-decoration: none;
}
button.upcoming-item { background: #fff; width: 100%; }
a.upcoming-item { background: #fff; }
.upcoming-item:hover { border-color: #0d6efd; color: inherit; }
.upcoming-date {
  background: #f1f5f8;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--ink);
  display: grid;
  flex: 0 0 auto;
  font-weight: 700;
  gap: 1px;
  line-height: 1.1;
  padding: 6px 8px;
  text-align: center;
}
.upcoming-date small { color: inherit; font-size: .68rem; font-weight: 600; opacity: .82; }
.upcoming-body { display: grid; gap: 2px; min-width: 0; }
.upcoming-body b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upcoming-body small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-toolbar {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}
.calendar-nav,
.calendar-view-switch { align-items: center; display: flex; gap: 8px; }
.calendar-weekdays {
  color: var(--muted);
  display: grid;
  font-size: .78rem;
  font-weight: 700;
  gap: 8px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-bottom: 8px;
  text-align: center;
}
.calendar-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.calendar-grid-day { grid-template-columns: 1fr; }
.calendar-day {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 132px;
  min-width: 0;
  padding: 8px;
}
.calendar-grid-week .calendar-day { min-height: 220px; }
.calendar-grid-day .calendar-day { min-height: 420px; }
.calendar-day.is-outside { background: #f8fafb; color: var(--muted); }
.calendar-day.is-today { border-color: #0d6efd; box-shadow: inset 0 0 0 1px #0d6efd; }
.calendar-day-head {
  align-items: baseline;
  display: flex;
  gap: 5px;
  justify-content: space-between;
  margin-bottom: 6px;
}
.calendar-day-head small { color: var(--muted); font-size: .72rem; }
.calendar-event {
  background: transparent;
  border: 0;
  border-left: 3px solid #0d6efd;
  color: inherit;
  display: grid;
  gap: 1px;
  margin-top: 6px;
  min-width: 0;
  padding: 5px 6px;
  text-align: left;
  text-decoration: none;
  width: 100%;
}
.calendar-event:hover { background: #f8fafb; color: inherit; }
.calendar-event b,
.calendar-event small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event b { font-size: .82rem; }
.calendar-event small { color: var(--muted); font-size: .72rem; }
.year-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.year-month {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
.year-month h3 { font-size: .95rem; margin: 0 0 8px; }
.mini-weekdays,
.mini-calendar {
  display: grid;
  gap: 3px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.mini-weekdays { color: var(--muted); font-size: .66rem; text-align: center; }
.mini-day {
  align-items: center;
  border-radius: 5px;
  display: flex;
  font-size: .72rem;
  gap: 2px;
  justify-content: center;
  min-height: 25px;
}
.mini-day.is-outside { color: #b0bac2; }
.mini-day.is-today { outline: 1px solid #0d6efd; }
.mini-day b {
  background: #0d6efd;
  border-radius: 999px;
  color: #fff;
  font-size: .58rem;
  min-width: 14px;
  padding: 1px 3px;
  text-align: center;
}

.attention-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.attention-column h3 {
  color: var(--muted);
  font-size: .78rem;
  letter-spacing: .04em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.attention-item,
.attention-empty {
  align-items: center;
  color: var(--ink);
  display: flex;
  gap: 8px;
  min-height: 30px;
  text-decoration: none;
}

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

.dashboard-project-actions {
  display: flex;
  justify-content: flex-end;
  margin: -2px 0 10px;
}
.dashboard-project-actions .icon-add-button { height: 32px; width: 32px; }

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

.project-card { padding: 16px; }
.project-card-top { align-items: center; display: flex; gap: 8px; min-height: 24px; }
.dashboard-status-button,
.dashboard-status-label {
  align-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: .75rem;
  gap: 6px;
  line-height: 1.2;
  padding: 2px 8px;
}
.dashboard-status-button:hover { border-color: #0d6efd; color: #0d6efd; }
.sidebar-status-button {
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
  text-align: left;
}
.sidebar-status-button:hover { color: #0d6efd; }
.project-title { color: var(--ink); display: block; font-size: 1.08rem; font-weight: 700; margin-top: 8px; text-decoration: none; }
.project-meta { color: var(--muted); font-size: .9rem; margin-top: 4px; }

.priority-pill,
.pin-mark {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: .75rem;
  padding: 2px 8px;
}

.project-facts {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
  margin: 10px 0 0;
}

.project-facts div,
.project-sidebar dl div {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.project-main-facts { margin-top: 10px; }

.project-card-signals {
  background: transparent;
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding: 0;
  text-align: left;
  width: 100%;
}
.project-card-signals:hover .signal-pill { border-color: #0d6efd; }

.signal-pill {
  align-items: baseline;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  gap: 5px;
  padding: 3px 8px;
}
.signal-pill b { font-size: .86rem; }
.signal-pill small { color: var(--muted); font-size: .72rem; }
.signal-positive { border-color: #b7dfc7; color: #176c38; }
.signal-risk { border-color: #f0c4c4; color: #a12626; }
.signal-reputation { border-color: #ead08a; color: #83620a; }
.signal-decision { border-color: #b9cef5; color: #174f9f; }

.project-date-strip {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 10px 0 0;
  padding-top: 8px;
}
.project-date-strip div { min-width: 0; }
.project-date-strip dt { font-size: .7rem; }
.project-date-strip dd { font-size: .86rem; white-space: nowrap; }

.project-card-brief {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding-top: 10px;
}
.project-card-brief strong { display: block; font-size: .9rem; }
.project-card-brief span { color: var(--muted); display: block; font-size: .82rem; }

.fact-date {
  color: var(--muted);
  display: block;
  font-size: .86rem;
  margin-top: 2px;
}

dt { color: var(--muted); font-size: .78rem; font-weight: 500; }
dd { margin: 0; }

.status-dot {
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 auto;
  height: 10px;
  width: 10px;
}
.status-dot.lg { height: 14px; width: 14px; }

.project-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: calc(100vh - 58px);
}

.project-sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  height: calc(100vh - 58px);
  overflow: auto;
  padding: 24px;
  position: sticky;
  top: 58px;
}

.back-link { color: var(--muted); display: inline-block; margin-bottom: 22px; text-decoration: none; }
.sidebar-status { align-items: center; display: flex; gap: 8px; margin-bottom: 10px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.project-content { display: grid; gap: 16px; padding: 24px; }
.module-block { padding: 18px; }
.module-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.assessment-module { display: grid; gap: 14px; }
.assessment-summary { background: transparent; border: 1px solid var(--line); border-radius: 8px; color: inherit; display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 12px; text-align: left; width: 100%; }
.assessment-summary:hover { border-color: #0d6efd; }
.assessment-summary span { display: grid; gap: 2px; min-width: 0; }
.assessment-summary b { font-size: 1.08rem; }
.assessment-summary small { color: var(--muted); }
.assessment-summary .assessment-positive b { color: #198754; }
.assessment-summary .assessment-risk b { color: #dc3545; }
.assessment-summary .assessment-balance.is-positive b { color: #198754; }
.assessment-summary .assessment-balance.is-negative b { color: #dc3545; }
.assessment-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.assessment-column { min-width: 0; }
.assessment-column h3 { font-size: .92rem; margin: 0; }
.section-action-title { align-items: center; display: inline-flex; gap: 8px; margin-bottom: 8px; max-width: 100%; vertical-align: top; }
.section-action-title h3 { flex: 0 1 auto; min-width: 0; }
.section-action-title .icon-add-button { flex: 0 0 24px; height: 24px; width: 24px; }
.assessment-column .compact-heading { justify-content: flex-start; gap: 8px; margin-bottom: 8px; }
.assessment-column .compact-heading .icon-add-button { flex: 0 0 24px; height: 24px; width: 24px; }
.compact-heading { margin-bottom: 8px; }
.brief-row { border-top: 1px solid var(--line); padding: 10px 0; }
.brief-title { font-weight: 700; }
.brief-links { display: flex; gap: 10px; margin-top: 4px; }
.brief-links a { color: #0d6efd; text-decoration: none; }
.modal-summary { margin-bottom: 14px; }
.dashboard-risk-summary { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.modal-section-title { font-size: .82rem; margin: 0 0 6px; text-transform: uppercase; color: var(--muted); }
.assessment-detail-groups { display: grid; gap: 18px; }
.assessment-detail-group { display: grid; gap: 6px; }
.assessment-detail-group h3 { border-bottom: 1px solid var(--line); font-size: .9rem; margin: 0; padding-bottom: 6px; }
.assessment-detail-row { border-top: 1px solid var(--line); padding: 10px 0; }
.assessment-detail-group .assessment-detail-row:first-of-type { border-top: 0; }
.assessment-detail-row p { margin: 6px 0 0; }

.timeline { border-left: 2px solid var(--line); margin-left: 6px; }
.timeline-row { display: grid; gap: 14px; grid-template-columns: 14px 1fr; margin-left: -8px; padding: 0 0 18px; scroll-margin-top: 86px; }
.timeline-row:target .timeline-entry-card { outline: 2px solid rgba(13, 110, 253, .35); outline-offset: 4px; }
.timeline-marker { border: 3px solid #fff; border-radius: 999px; height: 16px; margin-top: 3px; width: 16px; }
.timeline-entry-card {
  background: transparent !important;
  border: 0;
  color: inherit;
  display: grid;
  gap: 2px;
  padding: 0;
  text-align: left;
  width: 100%;
}
button.timeline-entry-card { cursor: pointer; }
button.timeline-entry-card:hover .timeline-title { color: #0d6efd; }
button.timeline-entry-card:focus-visible {
  border-radius: 6px;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, .2);
  outline: 0;
}
.timeline-title { font-weight: 700; }
.timeline-meta { color: var(--muted); font-size: .88rem; }
.timeline-description { display: block; margin-top: 4px; }
.timeline-period { color: var(--muted); font-size: .9rem; margin: 4px 0 0; }

.timeline-attachment-indicator {
  color: #0d6efd;
  display: inline-flex;
  font-size: .78rem;
  font-weight: 700;
  gap: 2px;
  margin-left: 6px;
  vertical-align: middle;
}
.attachment-panel { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.attachment-panel h3 { font-size: 1rem; margin: 0 0 10px; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.attachment-chip {
  align-items: center;
  background: #f7fbff;
  border: 1px solid #d8e7ff;
  border-radius: 8px;
  color: #084298;
  display: inline-flex;
  gap: 6px;
  max-width: 100%;
  padding: 7px 9px;
}
.attachment-chip:hover { background: #eef6ff; }
.attachment-chip a { color: #084298; display: inline-flex; gap: 6px; text-decoration: none; }
.attachment-chip small { color: var(--muted); margin-left: 4px; }
.attachment-chip-editable { align-items: center; }
.attachment-remove { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; color: #b42318; font-size: .78rem; cursor: pointer; }
.attachment-remove input { margin: 0; }
.attachment-download { border-left: 1px solid #b6d4fe; margin-left: 2px; padding-left: 8px; }
.empty-state.compact { padding: 4px 0; }
.journal-item.change-log-item,
.change-log-item { background: transparent !important; box-shadow: none; }
.change-log-button {
  background: transparent !important;
  border: 0;
  color: inherit;
  display: block;
  padding: 0;
  text-align: left;
  width: 100%;
}
.change-log-item:hover,
.change-log-item:focus-within,
.change-log-button:hover,
.change-log-button:focus { background: transparent !important; }
.change-log-button:hover strong { color: #0d6efd; }
.change-log-button:focus-visible { border-radius: 6px; box-shadow: 0 0 0 3px rgba(13, 110, 253, .2); outline: 0; }
.change-log-head { align-items: baseline; display: flex; gap: 12px; justify-content: space-between; }
.change-list { color: #343a40; display: grid; gap: 4px; margin-top: 8px; }
.change-list span { background: transparent !important; border: 0; display: block; line-height: 1.35; padding: 0; }
.change-list b { color: #212529; font-weight: 700; }
.change-list del { color: #842029; margin-right: 5px; text-decoration-thickness: 1.5px; }
.change-list ins { color: #0f5132; text-decoration: none; }
.change-more { color: var(--muted); font-size: .88rem; }
.history-item:first-child { border-top: 0; padding-top: 0; }
.history-loader { color: var(--muted); padding: 12px 0; text-align: center; }
.timeline-row-stage-start .timeline-marker { border-radius: 4px; }
.timeline-row-stage-end .timeline-marker { border-radius: 4px; box-shadow: inset 0 0 0 3px #fff; }
.timeline-row-checkpoint .timeline-marker { transform: rotate(45deg); }
.timeline-fork-block {
  --fork-gap: clamp(24px, 4vw, 56px);
  --fork-rise: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 10px;
  position: relative;
}
.timeline-fork-block::before,
.timeline-fork-block::after {
  display: none;
}
.timeline-fork-paths {
  align-items: start;
  display: grid;
  gap: 0 var(--fork-gap);
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 1fr);
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}
.scenario-date-rows { align-items: stretch; }
.scenario-date-head {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 0 0 10px 8px;
  text-transform: uppercase;
}
.scenario-date-cell {
  border-top: 1px solid var(--line);
  min-width: 0;
  padding-top: 12px;
}
.scenario-date-cell:nth-child(2n + 3),
.scenario-date-cell:nth-child(2n + 4) { margin-top: 12px; }
.scenario-date-empty { min-height: 34px; }
.scenario-lane-row { margin-bottom: 10px; }
.scenario-lane-row:last-child { margin-bottom: 0; }
.scenario-lane-aligned { padding: 0 12px 10px; }
.scenario-lane-aligned .scenario-timeline { margin-top: 0; }
.scenario-row-label { color: #084298; font-size: .82rem; font-weight: 700; padding-left: 22px; }
.timeline-fork-active {
  min-width: 0;
  position: relative;
  z-index: 2;
}
.timeline-fork-alt {
  min-width: 0;
  position: relative;
  z-index: 1;
}
.timeline-fork-main {
  position: relative;
  z-index: 2;
}
.timeline-fork-main .timeline-row > .timeline-entry-card,
.timeline-fork-active .timeline-row > .timeline-entry-card {
  background: var(--panel);
  border-radius: 6px;
  padding-left: 2px;
}
.scenario-split {
  --branch-color: #0d6efd;
  margin: 0;
  padding: 0;
  position: relative;
}
.scenario-split::before { display: none; }
.scenario-split-label { color: var(--muted); font-size: .78rem; letter-spacing: .04em; margin-bottom: 12px; text-transform: uppercase; }
.scenario-lanes { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.scenario-lane { background: #f7fbff; border: 1px solid #d8e7ff; border-radius: 8px; box-shadow: none; padding: 14px; }
.scenario-lane.is-active { border-color: #198754; box-shadow: none; }
.scenario-lane-header { align-items: center; display: flex; gap: 8px; justify-content: space-between; margin-bottom: 8px; }
.scenario-lane-header span { background: #d1e7dd; border-radius: 999px; color: #0f5132; font-size: .75rem; padding: 2px 8px; }
.scenario-comment { color: var(--muted); font-size: .9rem; margin: 0 0 12px; }
.scenario-merge { border-top: 1px solid #b6d4fe; color: #084298; font-size: .86rem; margin-top: 12px; padding-top: 10px; }
.scenario-timeline { border-left-color: var(--branch-color); margin-top: 8px; }
.scenario-timeline .timeline-marker { border-color: #f7fbff; }
.signature { color: var(--muted); font-size: .86rem; }

.journal-item,
.comment-item {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.event-type {
  border-radius: 999px;
  color: #fff;
  display: inline-block;
  font-size: .75rem;
  margin-right: 8px;
  padding: 2px 8px;
}

.compact-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-height: 36px;
}
button.compact-row,
.editable-item {
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  color: inherit;
  padding-left: 0;
  padding-right: 0;
  text-align: left;
  width: 100%;
}
.editable-item:hover { color: #0d6efd; }
.comment-item.editable-item { display: block; }

.empty-state { color: var(--muted); padding: 18px 0; }
.stack-form p { margin-bottom: 10px; }
.stack-form input,
.stack-form select,
.stack-form textarea,
.login-panel input {
  border: 1px solid var(--line);
  border-radius: 6px;
  display: block;
  padding: 8px 10px;
  width: 100%;
}
.timeline-edit-form textarea { min-height: 96px; }
.timeline-add-tabs { padding-top: 14px; }
.inline-footer { border-top: 1px solid var(--line); margin: 14px -16px -16px; padding-bottom: 0; }

.login-wrap {
  display: grid;
  min-height: calc(100vh - 58px);
  place-items: center;
  padding: 20px;
}
.login-panel { max-width: 420px; padding: 26px; width: 100%; }
.login-panel h1 { font-size: 1.6rem; margin: 0; }

@media (max-width: 980px) {
  .filter-bar,
  .calendar-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-title { grid-column: 1 / -1; }
  .attention-grid,
  .summary-grid,
  .module-grid,
  .upcoming-list,
  .year-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-layout { grid-template-columns: 1fr; }
  .project-sidebar { height: auto; position: static; }
}

@media (max-width: 640px) {
  .dashboard-header,
  .filter-bar,
  .calendar-filter-bar { align-items: stretch; grid-template-columns: 1fr; flex-direction: column; }
  .attention-grid,
  .summary-grid,
  .module-grid,
  .project-facts,
  .upcoming-list,
  .year-grid { grid-template-columns: 1fr; }
  .project-content,
  .project-sidebar { padding: 16px; }
  .calendar-toolbar { align-items: stretch; flex-direction: column; }
  .calendar-nav,
  .calendar-view-switch { flex-wrap: wrap; }
  .calendar-grid { overflow-x: auto; }
  .calendar-day { min-width: 150px; }
}


@media (max-width: 760px) {
  .timeline-fork-paths { grid-template-columns: 1fr; }
  .scenario-date-head:nth-child(2) { margin-top: 12px; }
  .timeline-fork-block::before,
  .timeline-fork-block::after { display: none; }
}

.current-status-module { display: grid; gap: 12px; }
.current-status-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.current-status-cell { border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 4px; padding: 12px; }
.current-status-cell small { color: var(--muted); }
.current-status-cell span, .date-distance { color: var(--muted); }
.current-status-link { color: inherit; font-weight: 700; text-decoration: none; }
.current-status-link:hover { color: #0d6efd; }
.fact-date { color: var(--muted); display: block; font-size: .86rem; margin-top: 2px; }
.journal-list .is-extra { display: none; }
.journal-more-button { background: transparent; border: 1px solid var(--line); border-radius: 8px; color: #0d6efd; margin-top: 10px; padding: 8px 12px; }
.journal-more-button:hover { border-color: #0d6efd; }
@media (max-width: 760px) { .current-status-grid { grid-template-columns: 1fr; } }

.dependency-panel { border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 8px; padding: 12px; }
.dependency-panel h3 { font-size: .95rem; margin: 0; }
.dependency-list select { min-height: 144px; width: 100%; }
.dependency-list select option:checked { background: #e7f1ff; }
.field-error { color: #dc3545; display: block; font-size: .86rem; margin-top: 4px; }

.timeline-description-wrap { display: block; margin-top: 4px; }
.timeline-description-preview { appearance: none; background: none; border: 0; box-shadow: none; color: inherit; display: inline; line-height: 1.35; max-width: 100%; overflow: hidden; padding: 0; text-align: left; }
.timeline-description-preview:hover { color: #0d6efd; }
.timeline-description-full { line-height: 1.55; white-space: normal; }

.calendar-event-meta { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.calendar-event-meta h3 { font-size: .95rem; margin: 0 0 6px; }
.calendar-event-meta p { color: var(--muted); margin: 0 0 8px; }

.assignment-summary { background: var(--panel); border: 1px solid #cbd8e6; border-radius: 8px; box-shadow: 0 10px 26px rgba(21, 32, 40, .06); display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 14px; padding: 14px; }
.dashboard-assignment-summary { display: block; grid-template-columns: none; }
.assignment-summary-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.assignment-summary-item { background: #f8fafb; border: 1px solid #d5e0e8; border-radius: 8px; color: inherit; display: grid; gap: 2px; padding: 12px; text-decoration: none; }
.assignment-summary-grid a.assignment-summary-item,
.assignment-summary-grid a.assignment-summary-item:link,
.assignment-summary-grid a.assignment-summary-item:visited {
  color: inherit;
  text-decoration: none;
}
.assignment-summary-grid a.assignment-summary-item b,
.assignment-summary-grid a.assignment-summary-item small {
  text-decoration: none;
}
.assignment-summary-grid a.assignment-summary-item:not(.is-overdue) b {
  color: var(--ink);
}
.assignment-summary-item b { font-size: 1.55rem; line-height: 1; }
.assignment-summary-item small { color: var(--muted); font-size: .82rem; }
.assignment-summary-item:hover { border-color: #0d6efd; color: inherit; }
.assignment-summary-item.is-overdue { background: #fff7f7; border-color: #f0c4c4; color: #a12626; }
.assignment-filter-bar { align-items: end; display: grid; gap: 8px; grid-template-columns: minmax(220px, 1.4fr) repeat(5, minmax(135px, 1fr)) auto auto; margin-bottom: 14px; }
.assignment-filter-bar label { display: grid; gap: 3px; min-width: 0; }
.assignment-filter-bar label span { color: var(--muted); font-size: .72rem; }
.assignment-filter-bar .form-select, .assignment-filter-bar .form-control, .assignment-filter-bar .btn { font-size: .86rem; min-height: 36px; padding-bottom: 5px; padding-top: 5px; }
.assignment-table { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.assignment-table-head, .assignment-row { display: grid; gap: 10px; grid-template-columns: 16px minmax(220px, 1.4fr) minmax(110px, .6fr) minmax(150px, .8fr) minmax(170px, .9fr) minmax(130px, .7fr) minmax(130px, .7fr); }
.assignment-table-head { background: #f8fafb; color: var(--muted); font-size: .72rem; font-weight: 700; padding: 10px 12px; text-transform: uppercase; }
.assignment-row { align-items: center; background: #fff; border: 0; border-top: 1px solid var(--line); color: inherit; padding: 12px; text-align: left; width: 100%; }
.assignment-row:hover { background: #f8fafb; }
.assignment-row.is-overdue { background: #fffafa; }
.assignment-row span { min-width: 0; }
.assignment-row small { color: var(--muted); display: block; font-size: .78rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assignment-main { display: grid; gap: 2px; }
.assignment-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assignment-dot { border-radius: 999px; height: 12px; width: 12px; }
.assignment-description { background: #f8fafb; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); padding: 10px; }
@media (max-width: 1100px) { .assignment-table { overflow-x: auto; } .assignment-table-head, .assignment-row { min-width: 1040px; } }
@media (max-width: 980px) { .assignment-summary, .assignment-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .assignment-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .assignment-summary, .assignment-summary-grid, .assignment-filter-bar { grid-template-columns: 1fr; } }

.summary-band > .dashboard-section-heading h2,
.dashboard-assignment-summary > .dashboard-section-heading h2,
.dashboard-upcoming-events > .dashboard-section-heading h2 {
  font-family: inherit;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}
.dashboard-assignment-summary .assignment-summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 640px) {
  .dashboard-assignment-summary { overflow-x: auto; }
  .dashboard-assignment-summary .assignment-summary-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); min-width: 486px; }
}


.module-heading-row {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}
.module-heading-row h2 { margin: 0; }
.icon-button {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: inline-flex;
  font-size: 1.1rem;
  font-weight: 600;
  height: 32px;
  justify-content: center;
  line-height: 1;
  width: 32px;
}
.icon-button:hover { background: #eef2f7; }
.compact-row-button:hover { color: #0d6efd; }
