:root {
  color-scheme: dark;
  font-family: "Segoe UI", "Roboto", sans-serif;
  font-size: 13px;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --background: #181818;
  --surface: #181818;
  --surface-raised: #202020;
  --surface-hover: #2a2d2e;
  --surface-selected: #04395e;
  --border: #2b2b2b;
  --foreground: #cccccc;
  --muted: #9d9d9d;
  --accent: #007acc;
  --folder: #dcb67a;
  --shadow: 0 8px 24px rgb(0 0 0 / 35%);
}

:root[data-theme="violet"] {
  --background: #323050;
  --surface: #28273e;
  --surface-raised: #35334f;
  --surface-hover: #454361;
  --surface-selected: #49456f;
  --border: #48465f;
  --foreground: #efeff5;
  --muted: #c1c0d0;
  --accent: #8784e8;
  --folder: #e4c478;
}

:root[data-theme="blue"] {
  --background: #253449;
  --surface: #202c3c;
  --surface-raised: #29384b;
  --surface-hover: #33465d;
  --surface-selected: #344f70;
  --border: #39495c;
  --foreground: #dce7f5;
  --muted: #a9bbd0;
  --accent: #75a7e8;
  --folder: #e4c478;
}

:root[data-theme="green"] {
  --background: #24352e;
  --surface: #1e2d27;
  --surface-raised: #293a32;
  --surface-hover: #35493f;
  --surface-selected: #355747;
  --border: #3b5046;
  --foreground: #dce9e1;
  --muted: #a9beb2;
  --accent: #78b994;
  --folder: #e4c478;
}

:root[data-theme="amber"] {
  --background: #382f22;
  --surface: #2d281f;
  --surface-raised: #3a3225;
  --surface-hover: #4a3d2c;
  --surface-selected: #66502f;
  --border: #50432f;
  --foreground: #f0e5d1;
  --muted: #c9b99d;
  --accent: #d6a85b;
  --folder: #edc878;
}

:root[data-theme="rose"] {
  --background: #382832;
  --surface: #2e232b;
  --surface-raised: #3b2b35;
  --surface-hover: #4d3643;
  --surface-selected: #684454;
  --border: #503844;
  --foreground: #f1e4eb;
  --muted: #cbb5c0;
  --accent: #d58aa9;
  --folder: #e7c179;
}

:root[data-theme="light"] {
  color-scheme: light;
  --background: #f3f3f3;
  --surface: #ffffff;
  --surface-raised: #f6f6f6;
  --surface-hover: #e8e8e8;
  --surface-selected: #cce5ff;
  --border: #e2e2e2;
  --foreground: #333333;
  --muted: #707070;
  --accent: #0066b8;
  --folder: #b98533;
  --shadow: 0 8px 24px rgb(0 0 0 / 18%);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  min-width: 360px;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--background);
  color: var(--foreground);
}

body,
button,
select,
input {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

.app {
  display: grid;
  width: 100%;
  height: 100dvh;
  min-height: 400px;
  grid-template-rows: 36px minmax(0, 1fr) 22px;
  background: var(--background);
}

.titlebar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  user-select: none;
}

.sidebar-toggle {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  margin-left: auto;
}

.sidebar-toggle:hover,
.sidebar-toggle[aria-pressed="false"] {
  background: var(--surface-hover);
  color: var(--foreground);
}

.sidebar-toggle svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.brand {
  display: inline-flex;
  width: 22px;
  min-width: 22px;
  flex: 0 0 22px;
  align-items: center;
  color: var(--foreground);
  text-decoration: none;
}

.brand img {
  width: 19px;
  height: 19px;
}

.menu-bar {
  display: flex;
  height: 100%;
  align-items: center;
  gap: 2px;
}

.menu {
  position: relative;
  height: 100%;
}

.menu-trigger {
  height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
}

.menu-trigger:hover,
.menu--open .menu-trigger {
  background: var(--surface-hover);
}

.menu-panel {
  position: absolute;
  top: 33px;
  left: 0;
  z-index: 10;
  min-width: 228px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
}

.menu-panel > button {
  display: flex;
  width: 100%;
  min-height: 29px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 4px 8px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--foreground);
  text-align: left;
  cursor: pointer;
}

.menu-panel > button:hover,
.recent-open:hover {
  background: var(--surface-hover);
}

.menu-panel kbd,
.welcome kbd {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
}

.menu-divider {
  height: 1px;
  margin: 4px 7px;
  background: var(--border);
}

.preferences-menu {
  min-width: 265px;
  padding: 9px;
}

.settings-menu-trigger[hidden] {
  display: none;
}

.settings-menu-panel {
  max-height: calc(100vh - 16px);
  overflow-y: auto;
}

.user-profile-panel {
  width: min(250px, calc(100vw - 56px));
  min-width: 220px;
  padding: 12px;
}

.user-profile-name {
  display: block;
  overflow: hidden;
  margin-bottom: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-profile-form {
  display: grid;
  gap: 7px;
}

.user-profile-field {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
}

.user-profile-form input {
  width: 100%;
  min-width: 0;
  min-height: 29px;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--background);
  color: var(--foreground);
}

.user-profile-form input:focus {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
}

.user-profile-save {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  place-items: center;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
}

.user-profile-save svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.user-profile-form:focus-within .user-profile-save {
  opacity: 1;
  visibility: visible;
}

.user-profile-save:hover {
  background: var(--surface-hover);
  color: var(--foreground);
}

.user-profile-save:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

.user-profile-error {
  margin: 0;
  color: #ff8a8a;
}

.user-profile-config {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.user-profile-config p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.user-profile-config > button {
  min-height: 29px;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.user-profile-config > button:hover {
  background: var(--surface-hover);
}

.menu-panel--activity-anchor {
  position: fixed;
  z-index: 20;
}

.preference-row {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 4px;
}

.preference-row select {
  width: 130px;
  min-height: 25px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  color: var(--foreground);
}

.preference-checkbox input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
}

.titlebar-tools {
  position: absolute;
  left: 50%;
  display: flex;
  width: max-content;
  max-width: calc(100% - 100px);
  align-items: center;
  justify-content: center;
  gap: 3px;
  transform: translateX(-50%);
}

.titlebar--profile-in-menu .titlebar-tools {
  position: static;
  width: auto;
  max-width: none;
  min-width: 0;
  flex: 1 1 0;
  left: auto;
  right: auto;
  transform: none;
}

.titlebar-tab-navigation {
  display: flex;
  align-items: center;
  gap: 3px;
}

.titlebar-tab-button {
  display: grid;
  width: 25px;
  height: 26px;
  flex: 0 0 25px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--foreground);
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}

.titlebar-tab-button:hover:not(:disabled) {
  background: var(--surface-hover);
}

.titlebar-tab-button:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.55;
}

.titlebar-search {
  width: clamp(120px, 24vw, 300px);
  height: 26px;
  min-width: 0;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
  background: var(--background);
  color: var(--foreground);
  font-size: 12px;
}

.titlebar-search:focus-visible {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
}

.titlebar-search:disabled {
  color: var(--muted);
}

.workbench {
  display: flex;
  min-height: 0;
  background: var(--background);
}

.sidebar {
  display: flex;
  width: 250px;
  min-width: 200px;
  flex: 0 0 250px;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

#explorer-view,
.search-view {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.activity-bar {
  display: flex;
  width: 43px;
  flex: 0 0 43px;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.activity-bar[hidden] {
  display: none !important;
}

.settings-gear-button {
  margin-top: 0;
}

.activity-profile-menu {
  position: static;
  height: auto;
  margin-top: auto;
}

.activity-profile-button {
  height: 38px;
  padding: 0;
}

.activity-profile-label {
  display: none;
}

.activity-profile-menu--titlebar {
  position: relative;
  height: 100%;
  margin-top: 0;
}

.activity-profile-menu--titlebar .activity-profile-button {
  display: flex;
  width: auto;
  height: 28px;
  align-items: center;
  gap: 0;
  padding: 0 9px;
  color: var(--foreground);
  font: inherit;
}

.activity-profile-menu--titlebar .activity-profile-button svg {
  display: none;
}

.activity-profile-menu--titlebar .user-profile-panel {
  position: absolute;
  top: 33px;
  right: auto;
  bottom: auto;
  left: 0;
}

.activity-profile-menu--titlebar .activity-profile-label {
  display: inline;
}

.activity-profile-button[aria-expanded="true"] {
  background: var(--surface-hover);
  color: var(--foreground);
}

.settings-gear-button[aria-expanded="true"] {
  background: var(--surface-hover);
  color: var(--foreground);
}

.activity-button {
  position: relative;
  display: grid;
  width: 36px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.activity-button svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.activity-button[data-activity="explorer"] svg {
  width: 29px;
  height: 29px;
}

.github-link {
  text-decoration: none;
}

.github-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  stroke: none;
}

.activity-button:hover,
.activity-button--active {
  color: var(--foreground);
}

.activity-button--active::after {
  position: absolute;
  top: 5px;
  left: -4px;
  bottom: 5px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
  content: "";
}

.sidebar-heading {
  display: flex;
  height: 35px;
  flex: 0 0 35px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 19px;
  color: var(--muted);
  font-size: 11px;
}

.explorer-actions {
  display: flex;
  align-items: center;
  gap: 1px;
}

.icon-button {
  width: 25px;
  height: 25px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
}

.icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.15;
}

.icon-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.icon-button:hover,
.recent-remove:hover {
  background: var(--surface-hover);
  color: var(--foreground);
}

.workspace-name {
  display: flex;
  min-height: 29px;
  flex: 0 0 29px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-raised);
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.workspace-folder,
.workspace-folder svg {
  display: inline-block;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: var(--folder);
}

#workspace-chevron {
  width: 11px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 400;
}

#workspace-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-tree {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 3px 0 12px;
}

.project-search-form {
  display: grid;
  gap: 7px;
  padding: 0 12px 9px;
}

.project-search-form > input {
  width: 100%;
  min-height: 29px;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--background);
  color: var(--foreground);
}

.project-search-form > input:focus {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
}

.search-case-option {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.search-case-option input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--accent);
}

.search-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.search-actions button {
  min-height: 27px;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface-raised);
  color: var(--foreground);
  font-size: 11px;
  cursor: pointer;
}

.search-actions button:hover:not(:disabled) {
  background: var(--surface-hover);
}

.search-actions button:disabled {
  opacity: 0.5;
  cursor: default;
}

.search-actions button[type="submit"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.search-summary {
  min-height: 16px;
  margin: 0;
  padding: 0 12px 5px;
  color: var(--muted);
  font-size: 11px;
}

.search-results {
  min-height: 0;
  flex: 1;
  overflow: auto;
  margin: 0;
  padding: 0 5px 8px;
  list-style: none;
}

.search-result {
  margin: 0 0 2px;
}

.search-result-button {
  display: grid;
  width: 100%;
  gap: 3px;
  padding: 5px 7px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--foreground);
  text-align: left;
  cursor: pointer;
}

.search-result-button:hover,
.search-result-button:focus-visible {
  background: var(--surface-hover);
}

.search-result-path {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-match {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-match mark {
  border-radius: 2px;
  background: var(--surface-selected);
  color: var(--foreground);
}

.tree-root,
.tree-children {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tree-item {
  display: flex;
  width: 100%;
  height: 23px;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 calc(10px + var(--tree-depth, 0) * 14px);
  border: 0;
  background: transparent;
  color: var(--foreground);
  text-align: left;
  cursor: pointer;
}

.tree-item:hover {
  background: var(--surface-hover);
}

.tree-item--active {
  background: var(--surface-selected);
  color: var(--foreground);
}

.tree-item--active:hover {
  background: var(--surface-selected);
}

.tree-item--selected {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

.tree-item[aria-expanded="true"] {
  color: var(--foreground);
}

.tree-chevron {
  width: 10px;
  color: var(--muted);
  font-size: 17px;
  text-align: center;
}

.tree-chevron--empty {
  font-size: 8px;
}

.folder-glyph,
.tree-item > .file-icon,
.recent-icon > svg {
  display: inline-grid;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  place-items: center;
  color: var(--folder);
}

.folder-glyph svg,
.recent-icon > svg {
  width: 16px;
  height: 16px;
}

.tree-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-empty {
  margin: 12px 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.file-icon {
  display: inline-grid;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  place-items: center;
}

.file-icon svg {
  width: 16px;
  height: 16px;
  overflow: visible;
}

.file-icon-page {
  fill: #f2f2f2;
  stroke: #929292;
  stroke-width: 0.55;
}

.file-icon-fold {
  fill: none;
  stroke: #929292;
  stroke-linejoin: round;
  stroke-width: 0.55;
}

.file-icon-outline {
  fill: none;
  stroke: rgb(0 0 0 / 15%);
  stroke-width: 0.35;
}

.file-icon-label {
  fill: #fff;
  font-family: "Segoe UI", sans-serif;
  font-size: 4px;
  font-weight: 700;
  text-anchor: middle;
}

.file-icon-lines {
  fill: none;
  stroke: #858585;
  stroke-linecap: round;
  stroke-width: 0.7;
}

.file-icon--html .file-icon-page {
  fill: #e44d26;
  stroke: #b73b1c;
}

.file-icon--css .file-icon-page {
  fill: #1673b6;
  stroke: #105687;
}

.file-icon--javascript .file-icon-page {
  fill: #f0db4f;
  stroke: #c4ac23;
}

.file-icon--javascript .file-icon-label,
.file-icon--data .file-icon-label,
.file-icon--document .file-icon-label,
.file-icon--config .file-icon-label,
.file-icon--lock .file-icon-label {
  fill: #292929;
}

.file-icon--typescript .file-icon-page,
.file-icon--csharp .file-icon-page,
.file-icon--c .file-icon-page,
.file-icon--cpp .file-icon-page {
  fill: #3178c6;
  stroke: #245c98;
}

.file-icon--data .file-icon-page {
  fill: #9c68a6;
  stroke: #764e81;
}

.file-icon--markdown .file-icon-page {
  fill: #58944a;
  stroke: #407138;
}

.file-icon--python .file-icon-page {
  fill: #3978a8;
  stroke: #2a597e;
}

.file-icon--java .file-icon-page,
.file-icon--ruby .file-icon-page {
  fill: #b34432;
  stroke: #853527;
}

.file-icon--go .file-icon-page {
  fill: #55a6bd;
  stroke: #3a7d90;
}

.file-icon--rust .file-icon-page,
.file-icon--shell .file-icon-page {
  fill: #d17743;
  stroke: #a35b33;
}

.file-icon--php .file-icon-page {
  fill: #777bb3;
  stroke: #5a5d89;
}

.file-icon--sql .file-icon-page {
  fill: #d79b28;
  stroke: #a8781e;
}

.file-icon--image .file-icon-page,
.file-icon--svg .file-icon-page {
  fill: #8b70ad;
  stroke: #654f80;
}

.file-icon--pdf .file-icon-page {
  fill: #d74842;
  stroke: #a93530;
}

.file-icon--archive .file-icon-page,
.file-icon--audio .file-icon-page,
.file-icon--video .file-icon-page {
  fill: #be8d45;
  stroke: #8b6935;
}

.file-icon--git .file-icon-page {
  fill: #e16d3d;
  stroke: #ab4f2c;
}

.file-icon--docker .file-icon-page {
  fill: #3296c8;
  stroke: #27769d;
}

.file-icon--generic .file-icon-page {
  fill: var(--surface-raised);
  stroke: #a0a0a0;
  stroke-width: 0.9;
}

.file-icon--generic .file-icon-fold,
.file-icon--generic .file-icon-lines {
  stroke: #a0a0a0;
}

:root[data-icon-style="minimal"] .folder-glyph,
:root[data-icon-style="minimal"] .workspace-folder,
:root[data-icon-style="minimal"] .recent-icon > svg {
  color: #9299a3;
}

:root[data-icon-style="minimal"] .file-icon-page {
  fill: none;
  stroke: #9299a3;
  stroke-width: 0.8;
}

:root[data-icon-style="minimal"] .file-icon-fold {
  stroke: #9299a3;
  stroke-width: 0.8;
}

:root[data-icon-style="minimal"] .file-icon-outline,
:root[data-icon-style="minimal"] .file-icon-label,
:root[data-icon-style="minimal"] .file-icon-lines {
  display: none;
}

.file-glyph--script {
  color: #e5c07b;
}

.file-glyph--markup {
  color: #e37933;
}

.file-glyph--style {
  color: #61afef;
}

.file-glyph--data {
  color: #cb8bf2;
}

.file-glyph--document {
  color: #8dbc8b;
}

.file-glyph--media {
  color: #d78bd5;
}

.file-glyph--config {
  color: #c7c7c7;
}

.file-glyph--archive {
  color: #cf9a6b;
}

.main-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  background: var(--background);
}

.tabs-bar {
  display: flex;
  min-width: 0;
  min-height: 36px;
  flex: 0 0 36px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-raised);
}

.tabs-list {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  overflow-x: auto;
  overflow-y: hidden;
}

.markdown-preview-toggle {
  display: grid;
  width: 32px;
  min-width: 32px;
  height: 28px;
  flex: 0 0 auto;
  align-self: center;
  margin: 0 8px 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--foreground);
  cursor: pointer;
}

.markdown-preview-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.markdown-preview-toggle:hover {
  background: var(--surface-hover);
}

.tab {
  display: flex;
  min-width: 130px;
  max-width: 215px;
  height: 36px;
  flex: 0 1 180px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 8px 0 11px;
  border: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.tab--active {
  border-top: 1px solid var(--accent);
  background: var(--background);
  color: var(--foreground);
}

.tab-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
}

.tab-title > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-close {
  display: grid;
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  place-items: center;
  border-radius: 3px;
  color: var(--muted);
  font-size: 15px;
}

.tab-close:hover {
  background: var(--surface-hover);
  color: var(--foreground);
}

.editor-area {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.code-editor,
.file-preview {
  width: 100%;
  height: 100%;
}

.code-editor {
  font-size: 16px;
}

.file-preview {
  display: grid;
  overflow: auto;
  place-items: center;
  padding: 20px;
}

.file-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.file-preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.file-preview audio,
.file-preview video {
  width: min(800px, 100%);
  max-height: 100%;
}

.markdown-preview {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 28px clamp(18px, 5vw, 56px);
}

.markdown-content {
  width: min(900px, 100%);
  margin: 0 auto;
  overflow-wrap: anywhere;
  line-height: 1.65;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
  margin: 1.25em 0 0.55em;
  color: var(--foreground);
  line-height: 1.3;
}

.markdown-content h1,
.markdown-content h2 {
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--border);
}

.markdown-content p,
.markdown-content ul,
.markdown-content ol,
.markdown-content blockquote,
.markdown-content pre,
.markdown-content table {
  margin: 0 0 1em;
}

.markdown-content a {
  color: var(--accent);
}

.markdown-content blockquote {
  padding: 0 1em;
  border-left: 3px solid var(--border);
  color: var(--muted);
}

.markdown-content pre,
.markdown-content code {
  border-radius: 4px;
  background: var(--surface-raised);
  font-family: Consolas, "Courier New", monospace;
}

.markdown-content code {
  padding: 0.15em 0.35em;
}

.markdown-content pre {
  overflow: auto;
  padding: 14px;
}

.markdown-content pre code {
  padding: 0;
  background: transparent;
}

.markdown-content table {
  width: 100%;
  border-collapse: collapse;
}

.markdown-content th,
.markdown-content td {
  padding: 6px 10px;
  border: 1px solid var(--border);
  text-align: left;
}

.markdown-content th {
  background: var(--surface-raised);
}

.markdown-content hr {
  border: 0;
  border-top: 1px solid var(--border);
}

.markdown-image-label {
  color: var(--muted);
  font-style: italic;
}

.editor-empty {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.unsupported-file {
  max-width: 440px;
}

.unsupported-file h2 {
  color: var(--foreground);
  font-size: 18px;
  font-weight: 400;
}

.unsupported-file p {
  line-height: 1.6;
}

.unsupported-file a {
  color: var(--accent);
}

.welcome {
  width: min(850px, 100%);
  margin: 0 auto;
  padding: clamp(36px, 8vh, 85px) 40px 30px;
  color: var(--foreground);
}

.welcome-logo {
  width: 42px;
  height: 42px;
  opacity: 0.9;
}

.welcome h1 {
  margin: 17px 0 6px;
  font-size: clamp(23px, 3vw, 29px);
  font-weight: 300;
}

.welcome-caption {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.welcome-columns {
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(280px, 1.2fr);
  gap: 48px;
  margin-top: 34px;
}

.welcome-section h2 {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
}

.welcome-section > p {
  margin: 10px 0;
  color: var(--muted);
  line-height: 1.6;
}

.welcome-action {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  margin: 0 0 4px;
  padding: 4px 10px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.welcome-action svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: currentColor;
}

.welcome-action:hover {
  filter: brightness(1.1);
}

.recent-empty {
  font-size: 12px;
}

.recent-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.recent-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
  border-radius: 4px;
}

.recent-open {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 11px;
  padding: 7px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.recent-icon {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
}

.recent-icon .file-icon {
  width: 16px;
  height: 16px;
}

.recent-details {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.recent-name {
  overflow: hidden;
  color: var(--accent);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-type {
  color: var(--muted);
  font-size: 11px;
}

.recent-remove {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: transparent;
  font-size: 16px;
  cursor: pointer;
}

.recent-item:hover .recent-remove,
.recent-remove:focus-visible {
  color: var(--muted);
}

.welcome-footnote {
  margin-top: 36px;
  color: var(--muted);
  font-size: 11px;
}

.statusbar {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 18px;
  padding: 0 10px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
}

.statusbar > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-workspace {
  margin-right: auto;
}

.confirm-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--foreground);
  box-shadow: var(--shadow);
}

.confirm-dialog::backdrop {
  background: rgb(0 0 0 / 55%);
}

.confirm-dialog h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
}

.confirm-dialog p {
  margin: 14px 0 22px;
  color: var(--muted);
  line-height: 1.5;
}

.entry-dialog form {
  display: grid;
  gap: 12px;
}

.entry-dialog label {
  color: var(--muted);
}

.entry-dialog input {
  width: 100%;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--background);
  color: var(--foreground);
}

.entry-dialog .entry-error {
  margin: 0;
  color: #f48771;
  font-size: 12px;
}

.about-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: min(90vh, 760px);
  overflow: auto;
}

.about-content {
  display: grid;
  gap: 16px;
}

.about-heading {
  display: flex;
  align-items: center;
  gap: 13px;
}

.about-heading img {
  width: 42px;
  height: 42px;
}

.about-heading h2 {
  margin-bottom: 4px;
}

.about-heading p,
.about-description,
.about-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.about-heading p,
.about-note {
  font-size: 12px;
}

.shortcut-section h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
}

.shortcut-list {
  display: grid;
  grid-template-columns: 1fr auto;
  margin: 0;
  border-top: 1px solid var(--border);
}

.shortcut-list > div {
  display: contents;
}

.shortcut-list dt,
.shortcut-list dd {
  display: flex;
  min-height: 32px;
  align-items: center;
  margin: 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.shortcut-list dt {
  color: var(--foreground);
}

.shortcut-list dd {
  justify-content: flex-end;
}

.shortcut-list kbd {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
}

.about-dialog .dialog-actions {
  margin-top: 2px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.dialog-actions button {
  min-height: 29px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  cursor: pointer;
}

.dialog-actions .primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

@media (max-width: 760px) {
  .brand {
    min-width: 0;
  }

  .brand span {
    display: none;
  }

  .titlebar-search {
    width: clamp(75px, 20vw, 180px);
  }

  .titlebar-tab-button {
    width: 22px;
    flex-basis: 22px;
  }

  .titlebar {
    gap: 9px;
    padding: 0 7px;
  }

  .titlebar-tools {
    max-width: calc(100% - 80px);
  }

  .menu-trigger {
    padding: 0 6px;
    font-size: 12px;
  }

  .sidebar {
    width: 205px;
    min-width: 170px;
    flex-basis: 205px;
  }

  .welcome {
    padding: 32px 24px;
  }

  .welcome-columns {
    grid-template-columns: 1fr;
    gap: 23px;
    margin-top: 25px;
  }

  .welcome-footnote {
    line-height: 1.7;
  }

  .statusbar {
    gap: 9px;
  }

  #status-encoding {
    display: none;
  }
}

@media (max-width: 520px) {
  .app {
    grid-template-rows: 36px minmax(0, 1fr) 22px;
  }

  .sidebar {
    position: absolute;
    left: 43px;
    top: 36px;
    bottom: 22px;
    z-index: 4;
    width: min(250px, 76vw, calc(100vw - 43px));
    box-shadow: var(--shadow);
  }

  .workbench.activity-bar-hidden .sidebar {
    left: 0;
    width: min(250px, 76vw);
  }

  .sidebar[hidden] {
    display: none !important;
  }

  .welcome {
    padding: 27px 19px;
  }

  .welcome-caption {
    font-size: 13px;
  }

  .statusbar {
    gap: 6px;
    padding: 0 6px;
    font-size: 10px;
  }
}
