:root {
  --brand: #1677ff;
  --brand-hover: #0958d9;
  --brand-active: #003eb3;
  --brand-soft: #e6f4ff;
  --brand-soft-2: #bae0ff;
  --bg: #f5f6f8;
  --bg-subtle: #fafbfc;
  --surface: #ffffff;
  --text: #1f2329;
  --text-secondary: #4e5969;
  --muted: #86909c;
  --border: #e5e6eb;
  --border-strong: #c9cdd4;
  --danger: #f53f3f;
  --danger-hover: #cb2634;
  --danger-soft: #ffece8;
  --danger-border: #fdcdc5;
  --success: #00b42a;
  --success-soft: #e8ffea;
  --success-border: #b7f0bf;
  --warn: #ff7d00;
  --warn-soft: #fff7e8;
  --warn-border: #ffd8a8;
  --radius: 4px;
  --shadow-sm: 0 1px 2px rgba(31, 35, 41, 0.04);
  --shadow-md: 0 6px 16px rgba(31, 35, 41, 0.08);
  --font: "IBM Plex Sans", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
  --topbar-h: 48px;
  --page-w: 1280px;
  --focus: 0 0 0 3px rgba(22, 119, 255, 0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.octicon {
  display: inline-block;
  vertical-align: text-bottom;
  fill: currentColor;
  flex: none;
  pointer-events: none;
}
.icon-muted { color: var(--muted); }
.icon-brand { color: var(--brand); }
.icon-folder { color: #69b1ff; }
.icon-file { color: var(--muted); }

/* ——— Topbar ——— */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
}
.topbar-inner {
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 0 20px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.02em;
  flex: none;
}
.brand:hover { color: var(--text); }
.brand-logo {
  height: 22px;
  width: auto;
  max-width: 140px;
  display: block;
  object-fit: contain;
}
.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
}
.brand-mark .octicon { color: #fff; }
.topbar-search {
  flex: 1;
  min-width: 0;
  max-width: 420px;
  position: relative;
}
.topbar-search form { margin: 0; }
.topbar-search .octicon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.topbar-search input {
  width: 100%;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 36px 0 30px;
  background: var(--bg);
  color: var(--text);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.topbar-search input:hover { border-color: var(--border-strong); }
.topbar-search input:focus {
  background: #fff;
  border-color: var(--brand);
}
.topbar-search .kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.topbar-link {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--radius);
}
.topbar-link:hover { color: var(--text); background: var(--bg); }
.topbar-search-mobile {
  display: none;
  color: var(--text-secondary);
  padding: 6px;
  border-radius: var(--radius);
}
.topbar-search-mobile:hover { background: var(--bg); color: var(--text); }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 8px 0 4px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  color: var(--text);
}
.user-chip:hover { background: var(--bg); border-color: var(--border); }
.user-chip .octicon { color: var(--muted); }
.user-name { color: var(--text); font-weight: 600; }

.avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  flex: none;
  line-height: 1;
}
.avatar-md { width: 40px; height: 40px; font-size: 16px; }
.avatar-lg { width: 64px; height: 64px; font-size: 24px; }
.avatar-inline { width: 18px; height: 18px; font-size: 10px; }

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 3px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-family: var(--mono);
  line-height: 1;
}

/* ——— Layout ——— */
.page {
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 20px 20px 48px;
  width: 100%;
  flex: 1;
}
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}
.site-footer-inner {
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 12px;
}
.page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  flex-wrap: wrap;
}
.page-header h1,
.auth-panel h1,
.commit-header h1 { margin: 0 0 4px; font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.page-kicker {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 4px;
  font-weight: 500;
}
.muted { color: var(--muted); }
.text-secondary { color: var(--text-secondary); }
.mono { font-family: var(--mono); font-size: 12px; }
.nowrap { white-space: nowrap; }
.truncate { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { border-color: #a9aeb8; background: var(--bg-subtle); color: var(--text); }
.btn:active { background: var(--bg); }
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: none;
}
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn-primary:active { background: var(--brand-active); }
.btn:disabled,
.btn[aria-busy="true"] {
  opacity: 0.55;
  cursor: wait;
  pointer-events: none;
}
.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  box-shadow: none;
}
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); color: #fff; }
.btn-danger-ghost {
  background: #fff;
  border-color: var(--danger-border);
  color: var(--danger);
}
.btn-danger-ghost:hover { background: var(--danger-soft); color: var(--danger); }
.btn-sm { height: 24px; padding: 0 8px; font-size: 12px; }
.btn-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  box-shadow: var(--shadow-sm);
}
.btn-icon:hover { background: var(--bg-subtle); color: var(--text); border-color: var(--border-strong); }
.btn-icon-danger:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.btn-icon:disabled { opacity: 0.45; cursor: not-allowed; }
.file-row-name {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.file-row-name .file-link {
  flex: 1;
  min-width: 0;
}
.file-copy-direct {
  flex: none;
  opacity: 0.55;
}
.file-row-name:hover .file-copy-direct,
.file-copy-direct:focus-visible {
  opacity: 1;
}
.file-table .col-check { width: 36px; padding-left: 10px; padding-right: 4px; }
.file-table .col-check input { margin: 0; vertical-align: middle; }
.btn-block { width: 100%; }
.btn-ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg); color: var(--text); border-color: transparent; }
.link-btn {
  background: none;
  border: none;
  color: var(--brand);
  cursor: pointer;
  font: inherit;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.link-btn:hover { color: var(--brand-hover); }
.link-btn.danger { color: var(--danger); }
.link-btn.danger:hover { color: var(--danger-hover); }
.inline-form { display: inline; margin: 0; }

/* ——— Panels / toolbar / table ——— */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.layout-narrow {
  max-width: 720px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.layout-narrow > .panel { margin-bottom: 16px; }
.layout-narrow > .panel:last-child { margin-bottom: 0; }
.panel.center { text-align: center; padding: 48px 24px; }
.panel-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-subtle);
  min-height: 40px;
}
.panel-header h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-body { padding: 14px; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  min-height: 40px;
  flex-wrap: wrap;
}
.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}
.toolbar-title { font-weight: 600; font-size: 13px; }
.toolbar-meta { color: var(--muted); font-size: 12px; }
.filter-input {
  height: 26px;
  width: 200px;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 8px 0 28px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2386909c'%3E%3Cpath d='M10.68 11.74a6 6 0 1 1 1.06-1.06l3.04 3.04a.75.75 0 1 1-1.06 1.06zM11.5 7a4.5 4.5 0 1 0-9 0 4.5 4.5 0 0 0 9 0z'/%3E%3C/svg%3E") 7px 50% no-repeat;
}
.filter-input:focus { border-color: var(--brand); outline: none; box-shadow: var(--focus); }

.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.seg button, .seg a {
  height: 26px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  border-right: 1px solid var(--border);
}
.seg button:last-child, .seg a:last-child { border-right: 0; }
.seg button:hover, .seg a:hover { background: var(--bg); color: var(--text); }
.seg .is-active {
  background: var(--brand-soft);
  color: var(--brand);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th,
.data-table td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
.data-table th {
  background: var(--bg-subtle);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}
.data-table tbody tr:hover td { background: #f7f8fa; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .empty, .data-table .empty-row td { text-align: center; color: var(--muted); padding: 32px 12px; }
.data-table tbody tr.commit-group:hover td { background: transparent; }
.data-table tbody tr.commit-group td {
  padding: 0;
  border-bottom: 0;
  background: transparent;
  vertical-align: middle;
}
.data-table tbody tr.commit-group:not(:first-child) .commit-group-title {
  margin-top: 8px;
  border-top: 1px solid var(--border);
}
.file-table td:first-child { font-family: var(--mono); font-size: 12.5px; }
.file-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.file-link:hover { color: var(--brand); }
.file-link.dir { font-weight: 600; color: var(--text); }
.parent-row td { background: var(--bg-subtle); }

.table-wrap { overflow-x: auto; }

/* ——— Badges ——— */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  height: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  text-transform: none;
  vertical-align: middle;
  line-height: 1;
}
.badge-warn { color: var(--warn); border-color: var(--warn-border); background: var(--warn-soft); }
.badge-ok { color: var(--success); border-color: var(--success-border); background: var(--success-soft); }
.badge-fail { color: var(--danger); border-color: var(--danger-border); background: var(--danger-soft); }
.badge-admin { color: var(--brand); border-color: var(--brand-soft-2); background: var(--brand-soft); }
.badge-public { color: #00b42a; border-color: var(--success-border); background: var(--success-soft); }
.badge-private { color: var(--warn); border-color: var(--warn-border); background: var(--warn-soft); }

/* ——— Tabs ——— */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  padding: 0 4px;
}
.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  font-weight: 500;
  white-space: nowrap;
  margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); }
.tabs a.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* ——— Repo header ——— */
.repo-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  align-items: flex-start;
}
.repo-title {
  font-size: 20px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  letter-spacing: -0.02em;
}
.repo-title .sep { color: var(--muted); font-weight: 400; }
.repo-title a { color: var(--brand); }
.repo-desc { margin: 6px 0 0; color: var(--text-secondary); max-width: 720px; }
.repo-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12.5px;
}
.breadcrumbs .sep { color: var(--muted); }
.breadcrumbs strong { font-weight: 650; }

.branch-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
}
.branch-select .octicon { color: var(--muted); }
.branch-select select {
  border: 0;
  background: transparent;
  height: 26px;
  padding: 0;
  min-width: 96px;
  max-width: 180px;
  font-weight: 600;
}
.branch-select select:focus { outline: none; box-shadow: none; }

.last-commit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: #f8fbff;
  min-height: 40px;
  flex-wrap: wrap;
}
.last-commit-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.last-commit-msg {
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 560px;
}
.last-commit-msg:hover { color: var(--brand); }

.sha-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid transparent;
  border-radius: var(--radius);
  height: 22px;
  padding: 0 6px;
  cursor: pointer;
}
.sha-chip:hover { border-color: var(--brand-soft-2); color: var(--brand-hover); }

/* ——— Dropdown ——— */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 240px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 50;
  padding: 6px 0;
}
.dropdown-menu-right { left: auto; right: 0; }
.dropdown.is-open .dropdown-menu { display: block; }
.dropdown-label {
  padding: 6px 12px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  color: var(--text);
  font-weight: 500;
}
.dropdown-item:hover { background: var(--bg); color: var(--text); }
button.dropdown-item {
  width: 100%;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.dropdown-item.is-danger { color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 0; }
.dropdown-user {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.dropdown-user .name { font-weight: 650; }
.dropdown-user .handle { color: var(--muted); font-size: 12px; }
.clone-menu {
  width: min(360px, calc(100vw - 32px));
  padding: 10px;
  box-sizing: border-box;
}
.clone-menu .clone-box {
  margin: 0 0 8px;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  max-width: 100%;
  box-sizing: border-box;
}
.clone-menu .clone-box code {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.45;
}
.clone-menu .clone-box .btn {
  width: 100%;
  justify-content: center;
}
.clone-menu .dropdown-item { margin: 0 -10px; width: calc(100% + 20px); }

.copy-link-dropdown--compact { display: inline-flex; vertical-align: middle; }
.copy-link-dropdown--compact .dropdown-menu { min-width: 11rem; }
.dropdown-hint {
  padding: 6px 12px 10px;
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* ——— Forms ——— */
.form { padding: 16px; }
.form-row { margin-bottom: 14px; }
.form-row:last-child { margin-bottom: 0; }
.form-row label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--text);
}
.form-hint { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.upload-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  text-align: center;
  cursor: pointer;
  color: var(--text);
}
.upload-dropzone strong { font-size: 13px; }
.upload-dropzone .muted { max-width: 420px; }
.upload-dropzone.is-dragover {
  border-color: var(--brand);
  background: var(--brand-soft, #f0f6ff);
  box-shadow: var(--focus);
}
.upload-dropzone-icon .octicon { width: 24px; height: 24px; color: var(--muted); }
.upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-file-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.upload-file-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font-size: 12px;
}
.upload-file-list .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-file-list .size { color: var(--muted); flex: none; }
.form-row input:not([type]),
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row input[type="search"],
.form-row input[type="url"],
.form-row input[type="number"],
.form-row input[type="tel"],
.form-row textarea,
.select,
.inline-create input:not([type="hidden"]),
.name-combo input {
  width: 100%;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 10px;
  background: #fff;
  transition: border-color .12s, box-shadow .12s;
}
.form-row textarea { height: auto; min-height: 72px; padding: 8px 10px; resize: vertical; }
.form-row input[type="file"] {
  display: block;
  width: 100%;
  font-size: 13px;
  padding: 6px 0;
}
.inline-check {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
  font-weight: 400;
  color: var(--muted);
  cursor: pointer;
}
.inline-check input { margin: 0; }
.asset-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.asset-preview img {
  display: block;
  max-height: 48px;
  max-width: 160px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px;
}
.asset-preview.is-favicon img {
  width: 32px;
  height: 32px;
  max-width: 32px;
  max-height: 32px;
  padding: 2px;
}
.form-row input:not([type]):hover,
.form-row input[type="text"]:hover,
.form-row input[type="email"]:hover,
.form-row input[type="password"]:hover,
.form-row input[type="search"]:hover,
.form-row input[type="url"]:hover,
.form-row input[type="number"]:hover,
.form-row input[type="tel"]:hover,
.select:hover,
.inline-create input:hover {
  border-color: var(--border-strong);
}
.form-row input:not([type]):focus,
.form-row input[type="text"]:focus,
.form-row input[type="email"]:focus,
.form-row input[type="password"]:focus,
.form-row input[type="search"]:focus,
.form-row input[type="url"]:focus,
.form-row input[type="number"]:focus,
.form-row input[type="tel"]:focus,
.select:focus,
.inline-create input:focus,
.name-combo input:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: var(--focus);
}
.select { width: auto; min-width: 140px; height: 28px; }
.form-row .select { width: 100%; height: 32px; }
.select-sm { height: 26px; min-width: 110px; font-size: 12px; }
.radio-group { display: flex; gap: 16px; flex-wrap: wrap; }
.radio-group label { font-weight: 400; display: flex; align-items: center; gap: 6px; margin: 0; }

.choice-grid { display: grid; gap: 8px; }
@media (min-width: 640px) {
  .choice-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.choice-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer;
  background: #fff;
}
.choice-card:hover { border-color: var(--brand-soft-2); }
.choice-card:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.choice-card input { margin-top: 3px; }
.choice-card strong { display: block; }
.choice-card span { color: var(--muted); font-size: 12px; }

.name-combo {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.name-combo .prefix {
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border-right: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}
.name-combo input { border: 0; border-radius: 0; box-shadow: none; }
.name-combo:focus-within { border-color: var(--brand); box-shadow: var(--focus); }
.form-hint code {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 4px;
}
[data-repo-create] [data-github-fields] { display: none; }
[data-repo-create]:has([data-repo-source][value="github"]:checked) [data-github-fields] { display: block; }
[data-repo-create]:has([data-repo-source][value="github"]:checked) [data-empty-fields] { display: none; }

/* ——— New repository page ——— */
.repo-create-page {
  max-width: 1040px;
  margin: 0 auto;
  padding-bottom: 8px;
}
.repo-create-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 24px;
  align-items: start;
}
.repo-create-panel {
  margin-bottom: 0;
}
.repo-create-hero {
  margin-bottom: 18px;
  max-width: calc(100% - 304px);
}
@media (max-width: 900px) {
  .repo-create-hero {
    max-width: none;
  }
}
.repo-create-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
  padding: 4px 8px 4px 4px;
  margin-left: -4px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  transition: color .15s, background .15s;
}
.repo-create-back .octicon {
  transform: rotate(90deg);
  opacity: .85;
}
.repo-create-back:hover {
  color: var(--brand);
  background: var(--brand-soft);
}
.repo-create-hero h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.03em;
}
.repo-create-hero__lead {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  max-width: 42em;
}
.repo-create-flash {
  margin-bottom: 14px;
  max-width: calc(100% - 304px);
}
@media (max-width: 900px) {
  .repo-create-flash {
    max-width: none;
  }
}
.repo-create-panel {
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
}
.repo-create-form.form {
  padding: 0;
}
.repo-create-section {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}
.repo-create-section--last {
  border-bottom: 0;
}
.repo-create-section__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.repo-create-section__head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.repo-create-step {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 650;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-soft-2);
  line-height: 1;
}
.repo-create-section__title {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.repo-create-section__desc {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.repo-create-fields {
  display: grid;
  gap: 2px;
}
.repo-create-fields .form-row {
  margin-bottom: 12px;
}
.repo-create-fields .form-row:last-child {
  margin-bottom: 0;
}
.repo-create-optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 11px;
}
.repo-create-input-mono {
  font-family: var(--mono);
  font-size: 12px;
}
.name-combo--repo-create input {
  font-family: var(--mono);
  font-size: 13px;
}
.repo-create-github-wrap {
  padding: 0 22px 20px;
  border-bottom: 1px solid var(--border);
  animation: repoCreateReveal .22s ease;
}
@keyframes repoCreateReveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
.repo-create-inset {
  padding: 16px 16px 4px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--bg-subtle) 0%, #fff 100%);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.repo-create-inset__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 650;
  color: var(--text-secondary);
}
.repo-create-inset__head .octicon {
  color: var(--text);
}
.repo-create-options {
  display: grid;
  gap: 10px;
}
@media (min-width: 560px) {
  .repo-create-options--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.repo-create-option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 14px 12px;
  min-height: 88px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s, transform .12s;
}
.repo-create-option--compact {
  min-height: 76px;
}
.repo-create-option:hover {
  border-color: var(--brand-soft-2);
  box-shadow: var(--shadow-sm);
}
.repo-create-option:has(input:focus-visible) {
  box-shadow: var(--focus);
}
.repo-create-option:has(input:checked) {
  border-color: var(--brand);
  background: linear-gradient(180deg, var(--brand-soft) 0%, #fff 72%);
  box-shadow: 0 0 0 1px rgba(22, 119, 255, 0.12);
}
.repo-create-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.repo-create-option__icon {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.repo-create-option__icon .octicon {
  width: 18px;
  height: 18px;
}
.repo-create-option__icon--empty {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: var(--brand-soft-2);
}
.repo-create-option__icon--github {
  color: var(--text);
  background: #f4f4f5;
}
.repo-create-option__icon--private {
  color: #86909c;
  background: var(--bg-subtle);
}
.repo-create-option__icon--public {
  color: var(--success);
  background: var(--success-soft);
  border-color: var(--success-border);
}
.repo-create-option:has(input:checked) .repo-create-option__icon {
  border-color: rgba(22, 119, 255, 0.25);
}
.repo-create-option__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 22px;
}
.repo-create-option__title {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
}
.repo-create-option__desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.repo-create-option__check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--border);
  color: transparent;
  transition: background .15s, color .15s, transform .15s;
}
.repo-create-option__check .octicon {
  width: 12px;
  height: 12px;
}
.repo-create-option:has(input:checked) .repo-create-option__check {
  background: var(--brand);
  color: #fff;
  transform: scale(1);
}
.repo-create-section--storage .storage-pick-grid {
  margin-top: 2px;
}
.repo-create-storage-hint {
  margin: 12px 0 0;
}
.repo-create-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 16px 22px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
}
.repo-create-foot__note {
  margin: 0;
  flex: 1;
  min-width: 200px;
}
.repo-create-foot__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.repo-create-foot__actions .btn {
  height: 32px;
  min-height: 32px;
  padding: 0 16px;
  box-sizing: border-box;
}
.repo-create-foot__actions .btn-primary {
  font-weight: 600;
}
.repo-create-aside {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.repo-create-tip {
  padding: 14px 16px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.repo-create-tip--muted {
  background: var(--bg-subtle);
  box-shadow: none;
}
.repo-create-tip h3 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}
.repo-create-tip h3 .octicon {
  color: var(--brand);
}
.repo-create-tip--muted h3 .octicon {
  color: var(--text-secondary);
}
.repo-create-tip ul {
  margin: 0;
  padding: 0 0 0 1.1em;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
}
.repo-create-tip li {
  margin-bottom: 6px;
}
.repo-create-tip li:last-child {
  margin-bottom: 0;
}
.repo-create-tip p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}
@media (max-width: 900px) {
  .repo-create-layout {
    grid-template-columns: 1fr;
  }
  .repo-create-aside {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .repo-create-tip {
    flex: 1;
    min-width: min(100%, 260px);
  }
}
@media (max-width: 560px) {
  .repo-create-section {
    padding: 16px;
  }
  .repo-create-github-wrap {
    padding: 0 16px 16px;
  }
  .repo-create-foot {
    padding: 14px 16px;
    flex-direction: column;
    align-items: stretch;
  }
  .repo-create-foot__actions {
    flex-direction: column-reverse;
    width: 100%;
  }
  .repo-create-foot__actions .btn {
    width: 100%;
    justify-content: center;
  }
  .repo-create-options--2 {
    grid-template-columns: 1fr;
  }
}

/* ——— Repository settings ——— */
.repo-settings-page {
  width: 100%;
  max-width: none;
  margin: 0;
}
.repo-settings-layout {
  display: grid;
  grid-template-columns: minmax(168px, 200px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.repo-settings-sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}
.repo-settings-nav-label {
  margin: 0;
  padding: 0 0 8px 4px;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.repo-settings-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 4px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: background .12s, color .12s;
}
.repo-settings-nav-link:hover {
  background: var(--bg);
  color: var(--text);
}
.repo-settings-nav-link.is-active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
.repo-settings-nav-link--danger {
  color: var(--danger);
}
.repo-settings-nav-link--danger:hover {
  background: var(--danger-soft);
  color: var(--danger-hover);
}
.repo-settings-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.repo-settings-hero {
  margin-bottom: 2px;
}
.repo-settings-hero h1 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-family: var(--mono);
}
.repo-settings-hero__lead {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}
.repo-settings-panel {
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 0;
  overflow: hidden;
}
.repo-settings-form.form {
  padding: 0;
}
.repo-settings-section {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}
.repo-settings-section--last {
  border-bottom: 0;
}
.repo-settings-section__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.repo-settings-section__icon {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.repo-settings-section__icon .octicon {
  width: 16px;
  height: 16px;
}
.repo-settings-section__title {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.repo-settings-section__desc {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.repo-settings-section__desc code {
  font-size: 11px;
}
.repo-settings-fields .form-row {
  margin-bottom: 12px;
}
.repo-settings-fields .form-row:last-child {
  margin-bottom: 0;
}
.repo-settings-optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 11px;
}
.repo-settings-select {
  width: 100%;
  max-width: 280px;
  height: 32px;
}
.repo-settings-clone {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
}
.repo-settings-clone__url {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}
.repo-settings-clone__copy {
  flex: none;
  height: 36px;
  align-self: stretch;
}
.repo-settings-toggle {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.repo-settings-toggle:hover {
  border-color: var(--brand-soft-2);
  box-shadow: var(--shadow-sm);
}
.repo-settings-toggle:has(input:checked) {
  border-color: var(--brand);
  background: linear-gradient(180deg, var(--brand-soft) 0%, #fff 70%);
}
.repo-settings-toggle:has(input:focus-visible) {
  box-shadow: var(--focus);
}
.repo-settings-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.repo-settings-toggle__track {
  flex: none;
  width: 40px;
  height: 22px;
  margin-top: 1px;
  border-radius: 99px;
  background: var(--border-strong);
  position: relative;
  transition: background .2s;
}
.repo-settings-toggle__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(31, 35, 41, 0.2);
  transition: transform .2s;
}
.repo-settings-toggle:has(input:checked) .repo-settings-toggle__track {
  background: var(--brand);
}
.repo-settings-toggle:has(input:checked) .repo-settings-toggle__track::after {
  transform: translateX(18px);
}
.repo-settings-toggle__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.repo-settings-toggle__title {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
}
.repo-settings-toggle__desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.repo-settings-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
}
.repo-settings-foot__hint {
  margin: 0;
  flex: 1;
  min-width: 160px;
}
.repo-settings-foot .btn,
.repo-settings-foot--inline .btn {
  height: 32px;
  min-height: 32px;
  padding: 0 16px;
  box-sizing: border-box;
}
.repo-settings-foot--inline {
  margin-top: 16px;
  padding: 14px 0 0;
  background: transparent;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}
.repo-settings-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}
.repo-settings-panel__head--danger {
  background: var(--danger-soft);
  border-bottom-color: var(--danger-border);
}
.repo-settings-panel__head--danger .repo-settings-panel__title {
  color: var(--danger);
}
.repo-settings-panel__title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
}
.repo-settings-panel__subtitle {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}
.repo-settings-panel__body {
  padding: 18px 22px 22px;
}
.repo-settings-panel--storage .repo-storage-current {
  margin-bottom: 16px;
}
.repo-settings-migrate-form.form {
  padding: 0;
}
.repo-settings-callout {
  margin-top: 14px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}
.repo-settings-callout--warn {
  background: var(--warn-soft);
  border-color: var(--warn-border);
  color: var(--text-secondary);
}
.repo-settings-callout a {
  font-weight: 500;
}
.repo-settings-danger-zone {
  scroll-margin-top: calc(var(--topbar-h) + 12px);
}
.repo-settings-danger-zone__shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
  gap: 0;
  border: 1px solid var(--danger-border);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(245, 63, 63, 0.06);
}
.repo-settings-danger-zone__info {
  padding: 20px 22px;
  border-right: 1px solid var(--danger-border);
  background: linear-gradient(180deg, #fff 0%, var(--danger-soft) 140%);
}
.repo-settings-danger-zone__kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 650;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
}
.repo-settings-danger-zone__kicker .octicon {
  width: 14px;
  height: 14px;
}
.repo-settings-danger-zone__title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--danger-hover);
}
.repo-settings-danger-zone__lead {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.repo-settings-danger-zone__bullets {
  margin: 0;
  padding: 0 0 0 1.15em;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.repo-settings-danger-zone__bullets li {
  margin-bottom: 4px;
}
.repo-settings-danger-zone__bullets li:last-child {
  margin-bottom: 0;
}
.repo-settings-danger-zone__form {
  padding: 20px 22px;
  margin: 0;
  background: var(--danger-soft);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}
.repo-settings-danger-zone__confirm-label {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
}
.repo-settings-danger-zone__confirm-label code {
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #fff;
  border: 1px solid var(--danger-border);
  color: var(--danger-hover);
}
.repo-settings-danger-zone__field {
  margin-bottom: 6px;
}
.repo-settings-danger-zone__field input {
  width: 100%;
  height: 36px;
  border-color: var(--danger-border);
  background: #fff;
}
.repo-settings-danger-zone__field input:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(245, 63, 63, 0.15);
}
.repo-settings-danger-zone__form .form-hint {
  margin: 0 0 14px;
}
.repo-settings-danger-zone__submit {
  width: 100%;
  height: 36px;
  justify-content: center;
  font-weight: 600;
}
@media (max-width: 800px) {
  .repo-settings-layout {
    grid-template-columns: 1fr;
  }
  .repo-settings-sidebar {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0 0 8px;
  }
  .repo-settings-nav-label {
    width: 100%;
    padding: 0 0 6px 4px;
  }
  .repo-settings-nav-link {
    padding: 6px 12px 6px 4px;
    font-size: 12px;
  }
  .repo-settings-section,
  .repo-settings-foot {
    padding-left: 16px;
    padding-right: 16px;
  }
  .repo-settings-panel__head,
  .repo-settings-panel__body {
    padding-left: 16px;
    padding-right: 16px;
  }
  .repo-settings-danger-zone__shell {
    grid-template-columns: 1fr;
  }
  .repo-settings-danger-zone__info {
    border-right: 0;
    border-bottom: 1px solid var(--danger-border);
  }
  .repo-settings-danger-zone__info,
  .repo-settings-danger-zone__form {
    padding: 16px;
  }
  .repo-settings-clone {
    flex-direction: column;
  }
  .repo-settings-clone__copy {
    width: 100%;
    justify-content: center;
  }
  .repo-settings-foot--inline {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .repo-settings-foot--inline .btn {
    width: 100%;
    justify-content: center;
  }
}

.inline-create {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  background: #fff;
  align-items: center;
}
.inline-create input { width: auto; flex: 1; min-width: 140px; height: 28px; }
.actions { text-align: right; }
.admin-actions-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ——— Auth / flash / empty ——— */
.auth-body {
  background: #fff;
  min-height: 100vh;
  display: block;
}
.auth-shell {
  display: grid;
  grid-template-columns: minmax(280px, 40%) minmax(0, 1fr);
  min-height: 100vh;
}
.auth-aside {
  background:
    linear-gradient(180deg, #f7f9fc 0%, #eef3f9 100%);
  border-right: 1px solid var(--border);
  padding: 36px 44px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.auth-aside::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.45;
  pointer-events: none;
}
.auth-aside > * { position: relative; }
.auth-aside .brand { font-size: 16px; }
.auth-aside .brand-logo { height: 28px; max-width: 180px; }
.auth-aside-copy { margin-top: 64px; max-width: 360px; }
.auth-aside-kicker {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
}
.auth-aside h2 {
  margin: 0 0 10px;
  font-size: 28px;
  letter-spacing: -0.03em;
  font-weight: 650;
  line-height: 1.25;
}
.auth-aside-copy > p {
  margin: 0 0 24px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}
.auth-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.auth-points li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
}
.auth-points .octicon { color: var(--brand); margin-top: 1px; }
.auth-aside-foot {
  margin-top: auto;
  padding-top: 32px;
  color: var(--muted);
  font-size: 12px;
}
.auth-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px 32px;
  background: #fff;
}
.auth-flash { width: 100%; max-width: 400px; margin-bottom: 16px; }
.auth-card {
  width: 100%;
  max-width: 400px;
}
.auth-card-head { margin-bottom: 20px; }
.auth-card-head h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.03em;
}
.auth-card-head .muted { margin: 0; }
.auth-form { padding: 0; }
.auth-form .form-row input[type="text"],
.auth-form .form-row input[type="email"],
.auth-form .form-row input[type="password"] {
  height: 36px;
  font-size: 14px;
}
.auth-submit {
  height: 36px;
  font-weight: 600;
  margin-top: 4px;
}
.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.label-row label { margin-bottom: 0; }
.field-password { position: relative; }
.field-password input { padding-right: 52px; }
.field-password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  height: 24px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius);
}
.field-password-toggle:hover { background: var(--brand-soft); color: var(--brand-hover); }
.auth-card-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
}
.auth-card-foot p { margin: 0 0 8px; }
.auth-card-foot p:last-child { margin-bottom: 0; }
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.auth-back:hover { color: var(--text); }
.auth-panel {
  max-width: 400px;
  margin: 48px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
}
.auth-panel .form { padding: 0; }
.auth-panel .muted { margin: 0 0 16px; }
.auth-foot { margin: 16px 0 0; }

.flash-wrap { max-width: var(--page-w); margin: 12px auto 0; padding: 0 20px; width: 100%; }
.flash {
  padding: 8px 12px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.flash-success { background: var(--success-soft); border-color: var(--success-border); color: #00801e; }
.flash-error { background: var(--danger-soft); border-color: var(--danger-border); color: #cb2634; }
.flash-warn { background: var(--warn-soft); border-color: var(--warn-border); color: #d25f00; }

.empty, .empty-repo { padding: 36px 20px; color: var(--muted); text-align: center; }
.empty-state {
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
}
.empty-state .octicon { width: 32px; height: 32px; color: var(--border-strong); margin-bottom: 8px; }
.empty-state h2, .empty-state h3 { margin: 0 0 6px; color: var(--text); font-size: 16px; }
.empty-state p { margin: 0 0 14px; }
.empty-repo { text-align: left; padding: 20px; }
.empty-repo h2 { margin: 0 0 6px; color: var(--text); font-size: 16px; }
.empty-steps { display: grid; gap: 16px; margin-top: 16px; }
.empty-step h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.empty-upload-cta {
  margin: 0 0 20px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.empty-upload-cta h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.empty-upload-cta .btn { margin-top: 4px; }

.clone-box {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  margin: 8px 0 12px;
}
.clone-box .btn { flex: none; }

/* ——— Code / README ——— */
.code-block {
  margin: 0;
  padding: 12px 14px;
  background: #0f172a;
  color: #e2e8f0;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
}
.code-block.readme {
  background: #fff;
  color: var(--text);
  border-top: 1px solid var(--border);
  white-space: pre-wrap;
}
.code-view { overflow: auto; max-height: 72vh; background: #fff; }
.code-view.is-wrap .lc pre { white-space: pre-wrap; word-break: break-word; }
.code-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px; }
.code-table .ln {
  width: 1%;
  padding: 0 12px;
  text-align: right;
  color: var(--muted);
  user-select: none;
  border-right: 1px solid var(--border);
  vertical-align: top;
  background: var(--bg-subtle);
}
.code-table tr:hover .ln { color: var(--text-secondary); }
.code-table tr:hover .lc { background: #f8fbff; }
.code-table .lc { padding: 0 12px; vertical-align: top; }
.code-table .lc pre { margin: 0; white-space: pre; min-height: 18px; }
.image-preview {
  padding: 24px;
  text-align: center;
  background: repeating-conic-gradient(var(--bg) 0% 25%, #fff 0% 50%) 50% / 16px 16px;
}
.image-preview img {
  max-height: 70vh;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius);
}

.readme-md {
  padding: 20px 24px 28px;
  line-height: 1.7;
  font-size: 14px;
  color: var(--text);
}
.readme-md h1, .readme-md h2, .readme-md h3, .readme-md h4 {
  margin: 1.4em 0 0.5em;
  font-weight: 650;
  line-height: 1.3;
}
.readme-md h1 { font-size: 1.6em; padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-top: 0; }
.readme-md h2 { font-size: 1.3em; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.readme-md h3 { font-size: 1.12em; }
.readme-md p { margin: 0 0 12px; }
.readme-md ul, .readme-md ol { margin: 0 0 12px 1.4em; }
.readme-md li { margin: 4px 0; }
.readme-md hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.readme-md blockquote {
  margin: 0 0 12px;
  padding: 4px 12px;
  color: var(--text-secondary);
  border-left: 3px solid var(--border-strong);
}
.readme-md pre.md-code {
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px 14px;
  overflow: auto;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 12px;
  margin: 0 0 12px;
}
.readme-md code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--border);
}
.readme-md pre code { background: none; border: 0; padding: 0; color: inherit; }

.commit-header { padding: 16px; border-bottom: 1px solid var(--border); }
.commit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin-top: 10px;
  color: var(--text-secondary);
}
.commit-body {
  white-space: pre-wrap;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 12px;
}
.commit-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 12px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  text-align: left;
  line-height: 1.4;
}
.commit-visibility-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--warn-soft);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}
.commit-visibility-hint .octicon {
  color: var(--warn);
  flex: none;
  margin-top: 2px;
}
.commit-visibility-hint strong { color: var(--text); font-weight: 600; }
.commit-visibility-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: 12px;
  line-height: 1.45;
}
.commit-visibility-banner.is-hidden {
  background: var(--warn-soft);
  border-bottom-color: var(--warn-border);
}
.commit-visibility-banner .octicon { flex: none; color: var(--brand); }
.commit-visibility-banner.is-hidden .octicon { color: var(--warn); }
.commit-visibility-cell {
  white-space: nowrap;
  font-size: 12px;
}
.commit-visibility-cell .link-btn { margin-left: 6px; }
.commit-row-hidden td { background: #fffdf8; }

.commit-group-title .octicon {
  flex: none;
  color: var(--muted);
}
.commit-table td:nth-child(2),
.commit-table td:nth-child(3),
.commit-table th:nth-child(2),
.commit-table th:nth-child(3),
.commit-table th:nth-child(4) {
  white-space: nowrap;
  width: 1%;
}
.commit-subject { font-weight: 600; color: var(--text); }
.commit-subject:hover { color: var(--brand); }

.danger-zone { border-color: var(--danger-border); }
.danger-zone .panel-header { background: var(--danger-soft); color: var(--danger); }
.danger-zone .panel-header h2 { color: var(--danger); }
.danger-zone .form { padding-top: 12px; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}
.pagination-meta { color: var(--muted); font-size: 12px; }

.search-bar {
  display: flex;
  gap: 8px;
  padding: 10px;
  align-items: center;
}
.search-bar input {
  flex: 1;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 10px;
}
.search-bar input:focus { border-color: var(--brand); outline: none; box-shadow: var(--focus); }

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.profile-head h1 { margin: 0 0 2px; }

/* ——— Guest console home ——— */
.console-home { min-width: 0; }
.console-crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--muted);
}
.console-crumb a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
}
.console-crumb a:hover { color: var(--brand); }
.console-crumb .sep { color: var(--border-strong); }
.console-home .page-header {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.console-home .page-header h1 {
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.console-home .page-kicker {
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  font-weight: 600;
}
.console-home .page-header .muted {
  margin: 4px 0 0;
  max-width: 640px;
  font-size: 12px;
}
.console-status {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--brand-soft-2);
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.console-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-soft-2);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}
.console-notice .octicon {
  color: var(--brand);
  margin-top: 2px;
  flex: none;
}
.console-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.console-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  min-height: 84px;
}
.console-kpi-card:hover { border-color: var(--brand-soft-2); }
.console-kpi-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}
.console-kpi-label .octicon { color: var(--brand); }
.console-kpi-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 6px 0 2px;
  line-height: 1.2;
  color: var(--text);
}
.console-kpi-sub { font-size: 11px; color: var(--muted); }
.console-service-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.console-service-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--text);
  min-height: 72px;
}
.console-service-card:hover {
  border-color: var(--brand-soft-2);
  color: var(--text);
  background: #fafcff;
}
.console-service-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  flex: none;
}
.console-service-body { min-width: 0; }
.console-service-card strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}
.console-service-desc {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.console-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 12px;
  align-items: start;
}
.console-rail {
  display: grid;
  gap: 12px;
  position: sticky;
  top: calc(var(--topbar-h) + 12px);
}
.console-rail .panel { margin-bottom: 0; }
.console-rail-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}
.console-rail-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}
.console-rail-list li:last-child { border-bottom: 0; }
.console-rail-list .octicon { color: var(--brand); margin-top: 1px; flex: none; }
.console-rail-list strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
}
.console-steps {
  margin: 0;
  padding: 8px 12px 8px 28px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
}
.console-steps li { margin: 4px 0; }
.console-clone { margin: 0 12px 12px; }
.console-clone .clone-box {
  margin: 0 0 8px;
  flex-wrap: wrap;
}
.console-clone .clone-box code {
  min-width: 0;
  flex: 1;
  overflow-x: auto;
  font-size: 11px;
}
.console-clone-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.console-home .toolbar {
  min-height: 36px;
  padding: 4px 10px;
}
.console-home .data-table th,
.console-home .data-table td {
  padding: 5px 10px;
  font-size: 12px;
}
.console-home .data-table th {
  background: #fafbfc;
}
.console-home #public-repos { scroll-margin-top: calc(var(--topbar-h) + 12px); }
.console-home #access-guide { scroll-margin-top: calc(var(--topbar-h) + 12px); }

/* ——— Settings / admin ——— */
.settings-layout {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  width: 100%;
}
.settings-layout .settings-sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + 12px);
}
.settings-layout .page-header {
  margin-bottom: 16px;
}
.settings-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
}
.settings-nav-label {
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  padding: 6px 10px 8px;
  letter-spacing: 0.04em;
}
.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.settings-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 500;
}
.settings-nav a:hover { background: var(--bg); color: var(--text); }
.settings-nav a.active {
  background: var(--brand-soft);
  color: var(--brand);
}
.settings-main { min-width: 0; }
.settings-tabs { margin-bottom: 16px; }

/* ——— Admin: Enterprise cloud console ——— */
.admin-body {
  --admin-sider-w: 220px;
  --admin-topbar-h: 44px;
  background: #f2f3f5;
  min-height: 100vh;
  font-size: 12px;
}
.admin-app {
  display: flex;
  min-height: 100vh;
  width: 100%;
}
.admin-sider {
  width: var(--admin-sider-w);
  flex: none;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  align-self: flex-start;
  min-height: 100vh;
  max-height: 100vh;
  z-index: 30;
}
.admin-sider-brand {
  padding: 14px 12px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-sider-brand-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}
.admin-sider-brand-link:hover { color: var(--brand); }
.admin-sider-logo {
  height: 22px;
  width: auto;
  max-width: 100px;
  object-fit: contain;
  flex: none;
}
.admin-sider-mark {
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
}
.admin-sider-mark .octicon { color: #fff; }
.admin-sider-brand-name {
  font-weight: 650;
  font-size: 13px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-sider-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 0 6px;
  height: 20px;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-soft-2);
  border-radius: var(--radius);
}
.admin-sider-menu {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px 12px;
  min-height: 0;
}
.admin-sider-group { margin-bottom: 12px; }
.admin-sider-group:last-child { margin-bottom: 0; }
.admin-sider-group-title {
  margin: 0 0 4px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.4;
}
.admin-sider-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  padding: 0 8px;
  margin: 0 0 1px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-weight: 500;
  text-decoration: none;
  transition: background .12s, color .12s, border-color .12s;
}
.admin-sider-item:hover {
  background: #f7f8fa;
  color: var(--text);
}
.admin-sider-item.is-active {
  background: var(--brand-soft);
  border-color: var(--brand-soft-2);
  color: var(--brand);
  font-weight: 600;
}
.admin-sider-item.is-active .admin-sider-item-icon { color: var(--brand); }
.admin-sider-item--ghost { color: var(--muted); }
.admin-sider-item-icon {
  width: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: var(--muted);
}
.admin-sider-item-text {
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-sider-bottom {
  padding: 8px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
}
.admin-workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #f2f3f5;
}
.admin-topbar {
  height: var(--admin-topbar-h);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.admin-topbar-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.admin-topbar-title {
  font-weight: 650;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}
.admin-topbar-divider {
  width: 1px;
  height: 14px;
  background: var(--border);
  flex: none;
}
.admin-topbar-sub {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.admin-topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 8px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-weight: 500;
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
}
.admin-topbar-link:hover {
  background: #f7f8fa;
  color: var(--text);
}
.admin-topbar-link--btn { color: var(--text-secondary); }
.admin-topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 6px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
}
.admin-topbar-user-name {
  font-weight: 600;
  font-size: 12px;
  color: var(--text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-flash-wrap {
  width: 100%;
  padding: 12px 16px 0;
}
.admin-main {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 16px;
}
.admin-main .page-header {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.admin-main .page-header h1 {
  font-size: 18px;
  margin-bottom: 2px;
}
.admin-main .page-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand);
  font-weight: 600;
}
.admin-main .page-header .muted {
  font-size: 12px;
  margin-top: 4px;
}
.admin-settings-form { width: 100%; min-width: 0; }
.admin-foot {
  padding: 10px 16px;
  color: var(--muted);
  font-size: 11px;
  border-top: 1px solid var(--border);
  background: #fff;
}
.admin-body .panel {
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.admin-body .toolbar {
  min-height: 36px;
  padding: 4px 10px;
}
.admin-body .toolbar-title {
  font-size: 12px;
  font-weight: 600;
}
.admin-body .toolbar-meta { font-size: 11px; }
.admin-body .data-table th,
.admin-body .data-table td {
  padding: 5px 10px;
  font-size: 12px;
}
.admin-body .data-table th {
  background: #fafbfc;
  font-weight: 600;
}
.admin-body .panel-header {
  min-height: 36px;
  padding: 6px 12px;
}
.admin-body .panel-header h2 { font-size: 12px; }
.admin-body .form-row label { font-size: 12px; }
.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.admin-stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.admin-stat-card .octicon { color: var(--brand); }
.admin-stat-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  margin: 4px 0 2px;
  letter-spacing: -0.03em;
  color: var(--text);
}
.admin-stat-label { font-weight: 600; font-size: 12px; }
.admin-stat-sub { font-size: 11px; }
.admin-quick-links {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  flex-wrap: wrap;
}

/* ——— Admin: storage integrations & migrations ——— */
.admin-storage-page,
.admin-migration-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.admin-storage-page .page-header,
.admin-migration-page .page-header {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.admin-storage-kpi {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.admin-storage-kpi__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.admin-storage-kpi__icon {
  flex: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
}

.admin-storage-kpi__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.admin-storage-kpi__value {
  font-size: 14px;
  font-weight: 600;
  margin-top: 2px;
  line-height: 1.35;
  word-break: break-word;
}

.admin-storage-layout {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.admin-storage-aside {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.admin-storage-aside .panel { margin-bottom: 0; }
.admin-storage-aside .form { padding: 12px 14px 14px; }
.admin-storage-aside .form-row { margin-bottom: 12px; }
.admin-storage-aside .form-actions { margin-top: 4px; }

.admin-callout {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.admin-callout strong {
  display: block;
  font-size: 12px;
  color: var(--text);
  margin-bottom: 6px;
}

.admin-callout code {
  font-size: 11px;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--bg-subtle);
}

.admin-callout--warn {
  border-color: var(--warn-border);
  background: var(--warn-soft);
  color: var(--text);
}

.admin-cron-steps {
  margin: 0 0 16px;
  padding-left: 1.25rem;
  line-height: 1.65;
}

.admin-cron-steps li + li {
  margin-top: 6px;
}

.admin-cron-path {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--bg-subtle);
  word-break: break-all;
}

.admin-cron-block {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-subtle);
}

.admin-cron-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.admin-cron-pre {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-cron-pre.is-oneline code {
  white-space: pre-wrap;
}

.admin-cron-details {
  margin-top: 12px;
}

.admin-cron-notes {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.65;
}

.admin-cron-notes li + li {
  margin-top: 8px;
}

.storage-provider-list {
  list-style: none;
  margin: 0;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.storage-provider-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.storage-provider-card.is-default {
  border-color: var(--brand-soft-2);
  box-shadow: 0 0 0 1px var(--brand-soft);
}

.storage-provider-card__main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 12px;
}

.storage-provider-card__icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  color: var(--brand);
}

.storage-provider-card.is-builtin .storage-provider-card__icon {
  background: #eef2f7;
  color: var(--text-secondary);
}

.storage-provider-card__body {
  flex: 1;
  min-width: 0;
}

.storage-provider-card__title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.storage-provider-card__meta {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

.storage-provider-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.storage-provider-card__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}

.admin-btn-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-migration-compose {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px 16px 16px;
}

.admin-migration-compose .form-row {
  margin-bottom: 0;
}

.admin-migration-compose .btn-primary {
  height: 32px;
  white-space: nowrap;
}

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

.migration-log__item {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) auto minmax(88px, auto) minmax(72px, auto);
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.migration-log__item:last-child { border-bottom: 0; }
.migration-log__item:hover { background: #f7f8fa; }

.migration-log__repo {
  font-weight: 600;
  min-width: 0;
}

.migration-log__repo a {
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.migration-log__repo a:hover { color: var(--brand); }

.migration-flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.migration-flow__pill {
  display: inline-flex;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  word-break: break-word;
}

.migration-flow__arrow {
  color: var(--muted);
  flex: none;
  font-size: 11px;
}

.migration-log__status {
  min-width: 0;
}

.migration-log__error {
  margin-top: 4px;
  font-size: 11px;
  color: var(--danger);
  line-height: 1.35;
}

.migration-log__head {
  display: none;
}

.admin-form-sections {
  padding: 0;
}

.admin-form-section {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.admin-form-section:last-of-type { border-bottom: 0; }

.admin-form-section__title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.admin-form-grid .form-row--full {
  grid-column: 1 / -1;
}

.admin-form-foot {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-form-foot .form-hint {
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.admin-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin-bottom: 8px;
}

.admin-breadcrumb a {
  color: var(--brand);
  font-weight: 500;
}

.admin-breadcrumb a:hover { text-decoration: underline; }

/* ——— Repo: storage picker & migration (settings / create) ——— */
.repo-storage-panel .panel-header {
  flex-wrap: wrap;
  gap: 4px 12px;
}
.repo-storage-panel .panel-header-sub {
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  width: 100%;
}
.repo-storage-panel__body {
  padding: 0 16px 16px;
}
.repo-storage-current {
  margin-bottom: 18px;
}
.repo-storage-current__label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.repo-storage-current__card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--brand-soft-2);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-soft) 0%, #fff 55%);
  box-shadow: 0 0 0 1px rgba(22, 119, 255, 0.08);
}
.repo-storage-current__icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--brand-soft-2);
}
.repo-storage-current__icon .octicon { width: 18px; height: 18px; }
.repo-storage-current__title {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 650;
}
.repo-storage-current__meta {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.repo-storage-step {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
}
.repo-storage-create-block {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed var(--border);
}
.repo-storage-create-block__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.repo-storage-create-block__head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
}
.repo-storage-admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}
.storage-pick-grid {
  display: grid;
  gap: 10px;
}
@media (min-width: 560px) {
  .storage-pick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.storage-pick-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px 12px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
  min-height: 72px;
}
.storage-pick-card:hover {
  border-color: var(--brand-soft-2);
  box-shadow: var(--shadow-sm);
}
.storage-pick-card:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand-soft-2);
}
.storage-pick-card input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.storage-pick-card__icon {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--bg-subtle);
  color: var(--brand);
}
.storage-pick-card--local .storage-pick-card__icon {
  color: var(--text-secondary);
  background: #eef2f7;
}
.storage-pick-card--default .storage-pick-card__icon {
  color: var(--text-secondary);
}
.storage-pick-card__icon .octicon { width: 18px; height: 18px; }
.storage-pick-card__body {
  flex: 1;
  min-width: 0;
  padding-right: 20px;
}
.storage-pick-card__title {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 3px;
  line-height: 1.3;
}
.storage-pick-card__meta {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.storage-pick-card__check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity .15s, transform .15s;
}
.storage-pick-card__check .octicon { width: 12px; height: 12px; }
.storage-pick-card:has(input:checked) .storage-pick-card__check {
  opacity: 1;
  transform: scale(1);
}
.repo-storage-confirm {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.repo-storage-confirm .form-row {
  margin-bottom: 0;
}
.repo-storage-confirm label {
  font-size: 12px;
}
.repo-storage-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.repo-storage-actions .btn-primary {
  min-width: 120px;
}
.repo-storage-history {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.repo-storage-history__title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-secondary);
}
.repo-storage-history__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.repo-storage-history__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font-size: 12px;
}
.repo-storage-history__flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}
.repo-storage-history__pill {
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
}
.repo-storage-history__meta {
  text-align: right;
  color: var(--muted);
  white-space: nowrap;
}
.repo-storage-history__error {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--danger);
  font-size: 11px;
  line-height: 1.4;
}
@media (max-width: 560px) {
  .repo-storage-history__item {
    grid-template-columns: 1fr;
  }
  .repo-storage-history__meta {
    text-align: left;
  }
}

@media (max-width: 960px) {
  .admin-storage-layout {
    grid-template-columns: 1fr;
  }
  .admin-storage-kpi {
    grid-template-columns: 1fr;
  }
  .admin-migration-compose {
    grid-template-columns: 1fr;
  }
  .migration-log__head { display: none; }
  .migration-log__item {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
  }
}

@media (min-width: 961px) {
  .migration-log-panel .panel-header {
    padding: 0;
    border: 0;
    background: transparent;
    min-height: 0;
  }
  .migration-log-panel .toolbar {
    border-radius: var(--radius) var(--radius) 0 0;
  }
  .migration-log__head {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) auto minmax(88px, auto) minmax(72px, auto);
    gap: 12px;
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
  }
}

/* ——— Install ——— */
.install-body { background: var(--bg); min-height: 100vh; }
.install-shell { max-width: 720px; margin: 0 auto; padding: 40px 16px 48px; }
.install-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.install-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.install-steps span {
  text-align: center;
  padding: 8px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
}
.install-steps span.active { color: var(--brand); border-color: var(--brand-soft-2); background: var(--brand-soft); }
.install-steps span.done { color: var(--success); border-color: var(--success-border); background: var(--success-soft); }
.install-panel { padding: 24px; }
.install-panel h1 { margin-top: 0; }
.install-panel .form { padding: 0; }
.install-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.install-hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.install-done .install-actions { margin-top: 20px; }

/* ——— Toast / error ——— */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #1f2329;
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s, transform .16s;
  box-shadow: var(--shadow-md);
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.confirm-modal[hidden] { display: none !important; }
.confirm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 35, 41, 0.45);
}
.confirm-modal-panel {
  position: relative;
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 18px 18px 14px;
}
.confirm-modal-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.confirm-modal-message {
  margin: 0 0 12px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}
.confirm-modal-list {
  margin: 0 0 12px;
  padding: 8px 10px;
  max-height: 160px;
  overflow: auto;
  list-style: none;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 12px;
}
.confirm-modal-list li { padding: 2px 0; }
.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.import-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.import-modal[hidden] { display: none !important; }
.import-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 35, 41, 0.48);
  animation: importFade .2s ease;
}
.import-modal-panel {
  position: relative;
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  padding: 28px 24px 22px;
  text-align: center;
  animation: importPop .22s cubic-bezier(.2, .8, .2, 1);
}
.import-modal-panel h2 {
  margin: 14px 0 6px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.import-modal-state[hidden] { display: none !important; }
.import-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto;
  border: 3px solid var(--brand-soft);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: importSpin .7s linear infinite;
}
.import-bar {
  height: 4px;
  margin: 16px 0 18px;
  background: var(--brand-soft);
  border-radius: 99px;
  overflow: hidden;
}
.import-bar-fill {
  display: block;
  height: 100%;
  width: 36%;
  border-radius: inherit;
  background: var(--brand);
  animation: importBar 1.35s ease-in-out infinite;
}
.import-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  text-align: left;
}
.import-steps li {
  position: relative;
  padding: 6px 10px 6px 28px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
  background: var(--bg-subtle);
  transition: color .2s, background .2s;
}
.import-steps li::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: var(--border-strong);
}
.import-steps li.is-active {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}
.import-steps li.is-active::before {
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(22, 119, 255, 0.16);
  animation: importPulse 1.2s ease-in-out infinite;
}
.import-steps li.is-done {
  color: var(--success);
}
.import-steps li.is-done::before { background: var(--success); }
.import-result-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.import-result-icon .octicon { width: 22px; height: 22px; }
.import-result-icon.is-success {
  background: var(--success-soft);
  color: var(--success);
  animation: importPop .22s cubic-bezier(.2, .8, .2, 1);
}
.import-result-icon.is-error {
  background: var(--danger-soft);
  color: var(--danger);
  animation: importPop .22s cubic-bezier(.2, .8, .2, 1);
}
.import-modal-actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}
@keyframes importFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes importPop {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to { opacity: 1; transform: none; }
}
@keyframes importSpin {
  to { transform: rotate(360deg); }
}
@keyframes importBar {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(380%); }
}
@keyframes importPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(22, 119, 255, 0.12); }
  50% { box-shadow: 0 0 0 7px rgba(22, 119, 255, 0.22); }
}

.release-list {
  display: grid;
  gap: 12px;
  padding: 12px;
}
.release-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: #fff;
}
.release-card.is-latest { border-color: var(--brand-soft-2); }
.release-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.release-title {
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.02em;
}
.release-title:hover { color: var(--brand); }
.release-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
}
.release-meta .mono { display: inline-flex; align-items: center; gap: 4px; }
.release-body { margin-top: 12px; }
.release-body > :last-child { margin-bottom: 0; }
.release-assets {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.release-assets li {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  font-size: 12px;
}
.release-assets a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text);
}
.release-assets a:hover { color: var(--brand); }
.release-assets .muted { margin-left: auto; }
.release-assets.is-detail {
  margin: 0;
  padding: 10px;
}
.release-assets.is-detail li { background: #fff; }
.release-detail .page-kicker a { color: var(--muted); }
.release-detail .page-kicker a:hover { color: var(--brand); }
.release-detail .panel .form { border-top: 1px solid var(--border); }

.error-page h1 { font-size: 48px; letter-spacing: -0.04em; color: var(--text); margin: 0 0 8px; }
.error-page p { margin: 0 0 16px; }

@media (max-width: 1100px) {
  .console-kpi-grid,
  .console-service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .console-home-grid { grid-template-columns: 1fr; }
  .console-rail { position: static; }
}
@media (max-width: 900px) {
  .admin-stat-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-layout .settings-sidebar { position: static; }
  .settings-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-app { flex-direction: column; }
  .admin-sider {
    width: 100%;
    min-height: auto;
    max-height: none;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .admin-sider-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 10px 10px;
    flex: none;
  }
  .admin-sider-group {
    display: contents;
  }
  .admin-sider-group-title { display: none; }
  .admin-sider-item {
    width: auto;
    min-height: 30px;
    padding: 0 10px;
    margin: 0;
  }
  .admin-sider-bottom {
    display: none;
  }
  .admin-topbar-sub { display: none; }
  .admin-topbar-divider { display: none; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
  }
  .auth-aside-copy { margin-top: 16px; }
  .auth-aside h2 { font-size: 20px; }
  .auth-points { display: none; }
  .auth-aside-foot { display: none; }
  .auth-main { padding: 32px 20px 48px; justify-content: flex-start; }
}
@media (max-width: 720px) {
  .console-kpi-grid,
  .console-service-grid { grid-template-columns: 1fr; }
  .page-header, .repo-header { flex-direction: column; }
  .topbar-search { display: none; }
  .topbar-search-mobile { display: inline-flex; }
  .inline-create { flex-direction: column; align-items: stretch; }
  .install-steps { grid-template-columns: 1fr 1fr; }
  .filter-input { width: 140px; }
  .page, .flash-wrap, .topbar-inner, .site-footer-inner { padding-left: 12px; padding-right: 12px; }
  .admin-main, .admin-flash-wrap, .admin-foot, .admin-topbar { padding-left: 12px; padding-right: 12px; }
  .admin-topbar-user-name { display: none; }
}
