/* ------------------------------------------------------------------
   GitMap — components: buttons, inputs, tabs, cards, overlays, chrome
   ------------------------------------------------------------------ */

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
  font-size: var(--fs-sm);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none !important;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.btn:hover { background: var(--surface-hover); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 600;
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, white); border-color: transparent; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--ink); border-color: transparent; }

.btn-icon { width: 36px; padding: 0; color: var(--ink-2); background: transparent; border-color: transparent; }
.btn-icon:hover { color: var(--ink); background: var(--surface-hover); }
.btn-icon.is-active { color: var(--accent); background: var(--accent-soft); }

.btn-sm { height: 30px; padding: 0 10px; font-size: var(--fs-xs); border-radius: var(--radius-sm); }
.btn-sm.btn-icon { width: 30px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  transition: all var(--dur-fast) var(--ease-out);
}
.chip:hover { color: var(--ink); border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.chip.is-active { color: var(--ink); border-color: var(--accent); background: var(--accent-soft); }

.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}
.seg button {
  height: 28px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-size: var(--fs-xs);
  font-weight: 500;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { color: var(--ink); }
.seg button.is-active { color: var(--ink); background: var(--surface-hover); }

/* ---------- inputs ---------- */

.input {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-2-soft); }
.input::placeholder { color: var(--ink-3); }

.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search svg { position: absolute; left: 10px; color: var(--ink-3); pointer-events: none; }
.search input { padding-left: 32px; width: 100%; }
.search kbd {
  position: absolute; right: 8px;
  padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px;
  font-size: 10px; color: var(--ink-3); background: var(--bg-2);
}

/* ---------- repo header ---------- */

.repo-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px 6px;
  animation: fade-up var(--dur-slow) var(--ease-out) both;
}
.repo-avatar {
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  object-fit: cover;
}
.repo-title { display: flex; flex-direction: column; min-width: 0; }
.repo-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.repo-name .owner { color: var(--ink-3); font-weight: 500; }
.repo-name .owner::after { content: "/"; margin: 0 4px; color: var(--ink-3); }
.repo-badge {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-2); background: var(--surface);
  letter-spacing: 0.02em;
}
.repo-desc { color: var(--ink-2); font-size: var(--fs-sm); max-width: 72ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repo-meta { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.repo-stat {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-2);
  font-size: var(--fs-xs); font-variant-numeric: tabular-nums;
}
.repo-stat svg { color: var(--ink-3); }
.repo-stat strong { color: var(--ink); font-weight: 600; }

/* ---------- view tabs ---------- */

.viewtabs {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 0 20px;
  height: var(--tabs-h);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  animation: fade-up var(--dur-slow) 60ms var(--ease-out) both;
}
.viewtab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.viewtab svg { opacity: 0.8; }
.viewtab kbd {
  font-size: 10px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px;
  opacity: 0; transition: opacity var(--dur-fast);
}
.viewtab:hover { color: var(--ink); background: var(--surface); }
.viewtab:hover kbd { opacity: 1; }
.viewtab.is-active { color: var(--ink); }
.viewtab.is-active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
  background: var(--accent); border-radius: 2px 2px 0 0;
}
.viewtabs-spacer { flex: 1; }
.viewtabs .tools { display: flex; align-items: center; gap: 6px; padding-bottom: 6px; }

/* ---------- stage + map sheet ---------- */

.workspace {
  position: absolute; inset: 0;
  display: grid;
  grid-template-rows: auto var(--tabs-h) 1fr var(--status-h);
  min-height: 0;
}

.stage {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  min-height: 0;
  padding: 14px 20px 14px;
  gap: 14px;
}

.sheet {
  position: relative;
  min-width: 0; min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--sheet);
  overflow: hidden;
  animation: fade-in var(--dur-slow) 120ms var(--ease-out) both;
}
.sheet-corner {
  position: absolute; width: 14px; height: 14px; z-index: 3; pointer-events: none;
  border-color: var(--line-strong); border-style: solid; border-width: 0;
}
.sheet-corner.tl { top: 8px; left: 8px; border-top-width: 1px; border-left-width: 1px; }
.sheet-corner.tr { top: 8px; right: 8px; border-top-width: 1px; border-right-width: 1px; }
.sheet-corner.bl { bottom: 8px; left: 8px; border-bottom-width: 1px; border-left-width: 1px; }
.sheet-corner.br { bottom: 8px; right: 8px; border-bottom-width: 1px; border-right-width: 1px; }

.view-root { position: absolute; inset: 0; min-height: 0; }

.view {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  min-height: 0;
  animation: fade-in var(--dur) var(--ease-out) both;
}
.view.is-leaving { animation: fade-in var(--dur-fast) var(--ease-out) reverse both; }
.view-scroll { overflow: auto; flex: 1; min-height: 0; }

.view-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--sheet) 80%, transparent);
  backdrop-filter: blur(8px);
  z-index: 2;
  min-height: 48px;
}
.view-toolbar .spacer { flex: 1; }
.view-toolbar .hint { color: var(--ink-3); font-size: var(--fs-xs); }

.crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; overflow: hidden; }
.crumb {
  border: 0; background: transparent; color: var(--ink-2); padding: 4px 6px; border-radius: 4px;
  font-family: var(--font-mono); font-size: var(--fs-xs); white-space: nowrap;
}
.crumb:hover { color: var(--ink); background: var(--surface-hover); }
.crumb.is-current { color: var(--ink); font-weight: 500; }
.crumb-sep { color: var(--ink-3); font-size: var(--fs-xs); }

.viz { flex: 1; min-height: 0; position: relative; }
.viz svg { width: 100%; height: 100%; display: block; }
.viz canvas { width: 100%; height: 100%; display: block; }

.legend {
  position: absolute; left: 14px; bottom: 12px; z-index: 2;
  display: flex; flex-wrap: wrap; gap: 6px 12px; max-width: 70%;
  padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--sheet) 82%, transparent);
  backdrop-filter: blur(8px);
  font-size: var(--fs-xs); color: var(--ink-2);
  animation: fade-up var(--dur-slow) 200ms var(--ease-out) both;
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-item .pct { color: var(--ink-3); font-variant-numeric: tabular-nums; }

.scalebar {
  position: absolute; right: 14px; bottom: 12px; z-index: 2;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--sheet) 82%, transparent);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-2);
  animation: fade-up var(--dur-slow) 240ms var(--ease-out) both;
}
.scalebar i { display: block; width: 48px; height: 6px; border: 1px solid var(--line-strong); border-top: 0; }

/* ---------- inspector ---------- */

.inspector {
  width: 320px;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: fade-up var(--dur) var(--ease-out) both;
}
.inspector-head {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
}
.inspector-head .swatch { width: 12px; height: 12px; border-radius: 4px; margin-top: 5px; flex: none; }
.inspector-title { min-width: 0; flex: 1; }
.inspector-title h3 { font-size: 1rem; word-break: break-all; }
.inspector-title .path { color: var(--ink-3); font-family: var(--font-mono); font-size: 11px; word-break: break-all; }
.inspector-body { padding: 12px 14px; overflow: auto; flex: 1; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: var(--fs-sm); }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.inspector-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 14px; border-top: 1px solid var(--line); }

/* ---------- status bar ---------- */

.statusbar {
  display: flex; align-items: center; gap: 18px;
  padding: 0 20px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
}
.statusbar .status-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.statusbar .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--good); }
.statusbar .dot.warn { background: var(--warn); }
.statusbar .dot.bad { background: var(--bad); }
.statusbar .spacer { flex: 1; }
.statusbar .ratebar { width: 72px; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.statusbar .ratebar i { display: block; height: 100%; background: var(--accent-2); transition: width var(--dur-slow) var(--ease-out); }

/* ---------- cards & tiles ---------- */

.cards {
  display: grid;
  gap: 14px;
  padding: 16px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}
.card {
  grid-column: span 12;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(6px);
  padding: 16px;
  min-width: 0;
  animation: fade-up var(--dur-slow) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 50ms);
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { font-size: 0.95rem; font-weight: 600; }
.card-head .sub { color: var(--ink-3); font-size: var(--fs-xs); }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
@media (max-width: 1100px) {
  .span-3, .span-4 { grid-column: span 6; }
  .span-5, .span-7, .span-8 { grid-column: span 12; }
}
@media (max-width: 720px) {
  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
}

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tile {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-2);
  min-width: 0;
}
.tile .label { color: var(--ink-3); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; }
.tile .value {
  font-family: var(--font-display);
  font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1;
  margin-top: 4px; font-variant-numeric: tabular-nums;
}
.tile .value small { font-size: 0.55em; color: var(--ink-3); font-weight: 500; margin-left: 2px; }
.tile .sub { color: var(--ink-3); font-size: var(--fs-xs); margin-top: 2px; }

.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 180px) 1fr auto; gap: 10px; align-items: center; font-size: var(--fs-sm); }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.bar-row .name i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.bar-row .track { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 4px; background: var(--accent-2); width: 0; transition: width 900ms var(--ease-out); }
.bar-row .val { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: var(--fs-xs); white-space: nowrap; }
.bar-row.is-link { cursor: pointer; border-radius: 6px; }
.bar-row.is-link:hover .name { color: var(--accent); }

.list { display: grid; gap: 2px; }
.list-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  transition: background var(--dur-fast);
}
.list-row:hover { background: var(--surface-hover); }
.list-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .dim { color: var(--ink-3); font-size: var(--fs-xs); white-space: nowrap; }
.avatar { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-2); flex: none; }

.empty {
  display: grid; place-items: center; text-align: center;
  padding: 40px 20px; color: var(--ink-3); font-size: var(--fs-sm);
  gap: 8px;
}
.empty strong { color: var(--ink-2); font-weight: 500; }

/* ---------- check list ---------- */
.checks { display: grid; gap: 6px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius-sm); font-size: var(--fs-sm); }
.check-row:hover { background: var(--surface-hover); }
.check-row .mark { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 11px; font-weight: 700; }
.check-row.ok .mark { background: color-mix(in srgb, var(--good) 20%, transparent); color: var(--good); }
.check-row.miss .mark { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.check-row .detail { margin-left: auto; color: var(--ink-3); font-size: var(--fs-xs); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }

.score-ring { display: flex; align-items: center; gap: 16px; }
.score-ring svg { width: 92px; height: 92px; flex: none; }
.score-ring .big { font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.score-ring .grade { color: var(--ink-3); font-size: var(--fs-sm); }

/* ---------- loader ---------- */

.loader {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(10px);
  animation: fade-in var(--dur) var(--ease-out) both;
}
.loader-card {
  width: min(460px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px 22px 18px;
  animation: fade-up var(--dur-slow) var(--ease-out) both;
}
.loader-title { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.loader-title h2 { font-size: 1.1rem; }
.loader-title .mono { color: var(--ink-3); font-size: var(--fs-sm); }
.loader-ring { position: relative; width: 28px; height: 28px; flex: none; }
.loader-ring::before, .loader-ring::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--accent); opacity: 0.5;
  animation: pulse-ring 1.6s var(--ease-out) infinite;
}
.loader-ring::after { animation-delay: 0.8s; }
.loader-ring i { position: absolute; inset: 9px; border-radius: 50%; background: var(--accent); }
.loader-steps { display: grid; gap: 8px; }
.loader-step { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: var(--fs-sm); transition: color var(--dur) var(--ease-out); }
.loader-step .ico { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; }
.loader-step.is-active { color: var(--ink); }
.loader-step.is-active .ico { border-color: var(--accent); border-top-color: transparent; animation: spin 0.9s linear infinite; }
.loader-step.is-done { color: var(--ink-2); }
.loader-step.is-done .ico { border-color: var(--good); background: color-mix(in srgb, var(--good) 20%, transparent); }
.loader-step.is-done .ico::after { content: "✓"; color: var(--good); font-size: 10px; font-weight: 700; }
.loader-step.is-skip .ico { border-style: dashed; }
.loader-step .note { margin-left: auto; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-3); }
.loader-bar { height: 3px; border-radius: 2px; background: var(--line); margin-top: 16px; overflow: hidden; }
.loader-bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width var(--dur-slow) var(--ease-out); }
.loader-foot { margin-top: 12px; display: flex; justify-content: space-between; align-items: center; color: var(--ink-3); font-size: var(--fs-xs); }

/* ---------- toasts ---------- */

.toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  display: grid; gap: 8px; width: min(380px, calc(100vw - 32px));
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-2);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: var(--fs-sm);
  animation: fade-up var(--dur) var(--ease-out) both;
}
.toast.error { border-left-color: var(--bad); }
.toast.warn { border-left-color: var(--warn); }
.toast.success { border-left-color: var(--good); }
.toast .grow { flex: 1; }
.toast .title { font-weight: 600; }
.toast .body { color: var(--ink-2); margin-top: 2px; }
.toast .body a { color: var(--accent); }
.toast .close { border: 0; background: transparent; color: var(--ink-3); padding: 0 2px; font-size: 16px; line-height: 1; }
.toast.is-leaving { animation: fade-in var(--dur-fast) var(--ease-out) reverse both; }

/* ---------- tooltip ---------- */

.tooltip {
  position: fixed; z-index: 70; pointer-events: none;
  max-width: 320px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow-sm);
  font-size: var(--fs-xs);
  color: var(--ink);
  backdrop-filter: blur(8px);
  transition: opacity var(--dur-fast) var(--ease-out);
}
.tooltip .t-title { font-weight: 600; display: flex; align-items: center; gap: 6px; word-break: break-all; }
.tooltip .t-title i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.tooltip .t-path { color: var(--ink-3); font-family: var(--font-mono); font-size: 10.5px; word-break: break-all; margin-top: 1px; }
.tooltip .t-row { display: flex; justify-content: space-between; gap: 14px; color: var(--ink-2); margin-top: 4px; }
.tooltip .t-row b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- dialog ---------- */

.dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  padding: 0;
  width: min(480px, calc(100vw - 32px));
  box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(5, 8, 20, 0.6); backdrop-filter: blur(6px); }
.dialog[open] { animation: fade-up var(--dur) var(--ease-out) both; }
.dialog-body { padding: 18px 20px 20px; display: grid; gap: 18px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
.dialog-head h2 { font-size: 1.15rem; }
.dialog-foot { display: flex; justify-content: flex-end; }
.field { display: grid; gap: 8px; }
.field > label { font-weight: 500; font-size: var(--fs-sm); display: flex; justify-content: space-between; }
.field input[type="text"], .field input[type="password"] {
  height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--bg-2); color: var(--ink); font-family: var(--font-mono); font-size: var(--fs-sm); outline: none;
}
.field input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-2-soft); }
.field input[type="range"] { accent-color: var(--accent); }
.field .help { color: var(--ink-3); font-size: var(--fs-xs); line-height: 1.5; }
.field .check { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--ink-2); }
.field .check input { accent-color: var(--accent); }

/* ---------- menus ---------- */

.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid; gap: 2px;
  animation: fade-up var(--dur-fast) var(--ease-out) both;
}
.menu button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: 34px; padding: 0 10px;
  border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--ink);
  font-size: var(--fs-sm); text-align: left;
}
.menu button:hover { background: var(--surface-hover); }
.menu button svg { color: var(--ink-3); }
.menu .sep { height: 1px; background: var(--line); margin: 4px 0; }
.menu .menu-label { padding: 6px 10px 2px; color: var(--ink-3); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .repo-switcher { display: none; }
  .stage { grid-template-columns: 1fr; padding: 10px 12px; }
  .inspector { position: absolute; right: 12px; top: 10px; bottom: 10px; width: min(320px, calc(100% - 24px)); z-index: 5; box-shadow: var(--shadow); }
  .repo-header { padding: 12px 12px 4px; }
  .repo-desc { white-space: normal; }
  .repo-meta { display: none; }
  .viewtabs { padding: 0 12px; }
  .statusbar { padding: 0 12px; gap: 12px; overflow-x: auto; }
  .legend { max-width: calc(100% - 28px); }
}
