:root {
  color-scheme: light;
  --bg: #edf1f5;
  --chrome: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --surface-hover: #eef5ff;
  --text: #111827;
  --muted: #5f6b7a;
  --faint: #98a2b3;
  --line: #d9e0e8;
  --line-strong: #c4ccd7;
  --accent: #0b6ff3;
  --accent-strong: #075ed3;
  --accent-soft: #e9f2ff;
  --ok: #2eb84a;
  --danger: #ef3434;
  --danger-soft: #fff0f0;
  --warning: #f59e0b;
  --shadow: 0 18px 50px rgba(21, 31, 47, 0.12), 0 1px 1px rgba(21, 31, 47, 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f141b;
  --chrome: #151b24;
  --surface: #1b222d;
  --surface-soft: #151b24;
  --surface-hover: #202d3d;
  --text: #edf2f7;
  --muted: #a2adba;
  --faint: #778293;
  --line: #2b3542;
  --line-strong: #3a4655;
  --accent: #5aa2ff;
  --accent-strong: #7bb5ff;
  --accent-soft: #142943;
  --ok: #41c763;
  --danger: #ff6464;
  --danger-soft: #351d22;
  --warning: #f6b84b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  min-width: 320px;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 650;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease,
    box-shadow 0.14s ease;
}

button:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  outline: 0;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

[hidden] {
  display: none !important;
}

.global-loading {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.26);
  backdrop-filter: blur(3px);
}

.global-loading-card {
  min-width: 220px;
  display: grid;
  justify-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}

.global-loading-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.global-loading-card p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.app-layout {
  display: grid;
  grid-template-columns: 72px 310px minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--surface);
}

.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: var(--chrome);
  padding: 16px 10px;
  overflow: visible;
  z-index: 5;
}

.rail-button {
  width: 42px;
  height: 42px;
  position: relative;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  padding: 0;
}

.rail-button.active,
.rail-button:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent);
}

.rail-button::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 20;
}

.rail-button:hover::after,
.rail-button:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(2px);
}

.nav-home::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 24px;
  background-color: currentColor;
  -webkit-mask: url("./icons/home.svg") no-repeat center / contain;
  mask: url("./icons/home.svg") no-repeat center / contain;
}

.nav-multi::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 24px;
  background-color: currentColor;
  -webkit-mask: url("./icons/multi.svg") no-repeat center / contain;
  mask: url("./icons/multi.svg") no-repeat center / contain;
}

.nav-frok::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 24px;
  background-color: currentColor;
  -webkit-mask: url("./icons/frok.svg") no-repeat center / contain;
  mask: url("./icons/frok.svg") no-repeat center / contain;
}

.nav-sync::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 24px;
  background-color: currentColor;
  -webkit-mask: url("./icons/sync.svg") no-repeat center / contain;
  mask: url("./icons/sync.svg") no-repeat center / contain;
}

.nav-db::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 24px;
  background-color: currentColor;
  -webkit-mask: url("./icons/db.svg") no-repeat center / contain;
  mask: url("./icons/db.svg") no-repeat center / contain;
}

.theme-toggle::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 22px;
  background-color: currentColor;
}

.language-toggle {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.theme-toggle.theme-light::before {
  -webkit-mask: url("./icons/moon.svg") no-repeat center / contain;
  mask: url("./icons/moon.svg") no-repeat center / contain;
}

.theme-toggle.theme-dark::before {
  -webkit-mask: url("./icons/sun.svg") no-repeat center / contain;
  mask: url("./icons/sun.svg") no-repeat center / contain;
}

.rail-bottom {
  margin-top: auto;
}

.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #fbfcfe;
  padding: 22px 18px 20px;
  overflow: hidden;
}

:root[data-theme="dark"] .sidebar {
  background: #171e28;
}

.sidebar-title {
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 750;
}

.workspace-path-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.folder-icon,
.search-icon {
  color: var(--muted);
  font-size: 16px;
}

.folder-icon::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  background-color: currentColor;
  -webkit-mask: url("./icons/folder.svg") no-repeat center / contain;
  mask: url("./icons/folder.svg") no-repeat center / contain;
}

.search-icon::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  background-color: currentColor;
  -webkit-mask: url("./icons/search.svg") no-repeat center / contain;
  mask: url("./icons/search.svg") no-repeat center / contain;
}

#pathInput {
  height: 30px;
  border: 0;
  background: #dfddddad;
  padding: 8px;
  color: var(--muted);
  font-size: 13px;
  box-shadow: none;
}

.scan-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.filter-wrap {
  position: relative;
  margin-top: 20px;
}

.filter-wrap .search-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
}

#filterInput {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 35px;
  font-size: 13px;
}

.repo-section-label {
  margin: 22px 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.sidebar-repo-list {
  display: grid;
  gap: 6px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.sidebar-repo {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 8px 8px 8px 12px;
  text-align: left;
}

.sidebar-repo.active {
  background: var(--accent-soft);
}

.sidebar-repo-copy {
  min-width: 0;
}

.sidebar-repo-copy strong,
.sidebar-repo-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-repo-copy strong {
  font-size: 14px;
}

.sidebar-repo-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.repo-badge {
  min-width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 12px;
}

.chevron {
  color: var(--muted);
  font-size: 20px;
}

.add-repo {
  margin-top: auto;
}

.detail {
  height: 100vh;
  min-width: 0;
  background: var(--surface);
  padding: 18px 24px 28px;
  overflow: auto;
}

.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(11, 111, 243, 0.22);
}

.primary:hover:not(:disabled) {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.secondary {
  background: var(--surface);
}

.danger {
  border-color: color-mix(in srgb, var(--danger) 30%, var(--line));
  background: var(--danger-soft);
  color: var(--danger);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.branch-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.detail-stack {
  display: grid;
  gap: 18px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel h2,
.panel-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 760;
}

.panel-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.status-grid {
  display: grid;
  gap: 18px;
  margin-top: 16px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 18px;
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
}

.action-panel {
  padding-top: 18px;
}

.action-header {
  align-items: center;
  margin-bottom: 14px;
  flex-direction: row;
  display: flex;
  gap: 16px;
  justify-content: flex-start;
}

.action-header p {
  overflow-wrap: anywhere;
}

.actions {
  display: grid;
  gap: 12px;
}

.action-row {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.action-row-commit input {
  flex: 1 1 360px;
}

.action-row-secondary {
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.action-group-snapshot {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 78%, var(--surface));
}

.action-group-snapshot button {
  min-width: 132px;
}

.actions button {
  min-height: 36px;
}

.actions input {
  min-width: 0;
  height: 36px;
  padding: 0 12px;
}

.repo-message {
  min-height: 18px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.working-tree-layout {
  display: grid;
  gap: 20px;
  margin-top: 16px;
  align-items: start;
}

.working-tree-layout.mode-split {
  grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
}

.working-tree-layout.mode-hidden {
  grid-template-columns: 1fr;
}

.working-tree-layout.mode-full {
  grid-template-columns: 1fr;
}

.working-tree-sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.working-tree-layout.mode-full .working-tree-sidebar {
  display: none;
}

.file-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 0;
  overflow: hidden;
}

.file-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-soft) 72%, var(--surface));
  padding: 11px 14px;
}

.file-card-toggle-hit {
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 1 1 auto;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
}

.file-card-toggle-hit:hover:not(:disabled),
.file-card-toggle-hit:focus-visible {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.file-card-summary {
  display: grid;
  gap: 4px;
}

.file-card-header:hover {
  background: color-mix(in srgb, var(--surface-soft) 88%, var(--surface));
}

.file-card-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.file-card-count {
  display: inline-block;
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.1;
}

.file-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.file-card-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.file-card-actions button {
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 700;
}

.file-card-toggle {
  width: 26px;
  min-width: 26px;
  min-height: 26px;
  display: inline-grid;
  place-items: center;
  font-size: 13px;
  color: var(--muted);
}

.file-row-list {
  display: grid;
  gap: 0;
  max-height: 260px;
  overflow: auto;
}

.tree-node {
  display: grid;
}

.tree-row {
  min-height: 26px;
  display: grid;
  grid-template-columns: 14px 14px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 0 12px 0 calc(12px + (var(--depth, 0) * 16px));
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.tree-dir-row {
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  background: color-mix(in srgb, var(--surface-soft) 46%, var(--surface));
}

.tree-caret,
.tree-folder {
  color: var(--faint);
}

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

.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
  background: var(--surface);
  padding: 0 10px 0 calc(12px + (var(--depth, 0) * 16px));
  min-height: 30px;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.file-row:hover,
.file-row.active {
  background: color-mix(in srgb, var(--accent-soft) 42%, var(--surface));
}

.file-row:last-child {
  border-bottom: 0;
}

.file-main {
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 14px auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 4px 0;
  text-align: left;
}

.file-main:hover:not(:disabled) {
  border-color: transparent;
  background: transparent;
}

.tree-spacer {
  width: 14px;
  height: 14px;
  display: inline-block;
}

.file-main-status {
  min-width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  flex-shrink: 0;
}

.file-row[data-scope="unstaged"] .file-main-status {
  color: #9a6700;
  background: #fff5d6;
}

.file-row[data-scope="staged"] .file-main-status {
  color: #116329;
  background: #e6f6ea;
}

.file-row[data-scope="untracked"] .file-main-status {
  color: var(--accent);
  background: var(--accent-soft);
}

.file-main-copy {
  min-width: 0;
  display: block;
}

.file-main-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 550;
  color: var(--text);
}

.file-row-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  justify-content: flex-end;
}

.file-row:hover .file-row-actions,
.file-row.active .file-row-actions {
  opacity: 1;
  pointer-events: auto;
}

.file-action-button {
  width: 22px;
  min-width: 22px;
  min-height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.file-action-button:hover:not(:disabled) {
  background: var(--surface-soft);
  color: var(--text);
}

.danger-text {
  color: var(--danger);
}

.action-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.action-view {
  -webkit-mask-image: url("./icons/view.svg");
  mask-image: url("./icons/view.svg");
}

.action-stage,
.action-add {
  -webkit-mask-image: url("./icons/stage.svg");
  mask-image: url("./icons/stage.svg");
}

.action-discard {
  -webkit-mask-image: url("./icons/discard.svg");
  mask-image: url("./icons/discard.svg");
}

.action-unstage {
  -webkit-mask-image: url("./icons/unstage.svg");
  mask-image: url("./icons/unstage.svg");
}

.action-delete {
  -webkit-mask-image: url("./icons/delete.svg");
  mask-image: url("./icons/delete.svg");
}

.action-ignore {
  -webkit-mask-image: url("./icons/ignore.svg");
  mask-image: url("./icons/ignore.svg");
}

.file-list-empty-card {
  min-height: 160px;
  display: grid;
  place-items: center;
  margin: 12px;
  border: 1px dashed color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 10px;
  color: var(--faint);
  font-size: 13px;
}

.preview-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
  align-self: stretch;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-soft) 72%, var(--surface));
  padding: 12px 16px;
}

.preview-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.preview-toggle {
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-toggle.active {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
}

.preview-body {
  min-height: 520px;
  max-height: 720px;
  overflow: auto;
  background: color-mix(in srgb, var(--surface-soft) 58%, var(--surface));
}

.preview-error {
  padding: 16px;
  color: var(--danger);
  font-size: 13px;
}

.preview-code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  padding: 10px 0;
}

.preview-line {
  padding: 0 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.preview-line.added {
  background: rgba(46, 184, 74, 0.08);
  color: #0f7a2f;
}

.preview-line.removed {
  background: rgba(239, 52, 52, 0.08);
  color: #b01f1f;
}

.preview-line.meta {
  background: color-mix(in srgb, var(--surface-soft) 82%, var(--surface));
  color: var(--muted);
}

:root[data-theme="dark"] .preview-line.added {
  color: #84e29a;
}

:root[data-theme="dark"] .preview-line.removed {
  color: #ff9b9b;
}

.branch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.branch-block {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 13px;
}

.branch-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
  margin-top: 10px;
}

.branch-chip,
.branch-empty {
  display: inline-flex;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  padding: 2px 10px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.branch-chip.active {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
  opacity: 1;
}

.branch-empty {
  color: var(--faint);
}

.repo-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
  background: var(--faint);
}

.dot-clean {
  background: var(--ok);
}

.dot-dirty,
.dot-diverged,
.dot-error {
  background: var(--danger);
}

.dot-ahead,
.dot-behind,
.dot-no_remote {
  background: var(--warning);
}

.status-clean {
  border-color: color-mix(in srgb, var(--ok) 28%, var(--line));
  background: #ecfdf3;
  color: #128237;
}

.status-dirty,
.status-diverged,
.status-error {
  border-color: color-mix(in srgb, var(--danger) 28%, var(--line));
  background: var(--danger-soft);
  color: var(--danger);
}

.status-ahead,
.status-behind,
.status-no_remote {
  border-color: color-mix(in srgb, var(--warning) 28%, var(--line));
  background: #fff7e8;
  color: #b26200;
}

.non-git-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.non-git-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.non-git-name {
  margin: 0 0 5px;
  color: var(--text);
  font-weight: 750;
}

.non-git-path {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.empty,
.empty-state {
  min-height: 160px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
}

.error-box {
  margin-top: 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 38%, var(--line));
  border-radius: 6px;
  background: var(--danger-soft);
  color: var(--danger);
  padding: 10px 12px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  .app-layout {
    grid-template-columns: 60px 280px minmax(0, 1fr);
  }

  .working-tree-layout {
    grid-template-columns: 1fr;
  }

  .actions {
    gap: 10px;
  }

  .action-row,
  .action-row-secondary {
    flex-direction: column;
    align-items: stretch;
  }

  .action-group,
  .action-group-snapshot {
    width: 100%;
  }

  .action-group button,
  .action-group-snapshot button {
    flex: 1 1 140px;
  }

  .preview-body {
    min-height: 320px;
  }
}

@media (max-width: 820px) {
  .app-layout {
    grid-template-columns: 1fr;
    width: 100%;
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .rail {
    flex-direction: row;
    justify-content: center;
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px;
    overflow: visible;
  }

  .rail-bottom {
    margin-top: 0;
    margin-left: auto;
  }

  .sidebar {
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  .detail {
    height: auto;
    padding: 20px 16px 28px;
  }

  .action-header {
    flex-direction: column;
    align-items: stretch;
  }

  .status-grid,
  .branch-grid {
    grid-template-columns: 1fr;
  }

  .working-tree-layout {
    grid-template-columns: 1fr;
  }

  .file-row-actions {
    opacity: 1;
    pointer-events: auto;
  }

  .file-card-header,
  .file-row {
    gap: 10px;
  }

  .file-row-actions {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 540px) {
  .action-group,
  .action-group-snapshot {
    display: grid;
    grid-template-columns: 1fr;
  }
}
