:root {
  --bg-editor: #1e1e2e;
  --bg-sidebar: #181825;
  --bg-activitybar: #11111b;
  --bg-titlebar: #11111b;
  --bg-statusbar: #89b4fa;
  --bg-tab-active: #1e1e2e;
  --bg-tab-inactive: #181825;
  --bg-terminal: #11111b;
  --bg-hover: #232336;
  --bg-selected: #28283f;
  --bg-modal: #1a1a28;
  --fg-main: #cdd6f4;
  --fg-dim: #6c7086;
  --fg-bright: #f5f5f7;
  --syn-keyword: #cba6f7;
  --syn-string: #a6e3a1;
  --syn-comment: #6c7086;
  --syn-func: #89b4fa;
  --syn-prop: #f9e2af;
  --syn-num: #fab387;
  --syn-tag: #f38ba8;
  --syn-type: #89dceb;
  --diff-add: #a6e3a1;
  --diff-add-bg: rgba(166, 227, 161, 0.08);
  --diff-meta: #6c7086;
  --accent: #cba6f7;
  --accent-soft: rgba(203, 166, 247, 0.12);
  --border: #313244;
  --sidebar-width: 260px;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-ui: "Inter", system-ui, sans-serif;
}

:root[data-theme="latte"] {
  --bg-editor: #eff1f5;
  --bg-sidebar: #e6e9ef;
  --bg-activitybar: #dce0e8;
  --bg-titlebar: #dce0e8;
  --bg-statusbar: #1e66f5;
  --bg-tab-active: #eff1f5;
  --bg-tab-inactive: #e6e9ef;
  --bg-terminal: #dce0e8;
  --bg-hover: #e6e9ef;
  --bg-selected: #ccd0da;
  --bg-modal: #e6e9ef;
  --fg-main: #4c4f69;
  --fg-dim: #7c7f93;
  --fg-bright: #181926;
  --syn-keyword: #8839ef;
  --syn-string: #40a02b;
  --syn-comment: #8c8fa1;
  --syn-func: #1e66f5;
  --syn-prop: #df8e1d;
  --syn-num: #fe640b;
  --syn-tag: #d20f39;
  --syn-type: #04a5e5;
  --diff-add: #40a02b;
  --diff-add-bg: rgba(64, 160, 43, 0.1);
  --diff-meta: #8c8fa1;
  --accent: #8839ef;
  --accent-soft: rgba(136, 57, 239, 0.12);
  --border: #ccd0da;
}

:root[data-theme="hc"] {
  --bg-editor: #000000;
  --bg-sidebar: #000000;
  --bg-activitybar: #000000;
  --bg-titlebar: #000000;
  --bg-statusbar: #ffff00;
  --bg-tab-active: #000000;
  --bg-tab-inactive: #0a0a0a;
  --bg-terminal: #000000;
  --bg-hover: #1a1a1a;
  --bg-selected: #2a2a2a;
  --bg-modal: #000000;
  --fg-main: #ffffff;
  --fg-dim: #d0d0d0;
  --fg-bright: #ffffff;
  --syn-keyword: #ff79c6;
  --syn-string: #50fa7b;
  --syn-comment: #aaaaaa;
  --syn-func: #8be9fd;
  --syn-prop: #f1fa8c;
  --syn-num: #ffb86c;
  --syn-tag: #ff5555;
  --syn-type: #8be9fd;
  --diff-add: #50fa7b;
  --diff-add-bg: rgba(80, 250, 123, 0.15);
  --diff-meta: #cccccc;
  --accent: #ffff00;
  --accent-soft: rgba(255, 255, 0, 0.18);
  --border: #ffffff;
}

body,
.titlebar,
.sidebar,
.editor-area,
.terminal,
.statusbar,
.tab,
.tree-item,
.palette-box {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-editor);
  color: var(--fg-main);
  font-family: var(--font-mono);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

a {
  color: var(--syn-func);
}

::selection {
  background: var(--accent-soft);
  color: var(--fg-bright);
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #45475a;
  border-radius: 6px;
  border: 3px solid var(--bg-editor);
}

::-webkit-scrollbar-thumb:hover {
  background: #585b70;
}

.titlebar {
  height: 34px;
  background: var(--bg-titlebar);
  display: flex;
  align-items: center;
  padding: 0 10px;
  flex-shrink: 0;
  font-size: 12.5px;
  color: var(--fg-dim);
  border-bottom: 1px solid var(--border);
  user-select: none;
}

.dots {
  display: flex;
  gap: 7px;
  margin-right: 14px;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.dot.red {
  background: #f38ba8;
  cursor: pointer;
}

.dot.red:hover {
  filter: brightness(1.25);
  box-shadow: 0 0 0 3px rgba(243, 139, 168, 0.18);
}

.dot.yellow {
  background: #f9e2af;
  cursor: pointer;
}

.dot.yellow:hover {
  filter: brightness(1.25);
  box-shadow: 0 0 0 3px rgba(249, 226, 175, 0.18);
}

.dot.green {
  background: #a6e3a1;
}

.titlebar-label {
  flex: 1;
  text-align: center;
  letter-spacing: 0.2px;
}

.palette-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--fg-dim);
  border-radius: 5px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  cursor: pointer;
  flex-shrink: 0;
}

.palette-btn:hover {
  color: var(--fg-bright);
  border-color: #45475a;
}

.palette-btn kbd {
  font-size: 10px;
  background: var(--bg-activitybar);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 4px;
  color: var(--fg-dim);
}

.resume-btn {
  margin-left: 8px;
  text-decoration: none;
}

.workbench {
  flex: 1;
  display: flex;
  min-height: 0;
}

.activitybar {
  width: 48px;
  background: var(--bg-activitybar);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10px;
  gap: 4px;
  flex-shrink: 0;
  position: relative;
}

.activitybar .act {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-dim);
  border-left: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.activitybar .act.active {
  color: var(--fg-bright);
  border-left-color: var(--accent);
}

.activitybar .act svg {
  width: 20px;
  height: 20px;
}

.activitybar .act .cib-leetcode {
  font-size: 20px;
  line-height: 1;
  display: block;
}

.activitybar .act .fa-circle-info {
  font-size: 20px;
  line-height: 1;
  display: block;
}

.activitybar .act:hover {
  color: var(--fg-bright);
}

.activitybar .spacer {
  flex: 1;
}

.activitybar .badge {
  position: relative;
}

.activitybar .badge::after {
  content: attr(data-count);
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--syn-tag);
  color: #11111b;
  font-size: 8px;
  font-weight: 700;
  border-radius: 7px;
  padding: 1px 4px;
  line-height: 1.2;
}

.sc-section-label {
  padding: 10px 14px 4px;
  font-size: 10.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.sc-item {
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 2px solid transparent;
  cursor: default;
}

.sc-item:hover {
  background: var(--bg-hover);
  border-left-color: var(--accent);
}

.sc-item a {
  color: var(--fg-bright);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
}

.sc-item a:hover {
  text-decoration: underline;
}

.sc-item .sc-desc {
  font-size: 11px;
  color: var(--fg-dim);
  line-height: 1.5;
}

.sc-item .sc-tag {
  display: inline-block;
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 6px;
  font-weight: 700;
}

.sc-tag.merged {
  background: rgba(166, 227, 161, 0.18);
  color: var(--diff-add);
}

.sc-tag.approved {
  background: rgba(137, 184, 250, 0.18);
  color: var(--syn-func);
}

.sc-tag.authored {
  background: rgba(203, 166, 247, 0.18);
  color: var(--accent);
}

.sc-panel-foot {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

.sc-panel-foot a {
  font-size: 11.5px;
  color: var(--syn-func);
  text-decoration: none;
}

.sc-panel-foot a:hover {
  text-decoration: underline;
}

.sidebar-wrap {
  display: flex;
  flex-shrink: 0;
  min-width: 0;
  position: relative;
}

.sidebar-wrap.collapsed {
  width: 0 !important;
}

.sidebar-wrap.collapsed .sidebar-resize-handle {
  display: none;
}

.sidebar {
  width: var(--sidebar-width, 260px);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 16px;
  min-height: 0;
}

.sidebar-wrap.collapsed .sidebar {
  width: 0;
  opacity: 0;
  pointer-events: none;
  border-right-color: transparent;
  overflow: hidden;
}

.sidebar:not(.no-transition) {
  transition: width 0.15s ease, opacity 0.15s ease;
}

.sidebar-view {
  display: none;
}

.sidebar-view.active {
  display: block;
}

.sidebar-view-stats .stats-stack {
  padding: 0 12px 16px;
}

.sidebar-view-stats .profile-card--panel {
  margin: 0 0 8px;
}

.sidebar-view-stats .profile-avatar-status {
  border-color: var(--bg-hover);
}

.sidebar-resize-handle {
  width: 4px;
  flex-shrink: 0;
  cursor: col-resize;
  background: transparent;
  position: relative;
  z-index: 5;
  touch-action: none;
  transition: background 0.15s ease;
}

.sidebar-resize-handle:hover,
.sidebar-resize-handle.resizing {
  background: var(--accent);
}

.sidebar-title {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--fg-dim);
  padding: 14px 16px 8px;
  text-transform: uppercase;
}

.sidebar > .sidebar-title:first-child {
  padding-top: 16px;
}

.profile-card {
  margin: 0 12px 14px;
  padding: 14px;
  background: var(--bg-hover);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.profile-card .name {
  color: var(--fg-bright);
  font-weight: 600;
  font-size: 14px;
}

.profile-card .role {
  color: var(--syn-func);
  font-size: 11.5px;
  margin-top: 4px;
  line-height: 1.5;
}

.profile-card .loc {
  color: var(--fg-dim);
  font-size: 11px;
  margin-top: 8px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.stats-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.stat-card:hover {
  border-color: var(--accent);
  background: var(--bg-selected);
}

.stat-card-body {
  flex: 1;
  min-width: 0;
}

.stat-card-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-bright);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 11px;
  line-height: 1.55;
}

.stat-key {
  color: var(--fg-dim);
}

.stat-val {
  color: var(--fg-bright);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.stat-tags {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.stat-tag {
  font-size: 10px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.stat-tag.easy { color: var(--diff-add); }
.stat-tag.medium { color: var(--syn-prop); }
.stat-tag.hard { color: #f38ba8; }

.stat-ring-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.stat-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.stat-ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 3;
}

.stat-ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 0 100;
  transition: stroke-dasharray 0.7s ease;
}

.stat-ring-fill--gh {
  stroke: var(--syn-string);
}

.stat-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--fg-bright);
  font-variant-numeric: tabular-nums;
}

.stat-card.is-loading .stat-val,
.stat-card.is-loading .stat-ring-label {
  opacity: 0.45;
}

.gh-readme-stats-wrap {
  display: block;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-hover);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.gh-readme-stats-wrap:hover {
  border-color: var(--accent);
  background: var(--bg-selected);
}

.gh-readme-stats {
  display: block;
  width: 100%;
  height: auto;
}

.tree {
  list-style: none;
  margin: 0;
  padding: 0 0 6px;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 16px;
  font-size: 13px;
  color: var(--fg-main);
  cursor: pointer;
  white-space: nowrap;
  border-left: 2px solid transparent;
}

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

.tree-item.active {
  background: var(--bg-selected);
  border-left-color: var(--accent);
  color: var(--fg-bright);
}

.tree-folder {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  font-size: 13px;
  color: var(--fg-main);
  cursor: pointer;
  user-select: none;
}

.tree-folder:hover {
  background: var(--bg-hover);
}

.tree-folder .chev {
  font-size: 10px;
  color: var(--fg-dim);
  transition: transform 0.12s ease;
  width: 10px;
}

.tree-folder.collapsed .chev {
  transform: rotate(-90deg);
}

.tree-folder .folder-icon {
  color: var(--syn-prop);
  font-size: 13px;
}

.tree-sub {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.tree-sub.collapsed {
  display: none;
}

.tree-sub .tree-item {
  padding-left: 38px;
}

.file-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: #11111b;
}

.ic-java { background: var(--syn-tag); }
.ic-log { background: var(--syn-func); }
.ic-diff { background: var(--diff-add); }
.ic-json { background: var(--syn-prop); }
.ic-yaml { background: var(--syn-type); }
.ic-sh { background: var(--syn-keyword); }
.ic-md { background: #94e2d5; }
.ic-pdf { background: var(--syn-tag); }

.editor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.tabbar {
  display: flex;
  background: var(--bg-tab-inactive);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px 9px 14px;
  font-size: 13px;
  color: var(--fg-dim);
  background: var(--bg-tab-inactive);
  border-right: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab.active {
  background: var(--bg-tab-active);
  color: var(--fg-bright);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.tab:hover {
  color: var(--fg-bright);
}

.tab .close {
  opacity: 0;
  margin-left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--fg-dim);
}

.tab:hover .close,
.tab.active .close {
  opacity: 1;
}

.tab .close:hover {
  background: var(--bg-hover);
  color: var(--fg-bright);
}

.breadcrumb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.breadcrumb-row .breadcrumb {
  border-bottom: none;
  flex: 1;
}

.breadcrumb {
  padding: 5px 16px;
  font-size: 11.5px;
  color: var(--fg-dim);
  flex-shrink: 0;
}

.breadcrumb b {
  color: var(--fg-main);
  font-weight: 500;
}

.run-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  color: var(--diff-add);
  font-family: var(--font-mono);
  font-size: 11.5px;
  cursor: pointer;
  padding: 4px 14px;
  flex-shrink: 0;
}

.run-btn:hover {
  color: var(--fg-bright);
}

.run-btn.running {
  color: var(--syn-prop);
}

.code-scroll {
  flex: 1;
  overflow: auto;
  min-height: 0;
}

.code-pane {
  display: none;
  font-size: 13.5px;
  line-height: 1.8;
}

.code-pane.active {
  display: block;
}

.code-line {
  display: flex;
  padding: 0 16px;
}

.code-line:hover {
  background: rgba(255, 255, 255, 0.025);
}

.ln {
  width: 38px;
  flex-shrink: 0;
  text-align: right;
  margin-right: 18px;
  color: #494966;
  user-select: none;
}

.code-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.k { color: var(--syn-keyword); }
.s { color: var(--syn-string); }
.c { color: var(--syn-comment); font-style: italic; }
.f { color: var(--syn-func); }
.p { color: var(--syn-prop); }
.n { color: var(--syn-num); }
.t { color: var(--syn-tag); }
.ty { color: var(--syn-type); }
.plain { color: var(--fg-main); }
.bold { font-weight: 700; color: var(--fg-bright); }
.add { background: var(--diff-add-bg); color: var(--diff-add); }
.meta { color: var(--diff-meta); }

.link-line a {
  color: var(--syn-func);
  text-decoration: none;
  border-bottom: 1px dashed rgba(137, 184, 250, 0.4);
}

.link-line a:hover {
  border-bottom-style: solid;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--fg-dim);
  gap: 14px;
  text-align: center;
  padding: 20px;
}

.empty-state .glyph {
  font-size: 34px;
  opacity: 0.5;
}

.empty-state .hint {
  font-size: 12.5px;
}

.empty-state kbd {
  font-size: 11px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--fg-main);
}

.palette-overlay,
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 16, 0.55);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 90px;
  z-index: 100;
}

.search-overlay {
  padding-top: 10vh;
  background: rgba(0, 0, 0, 0.5);
}

.palette-overlay.open,
.search-overlay.open {
  display: flex;
}

.palette-box,
.search-box {
  width: min(620px, 92vw);
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.palette-box {
  width: 560px;
  max-width: 90vw;
}

.palette-input,
.search-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg-bright);
  font-family: var(--font-mono);
  font-size: 14.5px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.search-input {
  font-size: 14px;
  box-sizing: border-box;
}

.palette-results {
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
}

.palette-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
}

.palette-row.sel,
.palette-row:hover {
  background: var(--bg-hover);
}

.palette-row .pname {
  color: var(--fg-bright);
}

.palette-row .ppath {
  color: var(--fg-dim);
  font-size: 11.5px;
  margin-left: auto;
}

.palette-empty,
.search-empty {
  padding: 18px;
  color: var(--fg-dim);
  font-size: 13px;
  text-align: center;
}

.search-results {
  max-height: 50vh;
  overflow-y: auto;
}

.search-row {
  padding: 9px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.search-row:hover,
.search-row.sel {
  background: var(--bg-hover);
}

.search-row .sr-file {
  font-size: 11.5px;
  color: var(--syn-func);
  margin-bottom: 3px;
}

.search-row .sr-snip {
  font-size: 12.5px;
  color: var(--fg-dim);
  white-space: pre-wrap;
  word-break: break-word;
}

.search-row .sr-snip mark {
  background: var(--accent-soft);
  color: var(--fg-bright);
  border-radius: 2px;
}

.terminal {
  height: 200px;
  background: var(--bg-terminal);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: height 0.18s ease;
}

.terminal.collapsed {
  height: 39px;
}

.terminal-head {
  display: flex;
  align-items: center;
  height: 34px;
  flex-shrink: 0;
  padding: 0 14px;
  font-size: 11.5px;
  color: var(--fg-dim);
  border-bottom: 1px solid var(--border);
  user-select: none;
  gap: 16px;
}

.panel-tab {
  cursor: pointer;
  padding: 9px 0 8px;
  border-bottom: 2px solid transparent;
}

.panel-tab.active {
  color: var(--fg-bright);
  border-bottom-color: var(--accent);
}

.terminal-head .chev {
  margin-left: auto;
  transition: transform 0.15s ease;
  cursor: pointer;
  padding: 4px;
}

.terminal.collapsed .chev {
  transform: rotate(-90deg);
}

.terminal-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px 14px;
  font-size: 13px;
  line-height: 1.7;
}

.terminal.collapsed .terminal-body {
  display: none;
}

.term-line {
  white-space: pre-wrap;
}

.prompt { color: var(--diff-add); }
.path { color: var(--syn-func); }
.cmd { color: var(--fg-bright); }
.out { color: var(--fg-main); }
.out a { color: var(--syn-func); text-decoration: none; }
.out a:hover { text-decoration: underline; }
.out.ok { color: var(--diff-add); }
.out.warn { color: var(--syn-prop); }

.panel-pane {
  display: none;
}

.panel-pane.active {
  display: block;
}

.cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--fg-bright);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.statusbar {
  height: 24px;
  background: var(--bg-statusbar);
  color: #11111b;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 16px;
  flex-shrink: 0;
  font-weight: 500;
  user-select: none;
}

.statusbar .right {
  margin-left: auto;
  display: flex;
  gap: 16px;
}

.statusbar span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.branch-link {
  color: #11111b;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

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

a:focus-visible,
.tree-item:focus-visible,
.tree-folder:focus-visible,
.tab:focus-visible,
.activitybar .act:focus-visible,
.terminal-head:focus-visible,
.panel-tab:focus-visible,
.palette-row:focus-visible,
.palette-btn:focus-visible,
.search-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--fg-dim);
  border-radius: 5px;
  width: 28px;
  height: 28px;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 8px;
}

.icon-btn:hover {
  color: var(--fg-bright);
  border-color: #45475a;
}

.skill-bars {
  margin: 4px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skill-bar .sb-label {
  font-size: 12.5px;
  color: var(--fg-main);
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.skill-bar .sb-pct {
  color: var(--fg-dim);
}

.sb-track {
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
}

.sb-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--syn-func));
  border-radius: 3px;
  transition: width 1.1s cubic-bezier(0.22, 0.9, 0.3, 1);
}

.ide-form {
  padding: 18px 20px 26px;
  max-width: 480px;
}

.ide-form .form-row {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ide-form label {
  font-size: 11.5px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.ide-form input,
.ide-form textarea,
.ide-form select {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--fg-bright);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 10px;
  outline: none;
  resize: vertical;
}

.ide-form input:focus,
.ide-form textarea:focus {
  border-color: var(--accent);
}

.ide-form textarea {
  min-height: 90px;
}

.ide-form button {
  background: var(--accent);
  color: #11111b;
  border: none;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  padding: 9px 18px;
  cursor: pointer;
  margin-top: 4px;
}

.ide-form button:hover {
  filter: brightness(1.08);
}

.ide-note {
  font-size: 11.5px;
  color: var(--fg-dim);
  margin-top: 10px;
  line-height: 1.6;
}

.pane-heading {
  padding: 18px 20px 4px;
  font-size: 13.5px;
  color: var(--fg-bright);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pane-subheading {
  padding: 0 20px 14px;
  font-size: 12px;
  color: var(--fg-dim);
  line-height: 1.55;
}

/* JavaFX-style testimonial cards */
.fx-scroll-wrap {
  padding: 4px 20px 18px;
}

.fx-grid {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 4px 14px;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 20px;
}

.fx-grid::-webkit-scrollbar {
  height: 9px;
}

.fx-card {
  position: relative;
  flex: 0 0 280px;
  scroll-snap-align: start;
  background: linear-gradient(180deg, #f4f6f9 0%, #e8ecf1 100%);
  border: 1px solid #b8c0cc;
  border-radius: 4px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 1px 2px rgba(0, 0, 0, 0.18),
    0 4px 12px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.fx-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 6px 16px rgba(53, 104, 163, 0.22),
    0 12px 28px rgba(0, 0, 0, 0.14);
}

.fx-card-titlebar {
  background: linear-gradient(180deg, #5a94d0 0%, #3d6fa8 50%, #3568a3 100%);
  color: #ffffff;
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 600;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #2a5688;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

.fx-win-controls {
  display: flex;
  gap: 5px;
  margin-right: 4px;
}

.fx-win-controls span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12) inset;
}

.fx-win-controls span:first-child {
  background: rgba(255, 255, 255, 0.65);
}

.fx-card-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fx-preview-tag {
  position: absolute;
  top: 38px;
  right: 10px;
  z-index: 2;
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 3px;
  background: rgba(53, 104, 163, 0.12);
  color: #3568a3;
  border: 1px solid rgba(53, 104, 163, 0.25);
}

.fx-card-body {
  padding: 16px 14px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, transparent 40%);
}

.fx-quote {
  font-family: var(--font-ui);
  font-size: 12.5px;
  line-height: 1.65;
  color: #2b2f36;
  flex: 1;
}

.fx-quote::before {
  content: "\201C";
  color: #3568a3;
  font-weight: 700;
  font-size: 15px;
}

.fx-quote::after {
  content: "\201D";
  color: #3568a3;
  font-weight: 700;
  font-size: 15px;
}

.fx-card-footer {
  margin-top: 14px;
  padding-top: 11px;
  border-top: 1px solid #d3d8df;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fx-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5a94d0, #3568a3);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(53, 104, 163, 0.35);
}

.fx-name {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: #1c2733;
}

.fx-role {
  font-family: var(--font-ui);
  font-size: 10.5px;
  color: #5b6573;
  margin-top: 1px;
}

.fx-hint {
  font-size: 11px;
  color: var(--fg-dim);
  padding: 0 20px 6px;
}

.fx-scroll-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 0 20px 8px;
}

.fx-scroll-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s ease, transform 0.2s ease;
}

.fx-scroll-dots span.active {
  background: var(--accent);
  transform: scale(1.2);
}

:root[data-theme="latte"] .fx-card {
  background: linear-gradient(180deg, #ffffff 0%, #eef0f4 100%);
}

:root[data-theme="hc"] .fx-card {
  background: #fff;
  border-color: #000;
  box-shadow: none;
}

:root[data-theme="hc"] .fx-card-titlebar {
  background: #000;
  color: #ffff00;
  border-bottom-color: #ffff00;
}

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  overflow: hidden;
}

.close-toast {
  position: fixed;
  top: 42px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  opacity: 0;
  pointer-events: none;
  z-index: 150;
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--fg-main);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(440px, 92vw);
  line-height: 1.45;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.close-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.close-toast-icon {
  color: var(--syn-tag);
  font-size: 10px;
  flex-shrink: 0;
}

.close-toast kbd {
  font-size: 11px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--fg-bright);
  font-family: var(--font-mono);
}

.confetti-piece {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 14px;
  opacity: 0.9;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  to {
    transform: translateY(108vh) rotate(540deg);
    opacity: 0.4;
  }
}

/* ============================================================
   NEW INTERACTIVE FEATURES
   ============================================================ */

/* Profile avatar */
.profile-avatar-row {
  position: relative;
  display: inline-flex;
  margin-bottom: 10px;
}

.profile-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--syn-func));
  color: #11111b;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(203, 166, 247, 0.35);
  user-select: none;
}

.profile-avatar-status {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--diff-add);
  border: 2px solid var(--bg-hover);
  animation: status-pulse 2.4s ease infinite;
}

@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(166, 227, 161, 0.5); }
  50% { box-shadow: 0 0 0 4px rgba(166, 227, 161, 0); }
}

/* Code navigation links (clickable comments in About.java) */
.code-nav {
  cursor: pointer;
  border-bottom: 1px dashed currentColor;
  opacity: 0.85;
  transition: opacity 0.15s;
}

.code-nav:hover {
  opacity: 1;
  text-decoration: none;
}

/* Code links (string values in About.java) */
.code-link {
  text-decoration: none;
}

.code-link span {
  border-bottom: 1px dashed var(--syn-string);
  transition: border-bottom-style 0.15s;
}

.code-link:hover span {
  border-bottom-style: solid;
}

/* Git blame tooltip */
.blame-tooltip {
  position: fixed;
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--fg-dim);
  pointer-events: none;
  z-index: 80;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.blame-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Problems panel */
.problems-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--syn-prop);
  color: #11111b;
  font-size: 9px;
  font-weight: 700;
  border-radius: 8px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 1.3;
}

.problems-list {
  padding: 6px 0;
}

.problem-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 16px;
  font-size: 12.5px;
  line-height: 1.5;
  border-left: 2px solid transparent;
}

.problem-row:hover {
  background: var(--bg-hover);
}

.problem-row.warn { border-left-color: var(--syn-prop); }
.problem-row.info { border-left-color: var(--syn-func); }
.problem-row.ok   { border-left-color: var(--diff-add); }

.prob-icon { flex-shrink: 0; font-size: 11px; }
.problem-row.warn .prob-icon { color: var(--syn-prop); }
.problem-row.info .prob-icon { color: var(--syn-func); }
.problem-row.ok .prob-icon   { color: var(--diff-add); }

.prob-source {
  color: var(--syn-func);
  font-weight: 500;
  flex-shrink: 0;
}

.prob-msg {
  color: var(--fg-main);
  flex: 1;
}

.prob-loc {
  color: var(--fg-dim);
  font-size: 11px;
  flex-shrink: 0;
}

/* Keyboard shortcuts overlay */
.kbd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 16, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 110;
}

.kbd-overlay.open {
  display: flex;
}

.kbd-box {
  width: min(520px, 92vw);
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  max-height: 85vh;
  overflow-y: auto;
}

.kbd-head {
  padding: 14px 18px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-bright);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg-modal);
}

.kbd-close {
  cursor: pointer;
  color: var(--fg-dim);
  font-size: 14px;
  padding: 4px;
}

.kbd-close:hover { color: var(--fg-bright); }

.kbd-body {
  padding: 8px 0 16px;
}

.kbd-section {
  padding: 12px 18px 6px;
  font-size: 10.5px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--fg-dim);
  font-weight: 600;
}

.kbd-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 18px;
  font-size: 12.5px;
  color: var(--fg-main);
}

.kbd-row kbd {
  font-size: 10.5px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  color: var(--fg-bright);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.kbd-row span {
  color: var(--fg-dim);
  margin-left: 4px;
}

/* Command palette action icon */
.palette-action-icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-size: 13px;
}

/* Settings pane */
.settings-gui {
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.settings-category {
  padding: 12px 18px 6px;
  font-size: 10.5px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--fg-dim);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  gap: 16px;
}

.setting-item:hover {
  background: var(--bg-hover);
}

.setting-info {
  flex: 1;
  min-width: 0;
}

.setting-name {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--syn-prop);
}

.setting-desc {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--fg-dim);
  margin-top: 2px;
}

.setting-control {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.s-toggle {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 40px;
}

.s-toggle:hover {
  border-color: var(--accent);
  color: var(--fg-bright);
}

.s-toggle.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.setting-stepper {
  gap: 8px;
}

.s-step {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 14px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.s-step:hover {
  border-color: var(--accent);
  color: var(--fg-bright);
}

.s-val {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg-bright);
  min-width: 22px;
  text-align: center;
}

.s-theme-btn {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.s-theme-btn:hover {
  border-color: var(--accent);
  color: var(--fg-bright);
}

/* Animated counters */
.counter {
  display: inline;
  font-variant-numeric: tabular-nums;
}

/* Active line highlight */
.code-line.active-line {
  background: rgba(203, 166, 247, 0.07);
  border-left: 2px solid var(--accent);
}

/* Focus ring for kbd-close */
.kbd-close:focus-visible {
  outline: 2px solid var(--accent);
  border-radius: 3px;
}

/* ---- Terminal resize handle ---- */
.terminal-resize-handle {
  height: 5px;
  background: transparent;
  cursor: ns-resize;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  transition: background 0.2s ease;
}

.terminal-resize-handle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 2px;
  border-radius: 2px;
  background: var(--border);
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.terminal-resize-handle:hover::after,
.terminal-resize-handle:active::after {
  opacity: 1;
  background: var(--accent);
}

.terminal-resize-handle:hover {
  background: rgba(203, 166, 247, 0.05);
}

/* ---- Neofetch layout ---- */
.nf-wrap {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  padding: 4px 0 6px;
  font-family: var(--font-mono);
}

.nf-art {
  font-size: 4.8px;
  line-height: 1.18;
  white-space: pre;
  flex-shrink: 0;
  margin: 0;
  letter-spacing: 0;
  user-select: none;
}

.nf-info {
  min-width: 260px;
  padding-top: 2px;
}

.nf-info-row {
  font-size: 12px;
  line-height: 1.65;
  color: var(--fg-main);
}

.nf-key {
  color: var(--accent);
  font-weight: 600;
  min-width: 80px;
  display: inline-block;
}

.nf-sep {
  color: var(--fg-dim);
}

.nf-info a {
  color: var(--syn-func);
  text-decoration: none;
}

.nf-info a:hover {
  text-decoration: underline;
}

/* ============================================================
   RESPONSIVE — Laptop / Tablet / Mobile
   ============================================================ */

.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 34px;
  left: 48px;
  right: 0;
  bottom: 0;
  z-index: 25;
  background: rgba(8, 8, 14, 0.52);
  -webkit-tap-highlight-color: transparent;
}

.sidebar-backdrop.visible {
  display: block;
}

/* Tablet (≤1024px): overlay sidebar, tighter chrome */
@media (max-width: 1024px) {
  .sidebar-wrap {
    position: fixed;
    top: 34px;
    bottom: 24px;
    left: 48px;
    z-index: 30;
    box-shadow: 8px 0 28px rgba(0, 0, 0, 0.45);
  }

  .sidebar-wrap.collapsed {
    display: none;
  }

  .sidebar-wrap:not(.collapsed) {
    display: flex;
  }

  .sidebar-wrap:not(.collapsed) .sidebar {
    width: min(var(--sidebar-width, 260px), calc(100vw - 48px - 24px));
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-resize-handle {
    display: none;
  }

  .editor-area {
    width: 100%;
  }

  .titlebar-label {
    font-size: 11px;
  }

  .palette-btn kbd {
    display: none;
  }

  .fx-card {
    flex: 0 0 min(300px, 78vw);
  }

  .setting-item {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .setting-control {
    margin-left: auto;
  }
}

/* Mobile (≤767px): compact layout, full-width panels */
@media (max-width: 767px) {
  .titlebar {
    padding: 0 8px;
    gap: 4px;
    padding-top: max(0px, env(safe-area-inset-top));
  }

  .dots {
    margin-right: 6px;
    gap: 6px;
  }

  .titlebar-label {
    flex: 1;
    min-width: 0;
    text-align: center;
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .palette-btn {
    padding: 4px 8px;
    font-size: 11px;
  }

  .palette-btn .label-text {
    display: none;
  }

  .resume-btn .label-text {
    display: inline;
  }

  .resume-btn {
    margin-left: 4px;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
    margin-left: 4px;
  }

  .sidebar-backdrop {
    top: calc(34px + env(safe-area-inset-top, 0px));
  }

  .sidebar-wrap {
    top: calc(34px + env(safe-area-inset-top, 0px));
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }

  .sidebar-wrap:not(.collapsed) .sidebar {
    width: min(var(--sidebar-width, 280px), calc(100vw - 48px - 12px));
  }

  .activitybar {
    width: 44px;
    padding-top: 8px;
  }

  .activitybar .act {
    width: 38px;
    height: 38px;
  }

  .sidebar-backdrop {
    left: 44px;
  }

  .sidebar-wrap {
    left: 44px;
  }

  .code-pane {
    font-size: 12.5px;
    line-height: 1.75;
  }

  .code-scroll,
  .tabbar,
  .sidebar {
    -webkit-overflow-scrolling: touch;
  }

  .code-line {
    padding: 0 10px;
  }

  .ln {
    width: 28px;
    margin-right: 10px;
    font-size: 11px;
  }

  .breadcrumb {
    padding: 5px 10px;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .run-btn {
    padding: 4px 10px;
    font-size: 11px;
  }

  .tab {
    padding: 8px 8px 8px 12px;
    font-size: 12px;
  }

  .terminal {
    height: 140px;
  }

  .terminal-head {
    gap: 10px;
    padding: 0 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .panel-tab {
    flex-shrink: 0;
    font-size: 10.5px;
  }

  .terminal-body {
    padding: 8px 10px 12px;
    font-size: 12px;
  }

  .statusbar {
    height: auto;
    min-height: 24px;
    padding: 4px 8px;
    padding-bottom: max(4px, env(safe-area-inset-bottom));
    gap: 8px;
    font-size: 10.5px;
    flex-wrap: wrap;
  }

  .statusbar .right {
    gap: 10px;
  }

  .statusbar .right span:nth-child(2),
  #status-cursor {
    display: none;
  }

  #status-file {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 42vw;
    min-width: 0;
  }

  .palette-overlay,
  .search-overlay {
    padding-top: max(72px, 12vh);
    padding-left: 12px;
    padding-right: 12px;
  }

  .palette-box,
  .search-box {
    width: 100%;
    max-width: none;
  }

  .problem-row {
    flex-wrap: wrap;
    padding: 6px 10px;
    font-size: 12px;
  }

  .prob-loc {
    flex: 1 1 100%;
    padding-left: 19px;
  }

  .fx-scroll-wrap {
    padding: 4px 12px 14px;
  }

  .fx-grid {
    scroll-padding-left: 12px;
    padding-left: 0;
    padding-right: 0;
  }

  .fx-card {
    flex: 0 0 min(88vw, 320px);
  }

  .fx-hint,
  .fx-scroll-dots {
    padding-left: 12px;
    padding-right: 12px;
  }

  .ide-form {
    padding: 14px 12px 20px;
    max-width: none;
  }

  .skill-bars {
    margin: 4px 10px 14px;
  }

  .empty-state .hint kbd {
    display: none;
  }

  .empty-state .hint {
    font-size: 0;
  }

  .empty-state .hint::after {
    content: "Tap the explorer icon or use Go to file";
    display: block;
    font-size: 11.5px;
  }

  .nf-wrap {
    flex-direction: column;
    gap: 10px;
  }

  .nf-art {
    font-size: 3.5px;
  }

  .nf-info {
    min-width: 0;
  }
}

/* Small mobile (≤480px): minimal chrome */
@media (max-width: 480px) {
  .titlebar-label {
    display: none;
  }

  .dots {
    display: none;
  }

  .resume-btn .label-text {
    display: none;
  }

  .resume-btn::before {
    content: "⭳";
    font-size: 13px;
  }

  #palette-btn::before {
    content: "⌕";
    font-size: 13px;
  }

  .sidebar-wrap:not(.collapsed) {
    right: 0;
  }

  .sidebar-wrap:not(.collapsed) .sidebar {
    width: calc(100vw - 44px);
    max-width: none;
  }

  .branch-link {
    font-size: 10px;
  }

  #status-file {
    max-width: 36vw;
  }

  .statusbar .right #status-lang {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .kbd-row {
    flex-wrap: wrap;
  }
}

/* Touch devices: larger targets, always-visible tab close */
@media (hover: none) and (pointer: coarse) {
  .tab .close {
    opacity: 1;
    width: 22px;
    height: 22px;
  }

  .activitybar .act {
    min-height: 42px;
  }

  .tree-item,
  .tree-folder {
    min-height: 36px;
  }

  .palette-row,
  .search-row {
    min-height: 40px;
  }
}

/* Landscape phone: reclaim vertical space */
@media (max-width: 767px) and (orientation: landscape) {
  .terminal:not(.collapsed) {
    height: 110px;
  }

  .titlebar-label {
    display: none;
  }
}
