:root {
  color-scheme: dark;
  --paper: #100d17;
  --surface: #191521;
  --surface-raised: #211b2b;
  --ink: #f1edf6;
  --muted: #a69db2;
  --line: #332c40;
  --purple: #a88be6;
  --purple-strong: #8463c2;
  --purple-muted: #786b8f;
  --purple-pale: #2d243b;
  --purple-wash: #211a2c;
  font-family: 'Segoe UI', 'Trebuchet MS', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); min-width: 320px; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }

.topbar { height: 66px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 max(28px, calc((100vw - 1260px) / 2)); }
.brand { display: inline-flex; gap: 11px; align-items: center; font-size: 15px; font-weight: 700; letter-spacing: -.035em; }
.brand-mark { width: 29px; height: 29px; border-radius: 8px; background: var(--purple-strong); display: grid; place-items: center; color: white; font-size: 22px; font-weight: 700; letter-spacing: -.08em; padding: 0 2px 4px 0; }
.brand-light { color: #a69db2; font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 20px; }
.public-label { display: inline-flex; align-items: center; gap: 8px; color: #a69db2; font-size: 12px; }
.status-dot { height: 7px; width: 7px; border-radius: 50%; background: var(--purple-muted); }
.icon-button { border: 1px solid var(--line); padding: 3px; border-radius: 50%; height: 35px; width: 35px; background: var(--surface-raised); display: grid; place-items: center; cursor: pointer; }
.avatar { flex: none; width: 29px; height: 29px; border-radius: 50%; object-fit: cover; }
.avatar-fallback { display: grid; place-items: center; background: #372b49; color: #d3c0fa; font-size: 13px; font-weight: 700; }

.layout { max-width: 1260px; margin: 0 auto; display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - 66px); }
.sidebar { border-right: 1px solid var(--line); padding: 33px 18px 24px 0; display: flex; flex-direction: column; min-height: calc(100vh - 66px); }
.side-heading { padding: 0 11px; display: flex; justify-content: space-between; align-items: center; color: #aaa1b4; font-size: 12px; font-weight: 600; margin-bottom: 13px; }
.count, .repo-total { color: #8f8799; font-variant-numeric: tabular-nums; font-size: 11px; }
.repo-list { display: grid; gap: 4px; }
.repo-link { min-height: 38px; display: flex; align-items: center; gap: 10px; padding: 6px 10px; color: #b8afc2; border-radius: 6px; font-size: 12px; }
.repo-link.selected { color: #d8c8f6; background: #2c2339; font-weight: 600; }
.repo-link:hover { background: #241e30; }
.repo-icon { width: 21px; height: 21px; border: 1px solid #393146; background: #201a2a; border-radius: 5px; display: grid; place-items: center; color: #b5a2d5; font-size: 11px; font-weight: 600; }
.all-icon { font-size: 15px; }
.repo-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.repo-total { margin-left: auto; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid var(--line); padding: 17px 10px 0; display: flex; gap: 9px; align-items: center; color: #9690a0; font-size: 11px; line-height: 1.5; }
.accent-mark { width: 7px; height: 7px; border-radius: 2px; background: var(--purple-muted); }

.main-content { padding: 48px 34px 70px; max-width: 900px; width: 100%; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 29px; border-bottom: 1px solid var(--line); }
.breadcrumb { font-size: 11px; color: #9c93a8; margin-bottom: 12px; }
.breadcrumb span { padding: 0 5px; color: #665d70; }
h1 { font-size: clamp(25px, 3vw, 31px); letter-spacing: -.045em; margin: 0; line-height: 1.2; font-weight: 650; }
.page-heading p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.admin-actions { display: flex; gap: 8px; align-items: center; padding-top: 28px; flex-wrap: wrap; justify-content: flex-end; }
.button { border: 1px solid var(--line); background: var(--surface-raised); border-radius: 6px; min-height: 34px; padding: 0 12px; color: #ded7e8; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.button:hover { border-color: #544566; background: #282134; }
.button-primary { background: var(--purple-strong); border-color: var(--purple-strong); color: #fff; }
.button-primary:hover { background: #9675d1; border-color: #9675d1; }
.button-quiet { background: transparent; }
.branch-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 21px; }
.branch-filter > span { color: var(--muted); font-size: 11px; margin-right: 3px; }
.branch-pill { background: transparent; border: 1px solid transparent; color: #aaa0b7; border-radius: 5px; padding: 5px 9px; font-size: 11px; cursor: pointer; }
.branch-pill.active { border-color: #49395e; color: #d5c2f6; background: #2c2339; font-weight: 600; }
.feed-heading { padding: 24px 0 11px; display: flex; justify-content: space-between; align-items: baseline; }
.feed-heading > div { display: flex; gap: 10px; align-items: baseline; }
.feed-heading h2 { margin: 0; font-size: 13px; font-weight: 650; }
.feed-count { color: #9890a1; font-size: 11px; }
.commit-list { display: grid; gap: 10px; }
.commit-card { display: flex; align-items: stretch; min-height: 104px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.commit-avatar { width: 91px; height: auto; min-height: 104px; align-self: stretch; flex-shrink: 0; object-fit: cover; border-radius: 0; background: #30263d; color: #c5b0e9; font-size: 26px; }
.commit-body { min-width: 0; flex: 1; padding: 19px 21px; }
.commit-meta { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.commit-identity { min-width: 0; display: flex; gap: 8px; align-items: center; font-size: 12px; flex-wrap: wrap; }
.commit-identity strong { font-weight: 650; }
.meta-star { color: #81788b; }
.repo-branch { color: #b7a2de; }
.repo-branch:hover { color: var(--purple); text-decoration: underline; }
.commit-hash { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; color: #a49aad; }
.commit-meta time { color: #938a9d; font-size: 10px; white-space: nowrap; }
.commit-message { margin: 12px 0 0; color: #d0c9d8; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.empty-state { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); padding: 36px; }
.empty-icon { display: grid; place-items: center; height: 41px; width: 41px; border-radius: 11px; background: var(--purple-pale); color: var(--purple); font-size: 19px; margin-bottom: 14px; }
.empty-state h2 { color: #e2d9ed; font-size: 16px; margin: 0; }
.empty-state p { font-size: 12px; margin: 7px 0 0; }
.text-link { color: var(--purple); font-size: 12px; margin-top: 17px; }
.loading { color: var(--muted); font-size: 13px; padding: 15px 0; }

.dialog { width: min(460px, calc(100% - 28px)); border: 1px solid var(--line); border-radius: 10px; padding: 25px; color: var(--ink); background: var(--surface); box-shadow: 0 20px 60px #07050c99; }
.dialog::backdrop { background: #08060eaa; }
.dialog form { margin: 0; }
.dialog-title { margin: 0 0 23px; font-size: 19px; letter-spacing: -.025em; }
.field-label { display: grid; gap: 7px; color: #c5bdce; font-size: 12px; font-weight: 600; margin: 0 0 17px; }
.field-input { width: 100%; min-width: 0; border: 1px solid #40364d; border-radius: 6px; background: #15111d; padding: 10px 11px; color: var(--ink); font-size: 13px; font-weight: 400; }
.field-input:focus { border-color: #8d72bb; }
.field-textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
.field-hint { color: #a099aa; font-weight: 400; font-size: 11px; }
.check-line { display: flex; align-items: center; gap: 8px; color: #aaa1b4; font-size: 12px; margin-top: -5px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 7px; }
.key-intro { margin: -9px 0 16px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.key-create { display: flex; align-items: center; gap: 8px; margin-bottom: 15px; }
.key-create .field-input { flex: 1; }
.key-list { display: grid; max-height: 250px; overflow-y: auto; border-top: 1px solid var(--line); }
.key-row { min-height: 57px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.key-info { display: grid; grid-template-columns: minmax(70px, 1fr) auto; align-items: baseline; gap: 3px 10px; min-width: 0; }
.key-info strong { color: #ded7e7; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-info code { color: #aaa0b6; font-size: 10px; }
.key-info time { grid-column: 1 / -1; color: #92899d; font-size: 10px; }
.revoke-key { color: #d49caa; min-height: 29px; padding: 0 8px; }
.key-empty { color: #9890a1; font-size: 12px; padding: 8px 0; }
.key-reveal { background: var(--purple-wash); border: 1px solid #49395e; border-radius: 7px; padding: 11px; margin: 0 0 14px; display: grid; gap: 8px; }
.key-reveal > div { display: flex; flex-direction: column; gap: 2px; }
.key-reveal strong { color: #cfbaf0; font-size: 11px; }
.key-reveal span { color: var(--muted); font-size: 10px; }
.key-reveal code { color: #e5deed; background: #17131f; border: 1px solid var(--line); padding: 9px; border-radius: 4px; font-size: 11px; overflow-wrap: anywhere; user-select: all; }
.key-reveal .button { justify-self: start; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 10px); opacity: 0; pointer-events: none; background: #36284b; color: #f5efff; padding: 11px 16px; border-radius: 6px; font-size: 12px; transition: opacity .15s, transform .15s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 750px) {
  .topbar { padding: 0 18px; }
  .layout { display: block; }
  .sidebar { min-height: auto; padding: 14px 18px 13px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-heading, .sidebar-bottom { display: none; }
  .repo-list { display: flex; overflow: auto; gap: 5px; scrollbar-width: thin; }
  .repo-link { flex: none; padding: 6px 9px; }
  .repo-total { display: none; }
  .main-content { padding: 30px 18px 48px; }
  .page-heading { display: block; padding-bottom: 23px; }
  .admin-actions { justify-content: flex-start; padding-top: 18px; }
  .commit-card { min-height: 92px; }
  .commit-avatar { width: 70px; min-height: 92px; }
  .commit-body { padding: 14px; }
  .commit-meta { align-items: flex-start; flex-direction: column; gap: 7px; }
  .commit-meta time { font-size: 10px; }
  .commit-message { margin-top: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
