/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  color-scheme: dark;

  /* Canvas */
  --canvas:        #0d1117;
  --canvas-subtle: #161b22;
  --canvas-inset:  #010409;

  /* Borders */
  --border:       #30363d;
  --border-muted: #21262d;

  /* Foreground */
  --fg:        #e6edf3;
  --fg-muted:  #7d8590;
  --fg-subtle: #6e7681;

  /* Accent */
  --accent:          #58a6ff;
  --accent-emphasis: #1f6feb;
  --accent-subtle:   rgba(56, 139, 253, 0.1);

  /* Status */
  --success:  #3fb950;
  --danger:   #f85149;
  --danger-subtle: rgba(248, 81, 73, 0.1);
  --warning:  #d29922;

  /* Monospace */
  --font-mono: "JetBrains Mono", "Cascadia Code", "Fira Code", Consolas, monospace;

  /* Radius */
  --radius: 6px;

  /* Layout */
  --sidebar-width: 240px;
  --right-rail-width: 220px;
  --topbar-height: 48px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background-color: var(--canvas);
  color: var(--fg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

iconify-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  flex-shrink: 0;
  vertical-align: text-bottom;
}

noscript {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--danger);
  background: var(--danger-subtle);
  border-bottom: 1px solid rgba(248, 81, 73, 0.4);
  font-size: 0.875rem;
}

/* ============================================================
   APP SHELL (SIDEBAR + WORKSPACE)
   ============================================================ */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.app-shell.has-right-rail {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--right-rail-width, 240px);
}

.app-shell.auth-shell {
  display: block;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--canvas-subtle);
}

.brand {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.brand:hover {
  text-decoration: none;
}

.brand__logo {
  display: block;
  width: 112px;
  max-width: 100%;
  height: auto;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.4rem 1rem;
  color: var(--fg-muted);
  border: 0;
  background: transparent;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  transition: color 120ms ease, background 120ms ease;
  position: relative;
}

.nav-item svg {
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-item:hover {
  color: var(--fg);
  background: rgba(177, 186, 196, 0.08);
}

.nav-item.is-active {
  color: var(--fg);
  background: rgba(177, 186, 196, 0.12);
  font-weight: 600;
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 1rem;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.nav-separator {
  height: 1px;
  margin: 0.5rem 1rem;
  background: var(--border-muted);
}

.nav-item--highlight {
  color: var(--accent);
}

.nav-item--highlight:hover {
  color: var(--fg);
  background: var(--accent-subtle);
}

/* Sidebar repos list */
.sidebar__repos {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 1px solid var(--border-muted);
  padding-top: 0.5rem;
  margin-top: 0.25rem;
}

.sidebar__repos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 1rem 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-subtle);
}

.sidebar__repos-new {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sidebar__repos-new:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.sidebar__repos-search {
  padding: 0 0.75rem 0.375rem;
}

.sidebar__repos-search input {
  width: 100%;
  padding: 0.3rem 0.625rem;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(177, 186, 196, 0.06);
  color: var(--fg);
  transition: border-color 0.15s;
}

.sidebar__repos-search input:focus {
  outline: none;
  border-color: var(--accent);
}

.sidebar__repos-search input::placeholder {
  color: var(--fg-subtle);
}

.sidebar__repos-list {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  gap: 1px;
  padding: 0 0.5rem;
  max-height: 340px;
}

.sidebar__repo-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--fg-muted);
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.sidebar__repo-item:hover {
  background: rgba(177, 186, 196, 0.08);
  color: var(--fg);
}

.sidebar__repo-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar__repo-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar__repo-private {
  font-size: 0.625rem;
  padding: 0.1rem 0.35rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--fg-subtle);
  flex-shrink: 0;
}

.sidebar__repos-empty {
  padding: 0.75rem 0.5rem;
  font-size: 0.8rem;
  color: var(--fg-subtle);
}

.sidebar__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
}

.sidebar__status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--fg-muted);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg-subtle);
}

.sidebar__status--signed-in .status-dot {
  background: var(--success);
}

.sidebar__shortcut {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.sidebar__shortcut kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 0.375rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--fg-muted);
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.sidebar__shortcut:hover kbd {
  color: var(--fg);
  border-color: var(--fg-subtle);
}

/* ============================================================
   WORKSPACE
   ============================================================ */
.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--topbar-height);
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--canvas-subtle);
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.topbar__search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: min(320px, 100%);
  padding: 0.3125rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas-inset);
  color: var(--fg-muted);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.topbar__search svg {
  flex-shrink: 0;
}

.topbar__search input {
  flex: 1;
  min-width: 0;
  padding: 0;
  color: var(--fg);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.8125rem;
}

.topbar__search input::placeholder {
  color: var(--fg-subtle);
}

.topbar__search:focus-within {
  border-color: var(--accent-emphasis);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.3);
}

.topbar__search:focus-within .search-shortcut {
  display: none;
}

.search-shortcut {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--fg-subtle);
  background: var(--canvas-subtle);
  border: 1px solid var(--border);
  border-radius: 3px;
}

.topbar__command {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3125rem 0.625rem;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  font-size: 0.75rem;
  transition: color 120ms ease, border-color 120ms ease;
}

.topbar__command:hover {
  color: var(--fg);
  border-color: var(--fg-subtle);
}

.topbar__command span {
  display: none;
}

.topbar__command kbd {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
}

@media (min-width: 900px) {
  .topbar__command span {
    display: inline;
  }
}

.topbar__signin {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent-emphasis);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 120ms ease;
}

.topbar__signin:hover {
  background: var(--accent);
}

.topbar__signin svg {
  flex-shrink: 0;
}

.user-menu-wrap {
  position: relative;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 2em;
  background: transparent;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 120ms ease, border-color 120ms ease;
}

.user-menu:hover {
  background: rgba(177, 186, 196, 0.08);
  border-color: rgba(177, 186, 196, 0.3);
}

.user-menu img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.user-menu__name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu svg {
  flex-shrink: 0;
  color: var(--fg-muted);
}

.profile-card img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.account-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 160px;
  padding: 0.375rem 0;
  background: var(--canvas-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
}

.user-menu-wrap.is-open .account-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.account-menu__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  color: var(--fg);
  font-size: 0.8125rem;
  text-decoration: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.account-menu__item:hover {
  background: rgba(177, 186, 196, 0.08);
}

.account-menu__item svg {
  flex-shrink: 0;
  color: var(--fg-muted);
}

.account-menu__divider {
  height: 1px;
  margin: 0.375rem 0;
  background: var(--border);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  min-width: 0;
}

/* ============================================================
   PAGE HEADER / HERO
   ============================================================ */
.hero-card {
  padding: 2rem 1.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.hero-card--error {
  border-color: rgba(248, 81, 73, 0.4);
  background: rgba(248, 81, 73, 0.05);
}

.hero-card h1 {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.hero-card p {
  margin: 0;
  color: var(--fg-muted);
  max-width: 640px;
  line-height: 1.6;
}

.hero-card strong {
  color: var(--fg);
  font-weight: 600;
}

.eyebrow {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: 0.25rem;
}

/* ============================================================
   PROFILE & AUTH CARDS
   ============================================================ */
.profile-card,
.auth-card {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas-subtle);
  margin-top: 1rem;
}

.profile-card strong,
.profile-card span,
.auth-card strong,
.auth-card span {
  display: block;
}

.profile-card span,
.auth-card span {
  color: var(--fg-muted);
  font-size: 0.75rem;
}

.profile-card img {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

/* ============================================================
   ACTION ROW
   ============================================================ */
.action-row,
.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.primary-action,
.secondary-action,
.danger-action {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid;
  line-height: 1.5;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.primary-action {
  color: #fff;
  border-color: rgba(240, 246, 252, 0.1);
  background: #238636;
}

.primary-action:hover {
  background: #2ea043;
  border-color: rgba(240, 246, 252, 0.15);
}

.secondary-action {
  color: var(--fg);
  border-color: var(--border);
  background: rgba(177, 186, 196, 0.12);
}

.secondary-action:hover {
  background: rgba(177, 186, 196, 0.2);
  border-color: rgba(177, 186, 196, 0.3);
}

.danger-action {
  color: var(--danger);
  border-color: var(--border);
  background: rgba(177, 186, 196, 0.12);
}

.danger-action:hover {
  color: #fff;
  border-color: transparent;
  background: #da3633;
}

.primary-action:disabled,
.secondary-action:disabled,
.danger-action:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Login form button (same as primary) */
.login-form button {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid rgba(240, 246, 252, 0.1);
  color: #fff;
  background: #238636;
  transition: background 120ms ease;
}

.login-form button:hover {
  background: #2ea043;
}

.login-form button:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ============================================================
   SECTION HEADING
   ============================================================ */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.section-heading h2 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg);
}

.section-heading span {
  color: var(--fg-muted);
  font-size: 0.8125rem;
}

/* ============================================================
   REPO SECTION (container)
   ============================================================ */
.repo-section,
.org-section {
  display: flex;
  flex-direction: column;
}

/* ============================================================
   REPO GRID → ROW LIST
   ============================================================ */
.repo-grid {
  display: flex;
  flex-direction: column;
}

.repo-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 0.25rem 1rem;
  align-items: start;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 100ms ease;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
}

.repo-card:first-child {
  border-top: 0;
}

.repo-card:last-child {
  border-bottom: 0;
}

.repo-card:hover,
.repo-card:focus {
  background: rgba(177, 186, 196, 0.04);
  outline: none;
}

.repo-card__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.repo-card h3 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0;
}

.repo-card__visibility {
  flex-shrink: 0;
  padding: 0.0625rem 0.375rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 2em;
}

.repo-card__description {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--fg-muted);
  grid-column: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 1.375rem; /* align with text after icon */
}

.repo-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  grid-column: 1;
  padding-left: 1.375rem;
  font-size: 0.75rem;
  color: var(--fg-muted);
}

.repo-card__meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ============================================================
   ORG SECTION
   ============================================================ */
.org-list {
  display: flex;
  flex-direction: column;
}

.org-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.org-card:last-child {
  border-bottom: 0;
}

.org-card img {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
}

.org-card strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
}

.org-card span {
  display: block;
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-top: 0.0625rem;
}

/* ============================================================
   ORG PAGE (centered layout)
   ============================================================ */
.org-page {
  width: 100%;
}

.org-page__inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Hero / banner */
.org-hero {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.75rem;
  background: var(--canvas-subtle);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  margin-bottom: 1.25rem;
}

.org-hero--skeleton {
  min-height: 120px;
}

.org-hero__avatar {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--canvas-inset);
}

.org-hero__info {
  flex: 1;
  min-width: 0;
}

.org-hero__name {
  margin: 0.25rem 0 0.125rem;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.2;
}

.org-hero__handle {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--fg-muted);
  font-family: var(--font-mono);
}

.org-hero__desc {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--fg-muted);
  line-height: 1.6;
  max-width: 560px;
}

.org-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 0.5rem;
}

.org-hero__stat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--fg-muted);
}

.org-hero__stat strong {
  color: var(--fg);
  font-weight: 600;
}

.org-hero__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
  align-items: stretch;
}

.org-hero__actions .primary-action,
.org-hero__actions .secondary-action {
  justify-content: center;
  min-width: 140px;
}

/* Tabs */
.org-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.org-tabs::-webkit-scrollbar {
  display: none;
}

.org-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.625rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-muted);
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.org-tab:hover {
  color: var(--fg);
}

.org-tab--active {
  color: var(--fg);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.org-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--fg-muted);
  background: rgba(177, 186, 196, 0.12);
  border: 1px solid var(--border);
  border-radius: 2em;
}

.org-tab--active .org-tab__count {
  color: var(--fg);
  background: rgba(177, 186, 196, 0.2);
}

/* Tab panels */
.org-tab-panel--hidden {
  display: none;
}

.org-repo-grid {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
}

.org-repo-grid .repo-card {
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
}

.org-repo-grid .repo-card:first-child {
  border-top: none;
}

.org-repo-grid .repo-card:last-child {
  border-bottom: none;
}

.org-members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.org-member-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  background: var(--canvas-subtle);
  transition: border-color 0.15s, background 0.15s;
}

.org-member-card:hover {
  border-color: var(--accent-emphasis);
  background: var(--canvas);
}

.org-member-card img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.org-member-card strong {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .org-hero {
    flex-direction: column;
    gap: 1rem;
  }

  .org-hero__actions {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }

  .org-hero__actions .primary-action,
  .org-hero__actions .secondary-action {
    min-width: 0;
    flex: 1;
  }
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--fg-muted);
  grid-column: 1 / -1;
}

.empty-state h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
}

.empty-state p {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  max-width: 320px;
}

.empty-state .primary-action,
.empty-state .secondary-action {
  margin-top: 0.25rem;
}

/* ============================================================
   404 PAGE
   ============================================================ */
.not-found-shell,
.not-found-page {
  background-color: var(--canvas);
  background-image:
    linear-gradient(150deg, rgba(239, 140, 14, 0.06) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Ccircle cx='0' cy='0' r='1.2' fill='rgba(177,186,196,0.13)'/%3E%3Ccircle cx='28' cy='0' r='1.2' fill='rgba(177,186,196,0.13)'/%3E%3Ccircle cx='0' cy='28' r='1.2' fill='rgba(177,186,196,0.13)'/%3E%3Ccircle cx='28' cy='28' r='1.2' fill='rgba(177,186,196,0.13)'/%3E%3Ccircle cx='14' cy='14' r='1.2' fill='rgba(177,186,196,0.13)'/%3E%3C/svg%3E");
  background-size: 100% 100%, 28px 28px;
}

.not-found-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.not-found-shell > .not-found-page {
  position: relative;
  z-index: 1;
}

.not-found-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.not-found-bg__item {
  position: absolute;
  font-family: var(--font-mono);
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
  line-height: 1;
}

.not-found-bg__item:nth-child(1) {
  top: 7%;
  left: 3%;
  font-size: 0.65rem;
  color: rgba(177, 186, 196, 0.09);
  transform: rotate(-4deg);
}

.not-found-bg__item:nth-child(2) {
  top: -2.5rem;
  right: -0.5rem;
  font-size: 16rem;
  font-weight: 700;
  color: rgba(239, 140, 14, 0.045);
  letter-spacing: -0.04em;
  transform: rotate(4deg);
}

.not-found-bg__item:nth-child(3) {
  top: 52%;
  left: 2%;
  font-size: 0.8rem;
  color: rgba(177, 186, 196, 0.08);
  transform: rotate(15deg);
}

.not-found-bg__item:nth-child(4) {
  bottom: 14%;
  left: 4%;
  font-size: 0.6rem;
  color: rgba(177, 186, 196, 0.08);
  transform: rotate(2deg);
}

.not-found-bg__item:nth-child(5) {
  top: 30%;
  right: 3%;
  font-size: 0.75rem;
  color: rgba(177, 186, 196, 0.08);
  transform: rotate(-8deg);
}

.not-found-bg__item:nth-child(6) {
  bottom: 8%;
  right: 5%;
  font-size: 0.7rem;
  color: rgba(177, 186, 196, 0.09);
  transform: rotate(-3deg);
}

.not-found-bg__item:nth-child(7) {
  top: 12%;
  left: 22%;
  font-size: 0.75rem;
  color: rgba(177, 186, 196, 0.07);
  transform: rotate(-12deg);
}

.not-found-page {
  min-height: calc(100vh - var(--topbar-height));
  display: grid;
  grid-template-columns: minmax(180px, 360px) minmax(0, 430px);
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: 3rem 1.5rem;
}

.not-found-shell .not-found-page {
  width: min(100%, 960px);
  min-height: auto;
  border: 1px solid rgba(239, 140, 14, 0.28);
  border-radius: 24px;
  box-shadow:
    0 0 0 1px rgba(239, 140, 14, 0.06),
    0 24px 80px rgba(0, 0, 0, 0.4);
}

.not-found-page__mascot {
  width: min(100%, 360px);
  height: auto;
  filter: drop-shadow(0 24px 60px rgba(0, 0, 0, 0.36)) drop-shadow(0 4px 24px rgba(239, 140, 14, 0.18));
  transform-origin: center;
  transition: transform 0.12s ease-out;
  will-change: transform;
}

.not-found-page__content {
  max-width: 430px;
}

.not-found-page .eyebrow {
  color: #ef8c0e;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
}

.not-found-page h1 {
  margin: 0.25rem 0 0.75rem;
  color: var(--fg);
  font-size: clamp(2rem, 7vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.not-found-page p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 1rem;
  line-height: 1.65;
}

.not-found-page code {
  padding: 0.1rem 0.3rem;
  border: 1px solid var(--border-muted);
  border-radius: 999px;
  background: var(--canvas-subtle);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.not-found-page__actions {
  margin-top: 1.25rem;
}

.not-found-page__actions .primary-action {
  background: #b65f0d;
  border-color: rgba(239, 140, 14, 0.3);
}

.not-found-page__actions .primary-action:hover {
  background: #cf6d0e;
  border-color: rgba(239, 140, 14, 0.45);
}

.code-hint {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas-subtle);
  color: var(--fg-muted);
  font-size: 0.8125rem;
}

/* ============================================================
   LOGIN PANEL
   ============================================================ */
.auth-screen {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  padding: 3rem 1rem;
  background:
    radial-gradient(circle at top, rgba(56, 139, 253, 0.08), transparent 32rem),
    var(--canvas);
}

.auth-screen__card {
  width: min(100%, 420px);
}

.auth-screen__brand {
  display: flex;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.auth-screen__brand:hover {
  text-decoration: none;
}

.auth-screen__brand img {
  width: 136px;
  height: auto;
}

.auth-screen__card h1 {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
}

.auth-screen__card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.auth-screen__card .login-form,
.auth-screen__card > p:not(.auth-switch):not(.auth-note) {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas-subtle);
}

.auth-screen__card > p:not(.auth-switch):not(.auth-note) {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.auth-note {
  margin: 0.75rem 0 0;
  color: var(--fg-muted);
  font-size: 0.75rem;
  line-height: 1.5;
  text-align: center;
}

.auth-switch {
  margin: 1rem 0 0 !important;
  padding: 1rem;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  font-size: 0.875rem !important;
  line-height: 1.5;
  text-align: center;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 400px);
  gap: 2rem;
  align-items: start;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.login-panel h2 {
  margin: 0.25rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.login-panel p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.login-panel strong {
  color: var(--fg);
}

.login-form {
  display: grid;
  gap: 0.75rem;
}

.login-form label {
  display: grid;
  gap: 0.375rem;
}

.login-form span {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fg);
}

/* ============================================================
   FORM INPUTS
   ============================================================ */
.login-form input,
.settings-form input,
.settings-form select,
.settings-form textarea {
  width: 100%;
  padding: 0.3125rem 0.75rem;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: 0;
  background: var(--canvas-inset);
  font-size: 0.875rem;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.settings-form textarea {
  resize: vertical;
}

.login-form input:focus,
.settings-form input:focus,
.settings-form select:focus,
.settings-form textarea:focus {
  border-color: var(--accent-emphasis);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.3);
}

/* ============================================================
   FORM FEEDBACK
   ============================================================ */
.form-error {
  margin: 0;
  padding: 0.5rem 0.75rem;
  color: var(--danger);
  border: 1px solid rgba(248, 81, 73, 0.4);
  border-radius: var(--radius);
  background: var(--danger-subtle);
  font-size: 0.8125rem;
}

.form-success {
  margin: 0;
  padding: 0.5rem 0.75rem;
  color: var(--success);
  border: 1px solid rgba(63, 185, 80, 0.4);
  border-radius: var(--radius);
  background: rgba(63, 185, 80, 0.1);
  font-size: 0.8125rem;
}

.form-help {
  color: var(--fg-muted);
  font-size: 0.8125rem;
  line-height: 1.6;
  margin: 0;
}

/* ============================================================
   DETAIL PANEL
   ============================================================ */
.detail-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
  gap: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.detail-panel > div:first-child {
  padding: 1.25rem 1.5rem;
  border-right: 1px solid var(--border);
}

.detail-panel > dl {
  padding: 1.25rem 1.5rem;
}

.detail-panel h2 {
  margin: 0.25rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.detail-panel p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.875rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0;
}

.detail-grid div {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas-subtle);
}

.detail-grid dt {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-grid dd {
  margin: 0.25rem 0 0;
  color: var(--fg);
  font-weight: 600;
  font-size: 0.9375rem;
}

.detail-panel .panel-actions {
  grid-column: 1 / -1;
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border);
}

/* ============================================================
   FORM PANEL / SETTINGS PAGE
   ============================================================ */
.form-panel,
.settings-page {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ============================================================
   SETTINGS HEADER
   ============================================================ */
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--canvas-subtle);
}

.settings-header__title {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.settings-header__repo {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg);
}

.settings-header__label {
  font-size: 0.75rem;
  color: var(--fg-muted);
}

.settings-feedback {
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

/* ============================================================
   SETTINGS LAYOUT (sidebar + content)
   ============================================================ */
.settings-layout {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  min-height: 0;
  flex: 1;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 1rem 0.75rem;
  border-right: 1px solid var(--border);
  background: var(--canvas-subtle);
}

.settings-nav__item {
  display: block;
  width: 100%;
  padding: 0.4375rem 0.625rem;
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg-muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  transition: background 120ms ease, color 120ms ease;
}

.settings-nav__item:hover {
  color: var(--fg);
  background: rgba(177, 186, 196, 0.1);
}

.settings-nav__item.is-active {
  color: var(--fg);
  background: rgba(177, 186, 196, 0.15);
  font-weight: 600;
}

.settings-nav__item--danger {
  color: var(--danger);
}

.settings-nav__item--danger:hover {
  color: var(--danger);
  background: rgba(248, 81, 73, 0.1);
}

.settings-nav__item--danger.is-active {
  color: var(--danger);
  background: rgba(248, 81, 73, 0.12);
}

.settings-nav__divider {
  margin: 0.5rem 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.settings-content {
  padding: 1.5rem;
  overflow-y: auto;
}

/* ============================================================
   SETTINGS CARD
   ============================================================ */
.settings-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  background: var(--canvas-subtle);
}

.settings-card[hidden] {
  display: none;
}

.settings-card__header {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-muted);
}

.settings-card__header h3 {
  margin: 0 0 0.375rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--fg);
}

.settings-card__header p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--fg-muted);
  line-height: 1.6;
}

.settings-card--danger {
  border-color: rgba(248, 81, 73, 0.35);
  background: rgba(248, 81, 73, 0.03);
}

.settings-card--danger .settings-card__header {
  border-bottom-color: rgba(248, 81, 73, 0.25);
}

.settings-card--danger .settings-card__header h3 {
  color: var(--danger);
}

.settings-card__divider {
  height: 1px;
  background: rgba(248, 81, 73, 0.25);
  border: 0;
  margin: 0;
}

.settings-form {
  display: grid;
  gap: 1rem;
}

.settings-form label {
  display: grid;
  gap: 0.375rem;
}

.settings-form label span {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fg);
}

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

.form-grid__wide {
  grid-column: 1 / -1;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
}

.toggle-card,
.confirm-line,
.radio-stack label {
  display: flex !important;
  align-items: center;
  gap: 0.5rem !important;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas-subtle);
  font-size: 0.8125rem;
}

.toggle-card input,
.confirm-line input,
.radio-stack input {
  width: auto;
  flex-shrink: 0;
}

.toggle-card.is-unavailable {
  color: var(--fg-subtle);
  opacity: 0.7;
}

.toggle-card.is-unavailable small {
  color: var(--fg-subtle);
  margin-left: auto;
  font-size: 0.6875rem;
}

.radio-stack {
  display: grid;
  gap: 0.5rem;
}

.radio-stack label,
.confirm-line {
  cursor: pointer;
}

.delete-form {
  display: grid;
  gap: 1rem;
}

.settings-card__subheader {
  padding-top: 0.5rem;
}

.settings-card__subheader h4 {
  margin: 0 0 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fg);
}

.settings-card__subheader p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

.settings-card .settings-card__divider {
  height: 1px;
  background: var(--border-muted);
  border: 0;
  margin: 0.5rem 0;
}

/* ============================================================
   MIRRORS TABLE
   ============================================================ */
.mirrors-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.mirrors-table th,
.mirrors-table td {
  padding: 0.625rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.mirrors-table th {
  background: var(--canvas-subtle);
  font-weight: 600;
  color: var(--fg-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mirrors-table tbody tr:last-child td {
  border-bottom: 0;
}

.mirrors-table tbody tr:hover {
  background: var(--canvas-subtle);
}

.mirror-name {
  display: block;
  font-weight: 500;
  color: var(--fg);
}

.mirror-url {
  display: block;
  color: var(--fg-muted);
  font-size: 0.75rem;
  word-break: break-all;
}

.push-mirrors-list {
  margin-bottom: 0.5rem;
}

.danger-action--small {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.danger-action--outline {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}

.danger-action--outline:hover {
  background: rgba(248, 81, 73, 0.1);
}

.danger-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
}

.danger-action-info {
  flex: 1;
}

.danger-action-info strong {
  display: block;
  font-size: 0.875rem;
  color: var(--fg);
  margin-bottom: 0.25rem;
}

.danger-action-info p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--fg-muted);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 2rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.24);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--canvas-subtle);
}

.modal__header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
}

.modal__close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--fg-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}

.modal__close:hover {
  background: var(--canvas-inset);
  color: var(--fg);
}

.modal__body {
  padding: 1.25rem;
  overflow-y: auto;
}

.modal__description {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

.modal__description strong {
  color: var(--fg);
}

.modal__body form[hidden] {
  display: none !important;
}

/* ============================================================
   TRANSFER TABS
   ============================================================ */
.transfer-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.transfer-tab {
  flex: 1;
  padding: 0.625rem 1rem;
  background: var(--canvas-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.transfer-tab:hover {
  background: var(--canvas-inset);
  color: var(--fg);
}

.transfer-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ============================================================
   BRANCH LIST
   ============================================================ */
.branch-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.branch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border);
  background: var(--canvas-subtle);
}

.branch-card:last-child {
  border-bottom: 0;
}

.branch-card strong {
  display: block;
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  font-weight: 500;
}

.branch-card span {
  display: block;
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-top: 0.0625rem;
}

.branch-card small {
  color: var(--fg-subtle);
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

/* ============================================================
   REPOSITORY BROWSER
   ============================================================ */
.repo-browser {
  display: flex;
  flex-direction: column;
}

.repo-browser__header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.repo-browser__title {
  flex: 1;
  min-width: 0;
}

.repo-browser__header h2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--fg);
}

.repo-browser__header h2 strong {
  font-weight: 600;
}

.repo-browser__header h2 a.repo-owner {
  color: var(--accent);
  text-decoration: none;
}

.repo-browser__header h2 a.repo-owner:hover {
  text-decoration: underline;
}

.repo-browser__header h2 .repo-sep {
  color: var(--fg-subtle);
  margin: 0;
  font-weight: 300;
}

.visibility-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 2em;
}

.visibility-badge--private {
  color: var(--warning);
  border-color: var(--warning);
}

.repo-browser__header p {
  margin: 0.375rem 0 0;
  color: var(--fg-muted);
  font-size: 0.875rem;
  max-width: 640px;
}

.repo-browser__toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.branch-selector {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas-subtle);
  font-size: 0.8125rem;
}

.branch-selector svg {
  flex-shrink: 0;
  color: var(--fg-muted);
}

.branch-selector select {
  padding: 0;
  color: var(--fg);
  border: 0;
  background: transparent;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
}

.branch-selector .branch-name {
  font-weight: 500;
}

.code-dropdown-wrap {
  position: relative;
}

.code-button {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  background: var(--success);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 120ms ease;
}

.code-button:hover {
  background: #2ea043;
}

.code-button svg:last-child {
  margin-left: 0.125rem;
}

.code-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: 300px;
  padding: 0.5rem 0;
  background: var(--canvas-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  z-index: 20;
}

.code-dropdown-wrap.is-open .code-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.code-dropdown__header {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border);
}

.code-dropdown__section {
  padding: 0.5rem 0.75rem;
}

.code-dropdown__label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.code-dropdown__field {
  display: flex;
  gap: 0.375rem;
}

.code-dropdown__field input {
  flex: 1;
  min-width: 0;
  padding: 0.375rem 0.5rem;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas-inset);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas);
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
}

.icon-button:hover {
  color: var(--fg);
  border-color: var(--fg-subtle);
}

.code-dropdown__divider {
  height: 1px;
  margin: 0.375rem 0;
  background: var(--border);
}

.code-dropdown__action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  color: var(--fg);
  font-size: 0.8125rem;
  text-decoration: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.code-dropdown__action:hover {
  background: rgba(177, 186, 196, 0.08);
}

.code-dropdown__action svg {
  flex-shrink: 0;
  color: var(--fg-muted);
}

/* ============================================================
   REPO TABS
   ============================================================ */
.repo-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  background: var(--canvas-subtle);
}

.repo-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  color: var(--fg-muted);
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: -1px;
  transition: color 120ms ease, border-color 120ms ease;
}

.repo-tab svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.repo-tab:hover {
  color: var(--fg);
}

.repo-tab:hover svg {
  opacity: 1;
}

.repo-tab.is-active {
  color: var(--fg);
  border-color: #f78166;
  font-weight: 600;
}

.repo-tab.is-active svg {
  opacity: 1;
}

.repo-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--fg-muted);
  background: rgba(177, 186, 196, 0.12);
  border-radius: 2em;
}

.repo-tab.is-active .repo-tab__count {
  color: var(--fg);
  background: rgba(177, 186, 196, 0.2);
}

/* ============================================================
   REPO STATS BAR
   ============================================================ */
.repo-browser__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0.625rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--canvas-subtle);
}

.repo-browser__stats div {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.75rem;
  font-size: 0.8125rem;
}

.repo-browser__stats div:first-child {
  padding-left: 0;
}

.repo-browser__stats div + div {
  border-left: 1px solid var(--border);
}

.repo-browser__stats dt {
  color: var(--fg-muted);
}

.repo-browser__stats dd {
  margin: 0;
  font-weight: 600;
  color: var(--fg);
}

/* ============================================================
   FILE BROWSER
   ============================================================ */
.file-browser {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1rem 1.5rem;
  background: var(--canvas);
}

.file-browser.is-dragging {
  border-color: var(--accent-emphasis);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.24);
}

.file-browser__toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.875rem;
  border-bottom: 1px solid var(--border);
  background: var(--canvas-subtle);
}

.branch-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas);
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--fg);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  color: var(--fg-muted);
  font-size: 0.875rem;
  font-family: var(--font-mono);
  min-width: 0;
}

.breadcrumb button {
  padding: 0.0625rem 0.25rem;
  color: var(--accent);
  border: 0;
  background: transparent;
  font-size: 0.875rem;
  font-family: var(--font-mono);
  font-weight: 500;
  border-radius: 2px;
  transition: background 100ms ease;
}

.breadcrumb button:hover {
  background: var(--accent-subtle);
  text-decoration: underline;
}

.breadcrumb span {
  color: var(--fg-subtle);
  margin: 0 0.125rem;
}

/* ============================================================
   FILE LIST
   ============================================================ */
.file-list {
  display: flex;
  flex-direction: column;
}

.file-list-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 0;
  padding: 0.375rem 0.875rem;
  border-bottom: 1px solid var(--border);
  background: var(--canvas-subtle);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-subtle);
}

.file-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 120px;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
  padding: 0.4375rem 0.875rem;
  color: var(--fg);
  border: 0;
  border-bottom: 1px solid var(--border-muted);
  background: transparent;
  text-align: left;
  text-decoration: none;
  transition: background 100ms ease;
}

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

.file-row:hover,
.file-row:focus {
  background: rgba(177, 186, 196, 0.04);
  outline: none;
}

.file-row__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-row__name {
  overflow: hidden;
  font-size: 0.875rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg);
}

.file-row:hover .file-row__name {
  color: var(--accent);
}

.file-row__meta {
  color: var(--fg-muted);
  font-size: 0.75rem;
  text-align: right;
  font-family: var(--font-mono);
}

/* ============================================================
   FILE VIEWER
   ============================================================ */
.file-viewer {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.file-viewer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.875rem;
  border-bottom: 1px solid var(--border);
  background: var(--canvas-subtle);
}

.file-viewer__header strong {
  font-size: 0.875rem;
  font-family: var(--font-mono);
}

.file-viewer__header span {
  color: var(--fg-muted);
  font-size: 0.8125rem;
  flex-shrink: 0;
}

.file-viewer pre {
  overflow: auto;
  max-height: 72vh;
  margin: 0;
  padding: 1rem;
  background: var(--canvas-inset);
}

.file-viewer code {
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  white-space: pre;
}

.user-menu-wrap {
  position: relative;
}

.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 20;
  display: none;
  min-width: 180px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas-subtle);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.user-menu-wrap.is-open .account-menu {
  display: grid;
}

.account-menu a,
.account-menu button {
  display: block;
  width: 100%;
  padding: 0.625rem 0.75rem;
  color: var(--fg);
  border: 0;
  border-bottom: 1px solid var(--border-muted);
  background: transparent;
  text-align: left;
  font-size: 0.8125rem;
}

.account-menu a:hover,
.account-menu button:hover {
  background: rgba(177, 186, 196, 0.08);
  text-decoration: none;
}



.repo-tab-panel,
.code-actions {
  margin: 1rem 1.5rem;
}

.code-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.upload-button {
  display: inline-flex;
  align-items: center;
}

.inline-message {
  margin: 1rem 1.5rem 0;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.8125rem;
}

.inline-message--success {
  color: var(--success);
  border: 1px solid rgba(63, 185, 80, 0.35);
  background: rgba(63, 185, 80, 0.1);
}

.inline-message--error {
  color: var(--danger);
  border: 1px solid rgba(248, 81, 73, 0.35);
  background: var(--danger-subtle);
}

.file-viewer__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border);
  background: var(--canvas);
}

.markdown-body {
  padding: 1rem;
  color: var(--fg);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin: 1rem 0 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border-muted);
}

.markdown-body p,
.markdown-body ul {
  margin: 0 0 0.75rem;
}

.markdown-body pre,
.readme-panel pre,
.diff-view {
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas-inset);
}

.markdown-body code,
.token-keyword {
  color: #ff7b72;
}

.token-string {
  color: #a5d6ff;
}

.readme-panel {
  overflow: hidden;
  margin: 1rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas);
}

.image-preview {
  display: grid;
  place-items: center;
  padding: 1rem;
  background: var(--canvas-inset);
}

.image-preview img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: var(--radius);
}

.file-editor {
  padding: 0 1.5rem 1.5rem;
}

.split-panel,
.commits-view {
  display: grid;
  grid-template-columns: minmax(260px, 0.45fr) minmax(0, 1fr);
  gap: 1rem;
}

.list-panel {
  display: grid;
  align-content: start;
  gap: 0.5rem;
}

.list-row {
  display: grid;
  gap: 0.25rem;
  width: 100%;
  padding: 0.75rem;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas-subtle);
  text-align: left;
}

.list-row:hover {
  border-color: var(--accent-emphasis);
}

.list-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-row span {
  color: var(--fg-muted);
  font-size: 0.75rem;
}

.detail-card,
.comment-card,
.member-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas-subtle);
}

.detail-card h3,
.detail-card h4 {
  margin: 0 0 0.5rem;
}

.issue-toolbar,
.quick-form,
.padded {
  margin-bottom: 1rem;
}

.quick-form {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas-subtle);
}

.label-pill {
  display: inline-flex;
  width: max-content;
  margin-right: 0.25rem;
  padding: 0.0625rem 0.375rem;
  border: 1px solid var(--border);
  border-radius: 2em;
  color: var(--fg);
}

.comment-list,
.asset-list,
.member-list {
  display: grid;
  gap: 0.5rem;
}

.asset-list a {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas);
}

.member-card {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.member-card img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

/* ============================================================
   GITHUB-STYLE PROFILE PAGE
   ============================================================ */

.profile-gh__layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  align-items: start;
  gap: 2rem;
  padding: 1.5rem;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.profile-gh__sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 1rem;
}

.profile-gh__avatar-skeleton {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  margin-bottom: 1rem;
}

.profile-gh__avatar {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  display: block;
}

.profile-gh__avatar-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  margin-bottom: 1rem;
  display: block;
  padding: 0;
  background: none;
  border: none;
  cursor: default;
  overflow: hidden;
}

.profile-gh__avatar-wrap--editable {
  cursor: pointer;
}

.profile-gh__avatar-wrap .profile-gh__avatar {
  margin-bottom: 0;
  border: none;
  width: 100%;
  height: 100%;
}

.profile-gh__avatar-wrap--editable:hover .profile-gh__avatar {
  filter: brightness(0.75);
}

.profile-gh__avatar-edit-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-gh__avatar-wrap--editable:hover .profile-gh__avatar-edit-overlay {
  opacity: 1;
}

.profile-gh__names {
  margin-bottom: 0.625rem;
}

.profile-gh__display-name {
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.1rem;
  color: var(--fg);
}

.profile-gh__username {
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  margin: 0;
}

.profile-gh__edit-btn {
  width: 100%;
  margin-bottom: 1rem;
  text-align: center;
  justify-content: center;
}

.profile-gh__bio {
  font-size: 0.875rem;
  color: var(--fg);
  margin: 0 0 1rem;
  line-height: 1.5;
}

.profile-gh__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.profile-gh__stat {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--fg-muted);
  text-decoration: none;
  cursor: pointer;
}

.profile-gh__stat:hover {
  color: var(--accent);
  text-decoration: underline;
}

.profile-gh__stat strong {
  color: var(--fg);
  font-weight: 600;
}

.profile-gh__stat svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.profile-gh__meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--fg-muted);
  margin-bottom: 0.5rem;
}

.profile-gh__meta-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.profile-gh__meta-item a {
  color: var(--accent);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-gh__meta-item a:hover {
  text-decoration: underline;
}

.profile-gh__sidebar-orgs {
  margin-top: 1.25rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.profile-gh__sidebar-orgs-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  margin: 0 0 0.625rem;
}

.profile-gh__sidebar-orgs-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.profile-gh__org-avatar {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  transition: opacity 0.15s;
}

.profile-gh__org-avatar:hover {
  opacity: 0.8;
}

.profile-gh__org-avatar img {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}

/* Main content area */
.profile-gh__main {
  min-width: 0;
  width: 100%;
}

/* Tab navigation */
.profile-gh__tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.profile-gh__tabs::-webkit-scrollbar {
  display: none;
}

.profile-gh__tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-muted);
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.profile-gh__tab:hover {
  color: var(--fg);
}

.profile-gh__tab--active {
  color: var(--fg);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.profile-gh__tab-count {
  background: var(--canvas-subtle);
  border: 1px solid var(--border);
  border-radius: 2em;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.05rem 0.45rem;
  color: var(--fg-muted);
}

/* Tab content areas */
.profile-gh__tab-content {
  min-height: 200px;
}

.profile-gh__overview {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.profile-gh__section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 0.75rem;
}

.profile-gh__pinned-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.profile-gh__repo-list .repo-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.profile-gh__repo-list .repo-grid .repo-card {
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
}

.profile-gh__repo-list .repo-grid .repo-card:first-child {
  border-top: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}

.profile-gh__repo-list .repo-grid .repo-card:last-child {
  border-radius: 0 0 var(--radius) var(--radius);
}

/* GitHub-style inline sidebar edit form */
.profile-edit-form-gh {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

.profile-edit-form-gh__field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.profile-edit-form-gh__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fg);
}

.profile-edit-form-gh__input {
  width: 100%;
  padding: 0.3125rem 0.5rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--fg);
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.profile-edit-form-gh__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.profile-edit-form-gh__textarea {
  width: 100%;
  padding: 0.3125rem 0.5rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--fg);
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-sizing: border-box;
  resize: vertical;
  min-height: 72px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.profile-edit-form-gh__textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.profile-edit-form-gh__hint {
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin: 0;
  line-height: 1.4;
}

/* ============================================================
   AVATAR CHANGE ROW (inline in profile edit form)
   ============================================================ */
.avatar-change-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
}

.avatar-change-row__thumb-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--canvas-inset);
  flex-shrink: 0;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s;
}

.avatar-change-row__thumb-wrap:hover {
  border-color: var(--accent);
}

.avatar-change-row__thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.avatar-change-row__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.15s;
  color: #fff;
}

.avatar-change-row__thumb-wrap:hover .avatar-change-row__overlay {
  opacity: 1;
}

.avatar-change-row__info {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

/* ============================================================
   AVATAR POPUP MODAL
   ============================================================ */
.avatar-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: palette-fade-in 150ms ease;
}

.avatar-popup {
  width: 100%;
  max-width: 600px;
  background: var(--canvas-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  animation: palette-slide-in 150ms ease;
  overflow: hidden;
}

.avatar-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.avatar-popup__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--fg);
}

.avatar-popup__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--fg-muted);
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease;
}

.avatar-popup__close:hover {
  color: var(--fg);
  background: rgba(177, 186, 196, 0.12);
}

.avatar-popup__body {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
}

.avatar-popup__preview-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem 1.25rem;
  border-right: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
}

.avatar-popup__preview-ring {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 3px solid var(--accent-emphasis);
  padding: 3px;
  box-shadow: 0 0 0 1px var(--border), 0 4px 16px rgba(0, 0, 0, 0.4);
}

.avatar-popup__preview-circle {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--canvas-inset);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.avatar-popup__preview-circle.is-dragging {
  cursor: grabbing;
}

.avatar-popup__preview-circle img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center;
  pointer-events: none;
}

.avatar-popup__preview-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  color: #fff;
  background: rgba(1, 4, 9, 0.68);
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.avatar-popup__preview-circle.is-loading .avatar-popup__preview-loader {
  opacity: 1;
}

.avatar-popup__spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  border-radius: 50%;
  animation: avatar-spin 700ms linear infinite;
}

@keyframes avatar-spin {
  to {
    transform: rotate(360deg);
  }
}

.avatar-popup__preview-label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-align: center;
  line-height: 1.4;
}

.avatar-popup__controls-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  overflow-y: auto;
}

/* Drop zone */
.avatar-drop-zone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
  text-align: center;
  background: transparent;
  outline: none;
}

.avatar-drop-zone:hover,
.avatar-drop-zone:focus-visible {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.avatar-drop-zone.is-dragging {
  border-color: var(--accent);
  background: rgba(56, 139, 253, 0.15);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.25);
}

.avatar-drop-zone__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.avatar-drop-zone__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  pointer-events: none;
}

.avatar-drop-zone__icon {
  color: var(--fg-subtle);
  margin-bottom: 0.125rem;
}

.avatar-drop-zone:hover .avatar-drop-zone__icon,
.avatar-drop-zone.is-dragging .avatar-drop-zone__icon {
  color: var(--accent);
}

.avatar-drop-zone__text {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--fg-muted);
}

.avatar-drop-zone__link {
  color: var(--accent);
  font-weight: 500;
}

.avatar-drop-zone__hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--fg-subtle);
}

/* URL row */
.avatar-popup__url-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.avatar-popup__url-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--fg-subtle);
  font-size: 0.75rem;
}

.avatar-popup__url-divider::before,
.avatar-popup__url-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.avatar-popup__url-input {
  width: 100%;
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
  font-family: inherit;
  color: var(--fg);
  background: var(--canvas-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.avatar-popup__url-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.25);
}

/* Sliders */
.avatar-popup__sliders {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.avatar-popup__slider-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.avatar-popup__slider-header {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-muted);
}

.avatar-popup__slider-header svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.avatar-popup__slider-label input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Footer */
.avatar-popup__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.1);
}

.avatar-popup__footer-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--fg-subtle);
  flex: 1;
}

.avatar-popup__footer-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

@media (max-width: 560px) {
  .avatar-popup__body {
    grid-template-columns: 1fr;
  }

  .avatar-popup__preview-col {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1.25rem;
    flex-direction: row;
    justify-content: flex-start;
    gap: 1rem;
  }

  .avatar-popup__preview-ring {
    width: 80px;
    height: 80px;
  }

  .avatar-popup__footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.625rem;
  }

  .avatar-popup__footer-actions {
    align-self: flex-end;
  }
}

.profile-edit-form-gh__input-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.profile-edit-form-gh__input-icon svg {
  position: absolute;
  left: 0.5rem;
  color: var(--fg-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.profile-edit-form-gh__input-icon .profile-edit-form-gh__input {
  padding-left: 1.875rem;
}

.profile-edit-form-gh__error {
  font-size: 0.8125rem;
  color: var(--danger, #f85149);
  margin: 0 0 0.75rem;
}

.profile-edit-form-gh__actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.25rem;
}

.profile-edit-form-gh__save,
.profile-edit-form-gh__cancel {
  font-size: 0.8125rem;
  padding: 0.3125rem 0.875rem;
}

/* Responsive: stack on narrow screens */
@media (max-width: 768px) {
  .profile-gh__layout {
    grid-template-columns: 1fr;
    padding: 1rem;
    gap: 1.25rem;
  }

  .profile-gh__sidebar {
    position: static;
  }

  .profile-gh__avatar {
    width: 80px;
    aspect-ratio: 1;
    float: left;
    margin-right: 1rem;
    margin-bottom: 0.5rem;
  }

  .profile-gh__names {
    padding-top: 0.25rem;
  }

  .profile-gh__edit-btn {
    clear: left;
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar__nav {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0.25rem 0.5rem;
  }

  .sidebar__note {
    display: none;
  }

  .nav-item {
    padding: 0.375rem 0.75rem;
  }

  .nav-item.is-active::before {
    top: auto;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1.5rem;
    height: 2px;
    border-radius: 2px 2px 0 0;
  }

  .auth-screen,
  .login-panel,
  .detail-panel {
    grid-template-columns: 1fr;
  }

  .detail-panel > div:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .settings-section {
    grid-template-columns: 1fr;
  }

  .settings-section > div:first-child {
    border-right: 0;
    padding-right: 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
  }

  .repo-browser__header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .profile-gh__pinned-grid {
    grid-template-columns: 1fr;
  }

  .split-panel,
  .commits-view {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 0 1rem;
  }

  .hero-card,
  .auth-screen,
  .login-panel,
  .section-heading {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .repo-card {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .file-browser {
    margin-left: 1rem;
    margin-right: 1rem;
  }

  .repo-tab-panel,
  .code-actions,
  .readme-panel,
  .inline-message {
    margin-left: 1rem;
    margin-right: 1rem;
  }

  .repo-browser__header {
    padding: 1rem;
  }

  .repo-tabs {
    padding: 0 1rem;
  }

  .not-found-shell {
    padding: 1rem;
  }

  .not-found-page {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 1.5rem;
    text-align: center;
  }

  .not-found-page__mascot {
    width: min(100%, 260px);
    justify-self: center;
  }

  .not-found-page__actions {
    justify-content: center;
  }

  .not-found-page .eyebrow {
    justify-content: center;
  }

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

  .settings-nav {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    gap: 0.25rem;
  }

  .settings-nav__item {
    width: auto;
  }

  .settings-nav__divider {
    display: none;
  }

  .settings-content {
    padding: 1rem;
  }

  .settings-header {
    padding: 0.75rem 1rem;
  }

  .repo-browser__stats {
    padding: 0.5rem 1rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .file-row {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .file-row__meta {
    display: none;
  }
}

/* ============================================================
   COMMAND PALETTE
   ============================================================ */
.command-palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  animation: palette-fade-in 150ms ease;
}

@keyframes palette-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.command-palette {
  width: 100%;
  max-width: 560px;
  max-height: 480px;
  margin: 0 1rem;
  background: var(--canvas-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  animation: palette-slide-in 150ms ease;
}

@keyframes palette-slide-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.command-palette__header {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.command-palette__search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--canvas-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.command-palette__search svg {
  flex-shrink: 0;
  color: var(--fg-muted);
}

.command-palette__search input {
  flex: 1;
  padding: 0;
  color: var(--fg);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.9375rem;
}

.command-palette__search input::placeholder {
  color: var(--fg-subtle);
}

.command-palette__results {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.command-palette__category {
  padding: 0.5rem 0.75rem 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.command-palette__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  color: var(--fg);
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.command-palette__item:hover,
.command-palette__item.is-selected {
  background: rgba(177, 186, 196, 0.12);
}

.command-palette__item.is-selected {
  background: var(--accent-subtle);
}

.command-palette__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--fg-muted);
}

.command-palette__label {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.command-palette__label strong {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg);
}

.command-palette__label span {
  font-size: 0.75rem;
  color: var(--fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.command-palette__hint {
  flex-shrink: 0;
  color: var(--fg-subtle);
  opacity: 0;
  transition: opacity 120ms ease;
}

.command-palette__item.is-selected .command-palette__hint {
  opacity: 1;
}

.command-palette__empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--fg-muted);
}

.command-palette__footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.625rem 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--fg-muted);
}

.command-palette__footer span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.command-palette__footer kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--fg-muted);
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: 3px;
}

/* ============================================================
   SHORTCUTS HELP MODAL
   ============================================================ */
.shortcuts-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  animation: palette-fade-in 150ms ease;
}

.shortcuts-modal {
  width: 100%;
  max-width: 480px;
  background: var(--canvas-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  animation: palette-slide-in 150ms ease;
}

.shortcuts-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.shortcuts-modal__header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.shortcuts-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--fg-muted);
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
}

.shortcuts-modal__close:hover {
  color: var(--fg);
  background: rgba(177, 186, 196, 0.12);
}

.shortcuts-modal__body {
  padding: 1rem;
  max-height: 400px;
  overflow-y: auto;
}

.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
}

.shortcuts-table td {
  padding: 0.5rem 0;
  vertical-align: middle;
}

.shortcuts-table__keys {
  width: 100px;
  white-space: nowrap;
}

.shortcuts-table__keys kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 0.375rem;
  margin-right: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg);
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--border);
}

.shortcuts-table__desc {
  color: var(--fg-muted);
  font-size: 0.875rem;
}

.shortcuts-table__context {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.125rem 0.375rem;
  font-size: 0.6875rem;
  color: var(--fg-subtle);
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: 2em;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  max-width: 420px;
  padding: 0.75rem 1rem;
  background: var(--canvas-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 200ms ease, transform 200ms ease;
}

.toast--visible {
  opacity: 1;
  transform: translateX(0);
}

.toast--leaving {
  opacity: 0;
  transform: translateX(100%);
}

.toast__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast--success .toast__icon {
  color: var(--success);
}

.toast--error .toast__icon {
  color: var(--danger);
}

.toast--warning .toast__icon {
  color: var(--warning);
}

.toast--info .toast__icon {
  color: var(--accent);
}

.toast__message {
  flex: 1;
  font-size: 0.875rem;
  color: var(--fg);
}

.toast__close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  color: var(--fg-muted);
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease;
}

.toast__close:hover {
  color: var(--fg);
  background: rgba(177, 186, 196, 0.12);
}

@media (max-width: 640px) {
  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}

/* ============================================================
   SKELETON LOADING
   ============================================================ */
@keyframes skeleton-pulse {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--canvas-subtle) 25%,
    var(--border-muted) 50%,
    var(--canvas-subtle) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius);
}

.skeleton-text {
  height: 1em;
  margin: 0.25em 0;
}

.skeleton-text--sm {
  height: 0.75em;
  width: 60%;
}

.skeleton-text--lg {
  height: 1.5em;
  width: 40%;
}

.skeleton-card {
  padding: 1rem;
  background: var(--canvas-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.skeleton-card__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.skeleton-card__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.skeleton-card__title {
  flex: 1;
}

.skeleton-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.skeleton-repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  padding: 1rem 1.5rem;
}

.skeleton-file-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 0;
}

.skeleton-file-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
}

.skeleton-file-row__icon {
  width: 16px;
  height: 16px;
  border-radius: 2px;
}

.skeleton-file-row__name {
  flex: 1;
  height: 0.875em;
}

.skeleton-file-row__size {
  width: 40px;
  height: 0.75em;
}

.skeleton-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.skeleton-header__title {
  height: 1.5em;
  width: 200px;
  margin-bottom: 0.5rem;
}

.skeleton-header__desc {
  height: 0.875em;
  width: 60%;
}

.skeleton-toolbar {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.skeleton-toolbar__btn {
  width: 80px;
  height: 32px;
  border-radius: var(--radius);
}

/* ========================================
   GitHub-Style Dashboard
   ======================================== */

.dashboard-layout {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 1.5rem 2rem;
}

.contribution-graph {
  width: fit-content;
  max-width: 100%;
  margin-bottom: 1.25rem;
  padding: 1rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas-subtle);
}

.contribution-graph__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.875rem;
}

.contribution-graph__header h2 {
  margin: 0;
  color: var(--fg);
  font-size: 0.9375rem;
  font-weight: 600;
}

.contribution-graph__header p,
.contribution-graph__header span {
  margin: 0.1875rem 0 0;
  color: var(--fg-muted);
  font-size: 0.8125rem;
}

.contribution-graph__body {
  width: max-content;
  max-width: none;
}

.contribution-graph__months {
  display: grid;
  gap: 3px;
  width: max-content;
  margin: 0 0 0.375rem 0;
  color: var(--fg-subtle);
  font-size: 0.6875rem;
}

.contribution-graph__months span {
  white-space: nowrap;
}

.contribution-graph__grid {
  display: grid;
  grid-template-rows: repeat(7, 10px);
  grid-auto-flow: column;
  width: max-content;
  gap: 3px;
}

.contribution-graph__cell {
  display: block;
  width: 10px;
  height: 10px;
  border: 1px solid rgba(240, 246, 252, 0.04);
  border-radius: 2px;
  background: var(--border-muted);
}

.contribution-graph__cell--empty {
  opacity: 0.35;
}

.contribution-graph__cell[data-level="1"] {
  background: #0e4429;
}

.contribution-graph__cell[data-level="2"] {
  background: #006d32;
}

.contribution-graph__cell[data-level="3"] {
  background: #26a641;
}

.contribution-graph__cell[data-level="4"] {
  background: #39d353;
}

.contribution-graph__legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  margin-top: 0.625rem;
  color: var(--fg-subtle);
  font-size: 0.6875rem;
}

.contribution-graph__skeleton {
  height: 104px;
}

/* Center Feed */
.dashboard-feed {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.dashboard-feed__header {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.dashboard-feed__header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0;
}

.dashboard-feed__content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.feed-loading,
.feed-error {
  padding: 1.5rem;
  text-align: center;
}

.feed-error p {
  color: var(--danger);
  margin: 0;
}

.feed-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.feed-empty h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 0.5rem;
}

.feed-empty p {
  color: var(--fg-muted);
  margin: 0;
  max-width: 360px;
}

/* Feed Items */
.feed-item {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.15s;
}

.feed-item:hover {
  border-color: var(--border-muted);
}

.feed-item__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.feed-item--release .feed-item__icon {
  background: rgba(56, 139, 253, 0.15);
  color: #388bfd;
}

.feed-item--commit .feed-item__icon {
  background: rgba(139, 148, 158, 0.15);
  color: var(--fg-muted);
}

.feed-item__content {
  flex: 1;
  min-width: 0;
}

.feed-item__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
}

.feed-item__repo {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}

.feed-item__repo:hover {
  text-decoration: underline;
}

.feed-item__time {
  font-size: 0.75rem;
  color: var(--fg-subtle);
}

.feed-item__body {
  margin-bottom: 0.5rem;
}

.feed-item__title {
  display: block;
  margin-bottom: 0.25rem;
}

.feed-item__title button {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--fg);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.feed-item__title button:hover {
  color: var(--accent);
}

.feed-item__desc {
  font-size: 0.8125rem;
  color: var(--fg-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-item__commit-msg {
  font-size: 0.875rem;
  color: var(--fg);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  display: block;
}

.feed-item__commit-msg:hover {
  color: var(--accent);
}

.feed-item__author {
  font-size: 0.75rem;
  color: var(--fg-subtle);
}

.feed-item__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feed-item__tag {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(56, 139, 253, 0.15);
  color: #388bfd;
  border-radius: 99px;
}

.feed-item__sha {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--fg-muted);
  background: var(--bg-tertiary);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius);
}

/* ============================================================
   RIGHT RAIL
   ============================================================ */
.right-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  border-left: 1px solid var(--border);
  background: var(--canvas-subtle);
  padding: 1rem 0;
  gap: 0;
}

.right-rail__profile {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0 1rem 1rem;
  border-bottom: 1px solid var(--border-muted);
  margin-bottom: 0.5rem;
}

.right-rail__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.right-rail__profile-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.right-rail__profile-info strong {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.right-rail__profile-info span {
  font-size: 0.75rem;
  color: var(--fg-muted);
}

.right-rail__section {
  padding: 0.625rem 1rem;
}

.right-rail__section + .right-rail__section {
  border-top: 1px solid var(--border-muted);
  margin-top: 0.25rem;
}

.right-rail__section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-subtle);
  margin: 0 0 0.625rem;
}

.right-rail__stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.right-rail__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.25rem;
  border-radius: var(--radius);
  background: rgba(177, 186, 196, 0.06);
}

.right-rail__stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.2;
}

.right-rail__stat-label {
  font-size: 0.625rem;
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.right-rail__org-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.right-rail__org-avatar {
  width: 26px;
  height: 26px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 1px solid var(--border);
}

.right-rail__empty {
  font-size: 0.8rem;
  color: var(--fg-subtle);
  margin: 0;
}

.right-rail__tips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.right-rail__tips li {
  font-size: 0.75rem;
  color: var(--fg-muted);
  line-height: 1.4;
}

.right-rail__tips kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--fg-muted);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 3px;
  vertical-align: middle;
}

/* Dashboard Responsive */
@media (max-width: 1100px) {
  .app-shell.has-right-rail {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .right-rail {
    display: none;
  }
}

@media (max-width: 768px) {
  .dashboard-layout {
    width: auto;
    padding: 0.75rem;
  }

  .contribution-graph {
    width: auto;
    margin-bottom: 1rem;
  }
}
