:root {
  --tf-workspace-titlebar-height: 34px;
  --tf-workspace-tab-max-width: 240px;
  --tf-workspace-tab-active: #101010;
  --tf-workspace-tab-idle: #2e2e2e;
  --tf-workspace-tab-hover: #454545;
  --tf-workspace-tab-text: #f1f1f1;
  --tf-workspace-tab-muted: #b8b8b8;
  --tf-workspace-tab-border: rgba(255, 255, 255, 0.14);
}

html.theme-light {
  --tf-workspace-tab-active: #ffffff;
  --tf-workspace-tab-idle: #f9f9f9;
  --tf-workspace-tab-hover: #e1e2e4;
  --tf-workspace-tab-text: #1e222d;
  --tf-workspace-tab-muted: #5d606b;
  --tf-workspace-tab-border: rgba(0, 0, 0, 0.14);
}

html.tauri-custom-titlebar #tauri_custom_titlebar {
  display: flex;
  align-items: stretch;
  height: var(--tf-workspace-titlebar-height);
  background: var(--tf-workspace-tab-idle);
}

html.tauri-custom-titlebar body {
  --tauri-custom-titlebar-height: var(--tf-workspace-titlebar-height);
}

#tf_workspace_tabs {
  display: flex;
  align-items: stretch;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  -webkit-app-region: no-drag;
}

html.tauri-platform-macos #tf_workspace_tabs {
  padding-left: 76px;
}

#tauri_custom_titlebar [data-tauri-drag-region] {
  -webkit-app-region: drag;
}

.tf-workspace-tab-shell,
.tf-workspace-tab,
.tf-workspace-add,
.tf-workspace-new-window {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--tf-workspace-tab-text);
  font: 500 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: default;
  -webkit-app-region: no-drag;
}

.tf-workspace-tab-shell {
  display: flex;
  flex: 0 1 var(--tf-workspace-tab-max-width);
  min-width: 120px;
  max-width: var(--tf-workspace-tab-max-width);
  height: 100%;
  background: transparent;
  border-radius: 6px 6px 0 0;
  transition: background-color 100ms ease;
}

.tf-workspace-tab-shell::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 0;
  bottom: 10px;
  width: 1px;
  background: var(--tf-workspace-tab-border);
  pointer-events: none;
  transition: opacity 100ms ease;
}

.tf-workspace-tab-shell:hover {
  background: var(--tf-workspace-tab-hover);
}

.tf-workspace-tab-shell.is-active {
  background: var(--tf-workspace-tab-active);
}

.tf-workspace-tab-shell.is-active::after {
  opacity: 0;
}

.tf-workspace-tab {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 8px;
  gap: 6px;
  user-select: none;
  touch-action: none;
}

.tf-workspace-tab.is-dragging {
  cursor: grabbing;
  opacity: 0.76;
}

.tf-workspace-tab.is-detach-target {
  box-shadow: inset 0 -2px #2962ff;
}

body.tf-workspace-tab-dragging,
body.tf-workspace-tab-dragging * {
  cursor: grabbing !important;
}

.tf-workspace-add:hover:not(:disabled) {
  background: var(--tf-workspace-tab-hover);
}

.tf-workspace-tab:focus-visible,
.tf-workspace-add:focus-visible {
  outline: 2px solid #2962ff;
  outline-offset: -2px;
}

.tf-workspace-tab-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f0f0f0;
  color: #4d4d4d;
  font: 700 8px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tf-workspace-tab.is-detached .tf-workspace-tab-icon {
  border-radius: 4px;
  background: transparent;
  color: var(--tf-workspace-tab-muted);
  font-size: 16px;
}

.tf-workspace-tab-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tf-workspace-tab-close {
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  margin: 5px 6px 5px 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--tf-workspace-tab-muted);
  font-size: 17px;
}

.tf-workspace-tab-close:hover {
  background: rgba(128, 128, 128, 0.26);
  color: var(--tf-workspace-tab-text);
}

.tf-workspace-add {
  align-self: center;
  flex: 0 0 32px;
  width: 32px;
  height: 28px;
  margin-left: 4px;
  border-radius: 6px;
  font-size: 0;
  color: var(--tf-workspace-tab-muted);
  border-right: 0;
}

.tf-workspace-add::before,
.tf-workspace-add::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 1px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.tf-workspace-add::before {
  width: 14px;
  height: 1px;
}

.tf-workspace-add::after {
  width: 1px;
  height: 14px;
}

.tf-workspace-add:disabled {
  opacity: 0.38;
}

.tauri-titlebar-drag-region {
  flex: 1 1 auto;
  min-width: 32px;
}

.tf-workspace-new-window {
  align-self: stretch;
  flex: 0 0 48px;
  width: 48px;
  padding: 0;
  color: var(--tf-workspace-tab-muted);
}

.tf-workspace-new-window[hidden] {
  display: none;
}

html.tauri-platform-macos .tf-workspace-new-window {
  margin-right: 8px;
}

.tf-workspace-new-window:hover:not(:disabled) {
  background: var(--tf-workspace-tab-hover);
}

.tf-workspace-new-window:focus-visible {
  outline: 2px solid #2962ff;
  outline-offset: -2px;
}

.tf-workspace-new-window:disabled {
  opacity: 0.38;
}

.tf-workspace-new-window-icon {
  width: 24px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#tf_workspace_notice {
  position: fixed;
  top: 50px;
  left: 50%;
  z-index: 2147483647;
  max-width: min(520px, calc(100vw - 40px));
  padding: 10px 14px;
  border-radius: 6px;
  background: #2a2e39;
  color: #f0f3fa;
  opacity: 0;
  transform: translate(-50%, -8px);
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
  font: 400 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#tf_workspace_notice.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

#tf_workspace_opening {
  position: fixed;
  inset: var(--tf-workspace-titlebar-height) 0 0;
  z-index: 2147483645;
  display: grid;
  place-items: center;
  background: var(--tf-workspace-tab-active);
  color: var(--tf-workspace-tab-muted);
  font: 400 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (max-width: 760px) {
  .tf-workspace-tab {
    min-width: 0;
  }
  .tf-workspace-tab-shell {
    min-width: 108px;
  }
  .tf-workspace-tab-icon {
    display: none;
  }
}
