:root {
  color-scheme: dark;
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
}

body {
  margin: 0;
  background: #0a0a0a;
  color: #e6e6e6;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

.card {
  background: #151515;
  border: 1px solid #2c2c2c;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

h1, h2, h3, p {
  margin-top: 0;
}

input, button {
  background: #1b1b1b;
  color: #e6e6e6;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  padding: 10px 12px;
}

button {
  cursor: pointer;
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.muted {
  color: #9a9a9a;
}

.error {
  color: #ff8c8c;
}

.workspace-list {
  display: grid;
  gap: 8px;
}

.pill {
  display: inline-block;
  border: 1px solid #404040;
  border-radius: 999px;
  padding: 2px 10px;
  color: #b3b3b3;
}

select {
  background: #1b1b1b;
  color: #e6e6e6;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  padding: 10px 12px;
}

.tab-btn.active {
  background: #262626;
  border-color: #5a5a5a;
}

.nav-text-tab,
.shell-tab {
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #b6b6b6;
  padding: 5px 6px;
  line-height: 1.1;
}

.nav-text-tab:hover,
.shell-tab:hover {
  color: #e1e1e1;
  background: #1a1a1a;
}

.nav-text-tab.active,
.shell-tab.active {
  color: #f1f1f1;
  background: #202020;
}

.shell-tab {
  text-align: left;
  width: auto;
  min-width: 0;
  padding-left: 6px;
  padding-right: 6px;
}

.tab-icon {
  min-width: 0;
  width: auto;
  text-align: center;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
}

.workspace-bar,
.tab-bar,
.launcher-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-bottom: 1px solid #222222;
  background: #111111;
}

.workspace-scroll,
.tab-scroll,
.launcher-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}

.tab-bar {
  justify-content: space-between;
}

.tab-scroll {
  display: flex;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: thin;
}

.workspace-scroll {
  flex: 1;
}

.tools-menu-wrap {
  position: relative;
}

.tools-gear {
  border: none;
  background: transparent;
  color: #cfcfcf;
  padding: 4px 6px;
  font-size: 16px;
}

.tools-gear:hover {
  color: #f0f0f0;
}

.tools-menu-dropdown {
  position: absolute;
  right: 0;
  top: 32px;
  z-index: 50;
  min-width: 170px;
  display: flex;
  flex-direction: column;
  background: #1a1a1a;
  border: 1px solid #343434;
  border-radius: 8px;
  overflow: hidden;
}

.tools-menu-dropdown button {
  border: none;
  border-radius: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  color: #e0e0e0;
}

.tools-menu-dropdown button:hover {
  background: #2a2a2a;
}

.workspace-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.workspace-pill.active {
  background: transparent;
  border-color: transparent;
}

.launcher-strip {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding-top: 5px;
  padding-bottom: 5px;
}

.launcher-btn {
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
}

.launcher-tab-toggle {
  font-size: 14px;
  padding-left: 2px;
  padding-right: 2px;
}

.launcher-plus {
  min-width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: none;
  background: transparent;
  color: #d0d0d0;
}

.launcher-plus:hover {
  color: #ededed;
}

.launcher-entity-icon {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  object-fit: cover;
}

.launcher-fallback {
  font-size: 18px;
  line-height: 1;
}

.content-area {
  padding: 16px;
}

.repo-entry-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 7px 10px;
  border: 1px solid #3b4d63;
  border-radius: 8px;
  background: #141f2d;
  color: #d8e6f8;
}

.repo-entry-tag {
  font-size: 11px;
  color: #a3bdd8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tool-surface {
  display: block;
}

.signal-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-right: 6px;
}

.signal-new {
  background: #48c774;
}

.signal-claimed {
  background: #f6c343;
}

.signal-delivered {
  background: #4f8df6;
}

.signal-expired {
  background: #f05d5e;
}

.toast {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 6px 10px;
  border: 1px solid #3f3f3f;
  background: #1f1f1f;
  color: #e7e7e7;
  border-radius: 6px;
  font-size: 12px;
}

.mini-plus {
  background: transparent;
  border: 1px solid #3b3b3b;
  color: #d0d0d0;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.mini-plus:hover {
  border-color: #565656;
  color: #ededed;
}

.context-menu {
  position: fixed;
  z-index: 40;
  display: flex;
  flex-direction: column;
  min-width: 140px;
  background: #1a1a1a;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.context-menu button {
  border: none;
  border-radius: 0;
  background: transparent;
  text-align: left;
  padding: 7px 10px;
  color: #dddddd;
}

.context-menu button:hover {
  background: #2a2a2a;
}

.context-menu-arrows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 6px;
  border-bottom: 1px solid #2a2a2a;
}

.context-menu-arrows button {
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  text-align: center;
  padding: 5px 0;
}

.context-menu-arrows button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.context-menu-arrows button:disabled:hover {
  background: transparent;
}

.entity-icon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  object-fit: cover;
  display: block;
  flex: 0 0 auto;
}

.shell-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.1;
}

.tab-entity-icon {
  width: 13px;
  height: 13px;
}

.launcher-link-list {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.launcher-editor-panel {
  border: 1px solid #2b2b2b;
  border-radius: 8px;
  padding: 10px;
  background: #131313;
}

.launcher-modal-card {
  width: min(980px, 100%);
}

.launcher-editor-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto auto;
  gap: 8px;
  align-items: center;
}

.launcher-editor-toolbar input {
  min-width: 0;
}

.launcher-link-grid {
  display: grid;
  grid-template-columns: 28px 92px minmax(120px, 1fr) minmax(170px, 2fr) minmax(120px, 1fr) 44px 28px 28px 28px 28px;
  gap: 6px;
  align-items: center;
}

.launcher-link-head {
  align-items: center;
  font-size: 11px;
  color: #9b9b9b;
  padding: 2px 6px;
}

.launcher-link-row {
  align-items: center;
  gap: 6px;
  border: 1px solid #252525;
  border-radius: 6px;
  padding: 5px;
  min-height: 30px;
}

.launcher-link-row input,
.launcher-link-row select {
  padding: 6px 8px;
  min-height: 28px;
}

.launcher-local-target-wrap {
  display: grid;
  grid-template-columns: 1fr 28px;
  gap: 6px;
  align-items: center;
}

.launcher-link-preview {
  color: #d7d7d7;
  text-decoration: underline;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.launcher-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid #3a3a3a;
  border-radius: 5px;
  text-decoration: none;
}

.launcher-link-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.launcher-link-pin {
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.launcher-link-label,
.launcher-link-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.launcher-link-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.launcher-icon-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 5px;
  font-size: 12px;
}

.home-panel {
  padding: 4px 0;
}

.home-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
}

.vault-surface {
  background: transparent;
  border: none;
  padding: 0;
}

.vault-header-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.vault-header-left,
.vault-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scope-segment {
  padding: 2px;
  border: 1px solid #353535;
  background: #141414;
  border-radius: 6px;
  gap: 2px;
}

.scope-option {
  background: transparent;
  border: none;
  border-radius: 4px;
  color: #b5b5b5;
  padding: 6px 10px;
}

.scope-option:hover {
  color: #e1e1e1;
  background: #1d1d1d;
}

.scope-option.active {
  color: #f0f0f0;
  background: #242424;
}

.vault-header-center {
  min-width: 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.breadcrumb-inline {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumb-link,
.breadcrumb-current {
  font-size: 13px;
  color: #b0b0b0;
}

.breadcrumb-link {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  background: transparent;
}

.breadcrumb-link:hover {
  border-bottom-color: #6f6f6f;
}

.crumb {
  padding: 4px 8px;
  font-size: 13px;
}

.crumb.active {
  border-color: #666666;
}

.crumb-sep {
  color: #7a7a7a;
  font-size: 12px;
}

.upload-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1b1b1b;
  color: #e6e6e6;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
}

.action-btn {
  background: #252525;
  border: 1px solid #4a4a4a;
  color: #f0f0f0;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
}

.action-btn:hover {
  background: #2d2d2d;
  border-color: #5a5a5a;
}

.upload-label input {
  display: none;
}

.upload-label.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.drop-zone {
  margin-top: 2px;
  border: 1px dashed #3f3f3f;
  border-left: none;
  border-right: none;
  border-radius: 0;
  padding: 6px 0;
  color: #9a9a9a;
  font-size: 12px;
}

.drop-zone.dragging {
  border-color: #8a8a8a;
  color: #d9d9d9;
}

.drop-zone.disabled {
  opacity: 0.45;
}

.table-wrap {
  width: 100%;
  margin-top: 8px;
}

.vault-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.vault-table th,
.vault-table td {
  border-bottom: 1px solid #2a2a2a;
  padding: 7px 8px;
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.vault-table th:nth-child(1),
.vault-table td:nth-child(1) {
  width: 32%;
}

.vault-table th:nth-child(2),
.vault-table td:nth-child(2) {
  width: 12%;
}

.vault-table th:nth-child(3),
.vault-table td:nth-child(3) {
  width: 24%;
}

.vault-table th:nth-child(4),
.vault-table td:nth-child(4) {
  width: 7%;
}

.vault-table th:nth-child(5),
.vault-table td:nth-child(5) {
  width: 16%;
}

.version-col {
  color: #888888;
  font-size: 12px;
}

.actions-cell {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  justify-content: flex-start;
}

.icon-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  font-size: 12px;
  border-radius: 6px;
}

.link-btn {
  background: transparent;
  border: none;
  color: #d7d7d7;
  padding: 0;
  text-align: left;
}

.link-btn:hover {
  text-decoration: underline;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: min(720px, 100%);
  max-height: 80vh;
  overflow: auto;
  background: #151515;
  border: 1px solid #2c2c2c;
  border-radius: 12px;
  padding: 16px;
}

.versions-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.version-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  flex-wrap: wrap;
}

.typebox-surface {
  min-height: calc(100vh - 200px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.typebox-saved {
  color: #8f8f8f;
  font-size: 12px;
  align-self: flex-end;
}

.typebox-editor {
  flex: 1;
  min-height: calc(100vh - 250px);
  width: 100%;
  resize: none;
  border-radius: 0;
  border: none;
  background: transparent;
  color: #e5e5e5;
  padding: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, monospace;
  line-height: 1.45;
}

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

.module-picker-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.module-picker-item {
  width: 100%;
  text-align: left;
}
