:root {
    --bg:    #fbfbfd;
    --bg2:   #ffffff;
    --panel: #f4f5f8;
    --sf:    #ffffff;
    --bd:    #ececf1;
    --bd2:   #dcdfe7;
    --t1:    #14161f;
    --t2:    #5b6072;
    --t3:    #969aa9;
    --ac:    #4763e6;
    --ac2:   #3a51c8;
    --acbg:  rgba(71,99,230,.07);
    --r-sm:  7px;
    --r:     10px;
    --r-lg:  14px;
    --fn:    'Plus Jakarta Sans', system-ui, sans-serif;
    --dp:    'Bricolage Grotesque', 'Plus Jakarta Sans', system-ui, sans-serif;
    --mo:    'JetBrains Mono', ui-monospace, monospace;
    --max:   1280px;
    --sh-sm: 0 1px 1px rgba(20,22,31,.04), 0 1px 2px rgba(20,22,31,.06);
    --sh-md: 0 2px 4px rgba(20,22,31,.04), 0 8px 20px -4px rgba(20,22,31,.08);
    --sh-lg: 0 12px 34px -6px rgba(20,22,31,.12), 0 2px 6px rgba(20,22,31,.05);
    --ring:  0 0 0 4px rgba(71,99,230,.13);
  }
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { font-size: 15px; }
  body {
    font-family: var(--fn); color: var(--t1); line-height: 1.6; -webkit-font-smoothing: antialiased;
    background-color: var(--bg);
    background-image: linear-gradient(180deg, #ffffff 0%, var(--bg) 420px);
    background-attachment: fixed;
    min-height: 100vh;
  }
  a { color: var(--ac); text-decoration: none; transition: color .15s; }
  a:hover { color: var(--ac2); text-decoration: none; }
  h1, h2, h3 { font-family: var(--dp); }
  h1 { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
  h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; margin: 1.5rem 0 0.6rem; }
  h3 { font-size: 1.02rem; font-weight: 600; letter-spacing: -0.01em; margin: 1.25rem 0 0.5rem; }
  p { margin-bottom: 0.75rem; }
  code { font-family: var(--mo); font-size: 0.85em; background: var(--panel); color: var(--t1); padding: 0.13em 0.42em; border-radius: 6px; }
  pre { font-family: var(--mo); font-size: 0.875rem; background: var(--panel); border: 1px solid var(--bd); border-radius: var(--r); padding: 0.95rem 1.1rem; overflow-x: auto; }
  pre code { background: none; padding: 0; font-size: inherit; }
  strong { font-weight: 600; }
  ::selection { background: rgba(71,99,230,.16); }

  /* ── NAV ── */
  .nav { background: rgba(251,251,253,.8); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid var(--bd); position: sticky; top: 0; z-index: 60; }
  .nav-inner { max-width: var(--max); margin: 0 auto; padding: 0 2rem; display: flex; align-items: center; height: 58px; }
  .nav-brand { display: flex; align-items: center; gap: 0.55rem; text-decoration: none; margin-right: 2.25rem; flex-shrink: 0; }
  .nav-brand:hover { text-decoration: none; }
  .nav-brand-mark { width: 26px; height: 26px; background: var(--t1); border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .nav-brand-wordmark { font-family: var(--dp); font-size: 1.06rem; font-weight: 700; color: var(--t1); letter-spacing: -0.03em; }
  .nav-beta { display: inline-flex; align-items: center; margin-right: 1.5rem; margin-left: -1.25rem; padding: 0.05rem 0.4rem; border-radius: 999px; background: var(--acbg); color: var(--ac); border: 1px solid rgba(37,99,235,.2); font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; flex-shrink: 0; }
  .nav-beta:hover { background: rgba(37,99,235,.14); color: var(--ac); text-decoration: none; }
  .nav-link { font-size: 0.875rem; font-weight: 500; color: var(--t2); padding: 0.35rem 0.65rem; border-radius: var(--r-sm); text-decoration: none; transition: color .12s, background .12s; }
  .nav-link:hover { color: var(--t1); background: var(--panel); text-decoration: none; }
  .nav-spacer { flex: 1; }
  .nav-right { display: flex; align-items: center; gap: 0.4rem; }
  .nav-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--ac); color: #fff; font-size: 0.7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; text-decoration: none; flex-shrink: 0; }
  .nav-avatar:hover { opacity: 0.85; text-decoration: none; }
  .nav-username { font-size: 0.85rem; font-weight: 500; color: var(--t2); padding: 0.3rem 0.5rem; border-radius: var(--r); }
  .nav-username:hover { color: var(--t1); background: var(--bg); text-decoration: none; }
  .nav-logout { background: transparent; border: 1px solid var(--bd); color: var(--t3); padding: 0.25rem 0.6rem; border-radius: var(--r); font-size: 0.78rem; font-family: var(--fn); cursor: pointer; transition: all .12s; }
  .nav-logout:hover { border-color: var(--t2); color: var(--t2); }

  /* ── PAGE CONTAINERS ── */
  .page { max-width: var(--max); margin: 0 auto; padding: 2rem 2rem 5rem; }
  .page-narrow { max-width: 560px; margin: 0 auto; padding: 3rem 2rem 5rem; }
  .page-mid { max-width: 860px; margin: 0 auto; padding: 2rem 2rem 5rem; }

  /* ── PAGE HERO (app header band) ── */
  .page-hero { position: relative; background: linear-gradient(180deg, rgba(71,99,230,.045), transparent 72%), var(--bg2); border-bottom: 1px solid var(--bd); }
  .page-hero-inner { max-width: var(--max); margin: 0 auto; padding: 2.25rem 2rem 1.35rem; }
  .page-hero-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
  .page-hero-sub { font-size: 0.92rem; color: var(--t3); margin-top: 0.4rem; max-width: 72ch; }

  /* ── BREADCRUMB ── */
  .breadcrumb { font-family: var(--dp); font-size: 1.4rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; }
  .breadcrumb a { color: var(--t1); }
  .breadcrumb a:hover { color: var(--ac); text-decoration: none; }
  .breadcrumb .sep { color: var(--t3); margin: 0 0.35rem; font-weight: 400; }

  /* ── TABS ── */
  .tabs { display: inline-flex; gap: 2px; margin: 0; background: var(--panel); border: 1px solid var(--bd); border-radius: 11px; padding: 3px; max-width: 100%; overflow-x: auto; }
  .tabs a, .tab-link { padding: 0.42rem 0.85rem; font-size: 0.85rem; font-weight: 500; color: var(--t2); border-radius: 8px; white-space: nowrap; text-decoration: none; transition: color .12s, background .12s, box-shadow .12s; }
  .tabs a:hover, .tab-link:hover { color: var(--t1); text-decoration: none; }
  .tabs a.active, .tab-link.active { background: var(--sf); color: var(--ac); font-weight: 600; box-shadow: var(--sh-sm); }

  /* ── BUTTONS ── */
  .btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1rem; border-radius: var(--r-sm); font-size: 0.875rem; font-weight: 600; font-family: var(--fn); cursor: pointer; text-decoration: none; border: 1px solid transparent; transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease; }
  .btn:hover { text-decoration: none; }
  .btn-primary { background: var(--ac); color: #fff; border-color: transparent; box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 2px rgba(20,22,31,.2), 0 4px 12px -3px rgba(71,99,230,.45); }
  .btn-primary:hover { background: var(--ac2); color: #fff; transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 2px 4px rgba(20,22,31,.2), 0 8px 18px -3px rgba(71,99,230,.5); }
  .btn-primary:active { transform: translateY(0); }
  .btn-secondary { background: var(--sf); color: var(--t1); border-color: var(--bd2); box-shadow: var(--sh-sm); }
  .btn-secondary:hover { background: var(--sf); border-color: var(--t3); color: var(--t1); transform: translateY(-1px); box-shadow: var(--sh-md); }
  .btn-danger { background: #d6324a; color: #fff; border-color: transparent; box-shadow: var(--sh-sm); }
  .btn-danger:hover { background: #bd2840; color: #fff; transform: translateY(-1px); }
  /* legacy compat */
  button { font-family: var(--fn); font-size: 0.875rem; cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1rem; border-radius: var(--r-sm); font-weight: 600; transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease; border: 1px solid transparent; }
  button:not([class]) { background: var(--ac); color: #fff; border-color: transparent; box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 2px rgba(20,22,31,.2), 0 4px 12px -3px rgba(71,99,230,.45); }
  button:not([class]):hover { background: var(--ac2); transform: translateY(-1px); }
  button.secondary { background: var(--sf); color: var(--t1); border-color: var(--bd2); box-shadow: var(--sh-sm); }
  button.secondary:hover { border-color: var(--t3); color: var(--t1); transform: translateY(-1px); box-shadow: var(--sh-md); }
  button.danger { background: #d6324a; color: #fff; border-color: transparent; }
  button.danger:hover { background: #bd2840; }
  button[disabled] { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

  /* ── FORMS ── */
  form.inline { display: inline; }
  .form-group { margin-bottom: 1.1rem; }
  label { display: block; margin: 0.9rem 0; font-size: 0.9rem; font-weight: 500; color: var(--t1); }
  label > small { display: block; color: var(--t3); font-size: 0.82rem; font-weight: 400; margin-top: 0.2rem; }
  label > input, label > select, label > textarea,
  input[type="text"], input[type="email"], input[type="password"], input[type="url"], select, textarea {
    display: block; width: 100%; margin-top: 0.3rem;
    padding: 0.5rem 0.65rem; font-size: 0.9rem; font-family: var(--fn);
    background: var(--sf); color: var(--t1);
    border: 1px solid var(--bd2); border-radius: var(--r);
    transition: border-color .12s, box-shadow .12s;
  }
  input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ac); box-shadow: var(--ring); }
  input[type="checkbox"], input[type="radio"] { display: inline; width: auto; margin-top: 0; }
  fieldset { border: 1px solid var(--bd); border-radius: var(--r); padding: 0.75rem 1rem; margin: 0.75rem 0; }
  fieldset legend { padding: 0 0.3rem; font-size: 0.85rem; font-weight: 600; color: var(--t2); }
  .actions { display: flex; gap: 0.5rem; margin-top: 1.25rem; flex-wrap: wrap; }

  /* ── TABLES ── */
  table { border-collapse: collapse; width: 100%; }
  th { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--t3); font-family: var(--mo); padding: 0.55rem 0.95rem; border-bottom: 1px solid var(--bd); text-align: left; }
  td { padding: 0.72rem 0.95rem; border-bottom: 1px solid var(--bd); font-size: 0.9rem; vertical-align: middle; }
  tr:last-child td { border-bottom: none; }
  tbody tr:hover td { background: var(--panel); }
  .table-card { background: var(--sf); border: 1px solid var(--bd); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-sm); }
  td a { color: var(--ac); }
  td a:hover { color: var(--ac2); }
  td.mono, th.mono { font-family: var(--mo); font-size: 0.8rem; color: var(--t2); }
  td.meta { color: var(--t3); font-size: 0.85rem; }

  /* ── BADGES ── */
  .badge { display: inline-flex; align-items: center; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; background: var(--panel); color: var(--t2); border: 1px solid var(--bd); }
  .badge.admin { background: #fef3c7; color: #92400e; border-color: #fde68a; }
  .badge.deactivated { background: var(--panel); color: var(--t3); }
  .badge.action-A { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
  .badge.action-M { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
  .badge.action-D { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
  .badge.action-R { background: #fef3c7; color: #92400e; border-color: #fde68a; }
  .badge.status-queued    { background: var(--panel); color: var(--t2); border-color: var(--bd); }
  .badge.status-running   { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
  .badge.status-succeeded { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
  .badge.status-failed    { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
  .badge.status-cancelled { background: var(--panel); color: var(--t3); border-color: var(--bd); }

  /* ── ALERTS ── */
  .error, .alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; border-radius: var(--r); padding: 0.65rem 0.9rem; margin: 0.75rem 0; font-size: 0.9rem; }
  .alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; border-radius: var(--r); padding: 0.65rem 0.9rem; margin: 0.75rem 0; font-size: 0.9rem; }

  /* ── META ── */
  .meta { color: var(--t3); font-size: 0.875rem; }
  .meta a { color: var(--t3); }
  .meta a:hover { color: var(--ac); }

  /* ── DIALOG ── */
  dialog { position: fixed; inset: 0; margin: auto; height: fit-content; border: 1px solid var(--bd); border-radius: var(--r-lg); padding: 1.5rem; max-width: 28rem; width: calc(100% - 2rem); max-height: 90vh; overflow-y: auto; box-shadow: var(--sh-lg); background: var(--sf); }
  dialog::backdrop { background: rgba(20,22,31,0.32); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
  dialog h3 { margin: 0 0 0.75rem; }

  /* ── DASHBOARD LAYOUT ── */
  .dashboard-layout { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: 1fr 272px; padding: 0 2rem; }
  .dashboard-feed { border-right: 1px solid var(--bd); padding: 1.75rem 2.5rem 5rem 0; }
  .dashboard-sidebar { background: var(--panel); border-left: 1px solid var(--bd); padding: 1.75rem 0 5rem 2rem; min-height: calc(100vh - 120px); }

  /* ── DATE GROUP ── */
  .date-group { margin-bottom: 1.75rem; }
  .date-group-hd { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.4rem; }
  .date-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--t3); white-space: nowrap; }
  .date-group-hd::after { content: ''; flex: 1; height: 1px; background: var(--bd); }

  /* ── COMMIT ROW ── */
  .commit-row {
    display: grid; grid-template-columns: minmax(0,1fr) 160px;
    gap: 0.4rem 1.25rem;
    padding: 0.7rem 0.85rem; border-radius: var(--r);
    cursor: pointer; transition: background .1s, border-left-color .1s;
    margin-bottom: 2px;
    border-left: 3px solid transparent;
  }
  .commit-row:hover { background: var(--sf); border-left-color: var(--ac); box-shadow: 0 1px 4px rgba(14,21,32,.05); }
  .commit-repo { font-family: var(--mo); font-size: 0.74rem; font-weight: 500; color: var(--t2); margin-bottom: 0.15rem; }
  .commit-repo a { color: inherit; }
  .commit-repo a:hover { color: var(--ac); text-decoration: none; }
  .commit-msg-row { display: flex; align-items: baseline; gap: 0.6rem; min-width: 0; }
  .commit-msg { font-size: 0.9rem; font-weight: 500; color: var(--t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
  .commit-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 0.1rem; }
  .commit-rev { font-family: var(--mo); font-size: 0.72rem; color: var(--t3); }
  .commit-rev a { color: var(--t2); }
  .commit-rev a:hover { color: var(--ac); text-decoration: none; }
  .commit-author { font-size: 0.78rem; color: var(--t2); }
  .commit-author a { color: var(--t2); }
  .commit-author a:hover { color: var(--ac); text-decoration: none; }
  .diff-stat { font-family: var(--mo); font-size: 0.78rem; font-weight: 600; }
  .diff-add { color: #16a34a; }
  .diff-del { color: #dc2626; }

  /* ── LOAD MORE ── */
  .load-more-row { padding: 0.6rem; border-radius: var(--r); border: 1.5px dashed var(--bd2); text-align: center; margin-top: 0.5rem; cursor: pointer; transition: all .12s; }
  .load-more-row:hover { border-color: var(--ac); border-style: solid; background: var(--acbg); }
  .load-more-row button { background: none; border: none; color: var(--t3); font-size: 0.82rem; font-family: var(--fn); cursor: pointer; }
  .load-more-row:hover button { color: var(--ac); }

  /* ── SIDEBAR ── */
  .sb-block { margin-bottom: 2rem; }
  .sb-hd { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--t3); margin-bottom: 0.65rem; }
  .sb-repo-row { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; padding: 0.4rem 0.45rem; margin: 0 -0.45rem; border-radius: var(--r); transition: background .1s; min-width: 0; }
  .sb-repo-row:hover { background: rgba(255,255,255,0.6); }
  .sb-repo-row-name { font-family: var(--mo); font-size: 0.78rem; color: var(--t1); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sb-repo-row-name a { color: inherit; }
  .sb-repo-row-name a:hover { color: var(--ac); text-decoration: none; }
  .sb-repo-row-rev { font-family: var(--mo); font-size: 0.7rem; color: var(--t3); flex-shrink: 0; }
  /* ── PRIVATE LOCK ICON ── */
  .lock-icon { font-size: 0.72rem; opacity: 0.5; margin-left: 0.3rem; vertical-align: middle; }

  /* ── COMMIT INFO BOX ── */
  .commit-info { background: var(--sf); border: 1px solid var(--bd); border-radius: var(--r-lg); padding: 0.85rem 1.1rem; margin: 0.75rem 0 1.25rem; font-size: 0.9rem; box-shadow: var(--sh-sm); }
  .commit-info .ci-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--t3); font-weight: 600; margin-bottom: 0.35rem; }
  .commit-info .ci-msg { margin-top: 0.35rem; white-space: pre-wrap; color: var(--t1); }

  /* ── CRUMBS ── */
  .crumbs { font-family: var(--mo); font-size: 0.875rem; margin-bottom: 1rem; display: flex; align-items: center; flex-wrap: wrap; gap: 0.1rem; }
  .crumbs a { color: var(--t2); }
  .crumbs a:hover { color: var(--ac); text-decoration: none; }
  .crumbs .sep { color: var(--bd2); padding: 0 0.2rem; }
  .crumbs .current { color: var(--t1); font-weight: 500; }

  /* ── FILE/BLOB ── */
  .file-meta { font-size: 0.875rem; color: var(--t2); margin-bottom: 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
  .file-meta a { color: var(--t2); }
  .file-meta a:hover { color: var(--ac); }
  .file-card { border: 1px solid var(--bd); border-radius: var(--r-lg); margin: 1rem 0; background: var(--sf); overflow: hidden; box-shadow: var(--sh-sm); }
  .file-card-hd { padding: 0.5rem 0.85rem; background: var(--panel); border-bottom: 1px solid var(--bd); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
  .file-card-hd .path { font-family: var(--mo); font-size: 0.875rem; color: var(--t1); }
  .file-card-hd .meta { margin-left: auto; color: var(--t3); font-size: 0.82rem; }
  .file-card-body { overflow-x: auto; }

  /* ── MEDIA VIEWER ── */
  .media-viewer { padding: 1.5rem; border: 1px solid var(--bd); border-radius: var(--r); background: var(--panel); text-align: center; }
  .media-viewer img { max-width: 100%; max-height: 80vh; height: auto; border: 1px solid var(--bd); border-radius: var(--r); }
  .media-viewer audio, .media-viewer video { width: 100%; max-width: 860px; }

  /* ── MARKDOWN ── */
  .markdown-rendered { background: var(--sf); border: 1px solid var(--bd); border-radius: var(--r-lg); padding: 1.6rem 2rem; box-shadow: var(--sh-sm); }
  .markdown-rendered h1, .markdown-rendered h2, .markdown-rendered h3 { border-bottom: 1px solid var(--bd); padding-bottom: 0.3rem; }
  .markdown-rendered pre { background: var(--panel); border: 1px solid var(--bd); padding: 0.75rem; border-radius: var(--r); overflow-x: auto; }
  .markdown-rendered code { background: var(--panel); padding: 0.1em 0.3em; border-radius: 3px; }
  .markdown-rendered pre code { background: transparent; padding: 0; }
  .markdown-rendered img { max-width: 100%; }
  .markdown-rendered blockquote { border-left: 3px solid var(--bd2); padding: 0 0.75rem; color: var(--t2); margin: 0.75rem 0; }
  .markdown-rendered table th, .markdown-rendered table td { border: 1px solid var(--bd); padding: 0.3rem 0.6rem; }

  /* ── AUTH CARD ── */
  .auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; }
  .auth-card { background: var(--sf); border: 1px solid var(--bd); border-radius: var(--r-lg); padding: 2.5rem 2rem; width: 100%; max-width: 400px; box-shadow: var(--sh-lg); }
  .auth-card h1 { font-family: var(--dp); font-size: 1.4rem; margin-bottom: 1.25rem; letter-spacing: -0.02em; }
  .auth-brand { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 2rem; }
  .auth-brand-mark { width: 26px; height: 26px; background: var(--t1); border-radius: 7px; display: flex; align-items: center; justify-content: center; }
  .auth-brand-wordmark { font-family: var(--dp); font-size: 1.06rem; font-weight: 700; color: var(--t1); letter-spacing: -0.03em; }

  /* ── REPO CARD GRID ── */
  .repo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.9rem; }
  .repo-card { background: var(--sf); border: 1px solid var(--bd); border-radius: var(--r-lg); padding: 1.2rem 1.3rem; text-decoration: none; color: var(--t1); display: block; box-shadow: var(--sh-sm); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
  .repo-card:hover { border-color: #dde0ea; box-shadow: var(--sh-md); transform: translateY(-2px); text-decoration: none; }
  .repo-card-name { font-family: var(--mo); font-size: 0.875rem; font-weight: 600; color: var(--t1); margin-bottom: 0.4rem; }
  .repo-card:hover .repo-card-name { color: var(--ac); }
  .repo-card-desc { font-size: 0.875rem; color: var(--t2); margin-bottom: 0.7rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 1.2rem; }
  .repo-card-foot { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: var(--t3); }
  .repo-card-ns { font-family: var(--mo); font-weight: 600; color: var(--t2); background: var(--panel); border: 1px solid var(--bd); border-radius: 999px; padding: 0.05rem 0.45rem; }

  /* ── NAMESPACE LAYOUT ── */
  .ns-layout { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: 1fr 240px; padding: 0 2rem; }
  .ns-main { border-right: 1px solid var(--bd); padding: 1.75rem 2.5rem 5rem 0; }
  .ns-sidebar { background: var(--panel); padding: 1.75rem 0 5rem 1.5rem; min-height: calc(100vh - 120px); }
  .ns-sb-hd { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--t3); margin-bottom: 0.65rem; }
  .ns-sb-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.45rem; margin: 0 -0.45rem; border-radius: var(--r); font-size: 0.875rem; color: var(--t1); text-decoration: none; transition: background .1s; }
  .ns-sb-item:hover { background: rgba(255,255,255,0.6); color: var(--ac); text-decoration: none; }
  .ns-sb-empty { font-size: 0.82rem; color: var(--t3); padding: 0.25rem 0; }

  /* ── IMPORT PROGRESS ── */
  .import-badge { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.15rem 0.6rem; border-radius: 999px; background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

  /* ── TREE TABLE ── */
  .tree-table td.name { font-family: var(--mo); font-size: 0.875rem; }
  .tree-table td.size { color: var(--t3); text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mo); font-size: 0.82rem; }
  .tree-table td.when { color: var(--t3); font-family: var(--mo); font-size: 0.8rem; }
  .icon-dir::before { content: "📁 "; }
  .icon-file::before { content: "📄 "; }

  /* ── README ── */
  .readme { background: var(--sf); border: 1px solid var(--bd); border-radius: var(--r-lg); margin-top: 1.5rem; overflow: hidden; box-shadow: var(--sh-sm); }
  .readme > header { background: var(--panel); border-bottom: 1px solid var(--bd); padding: 0.55rem 0.95rem; font-size: 0.875rem; color: var(--t2); display: flex; align-items: center; gap: 0.5rem; }
  .readme > .body { padding: 1.25rem 1.5rem; }
  .readme .body h1, .readme .body h2, .readme .body h3 { border-bottom: 1px solid var(--bd); padding-bottom: 0.25rem; }
  .readme .body pre { background: var(--panel); padding: 0.75rem; border-radius: var(--r); overflow-x: auto; }
  .readme .body code { background: var(--panel); padding: 0.05rem 0.3rem; border-radius: 3px; }
  .readme .body pre code { background: transparent; padding: 0; }
  .readme .body img { max-width: 100%; }
  .readme .body blockquote { border-left: 3px solid var(--bd2); padding: 0 0.75rem; color: var(--t2); margin: 0.75rem 0; }

  /* ── LATEST COMMIT BOX ── */
  .latest-commit { background: var(--sf); border: 1px solid var(--bd); border-radius: var(--r-lg); padding: 0.8rem 1.1rem; margin: 0.5rem 0 1rem; font-size: 0.9rem; box-shadow: var(--sh-sm); }
  .latest-commit .lc-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--t3); font-weight: 700; margin-bottom: 0.3rem; }
  .latest-commit .lc-msg { margin-top: 0.3rem; white-space: pre-wrap; color: var(--t1); font-size: 0.9rem; }

  /* ── AUTOCOMPLETE ── */
  .ac-wrap { position: relative; }
  .ac-list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--sf); border: 1px solid var(--bd2); border-radius: var(--r); box-shadow: var(--sh-lg); max-height: 220px; overflow-y: auto; z-index: 200; }
  .ac-item { padding: 0.45rem 0.75rem; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; }
  .ac-item:hover, .ac-item.ac-focused { background: var(--panel); }
  .ac-item-value { color: var(--t1); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ac-item-sub { color: var(--t3); font-size: 0.78rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
  .ac-local-badge { flex-shrink: 0; font-size: 0.68rem; background: var(--acbg); color: var(--ac); padding: 0.1rem 0.45rem; border-radius: 999px; border: 1px solid rgba(37,99,235,.2); margin-left: auto; }
  .ac-empty { padding: 0.6rem 0.75rem; font-size: 0.875rem; color: var(--t3); }
  .ac-item-kind { font-size: 0.68rem; color: var(--t3); text-transform: uppercase; letter-spacing: 0.06em; flex-shrink: 0; }

  /* ── MEMBER PICKER ── */
  .mp-outer { position: relative; margin-top: 0.4rem; }
  .mp-field {
    display: flex; align-items: center; height: 36px;
    padding: 0 0.65rem; gap: 0.5rem;
    background: var(--sf); border: 1px solid var(--bd2); border-radius: var(--r);
    transition: border-color .12s, box-shadow .12s;
  }
  .mp-field:focus-within { border-color: var(--ac); box-shadow: 0 0 0 3px var(--acbg); }
  input.mp-search {
    flex: 1; width: auto; border: none; outline: none; padding: 0; margin-top: 0;
    font-size: 0.875rem; font-family: var(--fn); background: transparent; color: var(--t1);
    box-shadow: none;
  }
  input.mp-search::placeholder { color: var(--t3); }
  .mp-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
  .mp-dot--user  { background: var(--ac); }
  .mp-dot--group { background: #059669; }
  .mp-dot--invite { background: #7c3aed; }
  .mp-sel-name { font-size: 0.875rem; font-weight: 500; color: var(--t1); white-space: nowrap; }
  .mp-sel-sub  { font-size: 0.8rem; color: var(--t3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
  .mp-sel-kind { font-size: 0.68rem; color: var(--t3); text-transform: uppercase; letter-spacing: 0.06em; flex-shrink: 0; }
  .mp-clear {
    background: none; border: none; color: var(--t3); font-size: 1.1rem; line-height: 1;
    cursor: pointer; padding: 0; margin-left: 0.15rem; flex-shrink: 0;
    transition: color .1s; font-family: var(--fn);
  }
  .mp-clear:hover { color: var(--t1); }

  /* ── ROLE CARDS ── */
  .role-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-top: 0.5rem; }
  .role-cards.two-col { grid-template-columns: repeat(2, 1fr); }
  .role-card { position: relative; cursor: pointer; }
  .role-card input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
  .role-card-inner {
    border: 1.5px solid var(--bd2); border-radius: 6px; padding: 0.65rem 0.75rem;
    background: var(--sf); transition: border-color .12s, background .12s, box-shadow .12s;
    display: flex; flex-direction: column; gap: 0.15rem; height: 100%; user-select: none;
  }
  .role-card:hover .role-card-inner,
  .role-card input:checked + .role-card-inner { border-color: var(--ac); background: var(--acbg); box-shadow: 0 0 0 3px var(--acbg); }
  .role-card-dot {
    width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--bd2);
    background: var(--sf); transition: border-color .12s, background .12s; margin-bottom: 0.2rem;
  }
  .role-card:hover .role-card-dot { border-color: var(--ac); }
  .role-card input:checked + .role-card-inner .role-card-dot { border-color: var(--ac); background: var(--ac); box-shadow: inset 0 0 0 2px var(--sf); }
  .role-card-title { font-size: 0.825rem; font-weight: 600; color: var(--t1); }
  .role-card-desc  { font-size: 0.75rem; color: var(--t3); line-height: 1.4; }
  .role-card.disabled { cursor: not-allowed; }
  .role-card.disabled .role-card-inner { opacity: 0.38; pointer-events: none; }
  @media (max-width: 480px) { .role-cards { grid-template-columns: 1fr; } }

  /* ── ROLE PILL ── */
  .role-pill {
    appearance: none; -webkit-appearance: none;
    border: 1px solid transparent;
    background: var(--panel); color: var(--t2);
    font-family: var(--fn); font-size: 0.78rem; font-weight: 500;
    padding: 0.18rem 1.5rem 0.18rem 0.55rem;
    border-radius: 999px; cursor: pointer; line-height: 1.4;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238f96ae' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.4rem center;
    background-size: 10px 6px;
    transition: background-color .12s, border-color .12s;
    white-space: nowrap; vertical-align: middle;
  }
  .role-pill:hover, .role-pill:focus { background-color: var(--bd2); border-color: var(--bd2); outline: none; }
  .role-pill.rp--read { background-color: rgba(5,150,105,.1); color: #047857; border-color: rgba(5,150,105,.25); }
  .role-pill.rp--read:hover { background-color: rgba(5,150,105,.18); }
  .role-pill.rp--read_write { background-color: rgba(217,119,6,.1); color: #b45309; border-color: rgba(217,119,6,.25); }
  .role-pill.rp--read_write:hover { background-color: rgba(217,119,6,.18); }
  .role-pill.rp--admin { background-color: rgba(220,38,38,.1); color: #b91c1c; border-color: rgba(220,38,38,.25); }
  .role-pill.rp--admin:hover { background-color: rgba(220,38,38,.18); }
  .role-pill.rp--owner { pointer-events: none; padding: 0.18rem 0.55rem; background-image: none; }
  .role-pill option { color: var(--t1); background: var(--sf); }

  /* ── RESPONSIVE / MOBILE ── */
  @media (max-width: 860px) {
    .dashboard-layout {
      grid-template-columns: 1fr;
      padding: 0 1rem;
    }
    .dashboard-feed {
      border-right: none;
      padding: 1.25rem 0 2rem;
    }
    .dashboard-sidebar {
      border-left: none;
      border-top: 1px solid var(--bd);
      padding: 1.5rem 1rem 3rem;
      min-height: 0;
    }
    .ns-layout {
      grid-template-columns: 1fr;
      padding: 0 1rem;
    }
    .ns-main {
      border-right: none;
      padding: 1.25rem 0 2rem;
    }
    .ns-sidebar {
      padding: 1.5rem 1rem 3rem;
      min-height: 0;
    }
  }

  @media (max-width: 700px) {
    html { font-size: 14px; }

    .nav-inner {
      padding: 0.4rem 0.85rem;
      height: auto;
      min-height: 50px;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.3rem 0.4rem;
    }
    /* Row 1: brand + beta on the left, user controls on the right.
       Row 2: all nav links wrap together, left-aligned. */
    .nav-brand { order: 0; margin-right: 0.5rem; }
    .nav-beta { order: 0; margin-left: 0; margin-right: 0; }
    .nav-right { order: 1; margin-left: auto; width: auto; justify-content: flex-end; flex-wrap: wrap; gap: 0.35rem; }
    .nav-spacer { order: 2; flex: 0 0 100%; height: 0; }
    .nav-link {
      order: 3;
      padding: 0.25rem 0.45rem;
      font-size: 0.8rem;
    }
    .nav-username { display: none; }

    .page { padding: 1.25rem 1rem 3rem; }
    .page-narrow { padding: 1.75rem 1rem 3rem; }
    .page-mid { padding: 1.25rem 1rem 3rem; }
    .page-hero-inner { padding: 1.25rem 1rem 0; }
    .page-hero-head {
      flex-direction: column;
      align-items: stretch;
      gap: 0.75rem;
    }
    .page-hero-head > .btn,
    .page-hero-head > a.btn {
      align-self: flex-start;
    }

    .breadcrumb { font-size: 1.1rem; word-break: break-word; }
    h1 { font-size: 1.35rem; }
    h2 { font-size: 1.05rem; }

    .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tabs a, .tab-link { padding: 0.55rem 0.7rem; white-space: nowrap; flex-shrink: 0; }

    .commit-row {
      grid-template-columns: 1fr;
      gap: 0.25rem;
    }
    .commit-side {
      flex-direction: row;
      align-items: center;
      justify-content: flex-start;
      gap: 0.5rem;
    }

    .repo-grid { grid-template-columns: 1fr; gap: 0.55rem; }

    .table-card { overflow-x: auto; }
    .table-card > table { min-width: 100%; }
    th, td { padding: 0.55rem 0.6rem; }

    .markdown-rendered { padding: 1rem 1.1rem; }
    .readme > .body { padding: 1rem 1.1rem; }

    .file-card-hd { gap: 0.35rem; padding: 0.5rem 0.65rem; }
    .file-card-hd .meta { margin-left: 0; flex-basis: 100%; }

    .auth-wrap { padding: 1rem; align-items: flex-start; padding-top: 2.5rem; }
    .auth-card { padding: 1.75rem 1.25rem; }

    .actions { gap: 0.45rem; }
    .actions > button, .actions > .btn { flex: 1 1 auto; justify-content: center; }

    dialog { padding: 1.25rem; }

    .role-cards { grid-template-columns: 1fr; }
    .role-cards.two-col { grid-template-columns: 1fr; }
  }

  @media (max-width: 480px) {
    .nav-link { font-size: 0.78rem; padding: 0.22rem 0.35rem; }
    .nav-brand-wordmark { font-size: 0.95rem; }
    .breadcrumb { font-size: 1rem; }
    h1 { font-size: 1.2rem; }
  }

  /* ── Blog / articles ───────────────────────────────────────────────── */
  /* Shared by the /blog index and every blog-*.html post, so individual
     posts stay as plain semantic HTML the author can write prose into. */
  .blog-hero { background: var(--sf); border-bottom: 1px solid var(--bd); padding: 3.5rem 2rem 2.75rem; }
  .blog-hero-inner { max-width: 720px; margin: 0 auto; }
  .blog-eyebrow { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ac); margin-bottom: 0.85rem; }
  .blog-hero h1 { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.04em; color: var(--t1); line-height: 1.15; margin: 0 0 0.75rem; }
  .blog-hero .blog-standfirst { font-size: 1.1rem; color: var(--t3); line-height: 1.6; margin: 0; }

  /* The article column where prose lives. */
  .post { max-width: 720px; margin: 0 auto; padding: 3rem 2rem 4.5rem; }
  .post p { font-size: 1rem; color: var(--t2); line-height: 1.75; margin: 0 0 1.15rem; }
  .post h2 { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; color: var(--t1); margin: 2.5rem 0 0.85rem; }
  .post h3 { font-size: 1.12rem; font-weight: 700; color: var(--t1); margin: 1.85rem 0 0.6rem; }
  .post ul, .post ol { margin: 0 0 1.15rem; padding-left: 1.4rem; }
  .post li { font-size: 1rem; color: var(--t2); line-height: 1.7; margin-bottom: 0.4rem; }
  .post blockquote { border-left: 3px solid var(--ac); margin: 1.5rem 0; padding: 0.25rem 0 0.25rem 1.25rem; color: var(--t3); font-style: italic; }
  .post a:not(.btn) { color: var(--ac); }
  .post code { font-family: var(--fm, monospace); font-size: 0.9em; background: var(--panel); padding: 0.1rem 0.35rem; border-radius: 4px; }
  .post-draft { background: #fff7ed; border: 1px dashed #e0a868; color: #92500a; border-radius: 8px; padding: 0.6rem 0.9rem; font-size: 0.82rem; margin-bottom: 2rem; }

  /* End-of-post call to action + cross-links. */
  .post-cta { background: var(--sf); border: 1px solid var(--bd); border-radius: 10px; padding: 1.75rem; text-align: center; margin-top: 3rem; }
  .post-cta h2 { margin: 0 0 0.4rem; font-size: 1.2rem; }
  .post-cta p { color: var(--t3); font-size: 0.875rem; margin-bottom: 1.1rem; }
  .post-more { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-top: 2.5rem; font-size: 0.85rem; }
  .post-more a { color: var(--ac); }

  /* /blog index listing. */
  .blog-list { max-width: 720px; margin: 0 auto; padding: 2.5rem 2rem 4.5rem; display: grid; gap: 1rem; }
  .blog-card { display: block; background: var(--sf); border: 1px solid var(--bd); border-radius: 10px; padding: 1.5rem 1.75rem; text-decoration: none; transition: border-color .12s, box-shadow .12s, transform .12s; }
  .blog-card:hover { border-color: var(--t3); box-shadow: var(--sh-md); transform: translateY(-1px); text-decoration: none; }
  .blog-card h2 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; color: var(--t1); margin: 0 0 0.4rem; }
  .blog-card p { font-size: 0.9rem; color: var(--t3); line-height: 1.6; margin: 0; }

  /* ── NAV SEARCH PILL ── */
  .nav-search { display:flex; align-items:center; gap:0.45rem; background:var(--panel); border:1px solid var(--bd); color:var(--t2); font-family:var(--fn); font-size:0.82rem; padding:0.32rem 0.62rem; border-radius:999px; cursor:pointer; transition:border-color .12s, color .12s; }
  .nav-search:hover { border-color:var(--bd2); color:var(--t1); }
  .nav-kbd { font-family:var(--mo); font-size:0.64rem; background:var(--bg2); border:1px solid var(--bd2); border-radius:4px; padding:1px 5px; color:var(--t3); }

  /* ── COMMAND PALETTE ── */
  .palette-backdrop { position:fixed; inset:0; z-index:120; background:rgba(20,22,31,.32); -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px); display:flex; align-items:flex-start; justify-content:center; padding-top:12vh; }
  .palette-backdrop[hidden] { display:none; }
  .palette { width:min(560px,calc(100vw - 2rem)); background:var(--sf); border:1px solid var(--bd2); border-radius:var(--r-lg); box-shadow:var(--sh-lg); overflow:hidden; max-height:70vh; display:flex; flex-direction:column; }
  .palette-input { display:flex; align-items:center; gap:10px; padding:13px 16px; border-bottom:1px solid var(--bd); }
  .palette-input svg { flex-shrink:0; color:var(--t3); }
  .palette-input input { flex:1; border:none; outline:none; background:none; font-size:0.98rem; font-family:var(--fn); color:var(--t1); padding:0; margin:0; box-shadow:none; }
  .palette-esc { font-family:var(--mo); font-size:0.62rem; background:var(--panel); border:1px solid var(--bd2); border-radius:4px; padding:2px 6px; color:var(--t3); }
  .palette-results { overflow-y:auto; }
  .palette-foot { display:flex; gap:14px; padding:8px 16px; border-top:1px solid var(--bd); font-size:0.7rem; color:var(--t3); }
  .palette-foot kbd { font-family:var(--mo); font-size:0.62rem; background:var(--panel); border:1px solid var(--bd2); border-radius:4px; padding:1px 5px; color:var(--t3); }

  /* ── SEARCH RESULTS (shared by palette + /search page) ── */
  .srch-grp { font-size:0.62rem; font-weight:700; text-transform:uppercase; letter-spacing:.1em; color:var(--t3); padding:10px 16px 4px; }
  .srch-row { display:flex; align-items:center; gap:11px; padding:8px 16px; font-size:0.86rem; color:var(--t1); text-decoration:none; }
  .srch-row:hover, .srch-row.srch-sel { background:var(--acbg); box-shadow:inset 2px 0 0 var(--ac); text-decoration:none; }
  .srch-ic { width:22px; height:22px; border-radius:6px; display:flex; align-items:center; justify-content:center; font-size:0.7rem; flex-shrink:0; }
  .srch-ic.ic-repo { background:#eef1ff; } .srch-ic.ic-user { background:#e7f6ee; } .srch-ic.ic-commit { background:#fff3e0; } .srch-ic.ic-file { background:#f0f0f4; }
  .srch-main { font-weight:500; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex-shrink:0; max-width:58%; }
  .srch-main.mono { font-family:var(--mo); font-size:0.8rem; }
  .srch-sub { color:var(--t3); font-size:0.78rem; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .srch-seeall { display:block; padding:9px 16px; font-size:0.8rem; color:var(--ac); border-top:1px solid var(--bd); background:var(--bg2); }
  .srch-empty { padding:14px 16px; font-size:0.86rem; color:var(--t3); }
  .srch-page { background:var(--sf); border:1px solid var(--bd); border-radius:var(--r-lg); box-shadow:var(--sh-sm); overflow:hidden; padding:6px 0; }
  .srch-pageform { display:flex; gap:0.6rem; margin-top:1rem; max-width:560px; }
  .srch-pageform input { flex:1; margin-top:0; }
