body {
  font-family: 'Segoe UI', 'Inter', 'Helvetica Neue', Arial, sans-serif;
  background: radial-gradient(circle at 10% 10%, #14253a, #0f1b2c 45%, #0a1220 100%);
  color: #e4eefc;
  margin: 0;
  padding: 0;
}

:root {
  --scrollbar-track: rgba(255, 255, 255, 0.12);
  --scrollbar-thumb: rgba(143, 181, 255, 0.85);
  --scrollbar-thumb-hover: rgba(180, 208, 255, 0.95);
  --sidebar-width: 248px;
  --left-resizer-width: 6px;
  --right-rail-toggle-width: 0px;
  --right-rail-width: 0px;
  --table-font-size: 13px;
  --table-cell-padding: 6px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(160, 194, 255, 0.96), rgba(114, 165, 255, 0.96));
  border-radius: 10px;
  border: 2px solid rgba(10, 18, 32, 0.35);
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(199, 222, 255, 1), rgba(131, 181, 255, 1));
}

body.admin-mode #file-menu-wrapper,
body.admin-mode #project-menu-wrapper,
body.admin-mode #topbar-search {
  display: none !important;
}
.layout {
  display: grid;
  grid-template-columns:
    var(--sidebar-width)
    var(--left-resizer-width)
    minmax(0, 1fr)
    var(--right-rail-toggle-width)
    var(--right-rail-width);
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
}
.layout > .sidebar {
  grid-column: 1;
}
.layout > #layout-resizer {
  grid-column: 2;
}
.layout > .main {
  grid-column: 3;
}
.layout > #right-rail-toggle-wrap {
  grid-column: 4;
}
.layout > #right-rail {
  grid-column: 5;
}
.sidebar {
  background: linear-gradient(180deg, #0b1422 0%, #0a1320 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 12px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  box-sizing: border-box;
}
.layout-resizer {
  width: var(--left-resizer-width);
  cursor: col-resize;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02));
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.layout-resizer:hover,
.layout-resizer.is-dragging {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
}
.sidebar h2 {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 10px 2px;
  color: #9bb8ff;
  opacity: 0.85;
}
.nav-search-row {
  padding: 4px 4px 8px;
}
.nav-search-input {
  width: 100%;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 14, 24, 0.88);
  color: #e2e8f0;
  font-size: 12px;
}
.nav-search-input::placeholder {
  color: rgba(226, 232, 240, 0.55);
}
.nav-item {
  min-height: 36px;
  padding: 7px 9px;
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.08s ease;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(155, 184, 255, 0.35);
}
.nav-item:active {
  transform: translateY(1px);
}
.nav-item-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-item-label {
  font-size: 13px;
  line-height: 1.3;
}
.nav-item-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.nav-chevron {
  font-size: 12px;
  opacity: 0.85;
}
.nav-pin {
  width: auto !important;
  margin: 0;
  padding: 1px 3px;
  border-radius: 6px;
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  background: rgba(255, 255, 255, 0.02) !important;
  color: #dbe8ff;
  opacity: 0.45;
}
.nav-pin:hover {
  opacity: 1;
}
.nav-pin.is-pinned {
  opacity: 0.95;
  border-color: rgba(155, 184, 255, 0.6) !important;
  background: rgba(155, 184, 255, 0.18) !important;
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(40, 111, 237, 0.36), rgba(40, 111, 237, 0.26));
  border-color: rgba(155, 184, 255, 0.7);
  box-shadow: inset 3px 0 0 #8eb5ff;
}
.nav-item-commit-attention {
  border-color: rgba(255, 202, 120, 0.62);
  background: linear-gradient(90deg, rgba(255, 179, 71, 0.24), rgba(255, 179, 71, 0.08));
}
.nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.nav-pill-draft {
  color: #3e2300;
  background: rgba(255, 193, 87, 0.95);
  border: 1px solid rgba(255, 218, 139, 0.95);
}
.nav-pill-pending {
  color: #e8f2ff;
  background: rgba(64, 132, 255, 0.9);
  border: 1px solid rgba(142, 189, 255, 0.88);
}
.sub-dropdown {
  background: rgba(7, 12, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 4px 6px 0;
  margin-bottom: 2px;
}
.sub-group {
  padding: 6px 8px 3px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7aa2ff;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 4px;
}
.sub-item {
  min-height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  cursor: pointer;
  margin: 3px 0 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  display: flex;
  align-items: center;
  line-height: 1.2;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.sub-item:last-child {
  margin-bottom: 0;
}
.sub-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(155, 184, 255, 0.3);
}
.sub-item.depth-two {
  margin-left: 10px;
  padding-left: 12px;
  border-left: 2px solid rgba(155, 184, 255, 0.25);
}
.sub-item.active {
  background: rgba(40, 111, 237, 0.38);
  border-color: rgba(155, 184, 255, 0.62);
}
.nav-empty {
  margin: 6px 2px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: rgba(228, 238, 252, 0.72);
  font-size: 12px;
}
.main {
  padding: 20px;
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}
.right-rail-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow: visible;
  position: relative;
}
.right-rail {
  background: linear-gradient(180deg, #0b1422 0%, #0a1320 100%);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 12px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  box-sizing: border-box;
}
.right-rail h2 {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 10px 2px;
  color: #9bb8ff;
  opacity: 0.85;
}
.rail-toggle-btn {
  width: 28px !important;
  min-width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  margin-top: 0;
  border-radius: 999px;
  background: rgba(16, 28, 46, 0.92);
  color: #dce9ff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  line-height: 1;
  font-size: 14px;
  font-weight: 700;
}
#left-rail-toggle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
}
#right-rail-toggle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
}
.layout.right-rail-available:not(.right-rail-open) #right-rail-toggle {
  left: 50%;
  transform: translate(-50%, -50%);
}
.layout.right-rail-open #right-rail-toggle {
  left: 50%;
  transform: translate(-50%, -50%);
}
#left-rail-toggle:hover,
#right-rail-toggle:hover {
  border-color: rgba(155, 184, 255, 0.62);
  color: #ffffff;
  background: rgba(26, 48, 80, 0.94);
}
.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rail-nav-item {
  text-align: left;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #e6f0ff;
  font-size: 12px;
  padding: 8px 10px;
}
.rail-nav-item.active {
  background: linear-gradient(90deg, rgba(40, 111, 237, 0.36), rgba(40, 111, 237, 0.26));
  border-color: rgba(155, 184, 255, 0.7);
  box-shadow: inset 3px 0 0 #8eb5ff;
}
.layout.left-rail-collapsed .sidebar {
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
  padding: 0;
  border-right: none;
}
.layout.left-rail-collapsed .layout-resizer {
  cursor: default;
  background: linear-gradient(180deg, rgba(120, 168, 255, 0.08), rgba(120, 168, 255, 0.02));
}
.layout.right-rail-open .right-rail {
  display: block;
}
#content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overflow-x: hidden;
  padding-right: 2px;
}
#content.content-table-scroll-mode {
  overflow: hidden;
  overflow-x: hidden;
}
h1 {
  margin: 0 0 16px 0;
}
.card {
  background: rgba(255, 255, 255, 0.05);
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 14px;
}
label {
  display: block;
  font-size: 12px;
  color: #a8c5ff;
  margin-top: 6px;
}
input,
select,
button,
textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  margin-top: 4px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #e4eefc;
}
.modal textarea {
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow-y: auto;
  resize: vertical;
  max-height: min(42vh, 320px);
}
.modal textarea:not([rows]) {
  min-height: 82px;
}
.modal textarea.field-compact-wrap {
  min-height: 42px;
  max-height: 120px;
}
button {
  transition: transform 0.04s ease, filter 0.04s ease, box-shadow 0.04s ease;
}
button:active {
  transform: translateY(1px);
  filter: brightness(1.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
button:focus-visible {
  outline: 2px solid #9bb8ff;
  outline-offset: 2px;
}
select option,
select optgroup {
  background: #0b1422;
  color: #e4eefc;
}
.chip-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip-option input {
  display: none;
}
.chip-option span {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #e4eefc;
  cursor: pointer;
  user-select: none;
}
.chip-option input:checked + span {
  background: #2a6fff;
  border-color: #2a6fff;
  color: #ffffff;
}

/* Inputs like checkboxes/radios should not inherit the full-width input styling. */
input[type='checkbox'],
input[type='radio'] {
  width: auto;
  padding: 0;
  margin-top: 0;
  border: none;
  background: transparent;
}
button {
  cursor: pointer;
  background: #1f6feb;
  border: none;
}
button.btn-intent-save {
  background: linear-gradient(180deg, #1f9f5a, #177343) !important;
  border: 1px solid rgba(137, 245, 184, 0.55);
  color: #f2fff6;
}
button.btn-intent-save:hover {
  filter: brightness(1.08) saturate(1.05);
}
button.btn-intent-cancel {
  background: linear-gradient(180deg, #5a667a, #3e4858) !important;
  border: 1px solid rgba(188, 199, 216, 0.5);
  color: #eef4ff;
}
button.btn-intent-cancel:hover {
  filter: brightness(1.08);
}
button.btn-intent-delete {
  background: linear-gradient(180deg, #c93b3b, #982a2a) !important;
  border: 1px solid rgba(255, 177, 177, 0.58);
  color: #fff5f5;
}
button.btn-intent-delete:hover {
  filter: brightness(1.08) saturate(1.04);
}
.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: var(--table-font-size);
}
.table-inline-search-wrap {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 6px;
  gap: 8px;
}
.table-inline-search-input {
  width: min(360px, 100%);
  margin-top: 0;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(150, 184, 255, 0.35);
  background: rgba(8, 14, 24, 0.88);
  color: #e4eefc;
}
.table-inline-search-input::placeholder {
  color: rgba(228, 238, 252, 0.56);
}
.table-inline-search-hit {
  background: rgba(255, 223, 93, 0.85);
  color: #172233;
  border-radius: 3px;
  padding: 0 2px;
}
.table-inline-search-hidden {
  display: none !important;
}
.table-scroll-shell {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(6, 12, 20, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.table-scroll-shell > .table {
  margin-top: 0;
}
.table-scroll-shell > .table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: linear-gradient(180deg, rgba(22, 36, 58, 0.98), rgba(14, 25, 42, 0.98));
  border-bottom: 1px solid rgba(140, 180, 255, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 2px 8px rgba(0, 0, 0, 0.22);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.table-scroll-shell > .table thead th:first-child {
  border-top-left-radius: 8px;
}
.table-scroll-shell > .table thead th:last-child {
  border-top-right-radius: 8px;
}
.table th,
.table td {
  padding: var(--table-cell-padding);
  border: 1px solid rgba(255, 255, 255, 0.15);
  text-align: left;
  vertical-align: top;
}
body.density-compact {
  --table-font-size: 12px;
  --table-cell-padding: 4px;
}
body.density-compact .card {
  padding: 10px;
}
body.density-compact .nav-item {
  min-height: 32px;
  padding: 5px 8px;
}
body.density-compact .sub-item {
  min-height: 24px;
}
body.density-compact .modal {
  padding: 12px;
}
body.density-compact input,
body.density-compact select,
body.density-compact button,
body.density-compact textarea {
  padding: 6px;
}
body.density-comfortable {
  --table-font-size: 13px;
  --table-cell-padding: 6px;
}

.design-definition-table {
  table-layout: fixed;
}

.design-definition-table th,
.design-definition-table td {
  white-space: normal;
  word-break: break-word;
}

.design-definition-table .pill {
  max-width: 100%;
  white-space: normal;
}

.ui-registry-table th:nth-child(8),
.ui-registry-table td:nth-child(8) {
  min-width: 320px;
}

.compact-table th,
.compact-table td {
  padding: 4px 6px;
  font-size: 12px;
  line-height: 1.2;
  white-space: normal;
  word-break: break-word;
}

.compact-table {
  table-layout: fixed;
}

.system-obligation-table td:nth-child(4),
.system-obligation-table th:nth-child(4) {
  max-width: 180px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.lib-highlight {
  background: rgba(86, 120, 255, 0.35);
  border-radius: 3px;
  padding: 0 2px;
}

.lib-dup-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
  background: rgba(255, 160, 160, 0.2);
  color: #ff9c9c;
}
.preview-row-new td {
  color: #8bd28b;
}
.preview-row-update td {
  color: #ffd27a;
}
.preview-row-duplicate td,
.preview-row-missingId td {
  color: #ff9c9c;
  text-decoration: line-through;
}
.preview-row-merged td {
  color: rgba(255, 255, 255, 0.6);
}

.row-obsolete {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(228, 238, 252, 0.65);
}

/* Traceability tables often contain long IDs/labels; increase spacing + allow wrapping
   so adjacent fields don't visually run into each other. */
.trace-table th,
.trace-table td {
  padding: 8px 10px;
  line-height: 1.3;
  white-space: normal;
  word-break: break-word;
}
.trace-diff-added td {
  background: rgba(82, 196, 141, 0.12);
  color: #c6f6d8;
}
.trace-diff-removed td {
  background: rgba(255, 107, 107, 0.12);
  color: #ffb3b3;
  text-decoration: line-through;
}

.trace-controls {
  display: flex;
  gap: 20px;
  row-gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.trace-controls label {
  margin-top: 0;
}

.trace-controls .trace-field {
  min-width: 260px;
}

.trace-controls .trace-field.compact {
  min-width: 210px;
}

.trace-controls .trace-toggles {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 2px;
}

.trace-controls .trace-toggle {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0;
}
.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.modal .row > div {
  flex: 1 1 0;
  min-width: 0;
}
.modal .row input,
.modal .row select,
.modal .row textarea {
  min-width: 0;
}
.modal .row button {
  width: auto;
  flex: 1 1 0;
  margin-top: 0;
}
.modal .row .small-btn {
  flex: 0 0 auto;
}
.modal .row .btn-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 auto;
  align-items: flex-start;
}
.modal .row .btn-stack button {
  flex: 0 0 auto;
  width: auto;
}
.processing-context-modal {
  width: min(920px, 96vw);
  max-height: 88vh;
  overflow: auto;
  overflow-x: hidden;
}
.processing-context-draft-panel {
  margin-top: 6px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(9, 14, 20, 0.45);
}
.processing-context-draft-actions {
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}
.processing-context-draft-list {
  max-height: 180px;
  overflow: auto;
  margin-top: 8px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(10, 18, 28, 0.35);
}
.processing-context-notes {
  min-height: 96px;
  max-height: 220px;
  overflow-y: auto;
  resize: vertical;
}
.editor-id-name-row > div:first-child {
  flex: 0.3 1 0;
}
.editor-id-name-row > div:last-child {
  flex: 0.7 1 0;
}
.ai-suggest {
  margin: 8px 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px;
  background: rgba(9, 14, 20, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}
.commit-cue-banner {
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.commit-cue-banner-warning {
  background: rgba(255, 181, 76, 0.2);
  border-color: rgba(255, 204, 120, 0.65);
  color: #ffe5b6;
}
.commit-cue-banner-info {
  background: rgba(75, 145, 255, 0.2);
  border-color: rgba(134, 184, 255, 0.6);
  color: #dbe9ff;
}
.commit-cue-banner-ok {
  background: rgba(116, 210, 136, 0.18);
  border-color: rgba(147, 227, 162, 0.56);
  color: #d7ffe0;
}
.commit-summary-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.commit-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.commit-status-draft {
  background: rgba(255, 181, 76, 0.22);
  border-color: rgba(255, 209, 141, 0.62);
  color: #ffe6be;
}
.commit-status-pending {
  background: rgba(75, 145, 255, 0.22);
  border-color: rgba(144, 191, 255, 0.62);
  color: #dfeeff;
}
.commit-status-approved {
  background: rgba(116, 210, 136, 0.2);
  border-color: rgba(154, 231, 170, 0.58);
  color: #dcffe4;
}
.commit-status-set {
  background: rgba(220, 220, 220, 0.16);
  border-color: rgba(220, 220, 220, 0.4);
  color: #e7edf6;
}
.commit-set-actions {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.commit-set-actions .small-btn {
  width: auto;
  margin-top: 0;
}
.ai-suggest-header {
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
}
.ai-suggest-title {
  font-weight: 600;
  font-size: 13px;
  opacity: 0.9;
  flex: 1 1 auto;
  min-width: 110px;
}
.ai-suggest-select {
  background: rgba(15, 22, 30, 0.7);
  color: #e7eef8;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  height: 28px;
  min-width: 150px;
  max-width: 220px;
}
.ai-suggest-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  opacity: 0.9;
  white-space: nowrap;
}
.ai-suggest-toggle input {
  margin: 0;
}
.ai-lock-indicator {
  position: fixed;
  right: 16px;
  top: 12px;
  z-index: 120;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(155, 184, 255, 0.45);
  background: rgba(18, 34, 58, 0.9);
  color: #dbe8ff;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.ai-lock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8cb4ff;
  box-shadow: 0 0 0 0 rgba(140, 180, 255, 0.6);
  animation: ai-lock-pulse 1.4s ease-in-out infinite;
}
@keyframes ai-lock-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(140, 180, 255, 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(140, 180, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(140, 180, 255, 0);
  }
}
.ai-panel {
  margin-top: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px;
  background: rgba(12, 20, 30, 0.35);
}
.ai-suggestion {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px;
  margin-bottom: 6px;
  background: rgba(18, 28, 38, 0.45);
}
.ai-suggestion:last-child {
  margin-bottom: 0;
}
.ai-suggestion-title {
  font-weight: 600;
  font-size: 13px;
  white-space: normal;
  display: flex;
  gap: 8px;
  align-items: center;
}
.ai-suggest-chip {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(97, 162, 255, 0.18);
  color: #9bb8ff;
  border: 1px solid rgba(97, 162, 255, 0.35);
  white-space: nowrap;
}
.ai-suggest-chip-confidence {
  background: rgba(111, 201, 142, 0.18);
  color: #baf7cb;
  border-color: rgba(111, 201, 142, 0.42);
}
.ai-suggestion-meta {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 4px;
  white-space: pre-wrap;
}
.ai-suggestion-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}
.table tr.ai-selected td {
  background: rgba(58, 120, 190, 0.18);
}
.ai-status {
  font-size: 12px;
  opacity: 0.85;
  padding: 4px 0;
}
.ai-error {
  color: #ffb3b3;
}
.spec-range {
  flex-wrap: nowrap;
  gap: 12px;
}
.spec-range > div {
  flex: 1 1 0;
  min-width: 0;
}
.pill {
  display: inline-block;
  background: #1a3f62;
  padding: 4px 8px;
  border-radius: 8px;
  margin: 4px 6px 0 0;
  font-size: 12px;
}
.pill-inherited {
  border: 1px dashed rgba(255, 255, 255, 0.35);
  opacity: 0.85;
}
.pill-origin-badge {
  margin-left: 8px;
  min-width: 16px;
  height: 16px;
  line-height: 14px;
  text-align: center;
  box-sizing: border-box;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
}
.pill-origin-direct {
  background: rgba(118, 170, 255, 0.2);
  border: 1px solid rgba(170, 204, 255, 0.45);
  color: #dcecff;
}
.pill-origin-inherited {
  background: rgba(255, 216, 143, 0.16);
  border: 1px dashed rgba(255, 216, 143, 0.55);
  color: #ffe8bf;
}
.ui-char-row-inherited td {
  background: rgba(255, 216, 143, 0.07);
}
.table tr.ui-char-row-inherited.row-selected td {
  background: rgba(94, 146, 234, 0.26);
}
.pill-safety {
  background: #6b1f1f;
  border: 1px solid #ff9a9a;
  color: #ffd5d5;
}
.pill-inherited.pill-safety {
  border-style: dashed;
  border-width: 1px;
  border-color: rgba(255, 154, 154, 0.95);
}
.pill-part {
  background: #1a2f4f;
  border: 1px solid rgba(155, 184, 255, 0.45);
  color: #cfe0ff;
}
.pill-obligation {
  background: #2a4b3c;
  border: 1px solid rgba(127, 208, 162, 0.8);
  color: #d7ffec;
}
.pill-user-need {
  background: #2a3c5a;
  border: 1px solid rgba(143, 186, 255, 0.75);
  color: #d8e6ff;
}
.pill-product-req {
  background: #4a2f57;
  border: 1px solid rgba(210, 165, 255, 0.7);
  color: #f3dcff;
}
.pill-user-goal {
  background: #3d4a2e;
  border: 1px solid rgba(185, 227, 120, 0.7);
  color: #e8ffd0;
}
.pill-use-scenario {
  background: #32465a;
  border: 1px solid rgba(150, 200, 255, 0.7);
  color: #e0f0ff;
}
.pill-system-scenario {
  background: #4a3b2e;
  border: 1px solid rgba(230, 180, 120, 0.7);
  color: #ffe7cf;
}
.pill-req {
  background: #3b3f4a;
  border: 1px solid rgba(220, 220, 220, 0.6);
  color: #f3f3f3;
}
.pill-task {
  background: #2f4b4a;
  border: 1px solid rgba(140, 230, 220, 0.7);
  color: #dbfff9;
}
.pill-hazard {
  background: #5a2a2a;
  border: 1px solid rgba(255, 160, 160, 0.75);
  color: #ffe0e0;
}
.pill-use-error {
  background: #52334a;
  border: 1px solid rgba(255, 185, 230, 0.75);
  color: #ffe3f3;
}
.pill-threat {
  background: #2a3b57;
  border: 1px solid rgba(150, 190, 255, 0.75);
  color: #deebff;
}
.pill-vulnerability {
  background: #3d2f57;
  border: 1px solid rgba(190, 160, 255, 0.75);
  color: #efe0ff;
}
.pill-standard {
  background: #2b3f36;
  border: 1px solid rgba(150, 220, 185, 0.75);
  color: #dff7ec;
}
.pill-copied {
  background: #3f365a;
  border: 1px solid rgba(188, 171, 255, 0.75);
  color: #ece6ff;
}
.list-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.list-block .list-item {
  position: relative;
  padding-left: 14px;
}

.list-block .list-item::before {
  content: '•';
  position: absolute;
  left: 0;
  top: 0;
  color: #5b6f82;
}
.tabular-row {
  display: grid;
  gap: 8px;
  align-items: center;
  padding: 6px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.library-field-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 8px;
}
.library-field-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.standards-progress {
  margin-top: 6px;
  height: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.standards-progress > div {
  height: 100%;
  background: linear-gradient(90deg, #4da3ff, #7ed7ff);
}
.standards-hazard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.standards-hazard-item {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.standards-hazard-text {
  font-size: 12px;
  line-height: 1.3;
  opacity: 0.9;
  word-break: break-word;
}
.standards-preview-controls {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 4px;
  background: #111924;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}
.standards-preview-header {
  position: sticky;
  top: 42px;
  z-index: 2;
  background: #111924;
}
.standards-hazard-filter {
  min-width: 220px;
  max-width: 320px;
}
.standards-manager-hazards-cell {
  min-width: 0;
}
.standards-manager-hazards-cell .standards-evidence-list {
  gap: 3px;
}
.standards-intent-panel {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.standards-intent-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.standards-intent-label {
  font-size: 12px;
  line-height: 1.25;
  word-break: break-word;
}
.standards-confidence-chip {
  font-size: 10px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(110, 187, 255, 0.45);
  color: #b9deff;
  background: rgba(76, 141, 197, 0.2);
  white-space: nowrap;
}
.standards-evidence-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.standards-evidence-btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: #c9ddff;
  border-radius: 4px;
  padding: 0 4px;
  font-size: 10px;
  line-height: 1.25;
  cursor: pointer;
  min-height: 16px;
  min-width: 0;
}
.standards-evidence-btn:hover {
  background: rgba(118, 186, 255, 0.2);
  border-color: rgba(118, 186, 255, 0.45);
}
.standards-evidence-muted {
  font-size: 11px;
  opacity: 0.65;
}
.standards-preview-list .tabular-row.standards-evidence-target {
  outline: 1px solid rgba(118, 186, 255, 0.65);
  background: rgba(118, 186, 255, 0.1);
}
.standards-preview-list {
  overflow-x: hidden;
}
.standards-preview-list .tabular-row {
  width: 100%;
  box-sizing: border-box;
}
.standards-action-cell {
  display: flex;
  gap: 6px;
  justify-content: flex-start;
}
.standards-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.standards-controls-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.standards-controls-label {
  min-width: 70px;
  font-size: 12px;
  opacity: 0.8;
}
.standards-filter {
  flex: 0 0 220px;
}
.standards-search {
  flex: 1 1 220px;
  min-width: 180px;
}
.standards-split {
  flex: 0 0 160px;
}
.standards-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.standards-toggles-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 190px;
  align-items: flex-start;
}
.standards-controls-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}
.standards-classifier-filter-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 210px;
}
.standards-classifier-filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.standards-classifier-filter-label {
  font-size: 11px;
  opacity: 0.8;
  margin: 0;
  line-height: 1;
  min-width: 44px;
  white-space: nowrap;
}
.standards-classifier-filter-stack .standards-split,
.standards-classifier-filter-stack .standards-hazard-filter {
  min-width: 150px;
  max-width: 200px;
  width: auto;
  margin-top: 0;
  padding: 6px 8px;
}
.standards-manager-sticky-controls {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #111924;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.standards-manager-sticky-header {
  position: sticky;
  z-index: 2;
  background: #111924;
}
.standards-hover-preview {
  position: fixed;
  z-index: 5000;
  max-width: min(640px, 80vw);
  max-height: min(300px, 55vh);
  overflow: auto;
  pointer-events: none;
  border: 1px solid rgba(120, 188, 255, 0.55);
  background: rgba(10, 15, 24, 0.96);
  border-radius: 10px;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.42);
  padding: 10px 12px;
}
.standards-hover-title {
  font-size: 12px;
  font-weight: 600;
  color: #b9d9ff;
  margin-bottom: 6px;
}
.standards-hover-text {
  font-size: 12px;
  line-height: 1.42;
  color: rgba(235, 243, 255, 0.94);
  white-space: pre-wrap;
  word-break: break-word;
}
.stat-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px;
}
.stat-title {
  font-weight: 600;
  margin-bottom: 8px;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 6px;
}
.stat-row strong {
  font-size: 14px;
}
.note-inline {
  margin-top: 4px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid #ff9a9a;
  background: rgba(107, 31, 31, 0.28);
  color: #ffd5d5;
  font-size: 12px;
  white-space: normal;
  word-break: break-word;
}
.topbar {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 7px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}
.topbar-row {
  display: grid;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.topbar-row-main {
  grid-template-columns: minmax(0, 1fr) auto;
}
.topbar-row-meta {
  grid-template-columns: minmax(280px, 1fr) auto;
}
.topbar-left,
.topbar-right {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}
.topbar-right {
  justify-content: flex-end;
}
.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.top-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
  color: #d7e3f6;
  font-size: 11px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.top-status-chip-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-right: 6px;
}
.top-status-chip-label {
  font-size: 11px;
  letter-spacing: 0.02em;
}
.top-status-chip-select select {
  width: auto;
  min-width: 132px;
  margin-top: 0;
  background: rgba(12, 20, 36, 0.9);
  color: #eaf0ff;
  border: 1px solid rgba(151, 191, 255, 0.45);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.2;
}
.top-status-chip.status-ok {
  border-color: rgba(84, 203, 154, 0.45);
  background: rgba(84, 203, 154, 0.12);
  color: #d8ffed;
}
.top-status-chip.status-warn {
  border-color: rgba(255, 179, 87, 0.5);
  background: rgba(255, 179, 87, 0.14);
  color: #ffe9ca;
}
.top-status-chip.status-danger {
  border-color: rgba(255, 130, 130, 0.52);
  background: rgba(255, 130, 130, 0.16);
  color: #ffdede;
}
.top-status-chip.status-busy {
  border-color: rgba(155, 184, 255, 0.52);
  background: rgba(155, 184, 255, 0.14);
  color: #dce8ff;
}
.top-status-chip-clickable {
  cursor: pointer;
}
.topbar-table-tools-btn {
  width: auto;
  margin-top: 0;
  padding: 3px 8px;
  font-size: 11px;
}
.project-settings-tools-card {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.project-settings-tools-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0.9;
}
.project-settings-density-row .small-btn {
  min-width: 142px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.project-settings-density-row .small-btn.active {
  border-color: rgba(74, 186, 154, 0.8);
  background: rgba(74, 186, 154, 0.16);
}
.project-settings-density-row .small-btn span {
  display: inline-block;
  width: 10px;
  text-align: center;
  color: #8df8d5;
  font-weight: 700;
}
.top-status-chip-clickable:hover {
  filter: brightness(1.06);
}
.topbar-search {
  display: flex;
  justify-content: flex-start;
  min-width: 0;
}
.global-search-wrap {
  display: flex;
  gap: 6px;
  align-items: center;
  max-width: 540px;
  width: 100%;
}
.global-search-input {
  max-width: 460px;
  width: 100%;
}
.topbar-context {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 12px;
}
.topbar-context-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(155, 184, 255, 0.35);
  background: rgba(155, 184, 255, 0.1);
  color: #cfe0ff;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.topbar-context-badge.mode-admin {
  border-color: rgba(255, 186, 120, 0.45);
  background: rgba(255, 186, 120, 0.15);
  color: #ffe7c8;
}
.topbar-context-badge.mode-viz {
  border-color: rgba(130, 215, 178, 0.45);
  background: rgba(130, 215, 178, 0.15);
  color: #ddfff2;
}
#topbar-context-text {
  flex: 1;
  color: rgba(228, 238, 252, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-mini-help-btn {
  width: 24px !important;
  min-width: 24px;
  height: 24px;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 999px;
  border: 1px solid rgba(155, 184, 255, 0.45) !important;
  background: rgba(155, 184, 255, 0.12) !important;
  color: #e3efff;
  font-weight: 700;
  line-height: 1;
}
.topbar-mini-help-btn:hover {
  background: rgba(155, 184, 255, 0.22) !important;
}
.topbar-mini-help-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(420px, 80vw);
  z-index: 18;
  border: 1px solid rgba(155, 184, 255, 0.35);
  border-radius: 10px;
  background: rgba(8, 13, 23, 0.96);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  padding: 10px 12px;
}
.topbar-mini-help-title {
  margin: 0 0 8px 0;
  color: #dbe9ff;
  font-size: 13px;
  font-weight: 700;
}
.topbar-mini-help-list {
  margin: 0;
  padding-left: 18px;
}
.topbar-mini-help-list li {
  margin-bottom: 5px;
  font-size: 12px;
  color: #d6e5ff;
}
.topbar-mini-help-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.topbar-mini-help-actions .small-btn {
  margin: 0 !important;
  padding: 4px 8px;
}
.menu {
  position: relative;
  display: inline-block;
}
.menu-muted {
  color: #9bb8ff;
  font-size: 12px;
  padding: 5px 8px;
  opacity: 0.8;
  cursor: default;
}
.menu-section-label {
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0.72;
}
.menu-items .menu-muted:hover {
  background: transparent;
}
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #42d392;
  margin-right: 6px;
}
.menu button {
  width: auto;
  min-height: 31px;
  padding: 5px 11px;
  background: linear-gradient(180deg, #1f6feb 0%, #1a5dcb 100%);
  border: 1px solid rgba(155, 184, 255, 0.35);
}
.topbar .menu button {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 12px;
}
.topbar .global-search-wrap .small-btn {
  padding: 5px 9px;
  margin-left: 4px;
}
.menu-items {
  position: absolute;
  top: 34px;
  left: 0;
  background: rgba(8, 14, 24, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 6px;
  min-width: 220px;
  display: none;
  z-index: 45;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

/* When the menu trigger sits on the right edge, align the dropdown right-to-left. */
#project-menu.menu-items {
  left: auto;
  right: 0;
}
.menu-items div {
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 5px 8px;
  cursor: pointer;
  border-radius: 8px;
  font-size: 13px;
}
.menu-items div:hover {
  background: rgba(155, 184, 255, 0.18);
}
.menu-separator {
  min-height: 0 !important;
  height: 1px;
  margin: 4px 2px;
  padding: 0 !important;
  background: rgba(255, 255, 255, 0.14) !important;
  pointer-events: none;
}
.menu-item-danger {
  color: #ffd3d3;
}
.menu-item-danger:hover {
  background: rgba(255, 122, 122, 0.2) !important;
}
.help-modal-context {
  margin-top: 2px;
  margin-bottom: 10px;
  font-size: 12px;
  color: #9db6ec;
  background: rgba(51, 82, 143, 0.22);
  border: 1px solid rgba(107, 146, 224, 0.35);
  border-radius: 8px;
  padding: 6px 10px;
}
.help-modal-body {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(9, 14, 24, 0.58);
  padding: 12px;
  white-space: normal;
  line-height: 1.45;
}
.help-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.help-hero {
  border: 1px solid rgba(114, 160, 255, 0.35);
  background: linear-gradient(180deg, rgba(73, 116, 211, 0.24) 0%, rgba(22, 33, 52, 0.28) 100%);
  border-radius: 10px;
  padding: 10px 12px;
}
.help-hero h4 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.01em;
}
.help-hero p {
  margin: 6px 0 0 0;
  font-size: 12px;
  color: #c2d6ff;
}
.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}
.help-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(11, 18, 30, 0.66);
  padding: 10px 12px;
}
.help-card h5 {
  margin: 0 0 8px 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a9c6ff;
}
.help-card ul {
  margin: 0;
  padding-left: 18px;
}
.help-card li {
  margin-bottom: 6px;
  color: #e8efff;
}
.help-card-shortcuts {
  grid-column: 1 / -1;
}
.help-shortcut-table {
  width: 100%;
  border-collapse: collapse;
}
.help-shortcut-table td {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 7px 0;
  vertical-align: top;
}
.help-shortcut-table tr:first-child td {
  border-top: none;
}
.help-shortcut-keys {
  width: 40%;
  white-space: nowrap;
}
.help-shortcut-desc {
  color: #d9e7ff;
}
.help-shortcut-join {
  display: inline-block;
  margin: 0 5px;
  opacity: 0.85;
}
.help-modal-body kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 11px;
  border: 1px solid rgba(177, 209, 255, 0.45);
  background: rgba(43, 68, 117, 0.42);
  color: #e4f0ff;
  border-radius: 6px;
  padding: 2px 6px;
}
.offline-queue-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.offline-queue-table th,
.offline-queue-table td {
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  padding: 7px 8px;
  font-size: 12px;
  text-align: left;
  vertical-align: top;
}
.offline-queue-table thead th {
  border-top: none;
  color: #9ec0ff;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.offline-queue-table td:nth-child(1),
.offline-queue-table td:nth-child(2),
.offline-queue-table td:nth-child(4),
.offline-queue-table td:nth-child(5) {
  white-space: nowrap;
}
.offline-queue-table td:nth-child(3) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 0;
}
.command-palette {
  width: min(760px, 92vw);
  max-height: 80vh;
}
.command-palette-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 58vh;
  overflow: auto;
}
.command-palette-item {
  margin: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(16, 24, 39, 0.5);
  color: #dce8ff;
  cursor: pointer;
}
.command-palette-item .muted {
  opacity: 0.72;
  font-size: 11px;
}
.command-palette-item:hover,
.command-palette-item.active {
  background: rgba(86, 133, 255, 0.24);
  border-color: rgba(155, 184, 255, 0.58);
}
table tbody tr.row-selected > td {
  background: rgba(77, 121, 255, 0.22) !important;
  box-shadow: inset 0 0 0 1px rgba(155, 184, 255, 0.48);
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
}
.modal-backdrop.full-panel {
  justify-content: flex-start;
  align-items: stretch;
  padding: 20px 20px 20px 240px;
}
.modal-backdrop.stack-top {
  z-index: 60;
}
.modal {
  background: #0b1422;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 16px;
  width: 640px;
  max-height: 85vh;
  overflow: auto;
  overflow-x: hidden;
}
.modal.full-panel-content {
  width: 100%;
  max-width: none;
  height: calc(100vh - 40px);
  max-height: none;
  display: flex;
  flex-direction: column;
}
.ui-loading-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 18;
  display: none;
}
body.ui-loading .ui-loading-overlay {
  display: block;
}
.ui-loading-skeleton {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.02), rgba(155, 184, 255, 0.08), rgba(255, 255, 255, 0.02)) 0 0 / 240px 100% no-repeat,
    linear-gradient(180deg, rgba(4, 9, 16, 0), rgba(4, 9, 16, 0.25));
  animation: uiSkeletonShift 1.2s linear infinite;
}
@keyframes uiSkeletonShift {
  from {
    background-position: -260px 0, 0 0;
  }
  to {
    background-position: calc(100vw + 260px) 0, 0 0;
  }
}
.toast-host {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(460px, 92vw);
}
.toast {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(11, 20, 34, 0.95);
  color: #e8f1ff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  font-size: 12px;
  line-height: 1.35;
}
.toast.toast-success {
  border-color: rgba(105, 215, 155, 0.5);
}
.toast.toast-warn {
  border-color: rgba(255, 184, 92, 0.6);
}
.toast.toast-error {
  border-color: rgba(255, 120, 120, 0.62);
}
.rel-preview-pop {
  position: fixed;
  z-index: 95;
  max-width: 340px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(150, 190, 255, 0.42);
  background: rgba(9, 16, 27, 0.95);
  color: #e7f0ff;
  font-size: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.rel-preview-title {
  font-weight: 600;
  color: #b7d0ff;
  margin-bottom: 4px;
}
.table-layout-list {
  max-height: 52vh;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px;
  margin-top: 6px;
}
.table-layout-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 78px 28px 28px;
  gap: 8px;
  align-items: center;
  padding: 5px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.table-layout-item:last-child {
  border-bottom: none;
}
.table-layout-col-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table-col-resize-handle {
  position: absolute;
  top: 0;
  right: -2px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
}
.table-enhanced .col-hidden {
  display: none !important;
}
.platform-entry-grid {
  display: grid;
  gap: 10px;
  align-items: start;
  margin-top: 6px;
}
.platform-entry-grid-refq {
  grid-template-columns: minmax(120px, 20%) minmax(0, 1fr);
}
.platform-entry-grid-ansnotes {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.platform-entry-field {
  min-width: 0;
}
.platform-entry-field > label {
  margin-top: 0;
}
.platform-entry-textarea {
  min-height: 84px;
  max-height: 220px;
  overflow-y: auto;
  resize: vertical;
}
.landing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f1b2c;
  color: #e4eefc;
}
.landing-card {
  width: 420px;
  background: rgba(255, 255, 255, 0.05);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.landing h1 {
  margin-top: 0;
}
.small-btn {
  width: auto;
  display: inline-block;
  margin-left: 6px;
  margin-top: 0;
  padding: 6px 10px;
}
button[data-hint] {
  position: relative;
}
.global-button-hint-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  max-width: 260px;
  min-width: 120px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(8, 17, 32, 0.96);
  border: 1px solid rgba(140, 173, 224, 0.45);
  color: #e7f0ff;
  font-size: 11px;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  z-index: 5000;
  pointer-events: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}
.small-btn:disabled,
button:disabled,
.small-btn.ai-suggest-locked {
  opacity: 0.48;
  cursor: not-allowed;
  filter: grayscale(0.35);
  box-shadow: none;
}
.small-btn:disabled:active,
button:disabled:active,
.small-btn.ai-suggest-locked:active {
  transform: none;
  filter: grayscale(0.35);
}
@media (max-width: 1200px) {
  .modal-backdrop.full-panel {
    padding: 16px !important;
  }
  .layout {
    grid-template-columns:
      min(220px, var(--sidebar-width))
      var(--left-resizer-width)
      minmax(0, 1fr)
      var(--right-rail-toggle-width)
      var(--right-rail-width);
  }
  .topbar {
    gap: 8px;
  }
  .topbar-row-main,
  .topbar-row-meta {
    grid-template-columns: 1fr;
  }
  .topbar-left,
  .topbar-right {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .topbar-status {
    width: 100%;
    flex-wrap: wrap;
    margin-right: 0;
  }
  .topbar-search {
    justify-content: flex-start;
  }
  .global-search-wrap {
    max-width: none;
  }
}
@media (max-width: 720px) {
  .layout {
    min-height: 100vh;
    height: auto;
    overflow: visible;
    grid-template-columns: 1fr;
  }
  .layout-resizer {
    display: none;
  }
  .right-rail-toggle-wrap,
  .right-rail,
  #left-rail-toggle {
    display: none !important;
  }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .modal {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
  }
  .topbar-context {
    margin-bottom: 10px;
  }
  .platform-entry-grid-refq,
  .platform-entry-grid-ansnotes {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  .modal .row {
    flex-direction: column;
    align-items: stretch;
  }
  .modal .row button,
  .modal .row .small-btn {
    width: 100%;
  }
}
.load-error-banner {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: #4a1b1b;
  color: #ffe8e8;
}
.load-error-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}
.load-error-detail {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}
.connection-banner {
  position: sticky;
  top: 0;
  z-index: 79;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: #20304a;
  color: #e7efff;
}
.connection-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}
.connection-detail {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.export-field-table {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  overflow: hidden;
}

.export-field-head,
.export-field-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 72px 120px;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
}

.export-field-head {
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #b8cdf6;
}

.export-field-row {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.export-col-include {
  display: flex;
  align-items: center;
  justify-content: center;
}

.export-col-field {
  min-width: 0;
}

.export-field-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.export-col-order {
  display: flex;
  justify-content: center;
}

.export-col-move {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
