:root {
  --app-bg: #050505;
  --editor-bg: #050505;
  --text-muted: #9da5af;
  --strip-bg: #050505;
  --panel-border: #0d0d0d;
  --strip-height: 46px;
  --tab-active-start: #0d0d0d;
  --tab-active-end: #0d0d0d;
  --tab-idle-text: #c5ced7;
  --tab-active-text: #eef6ff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--app-bg);
}

body {
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #d7deea;
}

#app {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--app-bg);
  border: 1px solid var(--panel-border);
}

#tab-strip {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  height: var(--strip-height);
  padding: 6px 10px 6px 8px;
  background: var(--strip-bg);
  border-bottom: 1px solid #0d0d0d;
}

#tabs {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 1px;
  flex: 0 1 auto;
  max-width: calc(100vw - 62px);
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

#tabs::-webkit-scrollbar {
  display: none;
}

.tab-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 29px;
  padding: 0 8px 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #050505;
  color: var(--tab-idle-text);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.tab-item:hover {
  border-color: #0d0d0d;
  background: #050505;
}

.tab-item.is-active {
  color: var(--tab-active-text);
  background: linear-gradient(180deg, var(--tab-active-start), var(--tab-active-end));
  border-color: transparent;
  box-shadow: none;
}

.tab-item:focus,
.tab-item:focus-visible {
  outline: none;
}

.tab-doc-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  background: center/contain no-repeat url("./icons/tab-doc.png");
  opacity: 0.98;
}

.tab-title {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
}

.tab-close-btn {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin-left: 2px;
  padding: 0;
  border: 0;
  outline: none;
  cursor: pointer;
  border-radius: 50%;
  background: center/contain no-repeat url("./icons/tab-close.png");
  opacity: 0.88;
  transition: transform 120ms ease, opacity 120ms ease;
}

.tab-close-btn:hover {
  opacity: 1;
  transform: scale(1.05);
}

.tab-close-btn:disabled,
.tab-close-btn.is-disabled {
  opacity: 0.36;
  cursor: not-allowed;
  transform: none;
}

#add-tab-btn {
  width: 15px;
  height: 15px;
  flex: 0 0 17px;
  border: 0;
  border-radius: 12px;
  padding: 0;
  margin-right: 2px;
  margin-left: 0;
  color: transparent;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  background: center/contain no-repeat url("./icons/tab-add.png");
  transition: transform 120ms ease, opacity 120ms ease;
  opacity: 0.86;
}

#add-tab-btn:hover {
  transform: scale(1.04);
  opacity: 1;
}

#editor-shell {
  position: absolute;
  top: var(--strip-height);
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}

#editor-root {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: none;
  background: var(--editor-bg);
}

#status {
  position: absolute;
  right: 10px;
  top: calc(var(--strip-height) + 10px);
  z-index: 10;
  max-width: min(72vw, 680px);
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.3;
  background: #0b0f14;
  border: 1px solid #1e2731;
  display: none;
}

#status.is-visible {
  display: block;
}

.monaco-editor,
.monaco-editor .overflow-guard {
  border: none !important;
}
