/*── PermawebOS design system (permaweb-os-client) ────────────────*/
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,200;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* Dark (default when data-theme is dark or unset after toggle) */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  --neutral-1: #1A1815;
  --neutral-2: #211F1B;
  --neutral-3: #2B2924;
  --neutral-4: #312E28;
  --neutral-5: #3A3630;
  --neutral-a1: #FBF8F3;
  --neutral-a5: #D4CFC6;
  --neutral-a6: #9A9289;
  --positive: #62c1b1;
  --negative: #F16A82;
  --link-color: #D4CFC6;
  --link-hover: #FFFFFF;
  --shadow-soft: rgb(0 0 0 / 0.5);
  --btn-alt-bg: rgba(43, 40, 36, 0.75);

  --bg: var(--neutral-1);
  --bg-card: var(--neutral-1);
  --bg-elevated: var(--neutral-2);
  --bg-hover: var(--neutral-3);
  --bg-glass: color-mix(in oklab, var(--neutral-1) 60%, transparent);
  --border: var(--neutral-3);
  --border-subtle: var(--neutral-3);
  --text: var(--neutral-a1);
  --text-secondary: var(--neutral-a5);
  --text-tertiary: var(--neutral-a6);
  --accent: var(--neutral-a1);
  --accent-soft: rgba(251, 248, 243, 0.08);
  --accent-glow: rgba(251, 248, 243, 0.12);
  --green: var(--positive);
  --green-soft: rgba(98, 193, 177, 0.12);
  --red: var(--negative);
  --red-soft: rgba(241, 106, 130, 0.12);
  --orange: #EECA00;
  --purple: #8580d9;
  --purple-soft: rgba(133, 128, 217, 0.12);
  --cyan: var(--positive);
  --gradient-accent: none;
  --gradient-subtle: none;
  --shadow-sm: 0 1px 5px 0 var(--shadow-soft);
  --shadow: 0 1px 5px 0 var(--shadow-soft);
  --shadow-lg: 0 3.5px 7.5px 0 var(--shadow-soft);
  --radius-sm: 5px;
  --radius: 5px;
  --radius-lg: 10px;
  --radius-xl: 10px;
  --radius-pill: var(--radius-sm);
  --transition: 100ms ease;
  --header-height: 60.5px;
  --header-fade-depth: 12px;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-display: 'Times New Roman', Times, serif;
  /* Global layout widths — use .page-max / .feed-max shells or matching selectors below */
  --header-max: 1800px;
  --page-max: 1400px;
  --feed-max: 1400px;
  --primary-hover-bg: #CEC8BE;
  --primary-hover-color: #1A1815;
  --btn-primary-bg: var(--text);
  --btn-primary-fg: var(--bg);
  --btn-hover-bg: color-mix(in oklab, var(--neutral-5) 78%, var(--neutral-a1) 22%);
}

[data-theme="light"] {
  color-scheme: light;
  --neutral-1: #FFFFFF;
  --neutral-2: #FAFAFA;
  --neutral-3: #F0F0F0;
  --neutral-4: #E5E5E5;
  --neutral-5: #D4D4D4;
  --neutral-a1: #1C1916;
  --neutral-a5: #5C554D;
  --neutral-a6: #756E65;
  --positive: #13ab8f;
  --negative: #F16A82;
  --link-color: #5C554D;
  --link-hover: #1C1916;
  --shadow-soft: rgb(0 0 0 / 0.08);
  --btn-alt-bg: rgba(245, 245, 245, 0.85);

  --bg: var(--neutral-1);
  --bg-card: var(--neutral-1);
  --bg-elevated: var(--neutral-2);
  --bg-hover: var(--neutral-3);
  --bg-glass: color-mix(in oklab, var(--neutral-1) 60%, transparent);
  --border: var(--neutral-3);
  --border-subtle: var(--neutral-3);
  --text: var(--neutral-a1);
  --text-secondary: var(--neutral-a5);
  --text-tertiary: var(--neutral-a6);
  --accent: var(--neutral-a1);
  --accent-soft: rgba(28, 25, 22, 0.06);
  --accent-glow: rgba(28, 25, 22, 0.1);
  --green: var(--positive);
  --green-soft: rgba(19, 171, 143, 0.1);
  --red: var(--negative);
  --red-soft: rgba(241, 106, 130, 0.1);
  --orange: #D97706;
  --purple: #7C3AED;
  --purple-soft: rgba(124, 58, 237, 0.08);
  --cyan: var(--positive);
  --gradient-accent: none;
  --gradient-subtle: none;
  --shadow-sm: 0 1px 5px 0 var(--shadow-soft);
  --shadow: 0 1px 5px 0 var(--shadow-soft);
  --shadow-lg: 0 3.5px 7.5px 0 var(--shadow-soft);
  --primary-hover-bg: #3D3934;
  --primary-hover-color: #FFFFFF;
  --btn-primary-bg: var(--text);
  --btn-primary-fg: var(--neutral-1);
  --btn-hover-bg: color-mix(in oklab, var(--neutral-5) 70%, white 30%);
}

/*── Global ───────────────────────────────────────────────────────*/
code, pre, kbd, samp {
  font-family: var(--font-sans);
}
html {
  font-size: 16px;
  letter-spacing: 0.15px;
}
body {
  font-family: var(--font-sans);
  font-weight: 500;
}
h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: 0.5px;
  line-height: 1.25;
}
a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 100ms ease;
}
a:hover {
  color: var(--link-hover);
  text-decoration: none;
}
::selection {
  background: var(--accent-soft);
  color: var(--text);
}
:focus-visible {
  outline: 2px solid var(--neutral-a5);
  outline-offset: 2px;
}
html {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in oklab, var(--text-tertiary) 28%, transparent) transparent;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in oklab, var(--text-tertiary) 28%, transparent);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: color-mix(in oklab, var(--text-tertiary) 45%, transparent);
}

/*── Utilities (PermawebOS border wrappers) ───────────────────────*/
.border-wrapper-primary,
.border-wrapper-alt1,
.border-wrapper-alt2,
.border-wrapper-alt3 {
  border: 1px solid var(--border);
}
.border-wrapper-primary {
  background: transparent;
  border-radius: var(--radius-lg);
}
.border-wrapper-alt1 {
  background: transparent;
  border-radius: var(--radius-lg);
  box-shadow: none;
}
.border-wrapper-alt2 {
  background: transparent;
  border-radius: var(--radius-lg);
}
.border-wrapper-alt3 {
  background: transparent;
  border-radius: var(--radius-sm);
}
.backdrop-wrapper-primary {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  flex-shrink: 0;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.backdrop-wrapper-primary::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: var(--header-fade-depth);
  background: linear-gradient(
    to bottom,
    var(--bg) 0%,
    color-mix(in oklab, var(--bg) 72%, transparent) 45%,
    color-mix(in oklab, var(--bg) 28%, transparent) 80%,
    transparent 100%
  );
  pointer-events: none;
}
.fade-in { animation: fadeIn 300ms cubic-bezier(0, 0, 0.2, 1) both; }

/*── Global layout shells (--page-max / --feed-max) ───────────────*/
.page-max,
.view-wrapper,
.container,
footer .footer-inner,
.diff-page,
.profile-page,
.profile-edit-page {
  max-width: var(--page-max);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.feed-max,
.feed-wrapper,
.home-feed-section .home-feed-header,
.home-feed-section .home-feed-panel,
.repo-grid.feed-list,
.view-wrapper.issues-page,
.issue-new-page {
  max-width: var(--feed-max);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/*── Header ───────────────────────────────────────────────────────*/
header {
  height: var(--header-height);
  padding: 0 25px;
  background: var(--bg);
  border-bottom: none;
  gap: 15px;
}
header .header-inner {
  max-width: var(--header-max);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 15px;
}
.header-top {
  display: contents;
}
.hamburger,
.header-nav-backdrop,
.notification-backdrop {
  display: none;
}
header .logo {
  grid-column: 1;
  justify-self: start;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.08px;
  gap: 6px;
}
.logo-mark {
  display: flex;
  flex-shrink: 0;
  line-height: 0;
  color: var(--text);
}
.logo-mark svg {
  display: block;
  width: 40px;
  height: 20px;
}
header .logo-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  font-size: 16px;
}
header nav a,
header nav .header-nav-btn {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.35px;
  color: var(--text-secondary);
  padding: 0 11.5px;
  min-height: 35px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
}
header nav .header-nav-btn {
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  transition: all 100ms ease;
}
header nav a:hover,
header nav a.active,
header nav .header-nav-btn:hover {
  color: var(--text);
  background: var(--btn-hover-bg);
  border-color: var(--btn-hover-bg);
  text-decoration: none;
}
.header-badge {
  font-size: 9px;
  font-weight: 500;
  line-height: 1.2;
  padding: 1px 4px;
  border-radius: 3px;
  background: #E5E5E5;
  color: #5C554D;
  border: 1px solid #D4D4D4;
  align-self: center;
  transform: translateY(1px);
}
.header-badge::before { background: var(--positive); }

.header-search {
  grid-column: 2;
  justify-self: center;
  width: 300px;
  max-width: min(300px, 42vw);
  min-width: 0;
  position: relative;
  display: block;
}
.header-search.search-wrapper-inline .search-input,
.header-search.search-wrapper-inline .search-input:focus {
  width: 100%;
  box-sizing: border-box;
  min-height: 35px;
  font-size: 13px;
  padding-left: 40px;
  padding-right: 34px;
}
.header-search .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.header-search .search-icon svg {
  position: static;
  transform: none;
  width: 14px;
  height: 14px;
}
.search-wrapper-inline .search-kbd {
  z-index: 2;
}
header nav {
  grid-column: 3;
  justify-self: end;
  flex-shrink: 0;
}

@media (min-width: 769px) {
  header .header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto;
    align-items: center;
    padding: 0;
  }
  .header-top {
    display: contents;
  }
  header .logo {
    grid-column: 1;
    grid-row: 1;
  }
  .header-search {
    grid-column: 2;
    grid-row: 1;
  }
  header nav {
    display: flex;
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }
  .hamburger,
  .header-nav-backdrop,
  .notification-backdrop,
  .wallet-backdrop {
    display: none !important;
  }
}

/*── Layout ───────────────────────────────────────────────────────*/
.container {
  padding: 25px;
}
@media (max-width: 768px) {
  header { padding: 0 15px; height: auto; min-height: 0; }
  .container { padding: 15px; }
}

/*── Buttons ──────────────────────────────────────────────────────*/
.btn-primary,
.hero-btn-primary,
.btn-connect-large {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 35px;
  padding: 0 17.5px;
  border-radius: var(--radius-pill);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  border: 1px solid var(--btn-primary-bg);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 100ms ease;
  text-decoration: none;
  box-shadow: none;
}
.btn-primary:hover,
.hero-btn-primary:hover,
.btn-connect-large:hover {
  background: var(--primary-hover-bg);
  border-color: var(--primary-hover-bg);
  color: var(--primary-hover-color);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: none;
  filter: none;
  opacity: 1;
}
a.btn-primary,
a.hero-btn-primary,
a.btn-connect-large {
  color: var(--btn-primary-fg);
}
a.btn-primary:hover,
a.hero-btn-primary:hover,
a.btn-connect-large:hover {
  color: var(--primary-hover-color);
}
.btn-small,
.ref-btn,
.wallet-btn,
.clone-btn,
.hero-btn-secondary,
.star-btn,
.issues-filter-btn,
.diff-expand-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 35px;
  padding: 0 17.5px;
  border-radius: var(--radius-pill);
  background: var(--btn-alt-bg);
  color: var(--text-secondary);
  border: 1px solid var(--btn-alt-bg);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 100ms ease;
  text-decoration: none;
}
.btn-small:hover,
.ref-btn:hover,
.wallet-btn:hover,
.clone-btn:hover,
.hero-btn-secondary:hover,
.star-btn:hover,
.issues-filter-btn:hover,
.diff-expand-all:hover {
  background: var(--btn-hover-bg);
  border-color: var(--btn-hover-bg);
  color: var(--text);
  text-decoration: none;
}
.ref-btn.open {
  background: var(--neutral-5);
  border-color: var(--neutral-5);
  box-shadow: none;
}

/*── Icon-only buttons (rounded square) ───────────────────────────*/
.btn-icon,
.theme-toggle,
.step-copy,
.btn-copy,
.profile-copy-btn,
.wm-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  min-width: 35px;
  min-height: 35px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: all 100ms ease;
  text-decoration: none;
  flex-shrink: 0;
}
.btn-icon:hover,
.theme-toggle:hover,
.step-copy:hover,
.btn-copy:hover,
.profile-copy-btn:hover,
.wm-close:hover {
  background: var(--btn-hover-bg);
  border-color: var(--btn-hover-bg);
  color: var(--text);
}
.btn-icon svg,
.theme-toggle svg,
.hamburger svg,
.step-copy svg,
.btn-copy svg,
.profile-copy-btn svg {
  width: 18px;
  height: 18px;
}
.wm-close {
  font-size: 20px;
}

.issues-filter-btn.active {
  background: var(--neutral-5);
  border-color: var(--neutral-5);
  color: var(--text);
}
.btn-outline,
.btn-secondary,
.hero-btn-secondary {
  background: var(--btn-alt-bg);
  border: 1px solid var(--btn-alt-bg);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
}
.btn-success,
.btn-success-outline {
  background: var(--positive);
  border-color: var(--positive);
  color: #fff;
  border-radius: var(--radius-pill);
}
.btn-danger,
.btn-danger-outline {
  background: var(--negative);
  border-color: var(--negative);
  color: #fff;
  border-radius: var(--radius-pill);
}
.btn-link {
  background: transparent;
  border: none;
  color: var(--link-color);
  padding: 0;
  min-height: 0;
}
.btn-link:hover { color: var(--link-hover); }

/*── Forms ────────────────────────────────────────────────────────*/
.search-input,
.form-input,
.form-textarea,
.form-select {
  min-height: 42.5px;
  padding: 10px 12.5px;
  background: var(--btn-alt-bg);
  border: 1px solid var(--neutral-4);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.15px;
  color: var(--text);
  transition: border-color 325ms ease, outline 325ms ease;
}
.search-input:focus,
.form-input:focus,
.form-textarea:focus {
  outline: 0.5px solid var(--neutral-a5);
  border-color: var(--neutral-a5);
  box-shadow: none;
  background: var(--btn-alt-bg);
}
.form-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 7.5px;
}

/*── Feed-style repo list (Landing / Asset pattern) ───────────────*/
.home-repos-section.feed-section { margin-bottom: 2rem; }
.repos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.section-heading,
.view-header-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.08px;
  margin: 0;
}
.repo-grid.feed-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.repo-card {
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  border-bottom: 1px solid var(--border);
  padding: 12.5px;
  margin: 0;
  box-shadow: none;
  transform: none;
}
.repo-card:last-child { border-bottom: none; }
.repo-card:hover {
  background: var(--bg-elevated);
  border-color: var(--border);
  box-shadow: none;
  transform: none;
}
.repo-card::before { display: none; }
.repo-card:focus-visible {
  outline: 2px solid var(--neutral-5);
  outline-offset: -2px;
}

/*── Profile: compact activity list ───────────────────────────────*/
.activity-compact-section {
  padding: 18px 20px;
}
.activity-compact-row {
  padding: 10px 12px;
  min-height: 40px;
}
.activity-compact-row:hover {
  background: var(--bg-elevated);
}
.activity-compact-skeleton .activity-compact-row:hover {
  background: transparent;
}

/*── Home: activity feed ──────────────────────────────────────────*/
.activity-feed {
  overflow: hidden;
  border-radius: var(--radius-sm);
}
.activity-compact-feed.border-wrapper-primary {
  border-radius: var(--radius-sm);
}
.activity-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: flex-start;
  min-height: 68px;
  padding: 18px;
  border-bottom: 1px solid var(--border);
  color: inherit;
  cursor: pointer;
  transition: background 150ms ease;
}
.activity-row:last-child {
  border-bottom: none;
}
.activity-row:hover {
  background: var(--bg-elevated);
}
.activity-row:focus,
.activity-row:focus-visible {
  outline: none;
}
.activity-row-skeleton {
  grid-template-columns: auto minmax(0, 1fr) auto;
  cursor: default;
  pointer-events: none;
}
.activity-row-skeleton:hover {
  background: transparent;
}
.commit-item-skeleton,
.commit-group-skeleton {
  pointer-events: none;
}
.commit-item-skeleton:hover {
  background: transparent;
  border-left-color: transparent;
}
.issue-row-skeleton {
  pointer-events: none;
}
.issue-row-skeleton:hover {
  background: transparent;
  border-color: var(--border);
}
.stats-bar-skeleton {
  gap: 8px;
}
.stat-skeleton-pill {
  display: inline-flex;
  flex-shrink: 0;
}
.about-box-skeleton,
.readme-box-skeleton {
  pointer-events: none;
}
.profile-edit-form-skeleton {
  pointer-events: none;
}
.activity-avatars {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.activity-avatar,
.activity-repo-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  line-height: 0;
  text-decoration: none;
}
.activity-avatar > .perm-avatar,
.activity-repo-avatar > .perm-avatar {
  width: 100% !important;
  height: 100% !important;
  flex: none !important;
}
.activity-flow-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-tertiary);
}
.activity-flow-arrow .ph-icon {
  display: block;
  width: 14px;
  height: 14px;
}
.activity-chip svg {
  width: 14px;
  height: 14px;
}
.activity-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.activity-copy {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.35;
}
.activity-actor,
.activity-repo {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.activity-actor:hover,
.activity-repo:hover {
  color: var(--link-hover);
  text-decoration: underline;
}
.activity-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.activity-detail--group {
  justify-content: space-between;
  gap: 12px;
}
.activity-detail-start {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.activity-detail-end {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}
.activity-diff-stats {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.activity-diff-add {
  color: var(--positive);
}
.activity-diff-del {
  color: var(--negative);
}
.activity-context {
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.activity-side-meta {
  color: var(--text-tertiary);
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
}
.activity-badge-new {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid color-mix(in oklab, var(--positive) 35%, var(--border));
  border-radius: var(--radius-pill);
  color: var(--positive);
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
  flex-shrink: 0;
}
.activity-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-width: 0;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  background: var(--btn-alt-bg);
  font-family: var(--font-sans);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-sha,
.activity-time {
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  white-space: nowrap;
}
.activity-side .activity-time {
  margin-top: 2px;
}

/*── Grouped ref activity (nearby pushes on same branch) ───────────*/
.activity-group {
  --activity-thread-x: 32px;
  --activity-thread-color: color-mix(in srgb, var(--border) 62%, var(--text-tertiary) 38%);
  position: relative;
  border-bottom: 1px solid var(--border);
  transition: background 150ms ease;
}
.activity-group:last-child {
  border-bottom: none;
}
.activity-group:hover {
  background: var(--bg-elevated);
}
.activity-group:focus-within {
  background: var(--bg-elevated);
}
.activity-group-header.activity-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto auto;
  align-items: start;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  border-bottom: none;
  position: relative;
  z-index: 1;
}
.activity-group-header .activity-main {
  display: contents;
}
.activity-group-header .activity-avatars {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: start;
}
.activity-group-header .activity-copy {
  grid-column: 2;
  grid-row: 1;
}
.activity-group-header .activity-side {
  grid-column: 3;
  grid-row: 1;
}
.activity-group-header .activity-detail--group {
  grid-column: 2 / 4;
  grid-row: 2;
  width: 100%;
}
.activity-group-header .activity-context {
  grid-column: 2 / 4;
  grid-row: 3;
}
.activity-group-header:hover {
  background: transparent;
}
.activity-group-header:focus,
.activity-group-header:focus-visible {
  outline: none;
}
.activity-group.is-expanded .activity-group-header {
  padding-bottom: 10px;
}
.activity-group.is-expanded .activity-group-header .activity-avatar {
  position: relative;
  z-index: 1;
  background: var(--bg);
  box-shadow: 0 0 0 2px var(--bg);
}
.activity-group.is-expanded:is(:hover, :focus-within) .activity-group-header .activity-avatar {
  background: var(--bg-elevated);
  box-shadow: 0 0 0 2px var(--bg-elevated);
}
.activity-group.is-expanded::before {
  content: '';
  position: absolute;
  left: var(--activity-thread-x);
  top: 46px;
  bottom: var(--activity-thread-stop, 14px);
  width: 1px;
  transform: translateX(-50%);
  background: var(--activity-thread-color);
  border-radius: 0.5px;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 150ms ease;
}
.activity-group.is-expanded.has-children::before {
  opacity: 1;
}
.activity-group-count {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  background: var(--btn-alt-bg);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.activity-group-chevron {
  display: inline-flex;
  color: var(--text-tertiary);
  transition: transform 150ms ease;
}
.activity-group-chevron .dropdown-chevron {
  display: inline-flex;
}
.activity-group.is-expanded .activity-group-chevron .dropdown-chevron {
  transform: rotate(0deg);
}
.activity-group:not(.is-expanded) .activity-group-chevron .dropdown-chevron {
  transform: rotate(-90deg);
}
.activity-group-items {
  display: none;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  position: relative;
  z-index: 1;
}
.activity-group.is-expanded .activity-group-items {
  display: block;
}
.activity-group-items[hidden] {
  display: none !important;
}
.activity-row--nested {
  min-height: 52px;
  padding: 6px 18px;
  margin: 0;
  border: none;
  border-radius: 0;
  cursor: pointer;
  background: transparent;
  position: relative;
  z-index: 1;
}
.activity-row--nested:hover {
  background: transparent;
}
.activity-row--nested .activity-avatar {
  margin-left: 3px;
  position: relative;
  z-index: 1;
  background: var(--bg);
  box-shadow: 0 0 0 2px var(--bg);
}
.activity-group:is(:hover, :focus-within) .activity-row--nested .activity-avatar {
  background: var(--bg-elevated);
  box-shadow: 0 0 0 2px var(--bg-elevated);
}
.activity-group-items .activity-row-skeleton {
  min-height: 52px;
  padding: 6px 18px;
  border: none;
  pointer-events: none;
}
.activity-group-items .activity-row-skeleton:hover {
  background: transparent;
}
.activity-row--nested .activity-avatar,
.activity-row--nested .activity-repo-avatar {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
}
.activity-row--nested .activity-avatar > .perm-avatar,
.activity-row--nested .activity-repo-avatar > .perm-avatar {
  width: 100% !important;
  height: 100% !important;
}
.activity-row--nested .activity-flow-arrow .ph-icon {
  width: 12px;
  height: 12px;
}
.activity-row--nested .activity-copy {
  font-size: 13px;
}
.activity-row--nested .activity-context {
  font-size: 12px;
}

.activity-sentinel {
  height: 4px;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

.activity-loading-more .activity-row-skeleton:last-child {
  border-bottom: none;
}
.activity-back-to-start {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
}
.activity-back-to-start.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.activity-back-to-start:hover {
  background: var(--bg-hover);
  border-color: var(--neutral-4);
}
.activity-back-to-start-icon {
  display: flex;
  align-items: center;
  transform: rotate(90deg);
}

/*── Home: feed tab (Activity / Repos) ────────────────────────────*/
.home-feed-section {
  margin-bottom: 25px;
  scroll-margin-top: calc(var(--header-height) + var(--header-fade-depth) + 10px);
}
.home-feed-header {
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.home-feed-tab {
  position: relative;
  display: inline-flex;
}
.home-feed-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 100ms ease;
}
.home-feed-tab-btn:hover {
  color: var(--link-hover);
}
.home-feed-tab-btn:focus-visible {
  outline: 2px solid var(--neutral-5);
  outline-offset: 4px;
}
.home-feed-tab-btn .section-heading {
  margin: 0;
  font-weight: 400;
  pointer-events: none;
}
.home-feed-tab-chevron {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  transition: transform 100ms ease, color 100ms ease;
}
.home-feed-tab-chevron svg {
  width: 16px;
  height: 16px;
}
.home-feed-tab-btn.open .home-feed-tab-chevron {
  color: var(--text);
}
.home-feed-tab-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 90;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--neutral-4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  animation: fadeIn 200ms cubic-bezier(0, 0, 0.2, 1) both;
  --dropdown-item-gap: 2px;
}
.home-feed-tab-menu.dropdown-menu__body {
  padding: var(--dropdown-padding);
  gap: var(--dropdown-item-gap);
}
.home-feed-tab-menu[hidden] {
  display: none !important;
}
.home-feed-tab-option {
  text-decoration: none;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08px;
  text-align: left;
  cursor: pointer;
  transition: background 100ms ease, color 100ms ease;
}
.home-feed-tab-option:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.home-feed-tab-option.active {
  background: var(--btn-alt-bg);
  color: var(--text);
}
.home-feed-tab-option:focus-visible {
  outline: 2px solid var(--neutral-5);
  outline-offset: -2px;
}
.home-feed-panel[hidden] {
  display: none !important;
}
#app:focus,
#app:focus-visible,
.home-feed-section:focus,
.home-feed-section:focus-visible,
.home-feed-panel:focus,
.home-feed-panel:focus-visible {
  outline: none;
}
.browse-repos-highlight {
  animation: browse-highlight 1.2s ease;
}
.browse-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.browse-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.browse-control-label {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.browse-filter {
  position: relative;
}
.browse-filter .ref-dropdown {
  min-width: 168px;
  max-width: min(220px, 92vw);
  right: 0;
  left: auto;
}
.browse-filter-btn > span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
@keyframes browse-highlight {
  0%, 100% { box-shadow: none; }
  30% { box-shadow: 0 0 0 2px color-mix(in oklab, var(--positive) 35%, transparent); }
}
.browse-repo-tile {
  cursor: pointer;
}
.browse-repo-title-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.browse-repo-owner {
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
}
.browse-repo-owner:hover {
  color: var(--link-hover);
  text-decoration: underline;
}
.browse-repo-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3em;
}
.browse-repo-desc--loading {
  color: var(--text-tertiary);
  font-style: italic;
}
.browse-repo-desc--empty {
  color: var(--text-tertiary);
  font-style: italic;
}
.browse-repo-meta {
  margin-top: auto;
}
.browse-repo-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
}
.browse-repo-stat strong {
  color: var(--text);
  font-weight: 600;
}
.browse-repo-stat--time {
  margin-left: auto;
}
.browse-repo-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.browse-repo-footer .browse-repo-stat--time {
  margin-left: 0;
}
.browse-repo-tx-ref {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/*── Home: repo tiles grid ─────────────────────────────────────────*/
.repo-grid.repo-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.repo-grid.repo-tiles .repo-card,
.repo-grid.repo-tiles .repo-tile {
  display: flex;
  flex-direction: column;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
  margin: 0;
  overflow: hidden;
  min-height: 168px;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, background 150ms ease;
}
.repo-grid.repo-tiles .repo-card:hover,
.repo-grid.repo-tiles .repo-tile:hover {
  background-color: var(--bg-elevated);
  border-color: var(--neutral-4);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.browse-repo-tile {
  background-image: none;
}
.browse-repo-tile:hover {
  border-color: var(--neutral-4);
}
.repo-grid.repo-tiles .repo-tile:focus,
.repo-grid.repo-tiles .repo-tile:focus-visible {
  outline: none;
}
.repo-grid.repo-tiles .repo-card:last-child {
  border-bottom: 1px solid var(--border);
}
.repo-tile-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 12px;
  padding: 16px;
}
.repo-grid.repo-tiles .repo-card-header {
  margin-bottom: 0;
  align-items: flex-start;
  gap: 10px;
}
.repo-grid.repo-tiles .repo-avatar.perm-avatar {
  width: 36px;
  height: 36px;
}
.repo-grid.repo-tiles .repo-name {
  font-size: 15px;
  line-height: 1.25;
  word-break: break-word;
}
.repo-grid.repo-tiles .repo-card-meta {
  margin-top: auto;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}
.repo-grid.repo-tiles .repo-meta-right {
  margin-left: auto;
  flex-shrink: 0;
}
.repo-tile-skeleton {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  min-height: 168px;
}
.repo-tile-skeleton-body {
  padding: 0;
}

/*── File tree (FileTree organism) ────────────────────────────────*/
.file-table-wrap {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: none;
}
.file-table-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 12.5px 15px;
  font-size: 13px;
}
.file-table-header::after { display: none; }
.file-table .row {
  min-height: 37.5px;
  padding: 0 15px;
  border-bottom: none;
  border-left: none;
  font-size: 13px;
  font-weight: 500;
}
.file-table .row:hover {
  background: var(--neutral-3);
  border-left: none;
}
.file-table .row .name { color: var(--text); }
.file-table .row-parent .name { color: var(--text-secondary); }

/*── Dropdown menu (concentric item radii) ─────────────────────────*/
.dropdown-menu {
  --dropdown-outer-radius: var(--radius-lg);
  --dropdown-padding: 5px;
  --dropdown-item-gap: 0px;
  --dropdown-item-inset-radius: max(0px, calc(var(--dropdown-outer-radius) - var(--dropdown-padding)));
}

.dropdown-menu__body {
  padding: var(--dropdown-padding);
  gap: var(--dropdown-item-gap);
}

.dropdown-menu__body:has(> .dropdown-menu-item) {
  display: flex;
  flex-direction: column;
}

.dropdown-menu-item {
  border-radius: var(--radius-sm);
}

.dropdown-menu__body > .dropdown-menu-item:first-child,
.dropdown-menu__body > .ref-item:first-child {
  border-top-left-radius: var(--dropdown-item-inset-radius);
  border-top-right-radius: var(--dropdown-item-inset-radius);
}

.dropdown-menu__body > .dropdown-menu-item:last-child,
.dropdown-menu__body > .ref-item:last-child {
  border-bottom-left-radius: var(--dropdown-item-inset-radius);
  border-bottom-right-radius: var(--dropdown-item-inset-radius);
}

.dropdown-menu__body > .dropdown-menu-item:only-child,
.dropdown-menu__body > .ref-item:only-child {
  border-radius: var(--dropdown-item-inset-radius);
}

.dropdown-menu__body > .ref-group:last-child .ref-item:last-child {
  border-bottom-left-radius: var(--dropdown-item-inset-radius);
  border-bottom-right-radius: var(--dropdown-item-inset-radius);
}

.dropdown-menu--panel {
  --dropdown-padding-block: 11.5px;
  --dropdown-padding-inline: 10px;
  --dropdown-item-inset-radius: max(
    0px,
    calc(var(--dropdown-outer-radius) - var(--dropdown-padding-inline))
  );
  padding: var(--dropdown-padding-block) var(--dropdown-padding-inline);
}

.dropdown-menu--panel > .dropdown-menu-item:last-child {
  border-bottom-left-radius: var(--dropdown-item-inset-radius);
  border-bottom-right-radius: var(--dropdown-item-inset-radius);
}

/*── Ref selector & dropdowns ─────────────────────────────────────*/
.ref-selector {
  position: relative;
  display: inline-flex;
}
.ref-btn {
  max-width: min(420px, 72vw);
  gap: 8px;
}
.ref-btn > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.ref-btn.open {
  background: var(--neutral-5);
  border-color: var(--neutral-5);
  box-shadow: none;
}
.ref-btn .dropdown-chevron {
  flex-shrink: 0;
}

.ref-dropdown,
.wallet-dropdown,
.clone-popup,
.star-gazers-dropdown,
.notification-panel,
.file-finder-inner,
.wallet-modal {
  background: var(--bg-elevated);
  border: 1px solid var(--neutral-4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/*── Clone dropdown ───────────────────────────────────────────────*/
.clone-dropdown {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}
.clone-dropdown.open > .clone-btn {
  background: var(--neutral-5);
  border-color: var(--neutral-5);
  color: var(--text);
}

.star-dropdown.open > .star-btn-count {
  background: var(--neutral-5);
  border-color: var(--neutral-5);
  color: var(--text);
}
.clone-popup {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 90;
  width: min(480px, 92vw);
  overflow: hidden;
  padding: 0;
  animation: fadeIn 200ms cubic-bezier(0, 0, 0.2, 1) both;
}
.clone-popup[hidden] {
  display: none !important;
}
.clone-popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12.5px 15px;
  border-bottom: 1px solid var(--border);
}
.clone-popup-heading {
  min-width: 0;
}
.clone-popup-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.15px;
  color: var(--text);
}
.clone-popup-subtitle {
  margin: 3px 0 0;
  font-size: 12px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.clone-popup-close {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  font-size: 18px;
  line-height: 1;
  color: var(--text-secondary);
}
.clone-popup-close:hover {
  color: var(--text);
  background: var(--bg-hover);
}
.clone-pane-hint {
  margin: -4px 0 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-tertiary);
}
.clone-pane-hint code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--btn-alt-bg);
  color: var(--text-secondary);
}
.clone-popup-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 15px;
  border: none;
  border-top: 1px solid var(--border);
  background: var(--neutral-a05);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 100ms ease, color 100ms ease;
}
.clone-popup-footer:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.clone-popup-footer svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.ref-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 90;
  min-width: 300px;
  max-width: min(380px, 92vw);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  animation: fadeIn 200ms cubic-bezier(0, 0, 0.2, 1) both;
}

.ref-search {
  position: relative;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ref-search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
  display: flex;
  align-items: center;
}
.ref-search-icon svg {
  width: 14px;
  height: 14px;
}
.ref-search input {
  width: 100%;
  min-height: 37.5px;
  padding: 0 12.5px 0 34px;
  background: var(--btn-alt-bg);
  border: 1px solid var(--neutral-4);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.ref-search input:focus {
  outline: 0.5px solid var(--neutral-a5);
  border-color: var(--neutral-a5);
  box-shadow: none;
}
.ref-search input::placeholder {
  color: var(--text-tertiary);
}

.ref-dropdown-body {
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in oklab, var(--text-tertiary) 28%, transparent) transparent;
}
.ref-dropdown-body.dropdown-menu__body {
  padding: var(--dropdown-padding);
}
.ref-dropdown-body::-webkit-scrollbar {
  width: 6px;
}
.ref-dropdown-body::-webkit-scrollbar-thumb {
  background: color-mix(in oklab, var(--text-tertiary) 28%, transparent);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.ref-group {
  margin-bottom: 4px;
}
.ref-group:last-child {
  margin-bottom: 0;
}

.ref-author-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 4px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.15px;
  text-transform: none;
  color: var(--text-secondary);
  background: transparent;
  border: none;
}
.ref-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: transparent;
  border: none;
}
.ref-author-label .perm-avatar,
.ref-author-label .avatar {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.ref-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 37.5px;
  padding: 0 10px;
  margin: 0;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background 100ms ease, color 100ms ease;
}
.ref-item-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 12px;
}
.ref-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  flex-shrink: 0;
}
.ref-item-check svg {
  color: var(--positive);
  width: 14px;
  height: 14px;
}
.ref-item-tag svg {
  width: 14px;
  height: 14px;
  opacity: 0.55;
}
.ref-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.ref-item.active {
  background: var(--bg-hover);
  color: var(--text);
  font-weight: 600;
}
.ref-item.active .ref-item-label {
  color: var(--text);
}

.ref-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  flex-shrink: 0;
}
.ref-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ref-legend .ref-dot {
  width: 6px;
  height: 6px;
  margin: 0;
}

.ref-dot-green { background: var(--positive); box-shadow: none; }
.ref-dot-yellow { background: var(--orange); opacity: 0.9; }
.ref-dot-dim { background: var(--text-tertiary); opacity: 0.45; }
.ref-dot-pulse { animation: ref-dot-pulse 2s ease-in-out infinite; }
@keyframes ref-dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.wallet-dropdown-nav-items {
  display: none;
}
.wallet-dropdown-item {
  min-height: 37.5px;
  padding: 0 7.5px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.wallet-dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.wallet-dropdown {
  width: 280px;
  border-radius: var(--radius-lg);
}
.wallet-dropdown.dropdown-menu--panel {
  padding: var(--dropdown-padding-block) var(--dropdown-padding-inline);
}
.wallet-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12.5px;
  padding: 5px 5px 15px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.wallet-dropdown-header .wallet-dropdown-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}
.wallet-dropdown-header .wallet-dropdown-addr {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-sans);
}
.wallet-theme-section {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.wallet-theme-label {
  display: block;
  padding: 0 7.5px 7.5px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}
.wallet-theme-options {
  display: flex;
  flex-direction: column;
  gap: 7.5px;
}
.wallet-theme-option {
  display: flex;
  align-items: center;
  gap: 12.5px;
  height: 37.5px;
  padding: 0 7.5px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.wallet-theme-option:hover,
.wallet-theme-option.active {
  background: var(--bg-hover);
}
.wallet-dropdown-disconnect { color: var(--negative); }
.wallet-dropdown-disconnect:hover { background: var(--red-soft); }
.wallet-btn-connected { min-height: 42px; padding: 0 14px; }
.wallet-dot { background: var(--positive); }

/*── Modals ───────────────────────────────────────────────────────*/
.wallet-modal-overlay,
.install-modal-overlay,
.file-finder-modal,
.global-search-overlay {
  background: rgb(0 0 0 / 0.5);
  backdrop-filter: blur(4px);
}
.global-search-panel {
  border: 1.25px solid var(--border);
  border-radius: var(--radius-lg);
}
.gs-search-bar { padding: 16px 18px; gap: 12px; }
.gs-input {
  font-size: 14px;
  padding: 6px 0;
  line-height: 1.45;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  border-radius: 0 !important;
}
.gs-input:focus,
.gs-input:focus-visible {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}
.gs-pill {
  min-height: 28px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}
.gs-pill.active {
  background: var(--neutral-a3);
  color: var(--text);
  border-color: var(--neutral-a3);
}
.gs-result { padding: 10px 15px; }
.gs-result-title { font-size: 13px; font-weight: 600; }
.gs-result-desc { font-size: 12px; }
.gs-result-crumb { font-size: 11px; }
.gs-footer { background: var(--neutral-a05); }
.install-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 150ms ease-out;
}
.install-modal {
  background: var(--bg-card);
  border: 1.25px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slideDown 200ms ease-out;
}
.install-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12.5px 15px;
  border-bottom: 1px solid var(--border);
}
.install-modal-header h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.15px;
}
.install-modal-body {
  padding: 0;
}
.wallet-modal {
  border-radius: var(--radius-lg);
  border: 1.25px solid var(--border);
  max-width: 650px;
}
.wm-header {
  min-height: 65px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}
.wm-header h2 { font-size: 18px; font-weight: 500; }
.wm-option {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 16px;
}
.wm-option:hover:not(.wm-option-disabled) {
  background: var(--bg-hover);
  border-color: var(--neutral-4);
}
.wm-option-icon {
  background: var(--btn-alt-bg);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}

/*── Home hero & features ─────────────────────────────────────────*/
.home-hero {
  text-align: left;
  padding: 0 0 25px;
  margin: 0 0 25px;
  border-bottom: none;
  background: none;
}
.home-hero-inner {
  max-width: none;
  margin: 0;
}
.hero-wordmark {
  font-family: var(--font-sans);
  font-size: 42px;
  font-weight: 400;
  letter-spacing: 0.08px;
  margin-bottom: 10px;
  line-height: 1;
}
.hero-tagline {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.hero-cta { justify-content: flex-start; }

.home-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  border: none;
  background: transparent;
  margin: 0 0 25px;
}
.feature-card,
.install-card,
.about-box,
.readme-box,
.creator-card {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: none;
}
.feature-icon {
  background: var(--btn-alt-bg);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
}
.feature-icon svg { fill: currentColor; color: var(--text-secondary); }

/*── Issues / PRs (feed rows) ─────────────────────────────────────*/
.issue-row {
  border-radius: var(--radius-sm);
  padding: 12.5px;
  border-bottom: 1px solid var(--border);
}
.issue-row:hover { background: var(--bg-elevated); }
.issues-filter-btn { border-radius: var(--radius-pill); }

/*── Diff ─────────────────────────────────────────────────────────*/
.diff-line-add .diff-code { background: rgba(19, 171, 143, 0.1); }
.diff-line-del .diff-code { background: rgba(241, 106, 130, 0.1); }
[data-theme="dark"] .diff-line-add .diff-code { background: rgba(98, 193, 177, 0.12); }
[data-theme="dark"] .diff-line-del .diff-code { background: rgba(241, 106, 130, 0.12); }
.diff-stat-add { color: var(--positive); }
.diff-stat-del { color: var(--negative); }

/*── Stats, breadcrumbs, misc ─────────────────────────────────────*/
.stats-bar .stat-item,
.breadcrumb { font-size: 13px; }
.breadcrumb a { color: var(--link-color); }
.breadcrumb a:hover { color: var(--link-hover); text-decoration: underline; }
.loading-bar { background: var(--text); height: 2px; }
.app-boot-state {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-tertiary);
  font-size: 13px;
}
.app-boot-molecule {
  width: 58px;
  height: 38px;
  margin-bottom: 3px;
  overflow: visible;
  color: var(--text);
}
.app-boot-wire {
  fill: none;
  stroke: currentColor;
  stroke-dasharray: 128;
  stroke-dashoffset: 128;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  animation: boot-wire-draw 1.8s cubic-bezier(.65, 0, .35, 1) infinite;
}
.app-boot-node {
  fill: currentColor;
  opacity: .18;
  transform: scale(.35);
  transform-box: fill-box;
  transform-origin: center;
  animation: boot-node-pop 1.8s cubic-bezier(.22, 1, .36, 1) infinite;
}
.app-boot-node-2 { animation-delay: 90ms; }
.app-boot-node-3 { animation-delay: 180ms; }
.app-boot-node-4 { animation-delay: 270ms; }
.app-boot-node-5 { animation-delay: 360ms; }
.app-boot-state.is-stalled .app-boot-wire,
.app-boot-state.is-stalled .app-boot-node {
  animation-play-state: paused;
}
.app-boot-state .btn-small { margin-top: 5px; }
.app-boot-state:not(.is-stalled) .btn-small { display: none; }
@keyframes boot-wire-draw {
  0% { opacity: .2; stroke-dashoffset: 128; }
  48%, 72% { opacity: .8; stroke-dashoffset: 0; }
  100% { opacity: 0; stroke-dashoffset: -128; }
}
@keyframes boot-node-pop {
  0%, 12% { opacity: .12; transform: scale(.35); }
  32%, 72% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(.6); }
}
@media (prefers-reduced-motion: reduce) {
  .app-boot-wire { animation: none; opacity: .7; stroke-dashoffset: 0; }
  .app-boot-node { animation: none; opacity: 1; transform: none; }
}
.toast {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
}
.empty-state,
.error-state,
.connect-prompt {
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
  background: transparent;
}
footer {
  background: transparent;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}
footer a { color: var(--link-color); }

.page-heading h2 { font-size: 20px; font-weight: 600; }
.blob-code,
.diff-table {
  font-family: var(--font-sans);
}
.commit-item {
  border-radius: var(--radius-sm);
  padding: 10px 12.5px;
}
.commit-item:hover { background: var(--bg-elevated); }
.profile-header,
.profile-edit-form .form-section {
  border-radius: var(--radius-lg);
}
.repo-layout .repo-sidebar .about-box {
  border-radius: var(--radius-sm);
}

/*── Wallet avatars ───────────────────────────────────────────────*/
.wallet-avatar,
.wallet-dropdown-avatar {
  display: inline-flex;
  flex-shrink: 0;
  line-height: 0;
  align-items: center;
  justify-content: center;
}
.wallet-dropdown-avatar { width: 40px; height: 40px; }
.wallet-avatar { width: 24px; height: 24px; }
.wallet-avatar .perm-avatar,
.wallet-dropdown-avatar .perm-avatar {
  width: 100%;
  height: 100%;
}

/*── Repo toolbar & stats ─────────────────────────────────────────*/
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 15px;
  margin-bottom: 12.5px;
  border-bottom: 1px solid var(--border);
}
.repo-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12.5px;
  flex-wrap: wrap;
}
.stats-bar {
  display: flex;
  align-items: center;
  gap: 7.5px;
  flex-wrap: wrap;
  margin-bottom: 15px;
  padding: 0;
}
.stats-bar .stat-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 35px;
  padding: 0 12.5px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 100ms ease;
}
.stats-bar .stat-item:hover {
  background: transparent;
  border-color: var(--neutral-a5);
  color: var(--text);
  text-decoration: none;
}
.stats-bar .stat-item strong { color: var(--text); font-weight: 600; }

/*── Issues / PR feed list ────────────────────────────────────────*/
.issues-list.border-wrapper-primary {
  overflow: hidden;
  padding: 0;
}
.issues-list .issue-row {
  display: flex;
  gap: 12.5px;
  padding: 12.5px 15px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}
.issues-list .issue-row:last-child { border-bottom: none; }
.issues-list .issue-row:hover {
  background: var(--bg-elevated);
  text-decoration: none;
}
.issues-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12.5px 0;
}
.issues-filters {
  display: flex;
  gap: 7.5px;
  margin-bottom: 12.5px;
  flex-wrap: wrap;
}
.issues-title svg { vertical-align: -0.15em; margin-right: 6px; }

/*── Commit list ──────────────────────────────────────────────────*/
.commit-list,
#commitSlot {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: transparent;
  padding: 0;
}
#commitSlot .commit-group {
  margin-bottom: 0;
}
#commitSlot .commit-group + .commit-group {
  border-top: 1px solid var(--border);
}
#commitSlot .commit-date-label {
  padding: 10px 15px;
  margin: 0;
  border-bottom: 1px solid var(--border);
}
#commitSlot .commit-item {
  padding: 12.5px 15px;
  margin: 0;
  border-left: none;
  border-radius: 0;
}
#commitSlot .commit-load-more {
  padding: 15px;
  border-top: 1px solid var(--border);
  margin: 0;
}
.count-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/*── Profile ──────────────────────────────────────────────────────*/
.profile-header {
  display: flex;
  gap: 20px;
  padding: 20px;
  margin-bottom: 0;
  background: transparent;
  border: 1px solid var(--border);
}
.profile-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 25px;
}
.profile-contrib-card {
  padding: 20px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-width: 0;
}
.profile-display-name {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.profile-wallet code {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-secondary);
}

/*── Ref dots (activity) ──────────────────────────────────────────*/
.ref-dot-green,
.repo-dot-green { background: var(--positive); }
.ref-dot-yellow,
.repo-dot-yellow { background: var(--orange); }

/*── Search (non-header inline wrappers) ──────────────────────────*/
.search-wrapper-inline:not(.header-search) .search-input {
  width: 220px;
  padding-left: 36px;
  padding-right: 28px;
}
.search-wrapper-inline:not(.header-search) .search-input:focus { width: 280px; }

/*── Skip link ────────────────────────────────────────────────────*/
.skip-link {
  background: var(--text);
  color: var(--bg);
  border-radius: 0 0 var(--radius-sm) 0;
}

/*── Install section ──────────────────────────────────────────────*/
.home-install-section {
  margin-bottom: 25px;
}
.install-card {
  overflow: hidden;
}
.install-header {
  text-transform: none;
  letter-spacing: 0.15px;
  font-weight: 600;
  font-size: 15px;
  padding: 12.5px 15px;
  border-bottom: 1px solid var(--border);
}
.install-grid {
  display: grid;
  grid-template-columns: 1fr;
}
.install-pane {
  padding: 15px;
  min-width: 0;
}
.install-pane + .install-pane {
  border-top: 1px solid var(--border);
}
.install-pane-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.install-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.install-cmd-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 5px 5px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 100ms ease;
}
.install-cmd-box:hover {
  border-color: var(--neutral-5);
}
.install-prompt {
  color: var(--text-tertiary);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  user-select: none;
  flex-shrink: 0;
}
.install-cmd {
  flex: 1;
  min-width: 0;
  display: block;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.install-cmd::-webkit-scrollbar {
  height: 3px;
}
.install-cmd::-webkit-scrollbar-thumb {
  background: color-mix(in oklab, var(--text-tertiary) 35%, transparent);
  border-radius: 99px;
}
.install-copy,
.btn-icon.install-copy {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
}
.install-copy svg {
  width: 15px;
  height: 15px;
}
.install-copy.btn-copy-success {
  color: var(--green);
}

/*── Blob viewer ──────────────────────────────────────────────────*/
.blob-header {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}
.blob-code-wrap {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

/*── Readme ───────────────────────────────────────────────────────*/
.readme-box {
  margin-top: 15px;
  overflow: hidden;
}
.readme-header {
  padding: 12.5px 15px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
}

/*── Override legacy GitHub-style light rules ─────────────────────*/
[data-theme="light"] .repo-card:hover,
[data-theme="dark"] .repo-card:hover {
  border-color: var(--border);
  background: var(--bg-elevated);
  box-shadow: none;
}
[data-theme="light"] .commit-sha,
[data-theme="dark"] .commit-sha {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}
[data-theme="light"] a:not(.btn-primary):not(.hero-btn-primary):not(.btn-connect-large),
[data-theme="dark"] a:not(.btn-primary):not(.hero-btn-primary):not(.btn-connect-large) {
  color: var(--link-color);
}
[data-theme="light"] a:not(.btn-primary):not(.hero-btn-primary):not(.btn-connect-large):hover,
[data-theme="dark"] a:not(.btn-primary):not(.hero-btn-primary):not(.btn-connect-large):hover {
  color: var(--link-hover);
}

/*── Flat surfaces inside page views (transparent fills, bordered containers) ── */
.view-wrapper .stats-bar .stat-item,
.view-wrapper .star-btn,
.view-wrapper .star-dropdown .star-btn,
.view-wrapper .ref-btn {
  background: transparent;
  border: 1px solid var(--border);
}
.view-wrapper .stats-bar .stat-item:hover,
.view-wrapper .star-btn:hover,
.view-wrapper .star-dropdown .star-btn:hover,
.view-wrapper .ref-btn:hover {
  background: transparent;
  border-color: var(--neutral-a5);
  color: var(--text);
}
.view-wrapper .ref-btn.open {
  background: transparent;
  border-color: var(--neutral-a5);
}

.view-wrapper .file-table-wrap {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: none;
}
.view-wrapper .file-table-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 12.5px 15px;
}
.view-wrapper .file-table-header .commit-sha {
  background: transparent;
  border: 1px solid var(--border);
  padding: 2px 6px;
}
.view-wrapper .file-table .row {
  background: transparent;
  padding: 0 15px;
  border-bottom: 1px solid var(--border);
}
.view-wrapper .file-table .row:last-child {
  border-bottom: none;
}
.view-wrapper .file-table .row:hover {
  background: var(--bg-hover);
  border-left: none;
}

.view-wrapper .about-box {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: none;
  overflow: hidden;
}
.view-wrapper .about-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 12.5px 15px;
}
.view-wrapper .about-languages,
.view-wrapper .about-row {
  border-bottom: 1px solid var(--border);
  padding-left: 15px;
  padding-right: 15px;
}

.view-wrapper .readme-box {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: none;
  overflow: hidden;
}
.view-wrapper .readme-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 12.5px 15px;
}
.view-wrapper .readme-body {
  padding: 15px;
}

.view-wrapper .blob-header {
  background: transparent;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.view-wrapper .blob-code-wrap {
  background: transparent;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.view-wrapper #commitSlot,
.view-wrapper .commit-list {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
}
.view-wrapper .commit-item {
  background: transparent;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 12.5px 15px;
  margin: 0;
  border-left: none;
}
.view-wrapper .commit-item:last-child {
  border-bottom: none;
}
.view-wrapper .commit-item:hover {
  background: var(--bg-hover);
  border-left: none;
}
.view-wrapper #commitSlot .commit-date-label {
  padding: 10px 15px;
  margin: 0;
}

.view-wrapper .count-badge {
  background: transparent;
  border: 1px solid var(--border);
}

.view-wrapper .issues-list.border-wrapper-primary,
.view-wrapper .repo-grid.feed-list.border-wrapper-primary {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.view-wrapper .empty-state,
.view-wrapper .error-state,
.view-wrapper .connect-prompt {
  background: transparent;
  border: 1px dashed var(--border);
}

/*── Notification inbox (notification bell) ───────────────────────────*/
.notification-inbox-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.notification-bell {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-sm);
  background: var(--accent, #1c1916);
  color: var(--bg, #fff);
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(420px, calc(100vw - 24px));
  max-height: min(70vh, 520px);
  overflow: hidden;
  display: none;
  flex-direction: column;
  z-index: 120;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(0,0,0,.12));
}

.notification-panel:not([hidden]) {
  display: flex;
}

.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.notification-list {
  overflow: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-elevated);
}

.notification-row {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface, #fff);
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
}

.notification-row.unread {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.notification-row:hover {
  background: var(--surface-hover, #fafafa);
}

.notification-row-avatar {
  flex-shrink: 0;
}

.notification-empty,
.notification-loading {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.notification-connect-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.notification-connect-prompt p {
  margin: 0;
  line-height: 1.5;
}
