:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --border: #d8dee4;
  --text: #1f2933;
  --muted: #5f6b7a;
  --accent: #1f6feb;
  --accent-dark: #1858bc;
  --danger: #c0392b;
  --cms-gantt-task: #3b82f6;
  --cms-gantt-progress: #1d4ed8;
  --cms-gantt-section: #334155;
  --cms-gantt-milestone: #db7dc5;
  --cms-gantt-critical: #dc2626;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.top-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}

.top-bar h1.product-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.product-brand {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}

.product-tagline,
.brand-copyright {
  margin: 0.1rem 0 0;
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.2;
  white-space: nowrap;
  max-width: 22rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  justify-self: start;
  min-width: 0;
  flex-wrap: wrap;
}

.top-center {
  justify-self: center;
  text-align: center;
  padding: 0 0.5rem;
  line-height: 1.2;
}

.top-center .active-sessions {
  display: block;
  margin-top: 0.15rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-self: end;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.import-summary {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
}

.import-summary.hidden {
  display: none;
}

#import-modal .import-review-panel {
  width: min(960px, 100%);
  max-height: min(90vh, 900px);
  display: flex;
  flex-direction: column;
}

#import-modal .import-review-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 0;
  overflow: hidden;
  flex: 1;
}

.import-detected-sheets {
  margin: 0;
  font-size: 0.9rem;
}

.import-review-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.import-review-toolbar.hidden {
  display: none;
}

.import-review-actions {
  display: flex;
  gap: 0.4rem;
}

.import-review-filter input,
.import-review-sheet-filter select {
  min-width: 10rem;
  max-width: 16rem;
}

.import-selection-meta {
  margin-left: auto;
  font-size: 0.85rem;
}

.import-changes-wrap {
  border: 1px solid var(--border);
  border-radius: 6px;
  max-height: min(48vh, 420px);
  overflow: auto;
  min-height: 0;
  flex: 1;
}

.import-changes-wrap.hidden {
  display: none;
}

.import-changes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.import-changes-table th,
.import-changes-table td {
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.import-changes-table th {
  position: sticky;
  top: 0;
  background: var(--panel, #fff);
  z-index: 1;
  font-weight: 600;
}

.import-changes-table tr.import-change-row {
  cursor: pointer;
}

.import-changes-table tr.import-change-row:hover {
  background: rgba(0, 0, 0, 0.03);
}

.import-changes-table tr.import-change-row.is-selected {
  background: rgba(37, 99, 235, 0.06);
}

.import-col-check {
  width: 2rem;
}

.import-context-cell {
  max-width: 22rem;
  color: var(--muted, #555);
  line-height: 1.35;
}

.import-change-values {
  line-height: 1.35;
  max-width: 18rem;
}

.import-change-blank {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #b45309;
}

.import-change-detail {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  font-size: 0.85rem;
  white-space: pre-wrap;
  max-height: 10rem;
  overflow: auto;
  background: rgba(0, 0, 0, 0.02);
}

.import-change-detail.hidden {
  display: none;
}

.import-change-detail strong {
  display: inline-block;
  min-width: 3.5rem;
}

.top-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.brand-logo-sm {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
}

.project-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.active-sessions {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.user-menu-btn {
  border: none;
  background: transparent;
  padding: 0.2rem 0.35rem;
  margin: 0;
  cursor: pointer;
  border-radius: 4px;
  max-width: 16rem;
  text-align: left;
}

.user-menu-btn:hover,
.user-menu-btn:focus-visible {
  background: #eef2f6;
  outline: none;
}

.user-menu-btn #user-info {
  display: inline-block;
  max-width: 15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.user-menu-actions {
  flex-direction: column;
  align-items: stretch;
}

.user-menu-actions button {
  width: 100%;
}

.user-menu-actions button.hidden {
  display: none;
}

.change-password-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: min(22rem, 90vw);
}

.change-password-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
}

.change-password-field input {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font: inherit;
}

.change-password-rules {
  margin: 0;
  font-size: 0.8rem;
  white-space: pre-line;
}

.active-sessions.hidden {
  display: none;
}

button {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button.primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.status-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  min-width: 0;
  line-height: 1.25;
}

#status-text.status-auto-refresh {
  color: var(--muted);
  font-style: italic;
  opacity: 0.85;
}

#status-error.status-error {
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

#status-error.hidden {
  display: none;
}

.tab-bar-row {
  display: flex;
  align-items: stretch;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border-bottom: none;
  flex: 1;
  min-width: 0;
}

.tab-bar-actions {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem 0.5rem 0;
  flex-shrink: 0;
}

.tab-bar-actions button {
  white-space: nowrap;
}

.tab-bar button {
  border: none;
  background: transparent;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
}

.tab-bar button.active {
  background: #e8eef8;
  color: var(--accent-dark);
  font-weight: 600;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.toolbar-view-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.toolbar-view-actions .toolbar-meta {
  margin-left: 0.25rem;
}

.templates-save-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.templates-save-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.templates-save-field input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font: inherit;
}

.templates-save-keep {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.templates-save-hint {
  margin: 0;
  font-size: 0.85rem;
}

.templates-load-body {
  min-height: 4rem;
  max-height: min(50vh, 22rem);
  overflow: auto;
}

.templates-load-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.templates-load-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.35rem 0.25rem;
  border: 1px solid transparent;
  border-radius: 4px;
}

.templates-load-row:hover {
  background: #f6f8fa;
  border-color: #d0d7de;
}

.templates-load-select {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.35rem 0.4rem;
  font: inherit;
  cursor: pointer;
}

.templates-load-name {
  display: block;
  font-weight: 600;
}

.templates-load-meta {
  display: block;
  font-size: 0.75rem;
  color: #656d76;
}

.templates-load-delete {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid #fecaca;
  border-radius: 0.3rem;
  background: #fff;
  color: #dc2626;
  cursor: pointer;
  line-height: 0;
}

.templates-load-delete:hover {
  background: #fef2f2;
  border-color: #f87171;
  color: #b91c1c;
}

.templates-load-delete:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 1px;
}

#grid {
  position: relative;
  margin: 0 1rem 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  flex: 1 1 auto;
  min-height: 0;
  /* Keep scroll inside Tabulator so headers + bottom bar stay in the viewport. */
  overflow: hidden;
}

#grid.summary-expand-busy {
  cursor: wait;
}

.summary-expand-loading {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.45);
  pointer-events: all;
}

.summary-expand-spinner {
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid #c5d0dc;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: summary-expand-spin 0.7s linear infinite;
}

@keyframes summary-expand-spin {
  to {
    transform: rotate(360deg);
  }
}

.config-panel {
  margin: 0 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-height: 0;
}

.config-panel.hidden {
  display: none;
}

.config-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 0 0 auto;
  min-height: 2.25rem;
}

.config-toolbar .primary {
  font-weight: 600;
}

.config-path {
  margin-left: auto;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.85rem;
}

.config-validation-status {
  font-size: 0.85rem;
  font-family: Consolas, Monaco, "Courier New", monospace;
}

.config-validation-status.config-valid {
  color: #16a34a;
}

.config-validation-status.config-invalid {
  color: #dc2626;
}

.config-toolbar button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.config-editor-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  border: 1px solid #3c3c3c;
  border-radius: 4px;
  background: #1e1e1e;
  overflow: hidden;
}

.config-highlight,
.config-editor {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 1rem;
  border: 0;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
  tab-size: 2;
  white-space: pre;
  overflow-x: scroll;
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.config-highlight {
  pointer-events: none;
  color: #d4d4d4;
  background: transparent;
}

.config-editor {
  resize: none;
  color: transparent;
  caret-color: #d4d4d4;
  background: transparent;
}

.config-editor:focus {
  outline: none;
}

.config-highlight .yaml-key {
  color: #9cdcfe;
}

.config-highlight .yaml-string {
  color: #ce9178;
}

.config-highlight .yaml-number {
  color: #b5cea8;
}

.config-highlight .yaml-boolean,
.config-highlight .yaml-null {
  color: #569cd6;
}

.config-highlight .yaml-punctuation {
  color: #d4d4d4;
}

.config-highlight .yaml-comment {
  color: #6a9955;
}

body.config-tab-active .toolbar,
body.config-tab-active #grid,
body.logs-tab-active .toolbar,
body.logs-tab-active #grid,
body.completions-tab-active .toolbar,
body.completions-tab-active #grid,
body.report-tab-active .toolbar,
body.report-tab-active #grid,
body.rundown-tab-active .toolbar,
body.rundown-tab-active #grid,
body.documents-tab-active .toolbar,
body.documents-tab-active #grid {
  display: none;
}

body.config-tab-active .tab-bar-actions,
body.logs-tab-active .tab-bar-actions,
body.documents-tab-active .tab-bar-actions {
  visibility: hidden;
}

.settings-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  overflow: hidden;
  background: #f6f8fa;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 0.5rem;
  background: #eef1f4;
  border-right: 1px solid #d0d7de;
  overflow-y: auto;
}

.settings-nav-item {
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  color: #1f2328;
}

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

.settings-nav-item.active {
  background: #ffffff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #0969da;
}

.settings-content {
  padding: 1rem 1.25rem;
  overflow: auto;
  background: #ffffff;
  min-height: 0;
}

.settings-page-title {
  margin: 0 0 1rem;
  font-size: 1.25rem;
}

.settings-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #d0d7de;
}

.settings-form-actions .primary {
  font-weight: 600;
}

.settings-form-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.settings-section-title {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.settings-disk-table th:nth-child(3),
.settings-disk-table th:nth-child(4),
.settings-disk-table th:nth-child(5),
.settings-disk-table td:nth-child(3),
.settings-disk-table td:nth-child(4),
.settings-disk-table td:nth-child(5) {
  text-align: right;
  white-space: nowrap;
}

.settings-disk-table td code {
  font-size: 0.88rem;
  word-break: break-all;
}

.settings-process-table th:nth-child(2),
.settings-process-table th:nth-child(3),
.settings-process-table th:nth-child(4),
.settings-process-table td:nth-child(2),
.settings-process-table td:nth-child(3),
.settings-process-table td:nth-child(4) {
  text-align: right;
  white-space: nowrap;
}

.settings-process-table tr.settings-process-total td {
  font-weight: 600;
  border-top: 1px solid #d0d7de;
}

.settings-process-table tr.settings-process-peak td,
.settings-process-table tr.settings-process-avg td {
  color: #656d76;
}

.settings-process-chart-wrap {
  position: relative;
  width: 100%;
  max-width: 920px;
  height: 240px;
  margin: 0.75rem 0 0.25rem;
}

.settings-network-table th:nth-child(2),
.settings-network-table th:nth-child(3),
.settings-network-table td:nth-child(2),
.settings-network-table td:nth-child(3) {
  text-align: right;
  white-space: nowrap;
}

.settings-network-table td code {
  font-size: 0.88rem;
  word-break: break-all;
}

.settings-hint {
  color: #656d76;
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.settings-revision {
  user-select: text;
  cursor: default;
}

.settings-form {
  display: grid;
  gap: 0.85rem;
  max-width: 42rem;
}

.settings-form.inline {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  align-items: end;
  max-width: none;
}

.settings-field {
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
}

.settings-field input,
.settings-field select {
  padding: 0.45rem 0.55rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font: inherit;
  max-width: 100%;
}

.settings-field textarea {
  padding: 0.45rem 0.55rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font: inherit;
  max-width: 100%;
  resize: vertical;
  min-height: 4rem;
}

.settings-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
}

.settings-mail-section {
  margin: 1.25rem 0 1.5rem;
}

.settings-mail-section > h3 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
}

.settings-mail-grid {
  max-width: 48rem;
}

.settings-mail-grid .settings-field-wide {
  grid-column: 1 / -1;
}

.settings-mail-reports {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.settings-mail-card {
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  display: grid;
  gap: 0.65rem;
  background: #fafbfc;
}

.settings-mail-card h3 {
  margin: 0;
  font-size: 1rem;
}

.settings-mail-sheet-grid {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.settings-mail-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.settings-field-label {
  font-size: 0.92rem;
}

#settings-timezone {
  min-width: min(100%, 36rem);
}

.settings-field.colour-field input[type="color"] {
  width: 3.5rem;
  height: 2.25rem;
  padding: 0.15rem;
  cursor: pointer;
}

.settings-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.92rem;
}

.settings-toggle input[type="checkbox"] {
  width: 2.4rem;
  height: 1.25rem;
  appearance: none;
  background: #c9d1d9;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease;
}

.settings-toggle input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 0.12rem;
  left: 0.12rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.settings-toggle input[type="checkbox"]:checked {
  background: #0969da;
}

.settings-toggle input[type="checkbox"]:checked::after {
  transform: translateX(1.1rem);
}

.settings-toggle.host-locked {
  opacity: 0.65;
}

.settings-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.45rem 0.75rem;
  margin: 0.5rem 0 1rem;
}

.settings-table-wrap {
  overflow: auto;
  border: 1px solid #d0d7de;
  border-radius: 8px;
}

.settings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.settings-table th,
.settings-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #eaeef2;
  text-align: left;
  vertical-align: middle;
}

.settings-row-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.settings-add-card {
  margin-top: 1.25rem;
  padding: 1rem;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #f6f8fa;
}

.settings-groups-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 1rem;
  min-height: 24rem;
}

.settings-groups-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.settings-group-item {
  text-align: left;
  border: 1px solid transparent;
  background: #f6f8fa;
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  font: inherit;
}

.settings-group-item.active {
  border-color: #0969da;
  background: #ddf4ff;
  font-weight: 600;
}

.settings-group-detail {
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 1rem;
  background: #fff;
}

.settings-rundown-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  max-width: none;
}

.settings-effort-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  max-width: none;
}

button.danger {
  color: #cf222e;
  border-color: #ff8182;
}

.settings-error {
  color: #cf222e;
}

.settings-loading {
  color: #656d76;
}

.settings-yaml-path {
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
}

.settings-adapter-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
  min-height: min(60vh, 40rem);
}

.adapter-status-panel {
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.adapter-status-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.adapter-status-subtitle {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.9rem;
}

.adapter-status-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.65rem;
  margin: 0;
  font-size: 0.85rem;
}

.adapter-status-dl dt {
  color: #656d76;
}

.adapter-status-dl dd {
  margin: 0;
  word-break: break-word;
}

.adapter-helper-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
}

.adapter-helper-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid #eaeef2;
}

.adapter-status-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-right: 0.4rem;
  background: #8c959f;
  vertical-align: middle;
}

.adapter-status-dot.on {
  background: #1a7f37;
}

.adapter-log-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.75rem;
  margin: 0.75rem 0 0.4rem;
}

.adapter-log-tabs-left {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.adapter-log-tab {
  font: inherit;
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #f6f8fa;
  cursor: pointer;
}

.adapter-log-tab.active {
  border-color: #0969da;
  background: #ddf4ff;
  font-weight: 600;
}

.adapter-log-tab:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.adapter-remote-meta {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
}

.adapter-remote-config {
  width: 100%;
  flex: 1;
  min-height: 10rem;
  margin: 0;
  padding: 0.45rem 0.5rem;
  box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  resize: vertical;
}

.adapter-remote-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-left: auto;
}

.adapter-config-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 0.35rem;
}

.adapter-config-pane.hidden,
.adapter-log-view.hidden {
  display: none;
}

.adapter-remote-banner {
  margin: 0;
  font-size: 0.85rem;
}

.helper-select-panel {
  width: min(480px, 100%);
}

.helper-select-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.helper-select-toolbar {
  display: flex;
  gap: 0.75rem;
}

.helper-select-toolbar .linkish {
  border: none;
  background: transparent;
  color: var(--accent-dark, #1d4ed8);
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.helper-select-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(40vh, 280px);
  overflow: auto;
  border: 1px solid var(--border, #d0d7de);
  border-radius: 6px;
}

.helper-select-list li {
  margin: 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.helper-select-list li:last-child {
  border-bottom: none;
}

.helper-select-list label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  line-height: 1.35;
}

.helper-select-list label:hover {
  background: #f6f8fa;
}

.helper-select-list input {
  margin-top: 0.2rem;
}

.helper-select-meta {
  display: block;
  color: var(--muted, #64748b);
  font-size: 0.85rem;
}

.adapter-log-view {
  flex: 1;
  min-height: 10rem;
  margin: 0;
  padding: 0.5rem;
  overflow: auto;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #0d1117;
  color: #e6edf3;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.72rem;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 960px) {
  .settings-adapter-layout {
    grid-template-columns: 1fr;
  }
}

.settings-yaml-editor {
  position: relative;
  min-height: 28rem;
  height: min(60vh, 40rem);
  border: 1px solid #3c3c3c;
  border-radius: 4px;
  background: #1e1e1e;
  overflow: hidden;
}

.settings-content:has(.settings-yaml-editor) {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

@media (max-width: 800px) {
  .settings-shell,
  .settings-groups-layout {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid #d0d7de;
  }
}

.logs-panel {
  margin: 0 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-height: 0;
}

.logs-panel.hidden {
  display: none;
}

.logs-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.logs-toolbar input[type="search"] {
  flex: 1;
  min-width: 12rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
}

.logs-meta {
  margin-left: auto;
  font-size: 0.85rem;
}

.logs-view {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0.85rem 1rem;
  overflow-x: scroll;
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #3c3c3c;
  border-radius: 4px;
}

.completions-panel {
  margin: 0 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-height: 0;
}

.completions-panel.hidden {
  display: none;
}

.completions-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.completions-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
  color: #475569;
}

.completions-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.completions-meta {
  margin-left: auto;
  font-size: 0.85rem;
}

.completions-tree {
  flex: 1;
  min-height: 0;
  overflow-x: scroll;
  overflow-y: scroll;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: thin;
  scrollbar-color: #9aa3ad #e8ecf0;
  padding: 0.75rem 1rem 1.5rem;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.completions-tree::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.completions-tree::-webkit-scrollbar-track {
  background: #e8ecf0;
}

.completions-tree::-webkit-scrollbar-thumb {
  background: #9aa3ad;
  border-radius: 6px;
  border: 2px solid #e8ecf0;
}

.completions-tree::-webkit-scrollbar-thumb:hover {
  background: #7b8794;
}

.completions-tree::-webkit-scrollbar-corner {
  background: #e8ecf0;
}

.completions-tree .tl-node {
  list-style: none;
  margin: 0;
  padding: 0;
}

.completions-tree .tl-children {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.35rem;
  border-left: 2px solid #334155;
  margin-left: 0.55rem;
}

.completions-tree .tl-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0.28rem 0;
  cursor: default;
  user-select: none;
}

.completions-tree .tl-row.tl-expandable {
  cursor: pointer;
}

.completions-tree .tl-row.tl-expandable:hover .tl-label {
  background: #f1f5f9;
}

.completions-hover-tip {
  position: fixed;
  z-index: 4000;
  max-width: min(28rem, calc(100vw - 1.5rem));
  padding: 0.55rem 0.7rem;
  border: 1px solid #334155;
  border-radius: 4px;
  background: #0f172a;
  color: #f8fafc;
  font: 12px/1.45 Consolas, "Cascadia Mono", "Segoe UI Mono", monospace;
  white-space: pre;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.35);
  pointer-events: none;
}

.completions-hover-tip[hidden] {
  display: none !important;
}

.completions-panel .tl-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.25);
  --tl-fill: #94a3b8;
  background: var(--tl-fill);
}

.completions-panel .tl-dot.red {
  --tl-fill: #dc2626;
}

.completions-panel .tl-dot.orange {
  --tl-fill: #ff8a00;
}

.completions-panel .tl-dot.blue {
  --tl-fill: #2563eb;
}

.completions-panel .tl-dot.yellow {
  --tl-fill: #facc15;
}

.completions-panel .tl-dot.green {
  --tl-fill: #16a34a;
}

/* Partial certificates: diagonal half-shade (colour | white). */
.completions-panel .tl-dot.partial {
  background: linear-gradient(
    135deg,
    var(--tl-fill) 0 50%,
    #ffffff 50% 100%
  );
}

.completions-tree .tl-label {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border: 1px solid #0f172a;
  background: #fff;
  font-size: 0.92rem;
  line-height: 1.35;
  max-width: min(70vw, 48rem);
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  flex-shrink: 1;
  word-break: break-word;
}

.completions-tree .tl-row.tl-system .tl-label,
.completions-tree .tl-row.tl-subsystem .tl-label {
  max-width: min(72vw, 56rem);
  font-weight: 500;
}

.completions-tree .tl-badge-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 1.1rem;
}

.completions-tree .tl-badge {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border: 1px solid #38bdf8;
  background: #e0f7fa;
  color: #0f172a;
  font-size: 0.82rem;
  line-height: 1.35;
  white-space: pre;
  flex-shrink: 0;
  tab-size: 4;
}

.completions-tree .tl-badge-click {
  cursor: pointer;
  font: inherit;
  margin: 0;
}

.completions-tree .tl-badge-click:hover {
  filter: brightness(0.96);
  box-shadow: 0 0 0 1px #0284c7;
}

.completions-tree .tl-badge-itr {
  background: #ecfdf5;
  border-color: #34d399;
}

.completions-tree .tl-progress-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex: 1;
}

.completions-tree .tl-progress-track {
  position: relative;
  display: inline-block;
  width: 9.5rem;
  height: 0.7rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #94a3b8;
  overflow: hidden;
  flex-shrink: 0;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.completions-tree .tl-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #16a34a;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.completions-tree .tl-progress-pct {
  font-size: 0.82rem;
  font-weight: 600;
  color: #0f172a;
  min-width: 2.6rem;
  text-align: center;
  padding: 0.05rem 0.35rem;
  border: 1px solid rgba(15, 23, 42, 0.25);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.completions-tree .tl-row.tl-itr .tl-label {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  font-size: 0.85rem;
  color: #334155;
  border-style: dashed;
  cursor: pointer;
  max-width: min(70vw, 52rem);
}

.completions-tree .tl-empty {
  color: var(--muted);
  padding: 2rem;
  text-align: center;
}

.completions-loading {
  flex: 1;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  color: var(--muted);
}

.completions-loading .completions-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid #c5d0dc;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: summary-expand-spin 0.7s linear infinite;
}

.rundown-panel {
  margin: 0 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-height: 0;
}

.report-panel {
  margin: 0 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1 1 auto;
  min-height: 0;
}

.report-panel.hidden {
  display: none;
}

.report-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.report-date-range {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.report-date-range input {
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
}

.report-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  user-select: none;
}

.report-meta {
  margin-left: auto;
  font-size: 0.8rem;
}

.report-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  color: var(--muted);
}

.report-loading.hidden {
  display: none;
}

.report-spinner {
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid #cbd5e1;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: summary-expand-spin 0.7s linear infinite;
}

.report-scroll {
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-bottom: 1rem;
}

.report-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  background: #fff;
}

.report-page-1 {
  /* Natural document flow — avoid viewport flex-fill that caused overlaps. */
  flex: 0 0 auto;
}

.report-page-1 > .report-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 0 0 auto;
  position: relative;
}

.report-page-1 > .report-section-pli {
  margin-top: 0.25rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.report-section-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 650;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.2rem;
  flex: 0 0 auto;
}

/* Mechanical Completions: ITR-A | MC-DAC + Notes */
.report-section-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 0.75rem;
  align-items: stretch;
  min-height: 300px;
}

.report-side-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
  height: 100%;
  align-self: stretch;
}

.report-section-grid > .report-chart-card {
  min-height: 300px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.report-chart-card {
  position: relative;
  min-height: 160px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0.35rem 0.45rem 0.25rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.report-side-col > .report-bar-card,
.report-side-col > .report-note-card {
  flex: 1 1 0;
  min-height: 120px;
}

.report-bar-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.report-bar-card.is-empty {
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.85rem;
  font-style: italic;
}

.report-chart-title {
  margin: 0 0 0.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  flex: 0 0 auto;
}

.report-section-grid > .report-chart-card canvas,
.report-rundown-card canvas {
  flex: 1 1 auto;
  width: 100% !important;
  height: 100% !important;
  min-height: 0;
}

.report-chart-card canvas {
  width: 100% !important;
  flex: 1 1 auto;
  min-height: 0;
}

.report-bar-card canvas {
  flex: 1 1 auto;
  width: 100% !important;
  min-height: 0;
  height: 100% !important;
}

.report-note-card {
  border: 1px solid #1e3a8a;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
  min-height: 120px;
}

.report-note-large {
  min-height: 200px;
}

.report-note-page-fill {
  min-height: 220px;
  height: clamp(220px, 42vh, 420px);
}

.report-summary-notes-section {
  margin-top: 0.35rem;
}

.report-note-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
  padding: 0.3rem 0.5rem 0;
  flex: 0 0 auto;
}

.report-note-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.45rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  flex: 0 0 auto;
}

.report-note-toolbar.hidden {
  display: none;
}

.report-fmt-btn {
  min-width: 1.85rem;
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1.2;
}

.report-fmt-btn:hover:not(:disabled) {
  background: #eff6ff;
  border-color: #93c5fd;
}

.report-fmt-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.report-fmt-color {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.1rem 0.3rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}

.report-fmt-color input[type="color"] {
  width: 1.35rem;
  height: 1.15rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.report-fmt-highlight span {
  background: #fef08a;
  padding: 0 0.15rem;
  border-radius: 2px;
}

.report-fmt-size {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: #475569;
}

.report-fmt-size select {
  font-size: 0.8rem;
  padding: 0.1rem 0.25rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}

.report-note-editor {
  flex: 1 1 auto;
  padding: 0.35rem 0.5rem 0.5rem;
  outline: none;
  /* ~Word 8pt default for free-text notes */
  font-size: 8pt;
  line-height: 1.35;
  overflow: auto;
  min-height: 4rem;
  white-space: pre-wrap;
}

.report-side-col > .report-note-card .report-note-editor {
  min-height: 0;
}

.report-note-editor ul,
.report-note-editor ol {
  margin: 0.2rem 0 0.2rem 1.2rem;
  padding: 0;
}

.report-note-editor.is-readonly {
  background: #f8fafc;
}

.report-note-placeholder {
  color: #dc2626;
  font-style: italic;
}

/* Mechanical Completions: flat 2×2
   [ ITR-A rundown ] [ MC-DAC (full height) ]
   [ MC-SSAC       ] [ Notes               ]
   Fixed row heights — Chart.js + auto rows caused endless growth. */
.report-mc-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  grid-template-rows: 300px 300px;
  gap: 0.75rem;
  align-items: stretch;
}

.report-mc-grid > .report-itr-a-card,
.report-mc-grid > .report-mc-ssac-card,
.report-mc-grid > .report-note-expanded,
.report-mc-grid > .report-mc-dac-card {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.report-mc-grid > .report-itr-a-card canvas,
.report-mc-grid > .report-mc-ssac-card canvas,
.report-mc-dac-card canvas {
  flex: 1 1 auto;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
}

/* Pre-Commissioning: flat 2×2 grid
   [ ITR-B rundown ] [ PC-DAC + pies ]
   [ PC-SSAC       ] [ Notes         ] */
.report-pc-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  grid-template-rows: 300px 300px;
  gap: 0.75rem;
  align-items: stretch;
}

.report-pc-grid > .report-itr-b-card,
.report-pc-grid > .report-pc-ssac-card,
.report-pc-grid > .report-note-expanded,
.report-pc-grid > .report-pc-top-right {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.report-pc-top-right {
  gap: 0.5rem;
}

.report-pc-top-right > .report-bar-card {
  flex: 1.15 1 0;
  min-height: 0;
  overflow: hidden;
}

.report-pc-top-right > .report-pies-combined {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.report-pc-grid > .report-itr-b-card canvas,
.report-pc-grid > .report-pc-ssac-card canvas {
  flex: 1 1 auto;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
}

.report-pies-section .report-pies,
.report-pies-combined .report-pies {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  align-items: stretch;
  min-height: 0;
  flex: 1 1 auto;
  position: relative;
}

.report-pie-card,
.report-pie-slot {
  min-height: 0;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

.report-pie-card canvas,
.report-pie-slot canvas {
  flex: 1 1 auto;
  width: 100% !important;
  max-height: 140px !important;
  min-height: 100px !important;
}

.report-pie-connector-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 2;
}

.report-pie-connector-svg.hidden {
  visibility: hidden;
}

.report-pie-connector-svg path {
  fill: none;
  stroke: #0f172a;
  stroke-width: 1.5;
}

.report-constraints-empty {
  position: absolute;
  inset: 2.2rem 0.5rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: 0.85rem;
}

.report-constraints-empty.hidden {
  display: none;
}

.report-pli-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  position: relative;
}

.report-pli-grid-charts-only {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 240px;
}

.report-pli-grid .report-chart-card {
  min-height: 240px;
  height: 240px;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.report-pli-grid .report-chart-card canvas {
  max-height: none !important;
  min-height: 180px;
  height: 100% !important;
}

.report-summary-wrap {
  overflow: auto;
  max-height: 360px;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.report-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.report-summary-table th,
.report-summary-table td {
  border: 1px solid #cbd5e1;
  padding: 0.15rem 0.35rem;
  text-align: left;
  white-space: nowrap;
}

.report-summary-table td.report-summary-multiline {
  white-space: pre-wrap;
  vertical-align: top;
  min-width: 12rem;
  max-width: 28rem;
  word-break: break-word;
}

.report-summary-table th {
  position: sticky;
  top: 0;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  z-index: 1;
}

.report-summary-table td.report-summary-open {
  color: #9a3412;
  font-weight: 600;
}

/* Whitened Completions system traffic-light row tints (readable text). */
.report-summary-table tr.report-tl-red td {
  background: #fdf4f4;
}

.report-summary-table tr.report-tl-orange td {
  background: #fff8ef;
}

.report-summary-table tr.report-tl-yellow td {
  background: #fffced;
}

.report-summary-table tr.report-tl-blue td {
  background: #f3f7fe;
}

.report-summary-table tr.report-tl-green td {
  background: #f3faf6;
}

@media (max-width: 1100px) {
  .report-section-grid,
  .report-mc-grid,
  .report-pc-grid,
  .report-pli-grid,
  .report-pies-section .report-pies,
  .report-pies-combined .report-pies {
    grid-template-columns: 1fr;
  }
  .report-mc-grid,
  .report-pc-grid {
    grid-template-rows: none;
  }
  .report-pie-connector-svg {
    display: none;
  }
}

.rundown-panel.hidden {
  display: none;
}

.rundown-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.rundown-filter {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.rundown-date-from-filter input[type="date"] {
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
  min-height: 2rem;
}

.rundown-filter select {
  min-width: 9rem;
  max-width: 14rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
  background: #fff;
}

.rundown-curves-filter select {
  min-width: 9.5rem;
}

.rundown-toggles {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding-bottom: 0.2rem;
}

.rundown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
  user-select: none;
  white-space: nowrap;
}

.rundown-toggle input {
  margin: 0;
}

.rundown-toggle.is-disabled,
.rundown-flow-bars-toggle.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.rundown-meta {
  margin-left: auto;
  font-size: 0.85rem;
  max-width: 28rem;
  text-align: right;
}

.rundown-chart-wrap {
  position: relative;
  flex: 1;
  min-height: 320px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem;
  cursor: grab;
}

.rundown-chart-wrap:active {
  cursor: grabbing;
}

.rundown-params-panel {
  width: min(640px, 100%);
  max-height: min(90vh, 720px);
}

.rundown-params-body {
  overflow: auto;
}

.rundown-params-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 1rem;
  margin-top: 0.75rem;
}

.rundown-params-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.rundown-params-grid input {
  font-weight: 400;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
}

@media (max-width: 560px) {
  .rundown-params-grid {
    grid-template-columns: 1fr;
  }
}

.rundown-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.rundown-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
}

.rundown-loading.hidden {
  display: none;
}

.rundown-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid #c5d0dc;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: summary-expand-spin 0.7s linear infinite;
}

.documents-panel {
  margin: 0 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-height: 0;
}

.documents-panel.hidden {
  display: none;
}

.documents-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.documents-toolbar input[type="search"] {
  flex: 1;
  min-width: 12rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
}

.documents-upload-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.documents-upload-label.hidden {
  display: none;
}

.documents-upload-btn {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  font-size: 0.9rem;
}

.documents-upload-label:hover .documents-upload-btn {
  background: #f1f5f9;
}

.documents-meta {
  margin-left: auto;
  font-size: 0.85rem;
}

.documents-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}

.documents-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.documents-table th,
.documents-table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.documents-table th {
  background: var(--general-header, #eef2f6);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}

.documents-table .documents-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.documents-actions button.danger {
  color: #b91c1c;
  border-color: #fca5a5;
  background: #fef2f2;
}

.documents-actions button.danger:hover {
  background: #fee2e2;
  border-color: #f87171;
}

.documents-empty {
  margin: 1rem;
}

body.planning-tab-active .toolbar,
body.planning-tab-active #grid {
  display: none;
}

body.planning-tab-active .tab-bar-actions {
  visibility: hidden;
}

.planning-panel {
  margin: 0 1rem 1rem;
  display: flex;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-height: 0;
  height: calc(100vh - 9.5rem);
}

.planning-panel.hidden {
  display: none;
}

.planning-sidebar {
  width: 16rem;
  flex: 0 0 16rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 1px solid #d0d7de;
  background: #f8fafc;
  padding: 0.65rem;
  min-height: 0;
}

.planning-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.planning-sidebar-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.planning-chart-list {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-height: 0;
}

.planning-chart-row {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
}

.planning-chart-item {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid #d0d7de;
  border-left-width: 3px;
  background: #fff;
  cursor: pointer;
  flex: 1 1 auto;
  min-width: 0;
}

/* Gantt: dark blue = yours, light blue = shared */
.planning-chart-row.is-gantt.is-mine .planning-chart-item {
  border-left-color: #1d4ed8;
  background: #dbeafe;
  border-color: #93c5fd;
}

.planning-chart-row.is-gantt.is-shared .planning-chart-item {
  border-left-color: #60a5fa;
  background: #eff6ff;
  border-color: #bfdbfe;
}

/* PERT: dark purple = yours, light purple = shared */
.planning-chart-row.is-pert.is-mine .planning-chart-item {
  border-left-color: #6d28d9;
  background: #ede9fe;
  border-color: #c4b5fd;
}

.planning-chart-row.is-pert.is-shared .planning-chart-item {
  border-left-color: #a78bfa;
  background: #f5f3ff;
  border-color: #ddd6fe;
}

.planning-chart-row.active.is-gantt.is-mine .planning-chart-item,
.planning-chart-row.is-gantt.is-mine .planning-chart-item:focus-visible {
  border-color: #1e40af;
  box-shadow: inset 0 0 0 1px #1d4ed8;
}

.planning-chart-row.active.is-gantt.is-shared .planning-chart-item,
.planning-chart-row.is-gantt.is-shared .planning-chart-item:focus-visible {
  border-color: #3b82f6;
  box-shadow: inset 0 0 0 1px #60a5fa;
}

.planning-chart-row.active.is-pert.is-mine .planning-chart-item,
.planning-chart-row.is-pert.is-mine .planning-chart-item:focus-visible {
  border-color: #5b21b6;
  box-shadow: inset 0 0 0 1px #6d28d9;
}

.planning-chart-row.active.is-pert.is-shared .planning-chart-item,
.planning-chart-row.is-pert.is-shared .planning-chart-item:focus-visible {
  border-color: #7c3aed;
  box-shadow: inset 0 0 0 1px #a78bfa;
}

.planning-chart-actions {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 0 0 auto;
  align-self: center;
}

.planning-chart-share,
.planning-chart-clone {
  flex: 0 0 auto;
  align-self: stretch;
  padding: 0.25rem 0.45rem;
  font-size: 0.75rem;
  white-space: nowrap;
}

.planning-chart-delete {
  flex: 0 0 auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid #fecaca;
  border-radius: 0.3rem;
  background: #fff;
  color: #dc2626;
  cursor: pointer;
  line-height: 0;
}

.planning-chart-delete:hover {
  background: #fef2f2;
  border-color: #f87171;
  color: #b91c1c;
}

.planning-chart-delete:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 1px;
}

.planning-chart-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.planning-chart-sub {
  font-size: 0.75rem;
}

.planning-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.planning-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.planning-toolbar #planning-name {
  min-width: 12rem;
  flex: 1 1 12rem;
}

.planning-gantt-host {
  flex: 1 1 auto;
  min-height: 20rem;
  overflow: hidden;
  border: 1px solid #d0d7de;
  background: #fff;
  position: relative;
}

.planning-gantt-host.hidden {
  display: none !important;
}

.planning-pert-host {
  flex: 1 1 auto;
  min-height: 20rem;
  overflow: hidden;
  border: 1px solid #d0d7de;
  background: #fff;
  position: relative;
}

.planning-pert-host.hidden {
  display: none !important;
}

.planning-pert-host.is-wiring {
  cursor: crosshair;
}

.planning-pert-wire-svg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 10050;
}

.planning-pert-wire-line {
  stroke: #2563eb;
  stroke-width: 2.5;
  stroke-dasharray: 6 4;
  fill: none;
}

.planning-new-panel {
  width: min(720px, 96vw);
}

.planning-new-body {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(200px, 0.9fr);
  gap: 1rem;
  align-items: start;
}

.planning-new-preview-wrap {
  border: 1px solid #d0d7de;
  background: #f8fafc;
  border-radius: 4px;
  overflow: hidden;
  min-height: 11rem;
}

.planning-new-preview {
  display: block;
  width: 100%;
  height: auto;
  max-height: 16rem;
  object-fit: contain;
  background: #fff;
}

.planning-new-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.planning-new-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.planning-new-label input,
.planning-new-label select {
  font-weight: 400;
  font-size: 0.95rem;
  padding: 0.4rem 0.5rem;
}

.planning-new-hint {
  margin: 0;
  font-size: 0.85rem;
}

.planning-toolbar.is-pert-mode .planning-gantt-only {
  display: none !important;
}

.planning-toolbar:not(.is-pert-mode) .planning-pert-only {
  display: none !important;
}

.planning-toolbar #planning-pert-link-btn.active {
  outline: 2px solid var(--interactive-header, #2563eb);
  outline-offset: 1px;
}

.planning-pert-edit-panel {
  max-width: 28rem;
}

.planning-pert-edit-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .planning-new-body {
    grid-template-columns: 1fr;
  }
}

.planning-gantt-host .gantt_container {
  width: 100%;
  height: 100%;
}

.planning-scale-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.planning-zoom-group {
  display: inline-flex;
  gap: 0.2rem;
}

.planning-zoom-group button {
  min-width: 2rem;
  font-weight: 600;
}

.planning-raw-panel {
  width: min(720px, 96vw);
}

.planning-raw-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#planning-raw-text {
  width: 100%;
  min-height: 360px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.35;
  resize: vertical;
  tab-size: 2;
}

.planning-raw-error {
  color: #b91c1c;
  min-height: 1.2em;
  margin: 0;
  font-size: 0.85rem;
}

#planning-critical-btn.active {
  background: var(--cms-gantt-critical, #dc2626);
  color: #fff;
  border-color: var(--cms-gantt-critical, #dc2626);
}

#planning-gantt-host {
  --dhx-gantt-task-background: var(--cms-gantt-task, #3b82f6);
  --dhx-gantt-task-progress-color: var(--cms-gantt-progress, #1d4ed8);
  --dhx-gantt-project-background: var(--cms-gantt-section, #334155);
  --dhx-gantt-project-progress-color: var(--cms-gantt-progress, #1d4ed8);
  --dhx-gantt-milestone-background: var(--cms-gantt-milestone, #db7dc5);
}

#planning-gantt-host .gantt_task_line:not(.gantt_milestone):not(.planning-section-bar) {
  background-color: var(--cms-gantt-task, #3b82f6) !important;
  border-color: color-mix(in srgb, var(--cms-gantt-task, #3b82f6) 72%, #000) !important;
}

#planning-gantt-host .gantt_task_line:not(.gantt_milestone) .gantt_task_progress {
  background: var(--cms-gantt-progress, #1d4ed8) !important;
  background-color: var(--cms-gantt-progress, #1d4ed8) !important;
}

#planning-gantt-host .gantt_task_line.gantt_project .gantt_task_progress,
#planning-gantt-host .gantt_task_line.planning-section-bar .gantt_task_progress {
  background: var(--cms-gantt-progress, #1d4ed8) !important;
  background-color: var(--cms-gantt-progress, #1d4ed8) !important;
}

#planning-gantt-host .gantt_task_line.gantt_milestone {
  --dhx-gantt-task-background: var(--cms-gantt-milestone, #db7dc5);
  background-color: var(--cms-gantt-milestone, #db7dc5) !important;
  border-color: color-mix(in srgb, var(--cms-gantt-milestone, #db7dc5) 72%, #000) !important;
}

#planning-gantt-host .gantt_task_line.gantt_milestone .gantt_task_content {
  background-color: var(--cms-gantt-milestone, #db7dc5) !important;
  border-color: color-mix(in srgb, var(--cms-gantt-milestone, #db7dc5) 72%, #000) !important;
}

.gantt_task_line.planning-critical-task,
.gantt_task_line.planning-critical-task .gantt_task_progress {
  background-color: var(--cms-gantt-critical, #dc2626) !important;
  border-color: color-mix(in srgb, var(--cms-gantt-critical, #dc2626) 72%, #000) !important;
}

.gantt_row.planning-critical-row .gantt_cell {
  color: color-mix(in srgb, var(--cms-gantt-critical, #dc2626) 80%, #000);
  font-weight: 600;
}

.gantt_task_link.planning-critical-link .gantt_line_wrapper div {
  background-color: var(--cms-gantt-critical, #dc2626) !important;
}

.gantt_task_link.planning-critical-link .gantt_link_arrow {
  border-color: var(--cms-gantt-critical, #dc2626) !important;
}

.gantt_row.planning-section-row .gantt_tree_content {
  font-weight: 700;
  font-size: 0.95rem;
}

.gantt_task_line.planning-section-bar {
  background-color: var(--cms-gantt-section, #334155) !important;
  border-color: color-mix(in srgb, var(--cms-gantt-section, #334155) 72%, #000) !important;
  opacity: 0.9;
}

.planning-empty,
.planning-list-empty {
  margin: 0.5rem;
}

.planning-peer-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: #fff7ed;
  border: 1px solid #fdba74;
}

.planning-peer-banner.hidden {
  display: none;
}

.planning-share-panel,
.planning-pdf-panel {
  max-width: 32rem;
}

.planning-pdf-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.planning-pdf-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
}

.planning-pdf-field select {
  max-width: 14rem;
}

.planning-pdf-range-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 0.35rem;
  padding-left: 1.35rem;
}

.planning-pdf-range-fields[hidden] {
  display: none;
}

.planning-pdf-layout {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid #d0d7de;
  border-radius: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.planning-pdf-layout legend {
  padding: 0 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.planning-pdf-radio {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.85rem;
  line-height: 1.35;
  cursor: pointer;
}

#planning-pdf-download.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.gantt_marker.planning-today-marker {
  background-color: #dc2626;
  width: 2px;
  opacity: 0.95;
}

.planning-pdf-radio input {
  margin-top: 0.15rem;
}

.planning-task-panel {
  width: min(36rem, 96vw);
}

.planning-share-body,
.planning-task-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.planning-share-add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.planning-share-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.planning-share-table th,
.planning-share-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 0.35rem 0.4rem;
  text-align: left;
}

.planning-everyone-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

button.danger {
  color: #b91c1c;
}

.document-props-panel {
  width: min(34rem, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.document-props-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  overflow-y: auto;
  max-height: min(70vh, 36rem);
}

.document-props-body label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: #334155;
}

.document-props-body input,
.document-props-body textarea {
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
}

.document-props-body input:disabled,
.document-props-body textarea:disabled {
  background: #f1f5f9;
  color: #64748b;
}

.document-props-linkages {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.document-props-section-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 650;
}

.doc-link-hint {
  margin: 0;
  font-size: 0.85rem;
}

.doc-link-list,
.doc-link-checklist,
.doc-link-search-results,
.target-docs-list,
.target-docs-attach-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 10rem;
  overflow: auto;
}

.doc-link-row,
.target-docs-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}

.doc-link-row label {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  flex: 1;
  margin: 0;
  font-weight: 400;
}

.doc-link-meta {
  flex: 1;
  min-width: 0;
}

.doc-link-meta strong {
  display: block;
  font-size: 0.85rem;
}

.doc-link-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  word-break: break-word;
}

.doc-link-add-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.doc-link-add-row select,
.doc-link-add-row input,
.target-docs-attach input {
  flex: 1;
  min-width: 8rem;
}

.doc-link-search-results button,
.target-docs-attach-list button {
  text-align: left;
}

.target-docs-panel {
  width: min(40rem, 96vw);
}

.target-docs-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.target-docs-attach {
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.tl-docs-btn {
  margin-left: 0.35rem;
  font-size: 0.72rem;
  padding: 0.1rem 0.4rem;
  line-height: 1.2;
}

.grid-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: var(--muted);
  font-size: 1rem;
}

.grid-loading.error {
  color: var(--danger);
}

.tabulator {
  font-size: 12px;
  background-color: #fff;
  border: none;
  height: 100% !important;
  max-height: 100%;
}

/* Header stays outside the scrolling body so titles remain visible. */
.tabulator .tabulator-header {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  overflow: hidden;
}

/* Keep both scrollbars visible; body scrolls here, not the page. */
.tabulator .tabulator-tableholder {
  overflow-x: scroll !important;
  overflow-y: scroll !important;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #9aa3ad #e8ecf0;
}

.tabulator .tabulator-footer {
  flex: 0 0 auto;
}

.tabulator .tabulator-tableholder::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.tabulator .tabulator-tableholder::-webkit-scrollbar-track {
  background: #e8ecf0;
}

.tabulator .tabulator-tableholder::-webkit-scrollbar-thumb {
  background: #9aa3ad;
  border-radius: 6px;
  border: 2px solid #e8ecf0;
}

.tabulator .tabulator-tableholder::-webkit-scrollbar-thumb:hover {
  background: #7b8794;
}

.tabulator .tabulator-tableholder::-webkit-scrollbar-corner {
  background: #e8ecf0;
}

/* Zebra row shading — all sheets */
.tabulator .tabulator-tableholder .tabulator-table .tabulator-row {
  background-color: #ffffff;
  align-items: stretch;
}

.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-row-even {
  background-color: #f4f6f9;
}

.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell {
  border-right: 1px solid #e8ecf0;
  border-bottom: 1px solid #e8ecf0;
  background-color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  align-self: stretch;
  box-sizing: border-box;
}

/* Expanded row — must beat default cell rule specificity above */
.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.row-expanded {
  background-color: #eef6ff !important;
}

.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.row-expanded.tabulator-row-even {
  background-color: #e8f1fc !important;
}

.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.row-expanded .tabulator-cell {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
  overflow-wrap: anywhere;
  align-self: stretch;
  align-items: flex-start;
}

.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.row-expanded .tabulator-cell .rich-cell {
  white-space: pre-wrap;
  pointer-events: auto;
}

/* Summary and Watch List — wrap cell content; row.normalizeHeight() sets equal cell heights */
#grid.wrap-rows-sheet .tabulator-tableholder .tabulator-table .tabulator-row {
  align-items: stretch;
}

#grid.wrap-rows-sheet .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
  overflow-wrap: anywhere;
  align-self: stretch;
  align-items: flex-start;
}

#grid.wrap-rows-sheet .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell .rich-cell {
  white-space: pre-wrap;
}

.tabulator .tabulator-row.tabulator-row-footer-style,
.tabulator .tabulator-row.tabulator-row-footer-style .tabulator-cell {
  background-color: #ededed !important;
  font-weight: 600;
}

#grid[data-sheet="Summary"] .tabulator-tableholder .tabulator-table .tabulator-row.summary-subsystem-row,
#grid[data-sheet="Summary"] .tabulator-tableholder .tabulator-table .tabulator-row.summary-subsystem-row .tabulator-cell {
  background-color: var(--cms-summary-subsystem, #fde8d0) !important;
}

#grid[data-sheet="Summary"] .tabulator-tableholder .tabulator-table .tabulator-row.summary-subsystem-row.tabulator-row-even,
#grid[data-sheet="Summary"] .tabulator-tableholder .tabulator-table .tabulator-row.summary-subsystem-row.tabulator-row-even .tabulator-cell {
  background-color: var(--cms-summary-subsystem-stripe, #fef6ec) !important;
}

#grid[data-sheet="Summary"] .tabulator-tableholder .tabulator-table .tabulator-row.summary-system-selected,
#grid[data-sheet="Summary"] .tabulator-tableholder .tabulator-table .tabulator-row.summary-system-selected.tabulator-row-even,
#grid[data-sheet="Summary"] .tabulator-tableholder .tabulator-table .tabulator-row.summary-system-selected .tabulator-cell {
  background-color: #c5d9f0 !important;
}

#grid[data-sheet="Summary"] .tabulator-cell[tabulator-field="System"],
#grid[data-sheet="Summary"] .tabulator-cell[tabulator-field="System Desc"] {
  cursor: pointer;
}

/* Column headers — titles centered horizontally and vertically above filters */
.tabulator .tabulator-header .tabulator-headers {
  min-height: 7.5rem;
}

.tabulator .tabulator-header .tabulator-col {
  background: var(--cms-header-general, #eef2f6);
  font-weight: 700;
  height: 7.5rem !important;
  text-align: center !important;
  vertical-align: middle !important;
  justify-content: flex-start !important;
  align-items: stretch !important;
  position: relative;
}

/* Thin top grip for column drag-reorder (sort uses the sort icon only). */
.tabulator .tabulator-header .tabulator-col::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  z-index: 3;
  cursor: grab;
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.12),
    rgba(15, 23, 42, 0.02) 70%,
    transparent
  );
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.tabulator .tabulator-header .tabulator-col:active::before {
  cursor: grabbing;
}

.tabulator .tabulator-header .tabulator-col[tabulator-field="_actions"]::before {
  display: none;
}

#grid .tabulator-header .tabulator-col[tabulator-field="Comments"],
#grid .tabulator-header .tabulator-col[tabulator-field="SHC Ready"],
#grid .tabulator-header .tabulator-col[tabulator-field="Target Date"],
#grid .tabulator-header .tabulator-col[tabulator-field="Exec Summary"],
#grid .tabulator-header .tabulator-col[tabulator-field="Action By"],
#grid .tabulator-header .tabulator-col[tabulator-field="Percent Complete"],
#grid.watch-list-sheet .tabulator-header .tabulator-col[tabulator-field="Action"],
#grid.watch-list-sheet .tabulator-header .tabulator-col[tabulator-field="Date Opened"],
#grid.watch-list-sheet .tabulator-header .tabulator-col[tabulator-field="Details"],
#grid.watch-list-sheet .tabulator-header .tabulator-col[tabulator-field="Action By"],
#grid.watch-list-sheet .tabulator-header .tabulator-col[tabulator-field="Target Date"],
#grid.watch-list-sheet .tabulator-header .tabulator-col[tabulator-field="Status"],
#grid.watch-list-sheet .tabulator-header .tabulator-col[tabulator-field="Comments"] {
  background: var(--cms-header-editable, #a8cbe2) !important;
}

#grid[data-sheet="Summary"] .tabulator-header .tabulator-col[tabulator-field="System Desc"],
#grid[data-sheet="Summary"] .tabulator-header .tabulator-col[tabulator-field="PLI-A"],
#grid[data-sheet="Summary"] .tabulator-header .tabulator-col[tabulator-field="PLI-B"],
#grid[data-sheet="Summary"] .tabulator-header .tabulator-col[tabulator-field="PLI-C"],
#grid[data-sheet="Summary"] .tabulator-header .tabulator-col[tabulator-field="ITR-A"],
#grid[data-sheet="Summary"] .tabulator-header .tabulator-col[tabulator-field="MC DAC"],
#grid[data-sheet="Summary"] .tabulator-header .tabulator-col[tabulator-field="MC SSAC"],
#grid[data-sheet="Summary"] .tabulator-header .tabulator-col[tabulator-field="ITR-B"],
#grid[data-sheet="Summary"] .tabulator-header .tabulator-col[tabulator-field="PC DAC"],
#grid[data-sheet="Summary"] .tabulator-header .tabulator-col[tabulator-field="PC SSAC"],
#grid[data-sheet="Summary"] .tabulator-header .tabulator-col[tabulator-field="ITR-C"],
#grid[data-sheet="Summary"] .tabulator-header .tabulator-col[tabulator-field="CTP"] {
  background: var(--cms-header-interactive, #cbdeec) !important;
}

#grid[data-sheet="Checksheets"] .tabulator-header .tabulator-col[tabulator-field="Sub-System"] {
  background: var(--cms-header-interactive, #cbdeec) !important;
}

#grid[data-sheet="Certificates"] .tabulator-header .tabulator-col[tabulator-field="PLTotalA"],
#grid[data-sheet="Certificates"] .tabulator-header .tabulator-col[tabulator-field="PLTotalB"],
#grid[data-sheet="Certificates"] .tabulator-header .tabulator-col[tabulator-field="PLTotalC"],
#grid[data-sheet="Certificates"] .tabulator-header .tabulator-col[tabulator-field="PLOpenA"],
#grid[data-sheet="Certificates"] .tabulator-header .tabulator-col[tabulator-field="PLOpenB"],
#grid[data-sheet="Certificates"] .tabulator-header .tabulator-col[tabulator-field="PLOpenC"],
#grid[data-sheet="Certificates"] .tabulator-header .tabulator-col[tabulator-field="PLCloseA"],
#grid[data-sheet="Certificates"] .tabulator-header .tabulator-col[tabulator-field="PLCloseB"],
#grid[data-sheet="Certificates"] .tabulator-header .tabulator-col[tabulator-field="PLCloseC"],
#grid[data-sheet="Certificates"] .tabulator-header .tabulator-col[tabulator-field="TotalITRA"],
#grid[data-sheet="Certificates"] .tabulator-header .tabulator-col[tabulator-field="AcceptITRA"],
#grid[data-sheet="Certificates"] .tabulator-header .tabulator-col[tabulator-field="RemainITRA"],
#grid[data-sheet="Certificates"] .tabulator-header .tabulator-col[tabulator-field="TotalITRB"],
#grid[data-sheet="Certificates"] .tabulator-header .tabulator-col[tabulator-field="AcceptITRB"],
#grid[data-sheet="Certificates"] .tabulator-header .tabulator-col[tabulator-field="RemainITRB"] {
  background: var(--cms-header-interactive, #cbdeec) !important;
}

/* Column hide / restore (session-only) */
.col-hide-btn,
.col-restore-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 3px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  line-height: 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  flex: 0 0 18px;
}

.col-hide-btn:hover,
.col-restore-btn:hover {
  color: #0f172a;
  border-color: #94a3b8;
  background: #f8fafc;
}

/* Open eye: centered on the column, below the restore band */
.col-hide-btn {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
}

/*
 * Cancelled-eye restore stack: sits on the left column separator, raised above
 * the open-eye row so icons never overlap. Adjacent hidden columns space right.
 */
.col-restore-stack {
  position: absolute;
  top: -4px;
  left: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  z-index: 6;
  /* Center first icon on the separator; further icons continue to the right. */
  transform: translateX(-9px);
  pointer-events: auto;
}

.col-restore-stack-trailing {
  left: auto;
  right: 0;
  transform: translateX(9px);
}

.col-vis-icon {
  width: 12px;
  height: 12px;
  display: block;
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-content {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  height: 100% !important;
  padding: 2px;
  padding-top: 36px;
  box-sizing: border-box;
}


.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title-holder {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  overflow: visible;
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-title {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto !important;
  max-width: 100%;
  line-height: 1.15;
  font-size: 12px;
  font-weight: 700;
  padding: 0.35rem 0;
  min-height: 0;
  text-align: center;
  vertical-align: middle !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title {
  padding-right: 0 !important;
}

/* Short titles — vertical (Tabulator adds tabulator-col-vertical) */
.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-title {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title,
.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Long titles — horizontal with wrap */
.tabulator .tabulator-header .tabulator-col:not(.tabulator-col-vertical) .tabulator-col-title {
  writing-mode: horizontal-tb;
  transform: none;
  white-space: normal;
  word-break: break-word;
  text-align: center;
  line-height: 1.2;
  overflow: visible !important;
  text-overflow: clip !important;
  hyphens: auto;
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-sorter {
  position: static !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  align-self: center;
  flex: 0 0 auto;
  width: auto;
  height: auto;
  margin: 0 0 2px;
}

.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-sorter {
  justify-content: center;
}

.tabulator .tabulator-header .tabulator-col .tabulator-header-filter {
  flex: 0 0 auto;
  align-self: stretch;
  width: 100%;
}

.tabulator-row.tabulator-row-footer-style .tabulator-cell {
  font-weight: 600;
}

.tabulator-cell.cell-editable {
  cursor: text;
}

.tabulator-cell.cell-editable:hover {
  outline: 1px dashed var(--accent);
  outline-offset: -1px;
}

.excel-filter-root {
  position: relative;
  width: 100%;
}

.excel-filter-btn {
  width: 100%;
  font-size: 11px;
  padding: 2px 4px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.excel-filter-btn:hover {
  border-color: var(--accent);
}

.excel-filter-btn-active {
  background: #e8f1fc;
  border-color: var(--accent);
  font-weight: 600;
}

.excel-filter-panel {
  position: fixed;
  z-index: 2000;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  padding: 0.35rem;
  max-width: min(320px, 92vw);
}

.excel-filter-panel.hidden {
  display: none;
}

.excel-filter-search {
  width: 100%;
  box-sizing: border-box;
  font-size: 11px;
  padding: 0.25rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-bottom: 0.35rem;
}

.excel-filter-list {
  max-height: 220px;
  overflow: auto;
  border: 1px solid #e8ecf0;
  border-radius: 3px;
  margin-bottom: 0.35rem;
}

.excel-filter-item {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.2rem 0.35rem;
  font-size: 11px;
  cursor: pointer;
  user-select: none;
}

.excel-filter-item:hover {
  background: #f4f6f9;
}

.excel-filter-select-all {
  font-weight: 600;
  border-bottom: 1px solid #e8ecf0;
}

.excel-filter-empty {
  padding: 0.5rem;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.excel-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
}

.excel-filter-actions button {
  font-size: 11px;
  padding: 0.2rem 0.55rem;
}

.excel-filter-ok {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.excel-filter-ok:hover {
  background: var(--accent-dark);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

#restart-notice-modal {
  z-index: 4000;
}

.modal.hidden {
  display: none;
}

.cms-other-links-panel {
  width: min(560px, 100%);
  max-height: min(70vh, 560px);
}

.cms-other-links-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 4rem;
}

.cms-other-links-list {
  overflow: auto;
  max-height: min(48vh, 400px);
}

.cms-links-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.cms-links-table th,
.cms-links-table td {
  text-align: left;
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.cms-links-table th {
  color: var(--muted, #64748b);
  font-weight: 600;
}

.cms-links-type {
  white-space: nowrap;
  color: var(--muted, #64748b);
  width: 8.5rem;
}

.cms-other-link-item {
  text-align: left;
  padding: 0.2rem 0;
  border: none;
  background: transparent;
  color: var(--accent-dark, #1d4ed8);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cms-other-link-item:hover {
  color: #1e40af;
}

.modal-panel {
  width: min(720px, 100%);
  max-height: min(80vh, 640px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.modal-close {
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.1rem 0.45rem;
}

.reload-log {
  flex: 1;
  margin: 0;
  padding: 0.75rem 1rem;
  overflow: auto;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  background: #0f172a;
  color: #e2e8f0;
}

.modal-footer {
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--border);
}

.confirm-modal-panel {
  width: min(420px, 100%);
  max-height: none;
}

#export-modal .confirm-modal-panel {
  width: min(480px, 100%);
}

.confirm-modal-body {
  padding: 1rem 1.25rem;
}

.confirm-modal-body p {
  margin: 0;
  line-height: 1.45;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.export-modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.export-mode-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.export-mode-option {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  cursor: pointer;
  line-height: 1.35;
}

.export-mode-option input {
  margin-top: 0.2rem;
}

.export-mode-option span {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.export-mode-option.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.export-modal-hint.hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.rich-cell {
  white-space: pre-wrap;
  line-height: 1.35;
  pointer-events: none;
  font-family: inherit;
  font-size: inherit;
}

.summary-metric-value {
  font-weight: 600;
}

.rich-editor-wrap {
  min-width: 200px;
  width: 100%;
  position: relative;
  z-index: 6;
}

.rich-editor {
  min-height: 3rem;
  max-height: min(70vh, 40rem);
  height: auto;
  overflow-x: hidden;
  overflow-y: hidden;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  background: #fff;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  outline: none;
  box-sizing: border-box;
}

/* While a rich cell is open, let the row/cell grow and paint above neighbours. */
.tabulator .tabulator-row.rich-editing-row {
  z-index: 5;
  position: relative;
}

.tabulator .tabulator-row .tabulator-cell.tabulator-editing {
  overflow: visible !important;
  z-index: 6;
  align-items: flex-start !important;
}

.format-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #f8fafc;
}

.tabulator .tabulator-row.comment-history-deleted {
  opacity: 0.72;
}

.tabulator .tabulator-row.comment-history-deleted .tabulator-cell {
  text-decoration: line-through;
  color: var(--muted);
}

.history-delete-btn {
  font-size: 0.8rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid #d8dee4;
  border-radius: 4px;
  background: #fff;
  color: var(--danger);
  cursor: pointer;
}

.history-delete-btn:hover:not(:disabled) {
  background: #fef2f2;
  border-color: #f5c2c0;
}

.history-delete-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.format-toolbar.hidden {
  display: none;
}

.format-toolbar-label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-right: 0.35rem;
}

.format-toolbar .fmt-btn {
  min-width: 2rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.9rem;
  line-height: 1.2;
}

.format-toolbar .fmt-btn:disabled,
.format-toolbar .fmt-color-label input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.fmt-color-label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
}

.fmt-color-label input[type="color"] {
  width: 1.6rem;
  height: 1.35rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.fmt-highlight-label span {
  padding: 0 0.15rem;
  background: #ffff00;
  border-radius: 2px;
}

.drill-link {
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: #1f2933;
  color: #fff;
  padding: 0.65rem 0.9rem;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.toast.error {
  background: var(--danger);
}

.toast.hidden {
  display: none;
}

.restart-notice-panel {
  width: min(480px, 100%);
  max-height: none;
}

.restart-notice-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-bottom: 1.25rem;
}

.restart-notice-hint {
  margin: 0;
  text-align: center;
  font-size: 0.9rem;
}

.restart-notice-countdown {
  margin: 0;
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.restart-notice-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.restart-notice-bar-fill {
  height: 100%;
  width: 100%;
  background: var(--accent);
  transition: width 0.2s linear;
}

.login-page {
  min-height: 100vh;
  height: auto;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #eef2f6 0%, #f8fafc 45%, #e8eef8 100%);
  padding: 1rem 1rem 0;
}

.login-logo {
  display: block;
  width: 140px;
  height: auto;
  margin: 0 auto 1rem;
  object-fit: contain;
}

.login-project {
  margin: 0 0 0.5rem;
  text-align: center;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
}

.login-footer {
  width: 100%;
  margin-top: auto;
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.login-card {
  width: min(100%, 380px);
  margin: 1rem;
  padding: 2rem 1.75rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(31, 41, 51, 0.08);
}

.login-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  text-align: center;
}

.login-subtitle {
  margin: 0 0 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.login-card label {
  display: block;
  margin: 0.75rem 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.login-card input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
}

.login-submit {
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.6rem;
  font-size: 1rem;
}

.login-error {
  margin: 1rem 0 0;
  color: var(--danger);
  text-align: center;
  font-size: 0.9rem;
}

.sessions-full-message {
  margin: 1.25rem 0 0;
  text-align: center;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.45;
}

.sessions-full-meta {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: 0.9rem;
}

.logout-btn {
  margin-left: 0.5rem;
  font-size: 0.85rem;
  padding: 0.25rem 0.55rem;
}

.project-scope-label {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
  margin-left: 0;
}

.project-scope-btn {
  font-size: 0.85rem;
  padding: 0.25rem 0.55rem;
  flex-shrink: 0;
}

.project-scope-modal-body {
  min-width: min(24rem, 90vw);
}

.project-scope-toolbar {
  display: flex;
  gap: 0.5rem;
  margin: 0.5rem 0 0.75rem;
}

.project-scope-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 16rem;
  overflow: auto;
  padding: 0.25rem 0;
}

.project-scope-list label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}
