/* ==========================================================================
   OwnForge — single canonical stylesheet
   Palette and typography inspired by neoxue.dev, structure by GitHub.
   ========================================================================== */

/* --- Fonts ---------------------------------------------------------------- */

@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

/* --- Tokens --------------------------------------------------------------- */

:root {
  color-scheme: dark;
  --bg: #0a0b1e;
  --bg-soft: #0d0f24;
  --card: #12132a;
  --fg: #e9eff6;
  --bone: #e8e0d0;
  --muted: rgba(233, 239, 246, 0.64);
  --dim: rgba(233, 239, 246, 0.42);
  --line: rgba(233, 239, 246, 0.1);
  --line-strong: rgba(233, 239, 246, 0.2);
  --cyan: #58bad6;
  --cyan-soft: #7fa8c5;
  --danger: #d74745;
  --warn: #d8c18e;
  --success: #7fc8a4;
  --serif: "Instrument Serif", "Songti SC", "Noto Serif SC", Georgia, serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 4px;
  --header: 56px;
  --container: 1200px;
  --gutter: 32px;
}

/* --- Reset ---------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-weight: 500;
  line-height: 1.2;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

a {
  color: var(--cyan);
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

a:hover {
  color: var(--cyan-soft);
}

img {
  max-width: 100%;
}

code,
pre,
kbd,
samp {
  font-family: var(--mono);
}

::selection {
  background: rgba(88, 186, 214, 0.32);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(233, 239, 246, 0.18) transparent;
}

/* --- Layout shell --------------------------------------------------------- */

.site {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.home-main,
.browser-main,
.stars-main,
.settings-main {
  flex: 1;
  padding: 56px 0 96px;
}

main:focus {
  outline: none;
}

.skip-link {
  position: fixed;
  top: -64px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--cyan);
  color: #06121c;
  font: 500 12px/1 var(--mono);
}

.skip-link:focus {
  top: 12px;
}

/* --- Header --------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 11, 30, 0.86);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  width: 100%;
  max-width: var(--container);
  height: var(--header);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  text-decoration: none;
}

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

.mark {
  display: grid;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(88, 186, 214, 0.55);
  border-radius: var(--radius);
  color: var(--cyan);
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1;
  place-items: center;
}

.brand-name {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
}

.site-nav a {
  position: relative;
  padding: 6px 0;
  color: var(--muted);
}

.site-nav a:hover {
  color: var(--fg);
}

.site-nav a[aria-current="page"] {
  color: var(--fg);
}

.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 0.08em;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--cyan);
}

.site-search {
  position: relative;
  flex: 1 1 200px;
  max-width: 240px;
  margin-left: auto;
}

.site-search .search-icon {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 13px;
  height: 13px;
  color: var(--dim);
  transform: translateY(-50%);
  pointer-events: none;
}

.site-search input {
  width: 100%;
  height: 32px;
  padding: 0 12px 0 31px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(233, 239, 246, 0.04);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 11.5px;
}

.site-search input::placeholder {
  color: var(--dim);
}

.site-search input:focus {
  border-color: var(--line-strong);
  background: rgba(233, 239, 246, 0.06);
}

.site-actions {
  display: flex;
  flex: none;
  align-items: center;
}

.manage-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.manage-link:hover {
  color: var(--fg);
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
}

.link-chevron {
  width: 12px;
  height: 12px;
  opacity: 0.55;
}

/* --- Footer --------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
}

.site-footer-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 26px var(--gutter) 30px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

.footer-brand {
  color: var(--fg);
  letter-spacing: 0.1em;
}

.footer-note {
  color: var(--dim);
}

.footer-links {
  display: flex;
  gap: 18px;
  margin-left: auto;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--cyan);
}

/* --- Shared type and controls --------------------------------------------- */

.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.2em;
  line-height: 1.5;
  text-transform: uppercase;
}

.display {
  margin: 0;
  color: var(--fg);
  font-family: var(--serif);
  font-size: clamp(44px, 6vw, 80px);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.02;
  white-space: pre-line;
}

.page-head {
  margin-bottom: 40px;
}

.page-head h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 5vw, 60px);
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1.05;
}

.page-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.page-title-row h1 {
  margin: 0;
}

.page-head .eyebrow {
  margin-bottom: 14px;
}

.page-lead,
.stars-lead {
  max-width: 660px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.75;
}

.content-note {
  color: var(--dim);
  font-size: 12.5px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.content-note a {
  color: var(--cyan-soft);
}

.inline-icon {
  width: 13px;
  height: 13px;
  vertical-align: -2px;
}

a .inline-icon,
button .inline-icon {
  margin-left: 6px;
}

.primary-button,
.secondary-button,
.danger-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  line-height: 1.3;
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.primary-button {
  padding: 9px 18px;
  border: 1px solid var(--cyan);
  background: var(--cyan);
  color: #06121c;
}

.primary-button:hover {
  border-color: #74c9e2;
  background: #74c9e2;
  color: #06121c;
}

.secondary-button {
  padding: 9px 18px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--fg);
}

.secondary-button:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.danger-button {
  padding: 9px 18px;
  border: 1px solid rgba(215, 71, 69, 0.55);
  background: transparent;
  color: #e07370;
}

.danger-button:hover {
  border-color: var(--danger);
  background: rgba(215, 71, 69, 0.12);
  color: #ef8b88;
}

.text-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--cyan);
  font-size: 11px;
}

.text-button:hover {
  color: var(--fg);
}

.danger-link {
  color: #e07370;
}

.danger-link:hover {
  color: #ef8b88;
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled,
.text-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(233, 239, 246, 0.04);
  color: var(--fg);
  font: inherit;
  font-size: 13px;
}

input::placeholder,
textarea::placeholder {
  color: var(--dim);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-color: var(--cyan);
}

input[type="checkbox"] {
  width: 14px;
  height: 14px;
  padding: 0;
  accent-color: var(--cyan);
}

select {
  cursor: pointer;
}

textarea {
  min-height: 72px;
  resize: vertical;
  line-height: 1.65;
}

form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--fg);
  -webkit-box-shadow: 0 0 0 1000px var(--card) inset;
  caret-color: var(--fg);
  transition: background-color 9999s ease-in-out 0s;
}

.form-error {
  margin: 0;
  padding: 8px 12px;
  border-left: 2px solid var(--danger);
  background: rgba(215, 71, 69, 0.08);
  color: #e58a87;
  font-size: 12.5px;
  line-height: 1.6;
}

.form-notice {
  margin: 0;
  padding: 8px 12px;
  border-left: 2px solid var(--success);
  background: rgba(127, 200, 164, 0.07);
  color: #a7dcc2;
  font-size: 12.5px;
  line-height: 1.6;
}

/* --- Home ----------------------------------------------------------------- */

.profile-head {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
  padding: 4px 0 52px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 52px;
}

.profile-mark {
  display: grid;
  width: 88px;
  height: 88px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--bone);
  font-family: var(--serif);
  font-size: 56px;
  line-height: 1;
  place-items: center;
}

.profile-copy {
  min-width: 0;
}

.profile-copy .eyebrow {
  margin-bottom: 18px;
}

.bio {
  max-width: 640px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.links a {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.links a:hover {
  border-color: rgba(88, 186, 214, 0.45);
  color: var(--cyan);
}

.home-columns {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.home-rail {
  position: sticky;
  top: calc(var(--header) + 32px);
  align-self: start;
}

.rail-title {
  margin: 0 0 14px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.rail-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.rail-link:hover {
  color: var(--cyan);
}

.rail-count {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10.5px;
}

.rail-note {
  margin: 20px 0 0;
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.85;
}

.home-feed {
  min-width: 0;
}

.home-projects {
  margin-bottom: 64px;
}

.home-projects:last-of-type {
  margin-bottom: 48px;
}

.home-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.home-section-title .eyebrow {
  margin-bottom: 6px;
}

.home-section-title h2 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.section-link {
  display: inline-flex;
  align-items: center;
  color: var(--cyan-soft);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

.section-link:hover {
  color: var(--cyan);
}

.home-feed .repository-list-rows {
  border-top: 1px solid var(--line);
}

.collection-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 34px 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.collection-banner .eyebrow {
  margin-bottom: 10px;
}

.collection-banner h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
}

.collection-banner p {
  max-width: 540px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

/* --- Repository rows and cards -------------------------------------------- */

.repository-list-rows {
  display: block;
}

.repository-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 19px 2px;
  border-bottom: 1px solid var(--line);
  transition: border-color 160ms ease;
}

.repository-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.repository-icon {
  display: inline-flex;
  flex: none;
  margin-top: 5px;
  color: var(--dim);
}

.repository-copy {
  min-width: 0;
}

.repository-copy h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.4;
}

.repository-copy h2 a {
  color: var(--fg);
  overflow-wrap: anywhere;
}

.repository-copy h2 a:hover {
  color: var(--cyan);
}

.repository-copy p {
  max-width: 760px;
  margin: 5px 0 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.repo-facts {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.repo-language {
  display: inline-flex;
  align-items: center;
}

.language-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--cyan-soft);
}

.row-arrow {
  display: inline-flex;
  flex: none;
  color: var(--dim);
  transition: color 160ms ease, transform 160ms ease;
}

.repository-row:hover .row-arrow {
  color: var(--cyan);
  transform: translateX(2px);
}

.repository-list-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.repository-list-cards .repository-row {
  align-items: flex-start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.repository-list-cards .repository-row:hover {
  border-color: var(--line-strong);
}

.repository-list-cards .repository-icon {
  margin-top: 4px;
  color: var(--cyan-soft);
}

.repository-list-cards .repository-copy h2 {
  font-size: 16px;
}

.repository-list-cards .row-arrow {
  display: none;
}

.visibility {
  padding: 1px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1.7;
  text-transform: uppercase;
  white-space: nowrap;
}

.visibility-private {
  border-color: rgba(216, 193, 142, 0.4);
  color: var(--warn);
}

.visibility-public {
  border-color: rgba(127, 200, 164, 0.35);
  color: var(--success);
}

/* --- Auth ----------------------------------------------------------------- */

.auth-page {
  flex: 1;
  padding: 88px 0 120px;
}

.auth-shell {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 0 20px;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

.auth-back:hover {
  color: var(--cyan);
}

.auth-back .link-chevron {
  margin: 0;
  transform: rotate(0deg);
}

.auth-card {
  padding: 40px 36px 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.auth-card h1 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

.auth-intro {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 13.5px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.auth-form input {
  height: 40px;
}

.auth-form .primary-button {
  width: 100%;
  margin-top: 5px;
  padding: 11px 18px;
}

.auth-form .text-button {
  align-self: flex-start;
  text-align: left;
}

/* --- Settings ------------------------------------------------------------- */

.settings-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.settings-nav {
  position: sticky;
  top: calc(var(--header) + 32px);
  display: flex;
  flex-direction: column;
}

.settings-nav .eyebrow {
  margin-bottom: 16px;
  color: var(--dim);
}

.settings-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.settings-nav a:hover {
  color: var(--cyan);
}

.settings-nav a span {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
}

.settings-nav .rail-note {
  margin-top: 22px;
}

.settings-content {
  min-width: 0;
}

.settings-content > div {
  scroll-margin-top: calc(var(--header) + 32px);
  border-top: 1px solid var(--line);
  margin-top: 36px;
  padding-top: 36px;
}

.settings-content > div:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.security-section {
  margin: 0 0 36px;
}

.security-section:last-child {
  margin-bottom: 0;
}

.security-section h2 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.008em;
}

.security-section > p {
  max-width: 640px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13.5px;
}

.security-settings .security-section {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.security-settings .security-section h2 {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
}

.security-settings .auth-form {
  max-width: 420px;
  margin-top: 14px;
}

.security-settings > .secondary-button {
  margin-top: 8px;
}

#security > .security-section {
  margin-bottom: 0;
}

.catalog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0 10px;
}

.catalog-actions + div {
  color: var(--muted);
  font-size: 12.5px;
}

.catalog-actions + div p {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.catalog-actions + div strong {
  color: var(--fg);
  font-weight: 500;
}

.annotation-search {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0 22px;
}

.annotation-search label {
  flex: 1 1 220px;
  max-width: 320px;
}

.annotation-search button {
  padding: 9px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
}

.annotation-search button:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.annotation-editor {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.annotation-editor h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
}

.annotation-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13px;
}

.annotation-controls label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: 0;
}

.annotation-controls input[type="number"] {
  width: 110px;
  height: 34px;
}

.annotation-controls button {
  padding: 8px 14px;
}

.enrollment-secret {
  display: block;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--cyan);
  font-size: 13px;
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
  user-select: all;
}

.recovery-codes {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid rgba(216, 193, 142, 0.35);
  border-radius: var(--radius);
  background: rgba(216, 193, 142, 0.05);
}

.recovery-codes h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
}

.recovery-codes p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12.5px;
}

.recovery-codes ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 16px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.recovery-codes code {
  color: var(--warn);
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* --- Stars: public -------------------------------------------------------- */

.stars-filters {
  display: flex;
  align-items: flex-end;
  gap: 14px 16px;
  flex-wrap: wrap;
}

.toolbar {
  display: flex;
  align-items: flex-end;
  gap: 14px 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  padding: 18px 0 22px;
  border-bottom: 1px solid var(--line);
}

.toolbar label,
.stars-filters label {
  flex: 0 1 170px;
}

.toolbar input,
.toolbar select,
.stars-filters input,
.stars-filters select {
  height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.stars-filters {
  margin: 4px 0 0;
}

.toolbar > button,
.toolbar .toolbar-actions,
.stars-filters > button {
  align-self: flex-end;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stars-clear {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

.stars-clear:hover {
  color: var(--cyan);
}

.stars-count {
  margin: 22px 0 18px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.stars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.star-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  transition: border-color 160ms ease;
}

.star-card:hover {
  border-color: var(--line-strong);
}

.star-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.star-category {
  padding: 2px 8px;
  border: 1px solid rgba(88, 186, 214, 0.28);
  border-radius: 999px;
  color: var(--cyan-soft);
  white-space: nowrap;
}

a.star-category:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.star-host {
  overflow: hidden;
  color: var(--dim);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.star-card h2 {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
  letter-spacing: -0.008em;
  line-height: 1.18;
}

.star-card h2 a {
  color: var(--fg);
  overflow-wrap: anywhere;
}

.star-card h2 a:hover {
  color: var(--cyan);
}

.star-description {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.star-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.star-tags a {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

.star-tags a:hover {
  border-color: rgba(88, 186, 214, 0.45);
  color: var(--cyan);
}

.star-facts {
  display: flex;
  gap: 26px;
  margin: auto 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.star-facts dt {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.star-facts dd {
  margin: 3px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
}

.star-source {
  font-family: var(--mono);
  font-size: 10.5px;
}

.star-source a {
  color: var(--cyan-soft);
}

.star-source a:hover {
  color: var(--cyan);
}

.stars-warning {
  margin: 0;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  color: var(--warn);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
}

.stars-empty,
.stars-loading,
.stars-session {
  padding: 56px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  text-align: center;
}

.stars-empty h2,
.stars-loading h2,
.stars-session h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
}

.stars-empty p,
.stars-loading p,
.stars-session p {
  margin: 0 auto;
  max-width: 460px;
  color: var(--muted);
  font-size: 13px;
}

.stars-empty a {
  color: var(--cyan);
}

.stars-session .primary-button {
  margin-top: 20px;
}

.stars-more {
  margin-top: 32px;
  text-align: center;
}

/* --- Stars: owner manager ------------------------------------------------- */

.stars-add {
  margin-bottom: 40px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.stars-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.stars-section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
}

.stars-section-head p {
  max-width: 620px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.stars-add form {
  margin-top: 18px;
}

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

.stars-form-grid .wide {
  grid-column: 1 / -1;
}

.stars-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stars-form-grid + .stars-actions {
  margin-top: 16px;
}

.stars-help {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.03em;
}

.stars-list-head {
  margin-bottom: 24px;
}

.stars-list-head .stars-filters {
  margin-top: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.stars-feedback:empty {
  display: none;
}

.stars-feedback {
  margin-bottom: 18px;
}

.stars-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stars-item {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.stars-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.stars-item-head h2 {
  margin: 12px 0 4px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
}

.stars-item-head h2 a {
  color: var(--fg);
  overflow-wrap: anywhere;
}

.stars-item-head h2 a:hover {
  color: var(--cyan);
}

.stars-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  padding: 1px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  line-height: 1.7;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-public,
.badge-sync-ok {
  border-color: rgba(127, 200, 164, 0.38);
  color: var(--success);
}

.badge-private {
  border-color: rgba(216, 193, 142, 0.38);
  color: var(--warn);
}

.badge-sync-error {
  border-color: rgba(215, 71, 69, 0.45);
  color: #e07370;
}

.badge-sync-pending,
.badge-sync-retrying,
.badge-sync-not_requested {
  color: var(--dim);
}

.stars-source {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9.5px;
  overflow-wrap: anywhere;
}

.stars-item .stars-warning {
  margin-top: 8px;
  border-top: 0;
  padding-top: 0;
}

.stars-actions {
  flex: none;
}

.stars-item .stars-actions {
  justify-content: flex-end;
}

.stars-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stars-facts dt {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stars-facts dd {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.stars-owner-note {
  margin: 14px 0;
  padding: 12px 16px;
  border-left: 2px solid rgba(216, 193, 142, 0.5);
  background: rgba(216, 193, 142, 0.05);
}

.stars-owner-note h3 {
  margin: 0 0 5px;
  font-size: 12.5px;
  font-weight: 600;
}

.stars-owner-note h3 span {
  margin-left: 8px;
  color: var(--warn);
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: 0.1em;
}

.stars-owner-note p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.stars-edit {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.stars-edit .stars-actions {
  margin-top: 16px;
}

.stars-preview {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid rgba(88, 186, 214, 0.35);
  border-radius: var(--radius);
  background: rgba(88, 186, 214, 0.05);
}

.stars-preview h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
}

.stars-preview > p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.stars-preview dl {
  margin: 0 0 16px;
}

.stars-preview dl > div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.stars-preview dt {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
}

.stars-preview dd {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.stars-delete {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid rgba(215, 71, 69, 0.4);
  border-radius: var(--radius);
  background: rgba(215, 71, 69, 0.05);
}

.stars-delete h3 {
  margin: 0 0 6px;
  color: #e07370;
  font-size: 15px;
  font-weight: 600;
}

.stars-delete p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12.5px;
}

.stars-delete label {
  max-width: 360px;
  margin-bottom: 14px;
}

/* --- Repository static pages ---------------------------------------------- */

.back-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 24px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

.back-link:hover {
  color: var(--cyan);
}

.repo-title {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.repo-title h1 {
  font-family: var(--serif);
  font-size: clamp(36px, 4.5vw, 54px);
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.repo-description {
  max-width: 680px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.repo-tabs {
  display: flex;
  gap: 26px;
  margin-top: 26px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

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

.repo-tabs a {
  padding: 12px 2px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}

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

.repo-tabs a[aria-current="page"] {
  border-bottom-color: var(--cyan);
  color: var(--fg);
}

.repo-metadata {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 16px 0;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.repo-metadata a {
  color: var(--cyan-soft);
}

.repo-metadata a:hover {
  color: var(--cyan);
}

.selected-sha {
  margin: 12px 0 22px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9.5px;
  overflow-wrap: anywhere;
}

.selected-sha code {
  color: var(--muted);
}

.clone-panel {
  margin: 4px 0 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.clone-panel summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 18px;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  list-style-position: inside;
}

.clone-panel summary:hover {
  color: var(--fg);
}

.clone-panel[open] summary {
  border-bottom: 1px solid var(--line);
}

.clone-panel summary .inline-icon {
  color: var(--cyan-soft);
}

.clone-section {
  padding: 0 18px;
}

.clone-section p {
  margin: 14px 0 4px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.clone-section code {
  display: block;
  color: var(--fg);
  font-size: 12px;
  overflow-wrap: anywhere;
  user-select: all;
}

.clone-archive {
  margin: 16px 18px 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
}

.clone-panel > .content-note {
  padding: 12px 18px 16px;
}

.commit-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  font-size: 12.5px;
}

.commit-icon {
  display: inline-flex;
  flex: none;
  color: var(--cyan-soft);
}

.commit-icon svg {
  width: 14px;
  height: 14px;
}

.commit-message {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commit-sha {
  flex: none;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.file-tree {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  overflow: hidden;
}

.file-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.file-row:first-child {
  border-top: 0;
}

.file-row:hover {
  background: rgba(233, 239, 246, 0.03);
}

.file-icon {
  display: inline-flex;
  color: var(--dim);
}

.file-icon svg {
  width: 15px;
  height: 15px;
}

.file-icon-directory {
  color: var(--cyan-soft);
}

.file-row > a {
  color: var(--fg);
  overflow-wrap: anywhere;
}

.file-row > a:hover {
  color: var(--cyan);
}

.file-meta {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9.5px;
  text-align: right;
  white-space: nowrap;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 20px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  overflow-wrap: anywhere;
}

.breadcrumbs a {
  color: var(--muted);
}

.breadcrumbs a:hover {
  color: var(--cyan);
}

.crumb-separator {
  width: 11px;
  height: 11px;
  opacity: 0.4;
}

.file-panel,
.readme-panel {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  display: flex;
  align-items: center;
  margin: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.panel-heading h2 .inline-icon {
  flex: none;
  margin: 0 8px 0 0;
  color: var(--cyan-soft);
}

.panel-heading a {
  flex: none;
  color: var(--cyan-soft);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.panel-heading a:hover {
  color: var(--cyan);
}

.file-panel > .content-note,
.readme-panel > .content-note {
  padding: 14px 18px;
}

.file-panel > .content-note code {
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* --- Markdown ------------------------------------------------------------- */

.markdown {
  padding: 32px 36px;
  color: rgba(233, 239, 246, 0.86);
  font-size: 15px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.markdown > :first-child {
  margin-top: 0;
}

.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
  color: var(--fg);
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.008em;
  line-height: 1.2;
}

.markdown h1 {
  margin: 0 0 20px;
  font-size: 34px;
  white-space: normal;
}

.markdown h2 {
  margin: 32px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 26px;
}

.markdown h3 {
  margin: 26px 0 10px;
  font-size: 21px;
}

.markdown h4,
.markdown h5,
.markdown h6 {
  margin: 22px 0 8px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
}

.markdown p {
  margin: 0 0 16px;
}

.markdown a {
  color: var(--cyan);
  border-bottom: 1px solid rgba(88, 186, 214, 0.35);
}

.markdown a:hover {
  color: var(--fg);
  border-bottom-color: var(--fg);
}

.markdown ul,
.markdown ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

.markdown li {
  margin: 5px 0;
}

.markdown li > input[type="checkbox"] {
  margin-right: 6px;
}

.markdown code {
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(233, 239, 246, 0.07);
  color: #d9e2ee;
  font-size: 12.5px;
}

.markdown pre {
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b0c1c;
  overflow: auto;
  font-size: 12px;
  line-height: 1.7;
}

.markdown pre code {
  padding: 0;
  background: none;
  color: #d6dde8;
  font-size: inherit;
}

.markdown table {
  display: block;
  max-width: 100%;
  margin: 0 0 18px;
  border-collapse: collapse;
  overflow: auto;
}

.markdown th,
.markdown td {
  padding: 8px 14px;
  border: 1px solid var(--line);
  text-align: left;
}

.markdown th {
  background: rgba(233, 239, 246, 0.03);
  color: var(--fg);
  font-weight: 600;
}

.markdown blockquote {
  margin: 0 0 18px;
  padding: 2px 0 2px 18px;
  border-left: 2px solid var(--cyan-soft);
  color: var(--muted);
}

.markdown img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.markdown hr {
  margin: 28px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* --- Source and syntax ---------------------------------------------------- */

.source-code {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  background: #0b0c1c;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
}

.source-code ol {
  margin: 0;
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  background: rgba(233, 239, 246, 0.03);
  color: var(--dim);
  list-style: none;
  text-align: right;
  user-select: none;
}

.source-code li {
  height: 1.7em;
}

.source-code a {
  color: inherit;
}

.source-code a:hover {
  color: var(--cyan);
}

.source-code pre {
  margin: 0;
  padding: 16px;
  overflow: auto;
  font: inherit;
  line-height: inherit;
  tab-size: 4;
}

.source-code code {
  color: #d6dde8;
  font: inherit;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-doctag {
  color: #ff7b72;
}

.hljs-string,
.hljs-regexp {
  color: #a5d6ff;
}

.hljs-comment,
.hljs-quote,
.hljs-meta {
  color: #8b949e;
}

.hljs-number,
.hljs-literal,
.hljs-symbol,
.hljs-bullet {
  color: #79c0ff;
}

.hljs-title,
.hljs-section,
.hljs-tag,
.hljs-name {
  color: #d2a8ff;
}

.hljs-attr,
.hljs-attribute,
.hljs-variable,
.hljs-template-variable,
.hljs-type,
.hljs-built_in {
  color: #7ee787;
}

.hljs-emphasis {
  font-style: italic;
}

.hljs-strong {
  font-weight: 700;
}

/* --- Commits, branches, tags ---------------------------------------------- */

.commit-list article {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  padding: 16px 2px;
  border-bottom: 1px solid var(--line);
}

.commit-list .commit-icon {
  margin-top: 3px;
  color: var(--dim);
}

.commit-copy h2 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.commit-copy p {
  margin: 6px 0 0;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.03em;
}

.reference-types {
  display: flex;
  gap: 4px;
  margin: 0 0 20px;
  border-bottom: 1px solid var(--line);
}

.reference-types a {
  padding: 10px 14px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

.reference-types a:hover {
  color: var(--fg);
}

.reference-types a[aria-current="page"] {
  border-bottom-color: var(--cyan);
  color: var(--fg);
}

.reference-list article {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--line);
}

.reference-icon {
  display: inline-flex;
  color: var(--dim);
}

.reference-icon svg {
  width: 14px;
  height: 14px;
}

.reference-list a {
  color: var(--fg);
  font-family: var(--mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.reference-list a:hover {
  color: var(--cyan);
}

.page-next {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 26px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

.page-next:hover {
  color: var(--fg);
}

.empty-state {
  margin: 24px 0;
  padding: 52px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-soft);
  text-align: center;
}

.empty-state-icon {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--dim);
}

.empty-state h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
}

.empty-state p {
  margin: 0 auto;
  max-width: 420px;
  color: var(--dim);
  font-size: 12.5px;
}

.error-head {
  margin-bottom: 28px;
}

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 1100px) {
  .home-columns,
  .settings-layout {
    gap: 40px;
  }

  .stars-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 900px) {
  .home-columns,
  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-rail {
    position: static;
    display: flex;
    align-items: center;
    gap: 8px 20px;
    flex-wrap: wrap;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--line);
  }

  .rail-title {
    width: 100%;
    margin: 0;
  }

  .rail-link {
    gap: 8px;
    padding: 0;
    border-bottom: 0;
  }

  .rail-note {
    width: 100%;
    margin-top: 4px;
  }

  .settings-nav {
    position: sticky;
    top: var(--header);
    z-index: 10;
    flex-direction: row;
    gap: 18px;
    margin: 0 0 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .settings-nav::-webkit-scrollbar {
    display: none;
  }

  .settings-nav .eyebrow,
  .settings-nav .rail-note {
    display: none;
  }

  .settings-nav a {
    padding: 4px 0;
    border-bottom: 0;
    white-space: nowrap;
  }

  .settings-content > div {
    scroll-margin-top: calc(var(--header) + 48px);
  }

  .repository-list-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .site-search {
    display: none;
  }

  .site-actions {
    margin-left: auto;
  }
}

@media (max-width: 720px) {
  :root {
    --gutter: 20px;
  }

  .home-main,
  .browser-main,
  .stars-main,
  .settings-main {
    padding: 40px 0 72px;
  }

  .auth-page {
    padding: 56px 0 80px;
  }

  .profile-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding-bottom: 36px;
    margin-bottom: 36px;
  }

  .profile-mark {
    width: 64px;
    height: 64px;
    font-size: 40px;
  }

  .display {
    font-size: clamp(38px, 11vw, 56px);
  }

  .home-columns {
    gap: 28px;
  }

  .home-feed {
    margin-top: 0;
  }

  .home-projects {
    margin-bottom: 48px;
  }

  .collection-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 26px 22px;
  }

  .page-head {
    margin-bottom: 30px;
  }

  .toolbar label,
  .stars-filters label {
    flex: 1 1 45%;
    min-width: 130px;
  }

  .toolbar-actions {
    width: 100%;
  }

  .stars-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .stars-item-head {
    flex-direction: column;
    gap: 14px;
  }

  .stars-item .stars-actions {
    justify-content: flex-start;
  }

  .stars-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stars-add,
  .stars-item {
    padding: 20px;
  }

  .markdown {
    padding: 22px 18px;
  }

  .markdown h1 {
    font-size: 28px;
  }

  .markdown h2 {
    font-size: 23px;
  }

  .markdown h3 {
    font-size: 19px;
  }

  .file-row {
    grid-template-columns: 16px minmax(0, 1fr);
    padding: 10px 14px;
    gap: 4px 8px;
  }

  .file-meta {
    grid-column: 2;
    text-align: left;
    font-size: 9px;
  }

  .commit-list article {
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 10px;
  }

  .commit-list .commit-sha {
    grid-column: 2;
    justify-self: start;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .repository-row {
    padding: 16px 2px;
  }

  .site-footer-inner {
    flex-wrap: wrap;
    gap: 8px 18px;
    padding: 22px var(--gutter) 26px;
  }

  .footer-links {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .site-header-inner {
    gap: 16px;
  }

  .brand-name {
    display: none;
  }

  .site-nav {
    gap: 14px;
    font-size: 11px;
  }

  .manage-link {
    font-size: 10px;
  }

  .manage-link .link-chevron {
    display: none;
  }

  .auth-card {
    padding: 28px 22px 24px;
  }

  .auth-card h1 {
    font-size: 34px;
  }

  .stars-badges {
    gap: 4px;
  }

  .stars-preview dl > div {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .recovery-codes ul {
    grid-template-columns: minmax(0, 1fr);
  }

  .annotation-controls {
    gap: 12px;
  }

  .page-title-row {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
