:root {
  --fx-shell-bg: #050816;
  --fx-shell-panel: #0b1022;
  --fx-shell-panel-2: #11182d;
  --fx-shell-border: rgba(148, 163, 184, 0.18);
  --fx-shell-text: #dbe7ff;
  --fx-shell-muted: #8aa0c7;
  --fx-shell-accent: #22d3ee;
  --fx-shell-accent-soft: rgba(34, 211, 238, 0.18);
  --fx-shell-status: #09111f;
}

:root[data-shell-accent='amber'] {
  --fx-shell-accent: #f59e0b;
  --fx-shell-accent-soft: rgba(245, 158, 11, 0.18);
}

body[data-tool] {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100vh !important;
  display: block !important;
  overflow: hidden !important;
  background: var(--fx-shell-bg) !important;
}

body[data-tool] > .main-nav,
body[data-tool] > .main-footer {
  display: none !important;
}

#cb-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  color: var(--fx-shell-text);
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.09), transparent 24%),
    radial-gradient(circle at bottom left, rgba(96, 165, 250, 0.08), transparent 26%),
    var(--fx-shell-bg);
}

#cb-tab-bar {
  display: flex;
  align-items: stretch;
  height: 38px;
  min-height: 38px;
  overflow-x: auto;
  background: rgba(3, 7, 18, 0.92);
  border-bottom: 1px solid var(--fx-shell-border);
  scrollbar-width: none;
}

#cb-tab-bar::-webkit-scrollbar {
  display: none;
}

.cb-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-shrink: 0;
  padding: 0 14px;
  font-size: 12px;
  color: var(--fx-shell-muted);
  border-right: 1px solid rgba(148, 163, 184, 0.1);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.cb-tab:hover {
  background: rgba(148, 163, 184, 0.08);
  color: var(--fx-shell-text);
}

.cb-tab.active {
  color: var(--fx-shell-text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  box-shadow: inset 0 -2px 0 var(--fx-shell-accent);
}

.cb-tab-icon {
  width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cb-tab-label {
  white-space: nowrap;
}

.cb-tab-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  opacity: 0;
  font-size: 14px;
  line-height: 1;
}

.cb-tab:hover .cb-tab-close,
.cb-tab.active .cb-tab-close {
  opacity: 0.7;
}

.cb-tab-close:hover {
  opacity: 1 !important;
  background: rgba(148, 163, 184, 0.16);
}

#cb-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

#cb-activity-bar {
  width: 94px;
  min-width: 94px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  overflow-y: auto;
  background: rgba(5, 10, 22, 0.94);
  border-right: 1px solid var(--fx-shell-border);
  scrollbar-width: none;
}

#cb-activity-bar::-webkit-scrollbar {
  display: none;
}

.cb-act-item {
  position: relative;
  width: 100%;
  min-height: 74px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: linear-gradient(180deg, rgba(13, 20, 37, 0.94), rgba(9, 14, 28, 0.92));
  color: var(--fx-shell-muted);
  cursor: pointer;
  transition:
    transform 140ms ease,
    background 140ms ease,
    color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.cb-act-item:hover {
  background: linear-gradient(180deg, rgba(18, 27, 47, 0.98), rgba(10, 18, 33, 0.95));
  color: var(--fx-shell-text);
  transform: translateY(-1px);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.28);
}

.cb-act-item.active {
  color: var(--fx-shell-text);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--tool-color, var(--fx-shell-accent)) 18%, rgba(13, 20, 37, 0.98)), rgba(10, 16, 30, 0.96));
  border-color: color-mix(in srgb, var(--tool-color, var(--fx-shell-accent)) 58%, white 12%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 14px 30px rgba(2, 6, 23, 0.34);
}

.cb-act-icon-badge {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: var(--tool-color, var(--fx-shell-accent));
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.16), transparent 55%),
    color-mix(in srgb, var(--tool-color, var(--fx-shell-accent)) 16%, rgba(255, 255, 255, 0.04));
  border: 1px solid color-mix(in srgb, var(--tool-color, var(--fx-shell-accent)) 28%, rgba(148, 163, 184, 0.22));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.cb-act-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cb-act-icon svg,
.cb-tab-icon svg,
.cb-palette-item-icon svg {
  width: 100%;
  height: 100%;
}

.cb-act-label {
  max-width: 100%;
  font-size: 10px;
  line-height: 1.15;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.01em;
  color: inherit;
  text-wrap: balance;
}

.cb-act-item--utility {
  min-height: 66px;
  color: var(--fx-shell-text);
}

.cb-act-item--utility .cb-act-icon-badge {
  color: var(--fx-shell-text);
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.16);
}

.cb-act-spacer {
  flex: 1;
}

.cb-act-bottom {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 6px;
  margin-top: 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.cb-tooltip {
  position: absolute;
  left: 92px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.96);
  border: 1px solid var(--fx-shell-border);
  color: var(--fx-shell-text);
  font-size: 12px;
  transition: opacity 140ms ease;
  z-index: 20;
}

.cb-act-item:hover .cb-tooltip {
  opacity: 1;
}

#cb-content {
  flex: 1;
  min-width: 0;
  overflow: auto;
  background: linear-gradient(180deg, #08101d 0%, #0b1220 100%);
}

#cb-content[data-layout='card'] {
  padding: 24px;
}

#cb-content[data-layout='full'] {
  padding: 0;
}

#cb-status-bar {
  position: relative;
  height: 28px;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  background: var(--fx-shell-status);
  border-top: 1px solid var(--fx-shell-border);
  color: var(--fx-shell-muted);
  font-size: 11px;
  overflow: visible;
  z-index: 40;
}

.cb-status-left,
.cb-status-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cb-status-right {
  margin-left: auto;
  overflow: visible;
}

.cb-status-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 20px;
  padding: 0 6px;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.cb-status-item.clickable {
  cursor: pointer;
}

.cb-status-item:hover {
  background: rgba(148, 163, 184, 0.08);
  color: var(--fx-shell-text);
}

.cb-status-brand {
  color: var(--fx-shell-text);
  font-weight: 600;
}

.cb-status-sep {
  opacity: 0.5;
}

.cb-shell-lang-slot {
  position: relative;
  display: flex;
  align-items: center;
  overflow: visible;
}

#cb-palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  justify-content: center;
  padding-top: 12vh;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(6px);
}

#cb-palette-overlay.open {
  display: flex;
}

#cb-palette {
  width: 560px;
  max-width: calc(100vw - 32px);
  max-height: 420px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--fx-shell-border);
  background: rgba(7, 12, 24, 0.98);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
}

#cb-palette-input {
  width: 100%;
  padding: 14px 16px;
  border: 0;
  outline: 0;
  color: var(--fx-shell-text);
  background: transparent;
  border-bottom: 1px solid var(--fx-shell-border);
  font-size: 15px;
}

#cb-palette-input::placeholder {
  color: var(--fx-shell-muted);
}

#cb-palette-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

.cb-palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--fx-shell-text);
  cursor: pointer;
}

.cb-palette-item:hover,
.cb-palette-item.selected {
  background: rgba(148, 163, 184, 0.08);
}

.cb-palette-item-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.cb-palette-item-name {
  flex: 1;
  font-size: 14px;
}

.cb-palette-item-shortcut {
  font-size: 11px;
  color: var(--fx-shell-muted);
}

body[data-tool='calculators'] .calculators-container {
  padding-top: 0;
  min-height: 100%;
}

body[data-tool='calculators'] .calculators-sidebar {
  top: 0;
  height: calc(100vh - 66px);
}

body[data-tool='calculators'] .calculators-layout {
  min-height: calc(100vh - 66px - 140px);
}

body[data-tool='news'] .news-page {
  min-height: 100%;
}

@media (max-width: 760px) {
  #cb-activity-bar {
    width: 58px;
    min-width: 58px;
    padding: 8px 6px;
  }

  .cb-act-item {
    min-height: 44px;
    padding: 6px 4px;
    border-radius: 12px;
  }

  .cb-act-icon-badge {
    width: 30px;
    height: 30px;
    border-radius: 10px;
  }

  .cb-act-icon {
    width: 16px;
    height: 16px;
  }

  #cb-content[data-layout='card'] {
    padding: 16px;
  }

  .cb-tab {
    padding: 0 10px;
  }

  .cb-act-label,
  .cb-tab-label,
  .cb-palette-item-shortcut,
  .cb-status-right a {
    display: none;
  }

  .cb-status-right {
    gap: 6px;
  }

  .cb-tooltip {
    display: none;
  }
}
