    top: 0;
    border-bottom: 1px solid #2a2a4a;
    white-space: nowrap;
  }
  .db-table td {
    padding: 4px 10px;
    border-bottom: 1px solid #1a1a2e;
    color: #c0caf5;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .db-table tr:hover td { background: #1a1a2e55; }
  .db-row-even td { background: #14142a; }
  .db-table tr[style*="height:100px"] .db-cell-pre { max-height: 50px; }

  /* All scrollbars inside DB table area — slim, consistent */
  #db-table-data,
  #db-table-data * {
    scrollbar-width: thin !important;
    scrollbar-color: #7dcfff33 transparent !important;
  }
  #db-table-data::-webkit-scrollbar,
  #db-table-data *::-webkit-scrollbar {
    width: 4px !important;
    height: 4px !important;
  }
  #db-table-data::-webkit-scrollbar-track,
  #db-table-data *::-webkit-scrollbar-track {
    background: transparent !important;
  }
  #db-table-data::-webkit-scrollbar-thumb,
  #db-table-data *::-webkit-scrollbar-thumb {
    background: #7dcfff55 !important;
    border-radius: 2px !important;
  }
  #db-table-data::-webkit-scrollbar-thumb:hover,
  #db-table-data *::-webkit-scrollbar-thumb:hover {
    background: #7dcfff99 !important;
  }
  #db-table-data::-webkit-scrollbar-corner,
  #db-table-data *::-webkit-scrollbar-corner {
    background: transparent !important;
  }
  .db-cell { scrollbar-width: thin; scrollbar-color: #7dcfff33 transparent; }
  .db-cell::-webkit-scrollbar { width: 4px; height: 4px; }
  .db-cell::-webkit-scrollbar-thumb { background: #7dcfff55; border-radius: 2px; }
  .db-cell::-webkit-scrollbar-thumb:hover { background: #7dcfff99; }

  /* Slim blue scrollbar for the DB sidebar table list */
  #db-table-list { scrollbar-width: thin; scrollbar-color: #7dcfff33 transparent; }
  #db-table-list::-webkit-scrollbar { width: 4px; }
  #db-table-list::-webkit-scrollbar-thumb { background: #7dcfff55; border-radius: 2px; }
  #db-table-list::-webkit-scrollbar-thumb:hover { background: #7dcfff99; }
  .db-table .col-pk { color: #e0af68; }
  .db-table .col-null { color: #565f89; font-style: italic; }
  .db-cell-pre {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: break-word;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 11px;
    line-height: 1.4;
    max-height: 6em;
    max-width: 100%;
    overflow: hidden;
  }
  .db-row-resize-td {
    padding: 0 !important;
    line-height: 0;
  }
  .db-row-resize-handle {
    height: 4px;
    cursor: row-resize;
    background: transparent;
  }
  .db-row-resize-handle:hover,
  .db-row-resize-handle.resizing {
    background: #7dcfff30;
  }
  .db-cell { overflow: auto; position: relative; }
  .db-cell:hover { outline: 1px solid #7dcfff55; }
  .db-cell-expand {
    position: absolute;
    top: 1px;
    right: 1px;
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    color: #565f89;
    width: 18px;
    height: 18px;
    line-height: 16px;
    text-align: center;
    font-size: 11px;
    cursor: pointer;
    border-radius: 3px;
    opacity: 0.35;
    z-index: 5;
    padding: 0;
    transition: opacity 0.12s;
  }
  .db-cell:hover .db-cell-expand {
    opacity: 1;
  }
  .db-cell-expand:hover {
    color: #7dcfff;
    border-color: #7dcfff;
  }

  .db-cell-edit {
    position: absolute;
    top: 1px;
    left: 1px;
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    color: #565f89;
    width: 18px;
    height: 18px;
    line-height: 16px;
    text-align: center;
    font-size: 11px;
    cursor: pointer;
    border-radius: 3px;
    opacity: 0.35;
    z-index: 5;
    padding: 0;
    transition: opacity 0.12s;
  }
  .db-cell:hover .db-cell-edit {
    opacity: 1;
  }
  .db-cell-edit:hover {
    color: #e0af68;
    border-color: #e0af68;
  }

  .db-table td, .db-table th {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .db-th { position: relative; user-select: none; }
  .th-text { 
    overflow: hidden; 
    text-overflow: ellipsis; 
    display: inline-block; 
    cursor: pointer; 
    border-radius: 3px; 
    padding: 1px 4px; 
    white-space: nowrap;
    max-width: 100%;
    box-sizing: border-box;
  }
  .th-text:hover { background: #1e2040; }
  .th-name { display: inline; }
  .th-sort { color: #565f89; display: inline; font-size: 10px; margin-left: 2px; }
  .th-resize {
    position: absolute;
    top: 0; right: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    z-index: 10;
  }
  .th-resize:hover, .th-resize.resizing { background: #7dcfff55; }
  .db-table .resize-line {
    position: absolute;
    top: 0; bottom: 0;
    width: 1px;
    background: #7dcfff;
    z-index: 20;
    pointer-events: none;
  }
  .db-edit-input {
    background: #0d0d1a;
    border: 1px solid #7dcfff;
    color: #c0caf5;
    padding: 4px 6px;
    font-size: 12px;
    font-family: 'Fira Code', Menlo, monospace;
    position: absolute;
    top: 4px;
    left: 10px;
    right: 10px;
    bottom: 4px;
    width: auto;
    height: auto;
    min-height: auto;
    box-sizing: border-box;
    outline: none;
    border-radius: 2px;
    resize: none;
  }

  /* ── JSON editor modal ── */
  #cell-modal { display: none; position: fixed; inset: 0; z-index: 999; }
  #cell-modal.open { display: flex; align-items: center; justify-content: center; }
  #cell-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
  }
  #cell-modal-panel {
    position: relative;
    width: 80vw;
    max-width: 900px;
    height: 70vh;
    background: #0d0d1a;
    border: 1px solid #2a2a4a;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    z-index: 10;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  }
  #cell-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid #2a2a4a;
    flex-shrink: 0;
  }
  #cell-modal-title {
    color: #7dcfff;
    font-size: 13px;
    font-weight: 600;
  }
  #cell-modal-close {
    background: none;
    border: none;
    color: #565f89;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
  }
  #cell-modal-close:hover { color: #f7768e; }
  #cell-modal-editor {
    flex: 1;
    background: #0d0d1a;
    border: none;
    border-bottom: 1px solid #2a2a4a;
    color: #c0caf5;
    font-family: 'Fira Code', Menlo, monospace;
    font-size: 12px;
    line-height: 1.5;
    padding: 14px 16px;
    resize: none;
    outline: none;
    tab-size: 2;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: auto;
  }
  #cell-modal-editor:focus { border-bottom-color: #7dcfff; }
  #cell-modal-viewer {
    flex: 1;
    overflow: auto;
    padding: 16px;
    font-family: 'Fira Code', Menlo, monospace;
    font-size: 12px;
    line-height: 1.5;
    background: #0d0d1a;
  }
  #cell-modal-viewer .json-root {
    font-size: 12px;
  }
  #cell-modal-viewer .json-content-md {
    font-size: 13px;
    max-width: 800px;
  }

  /* ── Chat expand modal ── */
  #chat-expand-modal { display: none; position: fixed; inset: 0; z-index: 999; }
  #chat-expand-modal.open { display: flex; align-items: center; justify-content: center; }
  #chat-expand-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
  }
  #chat-expand-panel {
    position: relative;
    width: 85vw;
    max-width: 800px;
    height: 75vh;
    background: #0d0d1a;
    border: 1px solid #2a2a4a;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    z-index: 10;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  }
  #chat-expand-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid #2a2a4a;
    flex-shrink: 0;
  }
  #chat-expand-title {
    color: #7dcfff;
    font-size: 13px;
    font-weight: 600;
  }
  #chat-expand-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  #chat-expand-close {
    background: none;
    border: none;
    color: #565f89;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
  }
  #chat-expand-close:hover { color: #f7768e; }
  #chat-expand-send {
    background: #7dcfff;
    border: none;
    border-radius: 6px;
    padding: 6px 18px;
    color: #0d0d1a;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: 0.15s;
  }
  #chat-expand-send:hover { background: #89ddff; }
  #chat-expand-send:disabled { opacity: 0.4; cursor: default; }
  #chat-expand-editor {
    flex: 1;
    background: #0d0d1a;
    border: none;
    border-bottom: 1px solid #2a2a4a;
    color: #c0caf5;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    padding: 16px;
    resize: none;
    outline: none;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: auto;
  }
  #chat-expand-editor:focus { border-bottom-color: #7dcfff; }
  #chat-expand-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 8px 16px;
    flex-shrink: 0;
  }
  #chat-expand-hint {
    color: #565f89;
    font-size: 11px;
  }

  body.light-mode #chat-expand-backdrop {
    background: rgba(255,255,255,0.5);
  }
  body.light-mode #chat-expand-panel {
    background: #fff6f0;
    border-color: #ffdec4;
  }
  body.light-mode #chat-expand-header {
    border-bottom-color: #ffdec4;
  }
  body.light-mode #chat-expand-title { color: #cc6a28; }
  body.light-mode #chat-expand-close {
    color: #cc6a28;
  }
  body.light-mode #chat-expand-close:hover { color: #f7768e; }
  body.light-mode #chat-expand-editor {
    background: #fff6f0;
    color: #4a3a30;
    border-bottom-color: #ffdec4;
  }
  body.light-mode #chat-expand-editor:focus { border-bottom-color: #ff8c42; }
  body.light-mode #chat-expand-hint { color: #cca08a; }
  body.light-mode #chat-expand-send {
    background: #ff8c42;
    color: #fff;
  }
  body.light-mode #chat-expand-send:hover { background: #ff9e5e; }

  /* Column filter indicator */
  .db-th.filtered .th-name { color: #7dcfff; }
  .th-funnel {
    display: inline;
    margin-left: 2px;
    font-size: 9px;
    color: #7dcfff;
  }
  .th-hide-btn {
    position: absolute;
    top: 4px;
    left: 4px;
    background: transparent;
    border: none;
    color: #565f89;
    font-size: 11px;
    cursor: pointer;
    z-index: 5;
    padding: 0;
    line-height: 1;
    opacity: 0.5;
    transition: all 0.15s;
  }
  .db-th:hover .th-hide-btn {
    opacity: 1;
  }
  .th-hide-btn:hover {
    color: #c0caf5;
  }
  .th-hide-btn.hidden-col {
    color: #f7768e;
    opacity: 1;
  }

  /* ── Column filter/sort popup (Google Sheets style) ── */
  .db-col-popup {
    position: absolute;
    z-index: 100;
    background: #14142a;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    padding: 6px 0;
    max-height: 320px;
    display: flex;
    flex-direction: column;
    min-width: 180px;
    max-width: 300px;
  }
  .db-popup-sort {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 6px;
    border-bottom: 1px solid #2a2a4a;
  }
  .db-popup-sort-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #c0caf5;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    text-align: left;
    width: 100%;
  }
  .db-popup-sort-btn:hover { background: #1e2040; }
  .db-popup-sort-btn.active { color: #7dcfff; }
  .db-popup-sort-arrow { font-size: 10px; display: inline-block; width: 14px; text-align: center; }
  .db-popup-unsort-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #565f89;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    text-align: left;
    width: 100%;
  }
  .db-popup-unsort-btn:hover { background: #1e2040; color: #c0caf5; }
  .db-popup-search-wrap {
    padding: 6px 6px 4px;
    border-bottom: 1px solid #2a2a4a;
  }
  .db-popup-search {
    width: 100%;
    background: #0d0d1a;
    border: 1px solid #2a2a4a;
    border-radius: 4px;
    padding: 4px 8px;
    color: #c0caf5;
    font-size: 11px;
    font-family: inherit;
    box-sizing: border-box;
    outline: none;
  }
  .db-popup-search:focus { border-color: #7dcfff; }
  .db-popup-search::placeholder { color: #3b4261; }
  .db-popup-select-header {
    display: flex;
    justify-content: space-between;
    padding: 4px 10px 2px;
    font-size: 11px;
  }
  .db-popup-select-header a {
    color: #7dcfff;
    text-decoration: none;
    cursor: pointer;
  }
  .db-popup-select-header a:hover { text-decoration: underline; }
  .db-popup-items {
    flex: 1;
    overflow-y: auto;
    max-height: 180px;
    padding: 2px 0;
  }
  .db-popup-items::-webkit-scrollbar { width: 4px; }
  .db-popup-items::-webkit-scrollbar-thumb { background: #2a2a4a; border-radius: 2px; }
  .db-popup-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    max-width: 100%;
  }
  .db-popup-item:hover { background: #1e2040; }
  .db-popup-item.unchecked .db-popup-val { opacity: 0.4; }
  .db-popup-check { accent-color: #7dcfff; cursor: pointer; margin: 0; flex-shrink: 0; }
  .db-popup-val { 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap; 
    flex: 1; 
  }
  .db-popup-empty { padding: 10px; color: #565f89; font-size: 11px; text-align: center; }
  .db-popup-status {
    padding: 4px 10px;
    font-size: 10px;
    color: #565f89;
    border-top: 1px solid #2a2a4a;
  }
  .db-popup-actions {
    padding: 6px 10px;
    border-top: 1px solid #2a2a4a;
    display: flex;
    justify-content: flex-end;
  }
  .db-popup-hide-row {
    padding: 2px 10px;
    border-top: 1px solid #2a2a4a;
  }
  .db-popup-hide-btn {
    background: none;
    border: none;
    color: #565f89;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    padding: 4px 4px;
    border-radius: 4px;
    width: 100%;
    text-align: left;
  }
  .db-popup-hide-btn:hover {
    background: #1e2040;
    color: #f7768e;
  }
  .db-popup-apply-btn {
    background: #7dcfff;
    color: #0d0d1a;
    border: none;
    border-radius: 4px;
    padding: 4px 16px;
    font-size: 12px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
  }
  .db-popup-apply-btn:hover { background: #a0dbff; }

  /* Drag-to-reorder */
  .db-th.drop-target {
    border-left: 2px solid #7dcfff !important;
  }
  .db-th[draggable="true"] {
    cursor: grab;
  }
  .db-th[draggable="true"]:active {
    cursor: grabbing;
  }

/* ── GitHub tab ── */
#gh-viewer {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #0d0d1a;
  font-size: 12px;
  min-height: 0;
  overflow: hidden;
}
#gh-toolbar {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #2a2a4a;
  align-items: center;
  flex-shrink: 0;
  background: #1a1a2e;
}
#gh-repo-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}
#gh-branch-display::before {
  content: '⎇ ';
  color: #e0af68;
}
#gh-branch {
  color: #e0af68;
  font-weight: 600;
}
#gh-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #2a2a4a transparent;
}
#gh-left {
  padding: 12px;
  border-bottom: 1px solid #2a2a4a;
}
#gh-right {
  padding: 12px;
}
.gh-card {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}
.gh-card-title {
  font-size: 11px;
  font-weight: 600;
  color: #7dcfff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.gh-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.gh-status-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gh-label {
  font-size: 10px;
  color: #565f89;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.gh-value {
  font-size: 12px;
  color: #c0caf5;
}
#gh-remote-url {
  font-family: 'Fira Code', Menlo, monospace;
  font-size: 11px;
  word-break: break-all;
}
#gh-last-commit {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gh-meta {
  font-size: 11px;
  color: #565f89;
}
.gh-hash {
  font-family: 'Fira Code', Menlo, monospace;
  font-size: 10px;
  color: #3b4261;
}
.gh-ahead {
  color: #9ece6a;
  font-weight: 600;
}
.gh-behind {
  color: #f7768e;
  font-weight: 600;
  margin-left: 8px;
}

/* File list */
.gh-file-list {
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2a2a4a transparent;
}
.gh-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 11px;
  font-family: 'Fira Code', Menlo, monospace;
  border-bottom: 1px solid #0d0d1a;
}
.gh-file-item:last-child { border-bottom: none; }
.gh-file-flag {
  display: inline-block;
  width: 22px;
  text-align: center;
  font-weight: 700;
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 3px;
}
.gh-flag-m { background: #e0af6830; color: #e0af68; }
.gh-flag-a { background: #9ece6a30; color: #9ece6a; }
.gh-flag-d { background: #f7768e30; color: #f7768e; }
.gh-flag-r { background: #7dcfff30; color: #7dcfff; }
.gh-flag-u { background: #565f8930; color: #565f89; }
.gh-file-area {
  font-size: 9px;
  color: #565f89;
  text-transform: uppercase;
  width: 60px;
  flex-shrink: 0;
}
.gh-file-path {
  color: #a9b1d6;
  word-break: break-all;
}
.gh-clean-msg {
  color: #9ece6a;
  font-size: 12px;
  padding: 8px 0;
}

/* Error */
.gh-error-box {
  background: #f7768e15;
  border: 1px solid #f7768e40;
  border-radius: 8px;
  padding: 16px;
  color: #f7768e;
  font-size: 13px;
  line-height: 1.5;
  margin: 12px;
}

/* Buttons */
.gh-btn {
  background: #2a2a4a;
  border: 1px solid #3b4261;
  color: #a9b1d6;
  padding: 6px 14px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  transition: 0.15s;
  white-space: nowrap;
}
.gh-btn:hover { background: #3b4261; border-color: #7dcfff; color: #c0caf5; }
.gh-btn:disabled { opacity: 0.5; cursor: default; pointer-events: none; }
.gh-btn-sm { padding: 3px 10px; font-size: 11px; }
.gh-btn-primary {
  background: #7dcfff;
  border-color: #7dcfff;
  color: #0d0d1a;
  font-weight: 600;
}
.gh-btn-primary:hover {
  background: #89ddff;
  border-color: #89ddff;
  color: #0d0d1a;
}
.gh-btn-deploy {
  background: #9ece6a;
  border-color: #9ece6a;
  color: #0d0d1a;
  font-weight: 600;
}
.gh-btn-deploy:hover {
  background: #b9e08c;
  border-color: #b9e08c;
  color: #0d0d1a;
}

/* Inputs */
.gh-input {
  background: #0d0d1a;
  border: 1px solid #2a2a4a;
  border-radius: 5px;
  padding: 6px 10px;
  color: #c0caf5;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  flex: 1;
}
.gh-input:focus {
  border-color: #7dcfff;
}
.gh-input::placeholder { color: #3b4261; }

/* Rows */
.gh-commit-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.gh-sync-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.gh-token-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Results */
.gh-result {
  margin-top: 6px;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
}

/* Spinner */
.gh-spinner {
  animation: gh-spin 0.8s linear infinite;
  color: #7dcfff;
  font-size: 14px;
}
@keyframes gh-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Hint */
.gh-hint {
  font-size: 10px;
  color: #565f89;
  margin-top: 6px;
  line-height: 1.4;
}
.gh-hint-details {
  margin-top: 8px;
  font-size: 11px;
}
.gh-hint-details summary {
  font-size: 11px;
}
.gh-hint-details summary:hover {
  text-decoration: underline;
}
.gh-hint-steps {
  margin-top: 8px;
  padding: 10px 14px;
  background: #0d0d1a;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.6;
  color: #a9b1d6;
}
.gh-hint-steps ol {
  padding-left: 18px;
  margin: 4px 0;
}
.gh-hint-steps li {
  margin-bottom: 2px;
}
.gh-hint-steps p {
  margin: 0;
}

/* ── Restricted access overlay ── */
#gh-restricted-overlay {
  flex: 1;
  display: none;
  align-items: center;
  justify-content: center;
  background: #0d0d1a;
  min-height: 300px;
}
.gh-restricted-card {
  background: #1a1a2e;
  border: 1px solid #fb4934;
  border-radius: 12px;
  padding: 40px 48px;
  text-align: center;
  max-width: 380px;
  animation: gh-fadein 0.3s ease;
}
.gh-restricted-icon {
  font-size: 44px;
  margin-bottom: 12px;
}
.gh-restricted-title {
  font-size: 20px;
  font-weight: 700;
  color: #fb4934;
  margin-bottom: 10px;
}
.gh-restricted-desc {
  font-size: 13px;
  color: #a9b1d6;
  line-height: 1.5;
}
@keyframes gh-fadein {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Commit log */
.gh-log-list {
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2a2a4a transparent;
}
.gh-log-item {
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Fira Code', Menlo, monospace;
  font-size: 11px;
  border-bottom: 1px solid #0d0d1a;
}
.gh-log-item:last-child { border-bottom: none; }
.gh-log-item .gh-hash {
  color: #3b4261;
  flex-shrink: 0;
}
.gh-refs {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #7dcfff15;
  color: #7dcfff;
  flex-shrink: 0;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gh-log-msg {
  color: #a9b1d6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════
   LIGHT MODE OVERRIDES
   ═══════════════════════════════════════════════ */
body.light-mode .db-col-popup {
  background: #ffffff;
  border-color: #ffdec4;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
body.light-mode .db-popup-sort {
  border-bottom-color: #ffdec4;
}
body.light-mode .db-popup-sort-btn {
  color: #3d2c2e;
}
body.light-mode .db-popup-sort-btn:hover {
  background: #fff5eb;
}
body.light-mode .db-popup-sort-btn.active {
  color: #cc6a28;
}
body.light-mode .db-popup-unsort-btn {
  color: #b09580;
}
body.light-mode .db-popup-unsort-btn:hover {
  background: #fff5eb;
  color: #3d2c2e;
}
body.light-mode .db-popup-search {
  background: #fffaf5;
  border-color: #ffdec4;
  color: #3d2c2e;
}
body.light-mode .db-popup-search:focus {
  border-color: #ff8c42;
}
body.light-mode .db-popup-search::placeholder {
  color: #cca08a;
}
body.light-mode .db-popup-select-header a {
  color: #cc6a28;
}
body.light-mode .db-popup-items::-webkit-scrollbar-thumb {
  background: #ffd4a8;
}
body.light-mode .db-popup-item {
  color: #3d2c2e;
}
body.light-mode .db-popup-item:hover {
  background: #fff5eb;
}
body.light-mode .db-popup-item.unchecked .db-popup-val {
  opacity: 0.3;
}
body.light-mode .db-popup-check {
  accent-color: #ff8c42;
}
body.light-mode .db-popup-empty {
  color: #b09580;
}
body.light-mode .db-popup-status {
  color: #b09580;
  border-top-color: #ffdec4;
}
body.light-mode .db-popup-actions {
  border-top-color: #ffdec4;
}
body.light-mode .db-popup-apply-btn {
  background: #ff8c42;
  color: #ffffff;
}
body.light-mode .db-popup-apply-btn:hover {
  background: #ff7a2e;
}
body.light-mode .th-text:hover {
  background: #fff5eb;
}
body.light-mode .db-popup-hide-row {
  border-top-color: #ffdec4;
}
body.light-mode .db-popup-hide-btn {
  color: #b09580;
}
body.light-mode .db-popup-hide-btn:hover {
  background: #fff5eb;
  color: #d65c5c;
}
body.light-mode .th-hide-btn {
  color: #cca08a;
}
body.light-mode .th-hide-btn:hover {
  color: #3d2c2e;
}
body.light-mode .th-hide-btn.hidden-col {
  color: #d44848;
}
body.light-mode .db-cell-expand {
  background: #fffaf5;
  border-color: #ffdec4;
  color: #cca08a;
}
body.light-mode .db-cell-expand:hover {
  color: #ff8c42;
  border-color: #ff8c42;
}
body.light-mode .db-cell-edit {
  background: #fffaf5;
  border-color: #ffdec4;
  color: #cca08a;
}
body.light-mode .db-cell-edit:hover {
  color: #d4873a;
  border-color: #d4873a;
}
body.light-mode .db-edit-input {
  background: #fffaf5;
  border-color: #ff8c42;
  color: #3d2c2e;
}
body.light-mode #cell-modal-backdrop {
  background: rgba(255, 250, 245, 0.7);
  backdrop-filter: blur(3px);
}
body.light-mode #cell-modal-close {
  color: #cca08a;
}
body.light-mode #cell-modal-close:hover {
  color: #d44848;
}
body.light-mode .gh-error-box {
  background: #fff0ee;
  border-color: #ffccbb;
  color: #cc4444;
}
body.light-mode .gh-restricted-card {
  background: #ffffff;
  border-color: #d44848;
}
body.light-mode .gh-restricted-desc {
  color: #5c4a4a;
}
body.light-mode .gh-log-list {
  scrollbar-color: #ffd4a8 transparent;
}
body.light-mode .gh-spinner {
  color: #ff8c42;
}
/* GitHub tab — full light mode */
body.light-mode #gh-viewer {
  background: #fffaf5;
}
body.light-mode #gh-toolbar {
  background: #ffffff;
  border-bottom-color: #ffdec4;
  color: #5c4a4a;
}
body.light-mode #gh-branch {
  color: #cc6a28;
}
body.light-mode #gh-branch-display::before {
  color: #cc6a28;
}
body.light-mode #gh-body {
  scrollbar-color: #ffd4a8 transparent;
}
body.light-mode #gh-left {
  border-bottom-color: #ffdec4;
}
body.light-mode .gh-card {
  background: #ffffff;
  border-color: #ffdec4;
}
body.light-mode .gh-card-title {
  color: #cc6a28;
}
body.light-mode .gh-label {
  color: #b09580;
}
body.light-mode .gh-value {
  color: #3d2c2e;
}
body.light-mode #gh-remote-url {
  color: #5c4a4a;
}
body.light-mode .gh-meta {
  color: #b09580;
}
body.light-mode .gh-hash {
  color: #cca08a;
}
body.light-mode .gh-file-item {
  border-bottom-color: #ffdec4;
}
body.light-mode .gh-file-path {
  color: #3d2c2e;
}
body.light-mode .gh-file-area {
  color: #b09580;
}
body.light-mode .gh-flag-m { background: #e0af6820; color: #b07820; }
body.light-mode .gh-flag-a { background: #9ece6a20; color: #5a9030; }
body.light-mode .gh-flag-d { background: #f7768e20; color: #cc4444; }
body.light-mode .gh-flag-r { background: #7dcfff20; color: #3080c0; }
body.light-mode .gh-flag-u { background: #b0958020; color: #b09580; }
body.light-mode .gh-clean-msg {
  color: #5a9030;
}
body.light-mode .gh-btn {
  background: #fff5eb;
  border-color: #ffdec4;
  color: #5c4a4a;
}
body.light-mode .gh-btn:hover {
  background: #ffdec4;
  border-color: #cc6a28;
  color: #3d2c2e;
}
body.light-mode .gh-btn-primary {
  background: #ff8c42;
  border-color: #ff8c42;
  color: #ffffff;
}
body.light-mode .gh-btn-primary:hover {
  background: #cc6a28;
  border-color: #cc6a28;
}
body.light-mode .gh-btn-deploy {
  background: #5a9030;
  border-color: #5a9030;
  color: #ffffff;
}
body.light-mode .gh-btn-deploy:hover {
  background: #4a7826;
  border-color: #4a7826;
  color: #ffffff;
}
body.light-mode .gh-input {
  background: #fffaf5;
  border-color: #ffdec4;
  color: #3d2c2e;
}
body.light-mode .gh-input:focus {
  border-color: #ff8c42;
}
body.light-mode .gh-input::placeholder {
  color: #cca08a;
}
body.light-mode .gh-log-item {
  border-bottom-color: #ffdec4;
}
body.light-mode .gh-log-msg {
  color: #5c4a4a;
}
body.light-mode .gh-refs {
  background: #ff8c4215;
  color: #cc6a28;
}
body.light-mode .gh-hint-steps {
  background: #fffaf5;
  border-color: #ffdec4;
  color: #5c4a4a;
}
body.light-mode #gh-restricted-overlay {
  background: #fffaf5;
}
body.light-mode .db-th.filtered .th-name {
  color: #cc6a28;
}
body.light-mode .th-funnel {
  color: #cc6a28;
}

/* ═══════════════════════════════════════════
   App Config tab — two-column settings page
═══════════════════════════════════════════ */

#tab-app-config {
  overflow: hidden;
  display: none;
}
#tab-app-config.active {
  display: flex;
  flex: 1;
  min-height: 0;
}

#app-config-container {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Left sidebar */
#app-config-sidebar {
  width: 180px;
  flex-shrink: 0;
  border-right: 1px solid var(--border, #2a2a4a);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-base, #0d0d1a);
  overflow-y: auto;
}
.ac-nav-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--fg-muted, #565f89);
  padding: 0 16px 12px;
}
.ac-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--fg-2, #a9b1d6);
  text-decoration: none;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.ac-nav-item:hover {
  background: var(--bg-hover, rgba(125,207,255,0.06));
  color: var(--fg-1, #c0caf5);
}
.ac-nav-item.active {
  border-left-color: var(--accent, #7dcfff);
  background: var(--bg-hover, rgba(125,207,255,0.08));
  color: var(--accent, #7dcfff);
  font-weight: 600;
}
.ac-nav-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Right scrollable content */
#app-config-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px 60px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  scrollbar-width: thin;
  scrollbar-color: var(--border, #2a2a4a) transparent;
}
#app-config-content::-webkit-scrollbar { width: 5px; }
#app-config-content::-webkit-scrollbar-thumb {
  background: var(--border, #2a2a4a);
  border-radius: 3px;
}

/* Section */
.ac-section {
  display: none;
  flex-direction: column;
  gap: 16px;
}
.ac-section.active {
  display: flex;
}
.ac-section-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.ac-section-icon {
  width: 20px;
  height: 20px;
  color: var(--accent, #7dcfff);
  flex-shrink: 0;
  margin-top: 3px;
}
.ac-section-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--fg-1, #c0caf5);
}
.ac-section-desc {
  margin: 0;
  font-size: 12px;
  color: var(--fg-muted, #565f89);
}

/* Card */
.ac-card {
  background: var(--bg-elev, #1a1a2e);
  border: 1px solid var(--border, #2a2a4a);
  border-radius: 10px;
  padding: 18px 20px;
}
.ac-card-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-2, #a9b1d6);
}
.ac-card-sublabel {
  font-size: 11px;
  color: var(--fg-muted, #565f89);
  margin-top: 2px;
}

/* Field */
.ac-field {
  margin-top: 14px;
}
.ac-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-2, #a9b1d6);
  margin-bottom: 6px;
}
.ac-input {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-base, #0d0d1a);
  border: 1px solid var(--border, #2a2a4a);
  border-radius: 6px;
  color: var(--fg-1, #c0caf5);
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.ac-input:focus {
  outline: none;
  border-color: var(--accent, #7dcfff);
}
.ac-hint {
  margin-top: 4px;
  font-size: 11px;
  color: var(--fg-muted, #565f89);
}

/* Actions row */
.ac-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.ac-btn {
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s, background 0.15s;
  border: none;
}
.ac-btn:hover { opacity: 0.85; }
.ac-btn-primary {
  background: var(--accent, #7dcfff);
  color: #0d0d1a;
}
.ac-btn-ghost {
  background: transparent;
  border: 1px solid var(--fg-muted, #565f89);
  color: var(--fg-muted, #565f89);
}
.ac-status {
  font-size: 12px;
}

/* Model dropdown */
.ac-model-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: var(--bg-elev, #16161e);
  border: 1px solid var(--border, #2a2a4a);
  border-radius: 0 0 6px 6px;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.ac-model-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  color: var(--fg-1, #c0caf5);
}
.ac-model-item:hover { background: rgba(125,207,255,0.08); }

/* Segment buttons (cloud/local, live/scheduled) */
.ac-seg-btn {
  text-align: center;
  padding: 14px 12px;
  border: 2px solid var(--border, #2a2a4a);
  border-radius: 8px;
  background: var(--bg-base, #0d0d1a);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--fg-1, #c0caf5);
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.ac-seg-btn.active {
  border-color: var(--accent, #7dcfff);
  background: rgba(125,207,255,0.08);
  color: var(--accent, #7dcfff);
}
.ac-seg-sub {
  font-weight: 400;
  font-size: 11px;
  color: var(--fg-muted, #565f89);
  display: block;
  margin-top: 4px;
}
.ac-seg-btn.active .ac-seg-sub { color: var(--accent, #7dcfff); opacity: 0.7; }

/* Info banner */
.ac-info-banner {
  padding: 12px 14px;
  background: var(--bg-base, #0d0d1a);
  border-radius: 8px;
  border-left: 3px solid var(--accent, #7dcfff);
  font-size: 12px;
  color: var(--fg-2, #a9b1d6);
  line-height: 1.5;
}
.ac-tab-link {
  color: var(--accent, #7dcfff);
  cursor: pointer;
  text-decoration: underline;
}

/* Stats table */
.ac-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.ac-stats-table th {
  padding: 8px 10px;
  text-align: left;
  color: var(--fg-2, #a9b1d6);
  font-weight: 600;
  white-space: nowrap;
  background: var(--bg-base, #0d0d1a);
  border-bottom: 1px solid var(--border, #2a2a4a);
}
.ac-stats-table td {
  padding: 7px 10px;
  color: var(--fg-1, #c0caf5);
  border-bottom: 1px solid rgba(42,42,74,0.5);
  white-space: nowrap;
}
.ac-stats-table tr:last-child td { border-bottom: none; }
.ac-table-empty {
  text-align: center;
  color: var(--fg-muted, #565f89);
  padding: 20px !important;
}

/* User Management — access mode radios */
.ac-um-radio {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border, #2a2a4a);
  border-radius: 6px;
  cursor: pointer;
  background: var(--bg-elev, #1a1a2e);
  transition: border-color 0.15s, background 0.15s;
}
.ac-um-radio:hover {
  border-color: var(--accent, #7dcfff);
}
.ac-um-radio input[type=radio] {
  margin-top: 3px;
  accent-color: var(--accent, #7dcfff);
  flex-shrink: 0;
}
.ac-um-radio:has(input[type=radio]:checked) {
  border-color: var(--accent, #7dcfff);
  background: rgba(125, 207, 255, 0.06);
}
.ac-um-radio-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-1, #c0caf5);
}
.ac-um-radio-desc {
  font-size: 12px;
  color: var(--fg-muted, #565f89);
  margin-top: 2px;
  line-height: 1.4;
}

/* User Management — pill badges in the table */
.ac-um-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.ac-um-badge-admin   { background: rgba(187,154,247,0.18); color: #bb9af7; }
.ac-um-badge-member  { background: rgba(125,207,255,0.14); color: #7dcfff; }
.ac-um-badge-approved{ background: rgba(158,206,106,0.16); color: #9ece6a; }
.ac-um-badge-pending { background: rgba(224,175,104,0.18); color: #e0af68; }
.ac-um-badge-locked  { background: rgba(247,118,142,0.18); color: #f7768e; }

.ac-um-action-btn {
  background: transparent;
  border: 1px solid var(--border, #2a2a4a);
  color: var(--fg-1, #c0caf5);
  padding: 3px 9px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  font-family: inherit;
  margin: 0 2px;
}
.ac-um-action-btn:hover { border-color: var(--accent, #7dcfff); color: var(--accent, #7dcfff); }
.ac-um-action-btn.danger:hover { border-color: #f7768e; color: #f7768e; }

/* GitHub status grid */
.ac-gh-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.ac-gh-status-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ac-gh-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-muted, #565f89);
}
.ac-gh-value {
  font-size: 12px;
  color: var(--fg-1, #c0caf5);
  word-break: break-all;
}

/* Details / summary */
.ac-details summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--accent, #7dcfff);
  font-weight: 500;
}
.ac-details-body {
  margin-top: 10px;
  font-size: 12px;
  color: var(--fg-2, #a9b1d6);
  line-height: 1.7;
}
.ac-details-body ol { padding-left: 18px; margin: 6px 0; }
.ac-details-body p { margin: 6px 0; }

/* Parallel provider row */
.ac-provider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-base, #0d0d1a);
  border: 1px solid var(--border, #2a2a4a);
  border-radius: 6px;
  padding: 8px 10px;
}

/* ── Light mode overrides ── */
body.light-mode #app-config-sidebar {
  background: #f5f2ed;
  border-right-color: #e8ddd0;
}
body.light-mode .ac-nav-title { color: #9a7c65; }
body.light-mode .ac-nav-item { color: #6b5240; }
body.light-mode .ac-nav-item:hover { background: rgba(204,107,40,0.06); color: #5a3e2b; }
body.light-mode .ac-nav-item.active { border-left-color: #cc6a28; background: rgba(204,107,40,0.08); color: #cc6a28; }
body.light-mode .ac-card { background: #ffffff; border-color: #e8ddd0; }
body.light-mode .ac-section-title { color: #2d1f14; }
body.light-mode .ac-section-desc { color: #9a7c65; }
body.light-mode .ac-card-label { color: #6b5240; }
body.light-mode .ac-hint { color: #9a7c65; }
body.light-mode .ac-label { color: #6b5240; }
body.light-mode .ac-input { background: #faf7f4; border-color: #d4c4b4; color: #2d1f14; }
body.light-mode .ac-input:focus { border-color: #cc6a28; }
body.light-mode .ac-btn-primary { background: #cc6a28; color: #fff; }
body.light-mode .ac-btn-ghost { border-color: #9a7c65; color: #9a7c65; }
body.light-mode .ac-seg-btn { background: #faf7f4; border-color: #d4c4b4; color: #2d1f14; }
body.light-mode .ac-seg-btn.active { border-color: #cc6a28; background: rgba(204,107,40,0.06); color: #cc6a28; }
body.light-mode .ac-info-banner { background: #faf7f4; border-left-color: #cc6a28; }
body.light-mode .ac-stats-table th { background: #faf7f4; color: #6b5240; border-bottom-color: #e8ddd0; }
body.light-mode .ac-stats-table td { color: #2d1f14; border-bottom-color: rgba(212,196,180,0.5); }
body.light-mode .ac-table-empty { color: #9a7c65; }

/* ── Integrations ── */
.ac-int-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
}
.ac-int-badge-on {
  background: rgba(158, 206, 106, 0.15);
  color: #9ece6a;
}
.ac-int-badge-off {
  background: rgba(86, 95, 137, 0.2);
  color: var(--fg-muted, #565f89);
}
.ac-int-account-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-base, #0d0d1a);
  border: 1px solid var(--border, #2a2a4a);
  border-radius: 8px;
}
body.light-mode .ac-int-badge-on { background: rgba(40, 167, 69, 0.12); color: #1a7c31; }
body.light-mode .ac-int-badge-off { background: rgba(107, 82, 64, 0.12); color: #9a7c65; }
body.light-mode .ac-int-account-info { background: #faf7f4; border-color: #d4c4b4; }

/* ── Communications channel grid ── */
.ac-comm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.ac-comm-card {
  background: var(--bg-card, #13131f);
  border: 1px solid var(--border, #2a2a4a);
  border-radius: 10px;
  position: relative;       /* anchor for the floating panel */
  transition: border-color 0.15s;
}
.ac-comm-card:hover { border-color: rgba(125,207,255,0.35); }
.ac-comm-card.panel-open { border-color: var(--accent, #7dcfff); z-index: 10; }
.ac-comm-card-dim {
  opacity: 0.6;
  pointer-events: none;
}
.ac-comm-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 14px;
}
.ac-comm-logo {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
}
.ac-comm-meta {
  flex: 1;
  min-width: 0;
}
.ac-comm-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-1, #c0caf5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-comm-desc {
  font-size: 11px;
  color: var(--fg-muted, #565f89);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-comm-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.ac-comm-badge-active {
  background: rgba(158,206,106,0.15);
  color: #9ece6a;
}
.ac-comm-badge-inactive {
  background: rgba(247,118,142,0.12);
  color: #f7768e;
}
.ac-comm-badge-unconfigured {
  background: rgba(86,95,137,0.18);
  color: var(--fg-muted, #565f89);
}
.ac-comm-badge-dim {
  background: rgba(86,95,137,0.12);
  color: var(--fg-muted, #565f89);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
}
.ac-comm-toggle-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid var(--border, #2a2a4a);
  background: transparent;
  color: var(--accent, #7dcfff);
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s;
}
.ac-comm-toggle-btn:hover { background: rgba(125,207,255,0.08); border-color: var(--accent,#7dcfff); }
.ac-comm-toggle-btn.open { background: rgba(125,207,255,0.1); border-color: var(--accent,#7dcfff); }
.ac-comm-panel {
  display: none;
  position: absolute;
  top: calc(100% - 14px);  /* overlap upward into the card, hiding its bottom corners */
  left: -1px;
  right: -1px;
  z-index: 200;
  padding: 24px 14px 16px; /* extra top padding to clear the overlap zone */
  border: 1px solid var(--accent, #7dcfff);
  border-top: none;
  border-radius: 0 0 10px 10px;
  background: var(--bg-card, #13131f);
  box-shadow: 0 12px 32px rgba(0,0,0,0.55);
}
.ac-comm-panel.open { display: block; }
.ac-comm-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.ac-comm-webhook-url {
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--bg-base, #0d0d1a);
  border: 1px solid var(--border, #2a2a4a);
  border-radius: 6px;
  font-size: 11px;
  color: var(--fg-2, #a9b1d6);
  word-break: break-all;
}

/* Light mode overrides for comm grid */
body.light-mode .ac-comm-card { background: #ffffff; border-color: #e8ddd0; }
body.light-mode .ac-comm-card:hover { border-color: rgba(204,107,40,0.4); }
body.light-mode .ac-comm-name { color: #2d1f14; }
body.light-mode .ac-comm-desc { color: #9a7c65; }
body.light-mode .ac-comm-toggle-btn { border-color: #d4c4b4; color: #cc6a28; }
body.light-mode .ac-comm-toggle-btn:hover { background: rgba(204,107,40,0.06); border-color: #cc6a28; }
body.light-mode .ac-comm-panel { background: #ffffff; border-color: #cc6a28; box-shadow: 0 12px 32px rgba(0,0,0,0.12); }
body.light-mode .ac-comm-webhook-url { background: #faf7f4; border-color: #d4c4b4; }
body.light-mode .ac-comm-badge-active { background: rgba(40,167,69,0.12); color: #1a7c31; }
body.light-mode .ac-comm-badge-inactive { background: rgba(220,53,69,0.1); color: #dc3545; }
body.light-mode .ac-comm-badge-unconfigured { background: rgba(107,82,64,0.1); color: #9a7c65; }

/* ── Login / Register / Restricted overlays (light mode) ── */
body.light-mode #left-login-overlay { background: rgba(250, 247, 244, 0.92) !important; }
body.light-mode #left-login-overlay > div { background: #ffffff !important; border-color: #e8ddd0 !important; box-shadow: 0 12px 32px rgba(0,0,0,0.10) !important; }
body.light-mode #left-login-overlay h2 { color: #cc6a28 !important; }
body.light-mode #left-login-overlay p,
body.light-mode #left-login-overlay label { color: #6b5240 !important; }
body.light-mode #left-login-overlay input[type="email"],
body.light-mode #left-login-overlay input[type="password"],
body.light-mode #left-login-overlay input[type="text"] { background: #faf7f4 !important; border-color: #d4c4b4 !important; color: #2d1f14 !important; }
body.light-mode #left-login-overlay input[type="email"]:focus,
body.light-mode #left-login-overlay input[type="password"]:focus,
body.light-mode #left-login-overlay input[type="text"]:focus { border-color: #cc6a28 !important; }
body.light-mode #left-login-overlay input[type="checkbox"] { accent-color: #cc6a28 !important; }
body.light-mode #left-login-btn { background: #cc6a28 !important; color: #ffffff !important; }
body.light-mode #left-reg-btn { background: #1a7c31 !important; color: #ffffff !important; }
body.light-mode #left-login-register-link,
body.light-mode #left-login-overlay #left-register-form > div:last-child { color: #9a7c65 !important; }
body.light-mode #left-login-overlay a { color: #cc6a28 !important; }
body.light-mode #left-login-loading,
body.light-mode #left-reg-loading { color: #9a7c65 !important; }

body.light-mode #restricted-overlay { background: rgba(250, 247, 244, 0.92) !important; }
body.light-mode #restricted-overlay > div { background: #ffffff !important; border-color: #dc3545 !important; box-shadow: 0 12px 32px rgba(0,0,0,0.10) !important; }
body.light-mode #restricted-overlay p { color: #6b5240 !important; }
body.light-mode #restricted-close-btn { background: #faf7f4 !important; color: #2d1f14 !important; border: 1px solid #d4c4b4 !important; }