/* Polar Design System — Minimalist Sidebar Layout, 3 Themes (light, dark, system) */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/static/fonts/Inter-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/static/fonts/Inter-Cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/static/fonts/JetBrainsMono-Regular.woff2') format('woff2');
}

:root,
html[data-theme="light"] {
  --background: 0 0% 100%;
  --foreground: 0 0% 6.7%;
  --card: 0 0% 98%;
  --card-foreground: 0 0% 6.7%;
  --popover: 0 0% 100%;
  --popover-foreground: 0 0% 6.7%;
  --primary: 0 0% 6.7%;
  --primary-foreground: 0 0% 100%;
  --secondary: 0 0% 95%;
  --secondary-foreground: 0 0% 6.7%;
  --muted: 0 0% 95%;
  --muted-foreground: 0 0% 38%;
  --accent: 0 0% 93%;
  --accent-foreground: 0 0% 6.7%;
  --destructive: 0 72% 46%;
  --destructive-foreground: 0 0% 100%;
  --destructive-surface: 0 72% 96%;
  --border: 0 0% 90%;
  --input: 0 0% 89%;
  --ring: 0 0% 6.7%;
  --radius: 0.45rem;

  --diff-add-bg: 142 70% 94%;
  --diff-add-fg: 142 76% 22%;
  --diff-del-bg: 0 86% 95%;
  --diff-del-fg: 0 72% 35%;

  --syntax-kw: 262 72% 42%;
  --syntax-str: 142 68% 28%;
  --syntax-cmt: 0 0% 46%;
  --syntax-fn: 215 80% 42%;
  --syntax-num: 24 85% 38%;
  --syntax-type: 190 78% 32%;
  --syntax-op: 0 0% 25%;
  color-scheme: light;
}

html[data-theme="dark"] {
  --background: 0 0% 6.7%;
  --foreground: 0 0% 100%;
  --card: 0 0% 10%;
  --card-foreground: 0 0% 100%;
  --popover: 0 0% 11%;
  --popover-foreground: 0 0% 100%;
  --primary: 0 0% 100%;
  --primary-foreground: 0 0% 6.7%;
  --secondary: 0 0% 15%;
  --secondary-foreground: 0 0% 100%;
  --muted: 0 0% 14%;
  --muted-foreground: 0 0% 74%;
  --accent: 0 0% 17%;
  --accent-foreground: 0 0% 100%;
  --destructive: 0 72% 58%;
  --destructive-foreground: 0 0% 98%;
  --destructive-surface: 0 45% 15%;
  --border: 0 0% 20%;
  --input: 0 0% 17%;
  --ring: 0 0% 85%;

  --diff-add-bg: 142 50% 12%;
  --diff-add-fg: 142 70% 75%;
  --diff-del-bg: 0 55% 14%;
  --diff-del-fg: 0 80% 78%;

  --syntax-kw: 265 85% 78%;
  --syntax-str: 142 65% 70%;
  --syntax-cmt: 0 0% 54%;
  --syntax-fn: 210 90% 74%;
  --syntax-num: 32 90% 72%;
  --syntax-type: 188 80% 68%;
  --syntax-op: 0 0% 78%;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    --background: 0 0% 6.7%;
    --foreground: 0 0% 100%;
    --card: 0 0% 10%;
    --card-foreground: 0 0% 100%;
    --popover: 0 0% 11%;
    --popover-foreground: 0 0% 100%;
    --primary: 0 0% 100%;
    --primary-foreground: 0 0% 6.7%;
    --secondary: 0 0% 15%;
    --secondary-foreground: 0 0% 100%;
    --muted: 0 0% 14%;
    --muted-foreground: 0 0% 74%;
    --accent: 0 0% 17%;
    --accent-foreground: 0 0% 100%;
    --destructive: 0 72% 58%;
    --destructive-foreground: 0 0% 98%;
    --destructive-surface: 0 45% 15%;
    --border: 0 0% 20%;
    --input: 0 0% 17%;
    --ring: 0 0% 85%;
    --diff-add-bg: 142 50% 12%;
    --diff-add-fg: 142 70% 75%;
    --diff-del-bg: 0 55% 14%;
    --diff-del-fg: 0 80% 78%;
    --syntax-kw: 265 85% 78%;
    --syntax-str: 142 65% 70%;
    --syntax-cmt: 0 0% 54%;
    --syntax-fn: 210 90% 74%;
    --syntax-num: 32 90% 72%;
    --syntax-type: 188 80% 68%;
    --syntax-op: 0 0% 78%;
    color-scheme: dark;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
  border-color: hsl(var(--border));
}

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  overflow-y: scroll;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
}

code, pre, kbd, .font-mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

a {
  color: inherit;
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

/* App Shell: Left Sidebar + Right Main Content */
.app-shell {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 100vh;
  width: 100%;
}

.app-sidebar {
  width: 232px;
  min-width: 232px;
  max-width: 232px;
  flex: 0 0 232px;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) * 1.5);
  background-color: hsl(var(--card));
  display: none;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 0.75rem;
  height: calc(100vh - 1.5rem);
  margin: 0.75rem 0 0.75rem 0.75rem;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.85rem 0.7rem;
  user-select: none;
  transition:
    width 200ms cubic-bezier(0.16, 1, 0.3, 1),
    min-width 200ms cubic-bezier(0.16, 1, 0.3, 1),
    max-width 200ms cubic-bezier(0.16, 1, 0.3, 1),
    flex-basis 200ms cubic-bezier(0.16, 1, 0.3, 1),
    margin 200ms cubic-bezier(0.16, 1, 0.3, 1),
    padding 200ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-inner {
  width: 100%;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition:
    opacity 150ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-sidebar="collapsed"] .app-sidebar {
  width: 0;
  min-width: 0;
  max-width: 0;
  flex-basis: 0;
  margin: 0.75rem 0;
  padding-left: 0;
  padding-right: 0;
  border-color: transparent;
}

html[data-sidebar="collapsed"] .sidebar-inner {
  opacity: 0;
  transform: translateX(-8px);
  pointer-events: none;
}

.sidebar-expand-btn {
  position: fixed;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  color: hsl(var(--muted-foreground));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  opacity: 0;
  transform: translateX(-6px) scale(0.95);
  pointer-events: none;
  transition:
    opacity 160ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 160ms cubic-bezier(0.16, 1, 0.3, 1),
    background-color 120ms ease,
    color 120ms ease;
}

.sidebar-expand-btn:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--foreground));
}

.mobile-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 2.75rem;
  padding: 0 0.85rem;
  border-bottom: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
}

.app-col {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
}

.page-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  left: 0;
  overflow: hidden;
  pointer-events: none;
  background: hsl(var(--background));
  transition: left 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.page-bg img {
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  height: clamp(28rem, 92vh, 54rem);
  object-fit: cover;
  object-position: center 28%;
  opacity: 0.9;
  filter: saturate(0.9) contrast(0.97);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.96) 38%, rgba(0, 0, 0, 0.62) 72%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.96) 38%, rgba(0, 0, 0, 0.62) 72%, transparent 100%);
}
.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(118% 86% at 50% 0%, transparent 16%, hsl(var(--background) / 0.36) 52%, hsl(var(--background) / 0.9) 86%, hsl(var(--background)) 100%),
    linear-gradient(to bottom,
      hsl(var(--background) / 0.5) 0%,
      hsl(var(--background) / 0.6) 32%,
      hsl(var(--background) / 0.88) 68%,
      hsl(var(--background)) 100%);
}
.app-col > .mobile-topbar,
.app-col > .app-main {
  position: relative;
  z-index: 1;
}

.app-main {
  flex: 1 1 auto;
  width: 100%;
  padding: 1.5rem 1.25rem 3rem;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-main > .container,
.app-main > .container-narrow {
  animation: pageFadeIn 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  .app-sidebar {
    display: flex;
  }
  .page-bg {
    left: 0.75rem;
  }
  html[data-sidebar="collapsed"] .page-bg {
    left: 0;
  }
  .sidebar-expand-btn {
    display: inline-flex;
  }
  html[data-sidebar="collapsed"] .sidebar-expand-btn {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
  }
  .mobile-topbar {
    display: none;
  }
  .app-main {
    padding: 2rem 2.5rem 3.5rem;
  }
}

/* Unified Container Width — identical across Code, Commits, and Settings */
.container,
.container-narrow {
  width: 100%;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

/* Sidebar Navigation */
.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  height: 1.95rem;
  padding: 0 0.55rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
  transition: background-color 140ms ease, color 140ms ease, transform 120ms cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  overflow: hidden;
}
.nav-item:hover,
.nav-item.active {
  background-color: hsl(var(--accent));
  color: hsl(var(--foreground));
}
.nav-item:active {
  transform: scale(0.985);
}
.muted-link {
  color: hsl(var(--muted-foreground));
  transition: color 140ms ease;
}
.muted-link:hover {
  color: hsl(var(--foreground));
}
.nav-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.55rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
}

/* Segmented Theme Control in Sidebar */
.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  padding: 2px;
  width: 100%;
  background-color: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}
.segmented-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  height: 1.65rem;
  padding: 0 0.2rem;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background-color 150ms cubic-bezier(0.16, 1, 0.3, 1), color 150ms ease, box-shadow 150ms ease, transform 120ms ease;
}
.segmented-btn:hover {
  color: hsl(var(--foreground));
}
.segmented-btn:active {
  transform: scale(0.96);
}
.segmented-btn.active {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Icons */
.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke: currentColor;
}
.size-3 { width: 0.75rem; height: 0.75rem; }
.size-3\.5 { width: 0.875rem; height: 0.875rem; }
.size-4 { width: 1rem; height: 1rem; }
.size-5 { width: 1.25rem; height: 1.25rem; }
.size-6 { width: 1.5rem; height: 1.5rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1;
  height: 1.95rem;
  padding: 0 0.7rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, opacity 140ms ease, transform 120ms cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}
.btn:active:not(:disabled) {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}
.btn-sm {
  height: 1.7rem;
  padding: 0 0.5rem;
  font-size: 0.78rem;
}
.btn-lg {
  height: 2.3rem;
  padding: 0 1rem;
  font-size: 0.92rem;
}
.btn-icon {
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
}
.btn-default, .btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.btn-default:hover, .btn-primary:hover {
  filter: brightness(0.92);
  opacity: 1;
}
.btn-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border-color: hsl(var(--border));
}
.btn-secondary:hover {
  background-color: hsl(var(--accent));
}
.btn-outline {
  background-color: hsl(var(--card));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}
.btn-outline:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}
.btn-ghost {
  background-color: hsl(var(--background));
  color: hsl(var(--muted-foreground));
}
.btn-ghost:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--foreground));
}
.btn-destructive {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}
.btn-destructive:hover {
  opacity: 0.9;
}

/* Inputs, Selects, Textareas */
.input, .select, .textarea {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  transition: border-color 100ms ease;
}
.input, .select {
  height: 2.05rem;
}
.textarea {
  min-height: 4rem;
  resize: vertical;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: hsl(var(--ring));
}
.input::placeholder, .textarea::placeholder {
  color: hsl(var(--muted-foreground));
}
.label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
  color: hsl(var(--foreground));
}
.field-hint {
  font-size: 0.74rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.25rem;
}

/* Switch */
.switch {
  position: relative;
  display: inline-flex;
  width: 2.1rem;
  height: 1.2rem;
  flex-shrink: 0;
  cursor: pointer;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted));
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.switch-thumb {
  pointer-events: none;
  display: block;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 9999px;
  background-color: hsl(var(--foreground));
  transform: translateX(0.15rem);
  transition: transform 100ms ease;
}
.switch input:checked ~ .switch-thumb {
  transform: translateX(0.95rem);
}
/* Toggle applied straight to the <input> (repo settings, release form) */
input.switch {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
input.switch::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0.16rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 9999px;
  background-color: hsl(var(--muted-foreground));
  transform: translateY(-50%);
  transition: left 0.15s ease, background-color 0.15s ease;
}
input.switch:checked {
  background-color: hsl(var(--primary));
  border-color: hsl(var(--primary));
}
input.switch:checked::after {
  left: calc(100% - 0.85rem - 0.16rem);
  background-color: hsl(var(--primary-foreground));
}
input.switch:focus-visible {
  outline: 2px solid hsl(var(--ring) / 0.4);
  outline-offset: 2px;
}
input.switch:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
input.switch:disabled::after {
  opacity: 0.7;
}

/* Radio */
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: inline-block;
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  border: 1px solid hsl(var(--input));
  border-radius: 9999px;
  background-color: hsl(var(--background));
  vertical-align: middle;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
input[type="radio"]::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 9999px;
  background-color: hsl(var(--background));
  transform: scale(0);
  transition: transform 0.12s ease;
}
input[type="radio"]:checked {
  border-color: hsl(var(--foreground));
  background-color: hsl(var(--foreground));
}
input[type="radio"]:checked::after {
  transform: scale(1);
}
input[type="radio"]:focus-visible {
  outline: 2px solid hsl(var(--ring) / 0.4);
  outline-offset: 2px;
}

/* Cards */
.card {
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
}
.card-header {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.card-body {
  padding: 0.9rem;
}
.card-footer {
  padding: 0.65rem 0.9rem;
  border-top: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted));
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 9999px;
  border: 1px solid hsl(var(--border));
  padding: 0.08rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.3;
  color: hsl(var(--foreground));
  background-color: hsl(var(--secondary));
}
.badge-outline {
  background-color: hsl(var(--background));
  color: hsl(var(--muted-foreground));
}
.badge-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: transparent;
}
.badge-destructive {
  background-color: hsl(var(--destructive-surface));
  color: hsl(var(--destructive));
  border-color: hsl(var(--destructive) / 0.3);
}

/* Kbd */
kbd, .kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.15rem;
  padding: 0 0.28rem;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1;
  color: hsl(var(--muted-foreground));
  background-color: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: 0.25rem;
}

/* Avatar */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 9999px;
  background-color: hsl(var(--secondary));
  border: 1px solid hsl(var(--border));
  font-size: 0.7rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  text-transform: uppercase;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-lg {
  width: 2.3rem;
  height: 2.3rem;
  font-size: 0.9rem;
}
.avatar-xl {
  width: 4.25rem;
  height: 4.25rem;
  font-size: 1.5rem;
}
.avatar-xxl {
  width: 8.5rem;
  height: 8.5rem;
  font-size: 2.75rem;
  box-shadow: 0 0 0 3px hsl(var(--background)), 0 0 0 4px hsl(var(--border));
}
.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border: 1px solid hsl(var(--border) / 0.9);
  border-radius: 9999px;
  background: hsl(var(--card));
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
}
.profile-chip a {
  color: inherit;
  text-decoration: none;
}
.profile-chip a:hover {
  color: hsl(var(--foreground));
}
.repo-card {
  transition: border-color 0.15s ease;
}
.repo-card:hover {
  border-color: hsl(var(--foreground) / 0.3);
}
@media (max-width: 640px) {
  .avatar-xxl {
    width: 6rem;
    height: 6rem;
    font-size: 2rem;
  }
}


/* Separator */
.separator {
  height: 1px;
  width: 100%;
  background-color: hsl(var(--border));
  margin: 0.85rem 0;
  border: 0;
}

/* Tabs */
.tabs-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.2rem;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  background: hsl(var(--muted));
  margin-bottom: 1rem;
  overflow-x: auto;
}
.tab-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  border-radius: 999px;
  white-space: nowrap;
  transition: color 100ms ease, background-color 100ms ease;
}
.tab-link:hover {
  color: hsl(var(--foreground));
}
.tab-link.active {
  color: hsl(var(--foreground));
  background: hsl(var(--card));
  box-shadow: 0 1px 2px hsl(0 0% 0% / 0.08);
}

/* Dense File List & Tables */
.dense-list {
  width: 100%;
}
.dense-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.05rem;
  padding: 0.25rem 0.75rem;
  border-bottom: 1px solid hsl(var(--border));
  font-size: 0.85rem;
  transition: background-color 80ms ease;
}
.dense-row:last-child {
  border-bottom: none;
}
.dense-row:hover {
  background-color: hsl(var(--accent));
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background-color: hsl(var(--card));
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.table th {
  text-align: left;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted));
  font-size: 0.75rem;
}
.table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid hsl(var(--border));
  vertical-align: middle;
}
.table tr:last-child td {
  border-bottom: none;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: 0.85rem;
}
.breadcrumb-sep {
  color: hsl(var(--muted-foreground));
}

/* Dropdown Menu */
@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 0.3rem);
  min-width: 11rem;
  background-color: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 0.25rem;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.22);
  z-index: 60;
  display: none;
  transform-origin: top left;
}
.dropdown-menu.open {
  display: block;
  animation: dropdownIn 140ms cubic-bezier(0.16, 1, 0.3, 1);
}
.dropdown-item {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.8rem;
  border-radius: calc(var(--radius) - 2px);
  color: hsl(var(--popover-foreground));
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  transition: background-color 120ms ease, color 120ms ease;
}
.dropdown-item:hover, .dropdown-item.active {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

/* Modal / Dialog & Command Palette */
@keyframes backdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes dialogIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: 80;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 1rem 2rem;
}
.backdrop.open {
  display: flex;
  animation: backdropIn 140ms ease;
}
.dialog-box {
  width: 100%;
  max-width: 28rem;
  background-color: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  animation: dialogIn 170ms cubic-bezier(0.16, 1, 0.3, 1);
}
.palette-box {
  width: 100%;
  max-width: 34rem;
  background-color: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 16px 48px -8px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  animation: dialogIn 170ms cubic-bezier(0.16, 1, 0.3, 1);
}
.palette-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid hsl(var(--border));
}
.palette-input {
  width: 100%;
  border: 0;
  background: transparent;
  color: hsl(var(--foreground));
  font-size: 0.9rem;
  outline: none;
}
.palette-list {
  max-height: 20rem;
  overflow-y: auto;
  padding: 0.3rem;
}
.palette-group-title {
  padding: 0.3rem 0.5rem 0.15rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
}
.palette-item {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.85rem;
  color: hsl(var(--foreground));
  cursor: pointer;
  border: 0;
  background: transparent;
  text-align: left;
  transition: background-color 100ms ease, color 100ms ease;
}
.palette-item:hover, .palette-item.selected {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

/* Custom context menu */
@keyframes contextMenuIn {
  from {
    opacity: 0;
    transform: translateY(-3px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.context-menu {
  position: fixed;
  z-index: 120;
  width: max-content;
  min-width: 15rem;
  max-width: min(20rem, calc(100vw - 1rem));
  max-height: min(72vh, 36rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.28rem;
  background-color: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 18px 44px -12px rgba(0, 0, 0, 0.42), 0 2px 8px -2px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-3px) scale(0.98);
  transform-origin: top left;
  transition: opacity 110ms ease, transform 130ms cubic-bezier(0.16, 1, 0.3, 1), visibility 110ms ease;
}
.context-menu.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  animation: contextMenuIn 130ms cubic-bezier(0.16, 1, 0.3, 1);
}
.context-menu-section[hidden],
.context-menu-item[hidden] {
  display: none;
}
.context-menu-section + .context-menu-section {
  margin-top: 0.24rem;
  padding-top: 0.24rem;
  border-top: 1px solid hsl(var(--border));
}
.context-menu-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.22rem 0.5rem 0.14rem;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}
.context-menu-item {
  display: flex;
  width: 100%;
  min-height: 1.95rem;
  align-items: center;
  gap: 0.55rem;
  padding: 0.33rem 0.5rem;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: hsl(var(--popover-foreground));
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.25;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: background-color 90ms ease, color 90ms ease;
}
.context-menu-item .icon {
  flex: none;
  color: hsl(var(--muted-foreground));
  transition: color 90ms ease;
}
.context-menu-item > span:not(.context-menu-kbd) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.context-menu-item:hover,
.context-menu-item:focus-visible,
.context-menu-item.is-active {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  outline: none;
}
.context-menu-item:hover .icon,
.context-menu-item:focus-visible .icon,
.context-menu-item.is-active .icon {
  color: currentColor;
}
.context-menu-kbd {
  margin-left: auto;
  flex: none;
  min-width: auto;
  height: 1.05rem;
  padding: 0 0.24rem;
  font-size: 0.6rem;
  color: hsl(var(--muted-foreground));
  background-color: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: 0.22rem;
}

/* Shortcuts dialog */
.shortcuts-list {
  display: flex;
  max-height: min(70vh, 44rem);
  flex-direction: column;
  padding-top: 0.45rem;
  padding-bottom: 0.55rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.shortcuts-group-label {
  padding: 0.65rem 0 0.2rem;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}
.shortcuts-group-label:first-child {
  padding-top: 0.15rem;
}
.shortcut-row {
  display: flex;
  min-height: 2rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.32rem 0;
  border-bottom: 1px solid hsl(var(--border));
  font-size: 0.82rem;
}
.shortcut-keys {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.2rem;
}

/* Toast */
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-width: 20rem;
}
.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.25);
  font-size: 0.8rem;
  animation: toastIn 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Skeleton */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.skeleton {
  background-color: hsl(var(--muted));
  border-radius: calc(var(--radius) - 2px);
  animation: pulse 1.6s ease-in-out infinite;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  border: 1px dashed hsl(var(--border));
  border-radius: var(--radius);
  background-color: hsl(var(--card));
  color: hsl(var(--muted-foreground));
}

/* Code Viewer & Chroma */
.code-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.5;
}
.code-ln {
  width: 1%;
  min-width: 2.75rem;
  padding: 0 0.65rem;
  text-align: right;
  color: hsl(var(--muted-foreground) / 0.6);
  user-select: none;
  vertical-align: top;
  border-right: 1px solid hsl(var(--border));
}
.code-line {
  padding: 0 0.75rem;
  white-space: pre;
  overflow-x: auto;
}
.chroma .k, .chroma .kc, .chroma .kd, .chroma .kn, .chroma .kp, .chroma .kr { color: hsl(var(--syntax-kw)); font-weight: 500; }
.chroma .kt { color: hsl(var(--syntax-type)); }
.chroma .s, .chroma .sa, .chroma .sb, .chroma .sc, .chroma .dl, .chroma .sd, .chroma .s2, .chroma .se, .chroma .sh, .chroma .si, .chroma .sx, .chroma .sr, .chroma .s1, .chroma .ss { color: hsl(var(--syntax-str)); }
.chroma .c, .chroma .ch, .chroma .cm, .chroma .c1, .chroma .cs, .chroma .cp, .chroma .cpf { color: hsl(var(--syntax-cmt)); font-style: italic; }
.chroma .nf, .chroma .fm, .chroma .nx { color: hsl(var(--syntax-fn)); }
.chroma .m, .chroma .mb, .chroma .mf, .chroma .mh, .chroma .mi, .chroma .il, .chroma .mo { color: hsl(var(--syntax-num)); }
.chroma .o, .chroma .ow { color: hsl(var(--syntax-op)); }

/* Diff Viewer */
.diff-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.5;
}
.diff-row-add {
  background-color: hsl(var(--diff-add-bg));
  color: hsl(var(--diff-add-fg));
}
.diff-row-del {
  background-color: hsl(var(--diff-del-bg));
  color: hsl(var(--diff-del-fg));
}
.diff-row-hunk {
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}
.diff-num {
  width: 2.75rem;
  padding: 0 0.45rem;
  text-align: right;
  user-select: none;
  opacity: 0.65;
  border-right: 1px solid hsl(var(--border));
}
.diff-code {
  padding: 0 0.65rem;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Markdown Body */
.markdown-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: hsl(var(--foreground));
}
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  margin-top: 1.25em;
  margin-bottom: 0.45em;
  font-weight: 600;
  line-height: 1.25;
}
.markdown-body h1 { font-size: 1.35rem; padding-bottom: 0.25rem; border-bottom: 1px solid hsl(var(--border)); }
.markdown-body h2 { font-size: 1.15rem; padding-bottom: 0.2rem; border-bottom: 1px solid hsl(var(--border)); }
.markdown-body h3 { font-size: 1rem; }
.markdown-body h1:first-child, .markdown-body h2:first-child { margin-top: 0; }
.markdown-body p, .markdown-body ul, .markdown-body ol, .markdown-body pre, .markdown-body blockquote {
  margin-top: 0;
  margin-bottom: 0.8rem;
}
.markdown-body code {
  background-color: hsl(var(--muted));
  padding: 0.12rem 0.3rem;
  border-radius: 0.25rem;
  font-size: 0.84em;
}
.markdown-body pre {
  background-color: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  overflow-x: auto;
}
.markdown-body pre code {
  background: transparent;
  padding: 0;
}
.markdown-body a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Utility Helpers */
.flex { display: flex; }
.block { display: block; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-baseline { align-items: baseline; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.min-w-0 { min-width: 0; }
.gap-0\.5 { gap: 0.125rem; }
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-2\.5 { gap: 0.625rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.w-full { width: 100%; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.85rem; }
.text-base { font-size: 0.96rem; }
.text-lg { font-size: 1.1rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.tracking-tight { letter-spacing: -0.015em; }
.text-muted { color: hsl(var(--muted-foreground)); }
.text-destructive { color: hsl(var(--destructive)); }
.text-foreground { color: hsl(var(--foreground)); }
.text-center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hover\:underline:hover { text-decoration: underline; }
.select-all { user-select: all; }
.cursor-pointer { cursor: pointer; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mr-2 { margin-right: 0.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-1\.5 { margin-bottom: 0.375rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 0.75rem; }
.pb-3 { padding-bottom: 0.75rem; }

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

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md-flex { display: flex !important; }
  .md-hidden { display: none !important; }
}

/* Mobile Drawer */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 75;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
}
.mobile-drawer.open {
  display: block;
}
.mobile-drawer-panel {
  width: 224px;
  max-width: 85vw;
  height: 100%;
  background-color: hsl(var(--card));
  border-right: 1px solid hsl(var(--border));
  padding: 0.75rem 0.65rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@media (min-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ── Polar repository shell ─────────────────────────────────────────── */
.repo-banner {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.65rem 1rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) * 1.6);
  overflow: hidden;
}

.repo-banner-main {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-width: 0;
  flex: 1 1 20rem;
}
.repo-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.repo-head-block {
  min-width: 0;
  flex: 1 1 auto;
}
.repo-head-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  min-width: 0;
}
.repo-desc {
  flex: 1 1 6rem;
  min-width: 0;
  max-width: 36rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
  line-height: 1.35;
  color: hsl(var(--muted-foreground));
  transition: color 0.15s ease;
}
.repo-desc.truncated {
  cursor: pointer;
}
.repo-desc.truncated:hover {
  color: hsl(var(--foreground));
}
.repo-banner.desc-open .repo-desc {
  flex-basis: 100%;
  max-width: 100%;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
}
.repo-avatar-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.repo-avatar {
  width: 1.65rem;
  height: 1.65rem;
  font-size: 0.68rem;
  transition: width 0.2s ease, height 0.2s ease, font-size 0.2s ease;
}



.clone-box {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--muted));
  padding: 0.15rem 0.25rem 0.15rem 0.6rem;
  min-width: 0;
}
.clone-box code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
}
.upload-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  padding: 1.6rem 1rem;
  border: 1.5px dashed hsl(var(--border));
  border-radius: calc(var(--radius) * 1.3);
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.upload-drop:hover {
  border-color: hsl(var(--foreground) / 0.4);
  color: hsl(var(--foreground));
}
.upload-drop.drag {
  border-color: hsl(var(--foreground) / 0.6);
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
}
/* Utility completion (classes used in templates but absent from the build) */
.relative { position: relative; }
.gap-1\.5 { gap: 0.375rem; }
.gap-5 { gap: 1.25rem; }
.mb-1\.5 { margin-bottom: 0.375rem; }
.pt-1 { padding-top: 0.25rem; }

/* Profile header sits directly on the page backdrop. */
.profile-hero {
  position: relative;
  padding: 0.6rem 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.profile-hero-content {
  position: relative;
}
.has-page-bg .profile-hero h1,
.has-page-bg .profile-hero p,
.has-page-bg .profile-hero .text-muted {
  text-shadow: 0 1px 16px hsl(var(--background) / 0.95);
}

/* Media settings */
.background-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 6;
  min-height: 7rem;
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) * 1.3);
  background:
    radial-gradient(100% 130% at 50% 30%, hsl(var(--muted)) 0%, hsl(var(--card)) 72%);
}
.background-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  -webkit-mask-image: radial-gradient(120% 145% at 50% 25%, #000 38%, rgba(0,0,0,0.86) 58%, transparent 100%);
  mask-image: radial-gradient(120% 145% at 50% 25%, #000 38%, rgba(0,0,0,0.86) 58%, transparent 100%);
}
.background-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, hsl(var(--background) / 0.75), hsl(var(--background) / 0.05));
  pointer-events: none;
}
.background-preview.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
}
.background-preview-placeholder {
  color: hsl(var(--muted-foreground) / 0.7);
}

/* Registration policy selector */
.registration-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}
.registration-option {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) * 1.2);
  background: hsl(var(--card));
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.registration-option:hover {
  border-color: hsl(var(--foreground) / 0.28);
  background: hsl(var(--accent));
}
.registration-option:has(input:checked) {
  border-color: hsl(var(--foreground) / 0.72);
  background: hsl(var(--secondary));
}
.registration-option input {
  margin-top: 0.14rem;
  flex-shrink: 0;
}
.registration-option strong,
.registration-option small {
  display: block;
}
.registration-option strong {
  font-size: 0.8rem;
  line-height: 1.3;
}
.registration-option small {
  margin-top: 0.18rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.7rem;
  line-height: 1.4;
}

/* Admin actions */
.admin-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.admin-row-actions form {
  margin: 0;
  display: inline-flex;
}
.admin-repo-row {
  gap: 0.75rem;
}
.admin-repo-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex: 1;
  color: inherit;
  text-decoration: none;
}
.admin-repo-link:hover strong {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.segmented-btn {
  text-decoration: none;
}

@media (max-width: 760px) {
  .registration-options {
    grid-template-columns: 1fr;
  }
  .profile-hero {
    padding: 0.35rem 0 0;
  }
  .background-preview {
    aspect-ratio: 16 / 7;
  }
}

.ban-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 9rem;
  gap: 0.75rem;
}
.admin-ban-row {
  gap: 0.75rem;
}
@media (max-width: 640px) {
  .ban-fields {
    grid-template-columns: 1fr;
  }
}
