/* CSS Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: Inter, Roboto, 'Helvetica Neue', 'Arial Nova', 'Nimbus Sans', Arial, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background: #faf9f7;
}

body {
  min-height: 100vh;
}

a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Site Nav */
.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.site-nav-logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: #1a1a1a;
}

.site-nav-logo:hover {
  text-decoration: none;
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-nav-link {
  font-size: 0.9375rem;
  color: #555;
}

.site-nav-link:hover {
  color: #1a1a1a;
  text-decoration: none;
}

.site-nav-cta {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: #0066cc;
  color: #fff;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 500;
}

.site-nav-cta:hover {
  background: #0052a3;
  text-decoration: none;
}

/* Hero / Landing */
.hero {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.tagline {
  font-size: 1.25rem;
  color: #555;
  margin-bottom: 1rem;
}

.description {
  color: #666;
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* CTA Button */
.cta-button {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: #0066cc;
  color: #fff;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.2s;
}

.cta-button:hover {
  background: #0052a3;
  text-decoration: none;
}

/* Grid */
.example-grid {
  margin-top: 4rem;
}

.example-grid h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px;
}

.grid-item {
  aspect-ratio: 1;
  border-radius: 2px;
  overflow: hidden;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.grid-item:hover {
  opacity: 0.85;
  text-decoration: none;
}

.grid-item img,
.grid-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-icon {
  text-align: center;
  padding: 1rem;
  font-size: 0.8125rem;
  color: #666;
  word-break: break-all;
}

.file-icon-md {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.file-icon-symbol {
  font-size: 2rem;
}

.file-icon-name {
  font-size: 0.8125rem;
  color: #666;
}

.text-card {
  width: 100%;
  height: 100%;
  padding: 1rem;
  background: #f8f6f3;
  display: flex;
  align-items: flex-start;
  font-family: Charter, 'Bitstream Charter', 'Sitka Text', Cambria, serif;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #444;
  overflow: hidden;
  position: relative;
  text-align: left;
}

.text-card-short {
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1rem;
}

.text-card-short::after {
  display: none;
}

.text-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2.5rem;
  background: linear-gradient(transparent, var(--text-card-bg, #f8f6f3));
  pointer-events: none;
}

/* Text card: tinted (short previews) — color per file hash */
.text-card-tinted {
  font-style: italic;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.2'/%3E%3C/svg%3E");
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.12);
}

.text-card-tint-0 { --text-card-bg: #eef3f8; background-color: #eef3f8; color: #3a4a5c; }
.text-card-tint-1 { --text-card-bg: #f3eef8; background-color: #f3eef8; color: #4a3a5c; }
.text-card-tint-2 { --text-card-bg: #eef8f0; background-color: #eef8f0; color: #3a5c42; }
.text-card-tint-3 { --text-card-bg: #f8f3ee; background-color: #f8f3ee; color: #5c4a3a; }
.text-card-tint-4 { --text-card-bg: #f8eeee; background-color: #f8eeee; color: #5c3a3a; }

/* Text card: accent border (long previews) */
.text-card-accent {
  border-left: 3px solid #c87941;
  padding-left: calc(1rem - 3px);
}

.placeholder-content {
  color: #999;
  font-size: 0.875rem;
}

/* Download Page */
.download-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
  text-align: center;
}

.download-page h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.download-page > p {
  color: #666;
  margin-bottom: 2rem;
}

.download-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.download-card h2 {
  margin-bottom: 0.5rem;
}

.download-card .cta-button {
  margin: 1rem 0;
}

.note {
  color: #999;
  font-size: 0.875rem;
}

.instructions {
  text-align: left;
  margin-top: 2rem;
}

.instructions h2 {
  margin-bottom: 1rem;
}

.instructions ol {
  padding-left: 1.5rem;
}

.instructions li {
  margin-bottom: 0.5rem;
}

.instructions code {
  background: #f0f0f0;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.875rem;
}

/* User Page */
.user-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.user-header {
  text-align: center;
  margin-bottom: 2rem;
}

.avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #ddd;
  margin: 0 auto 1rem;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  display: block;
}

/* Repo circles (#22) — Instagram-highlights style */
.repo-circles {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding: 0.5rem 0.25rem 1rem;
  margin-bottom: 1.5rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 640px) {
  /* Center when they fit; the row still scrolls horizontally when many. */
  .repo-circles { justify-content: center; }
}
.repo-circle {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  width: 76px;
  text-decoration: none;
  color: inherit;
}
.repo-circle-ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 3px;
  border: 2px solid #ddd;
  box-sizing: border-box;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.15s;
}
.repo-circle:hover .repo-circle-ring { border-color: #999; }
.repo-circle-selected .repo-circle-ring { border-color: #0066cc; }
.repo-circle-img,
.repo-circle-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
}
.repo-circle-placeholder {
  background: #f0f0f0;
  color: #888;
  font-size: 1.5rem;
  font-weight: 600;
}
.repo-circle-name {
  font-size: 0.75rem;
  color: #444;
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.repo-circle-selected .repo-circle-name { color: #0066cc; font-weight: 600; }
.repo-circle-add .repo-circle-placeholder { color: #0066cc; }
/* "All" aggregate circle (#23): the 2×2-tile glyph, neutral by default, accent
   when selected — matching the selected ring/name treatment. */
.repo-circle-all-glyph { color: #555; }
.repo-circle-all.repo-circle-selected .repo-circle-all-glyph { color: #0066cc; }
.repo-vis-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
}
.repo-vis-private { background: #cc3333; }
.repo-vis-unlisted { background: #d0a020; }

.avatar-sm {
  width: 28px;
  height: 28px;
  margin: 0;
  display: inline-block;
  vertical-align: middle;
}

.avatar-placeholder.avatar-sm {
  width: 28px;
  height: 28px;
  margin: 0;
  display: inline-block;
  vertical-align: middle;
}

/* Avatar picker (dashboard profile) */
.avatar-picker {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.avatar-current {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar-current .avatar-preview {
  margin: 0;
  flex-shrink: 0;
}

.avatar-remove-btn {
  background: none;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  padding: 0.25rem 0.625rem;
  font-size: 0.8125rem;
  font-family: inherit;
  color: #cc3333;
  cursor: pointer;
  transition: background 0.15s;
}

.avatar-remove-btn:hover {
  background: #fff0f0;
  border-color: #cc3333;
}

.avatar-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.avatar-option {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  background: #eee;
  transition: border-color 0.15s;
}

.avatar-option:hover {
  border-color: #0066cc;
}

.avatar-option-selected {
  border-color: #0066cc;
}

.avatar-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-header h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.bio {
  color: #666;
}

.username {
  color: #888;
  font-size: 0.9375rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.empty-state {
  text-align: center;
  color: #999;
  padding: 3rem 0;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 0;
  font-size: 0.875rem;
}

.pagination a {
  color: #555;
}

.pagination a:hover {
  color: #1a1a1a;
}

.pagination-info {
  color: #888;
}

/* Post Page */
.post-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.post-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.post-nav-back {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.media-container {
  background: #eee;
  border-radius: 8px;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  overflow: hidden;
}

.media-container img,
.media-container video {
  max-width: 100%;
  height: auto;
}

.post-meta {
  padding: 1rem 0;
}

.caption {
  margin-bottom: 1rem;
}

/* Reactions */
.reactions {
  display: flex;
  gap: 0.5rem;
}

.reaction-btn {
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.2s;
}

.reaction-btn:hover {
  background: #e0e0e0;
}

.reaction-btn.active {
  background: #e6f0ff;
  border-color: #99c2ff;
}

/* Sentinel for infinite scroll */
.sentinel {
  height: 1px;
}

/* Auth Pages (Login / Register) */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.auth-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
}

.auth-card h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  color: #666;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-group label {
  font-weight: 500;
  font-size: 0.875rem;
}

.form-input {
  padding: 0.625rem 0.75rem;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: #fafafa;
  color: #1a1a1a;
  transition: border-color 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: #0066cc;
  background: #fff;
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.form-button {
  display: inline-block;
  padding: 0.625rem 1.5rem;
  background: #0066cc;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  text-align: center;
  text-decoration: none;
}

.form-button:hover {
  background: #0052a3;
  text-decoration: none;
}

.form-button:disabled {
  background: #999;
  cursor: not-allowed;
}

.form-button-danger {
  background: #cc3333;
}

.form-button-danger:hover {
  background: #aa2222;
}

.form-message {
  font-size: 0.875rem;
  min-height: 1.25rem;
}

.form-error {
  color: #cc3333;
}

.form-success {
  color: #22883a;
}

.form-hint {
  font-size: 0.8125rem;
  color: #888;
}

.form-hint-inline {
  font-size: 0.8125rem;
  color: #888;
  font-weight: 400;
}

/* Username field with status indicator */
.username-field {
  position: relative;
  display: flex;
  align-items: center;
}

.username-field .form-input {
  width: 100%;
  padding-right: 2.5rem;
}

.username-status {
  position: absolute;
  right: 0.75rem;
  font-size: 1.125rem;
  font-weight: 700;
}

.status-ok {
  color: #22883a;
}

.status-error {
  color: #cc3333;
}

/* Dashboard */
.dashboard {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.dash-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 1rem;
}

.dash-nav-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dash-logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: #1a1a1a;
}

.dash-logo:hover {
  text-decoration: none;
}

.dash-username {
  color: #888;
  font-size: 0.875rem;
}

.dash-nav-right {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.dash-link {
  font-size: 0.875rem;
}

.dash-link-secondary {
  color: #888;
}

.dash-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 1.5rem;
}

.dash-tab {
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  color: #666;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.dash-tab:hover {
  text-decoration: none;
  color: #1a1a1a;
}

.dash-tab.active {
  color: #0066cc;
  border-bottom-color: #0066cc;
  font-weight: 500;
}

.dash-content {
  min-height: 400px;
  padding: 0 1.25rem;
}

.dash-content .file-table {
  margin-left: -1.25rem;
  margin-right: -1.25rem;
  width: calc(100% + 2.5rem);
}

/* Dashboard: Stats */
.dash-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.8125rem;
  color: #888;
}

/* Dashboard: Files */
.dash-empty {
  text-align: center;
  color: #888;
  padding: 3rem 0;
}

.dash-empty .form-button {
  margin-top: 1rem;
}

/* Dashboard: repo grouping (#22) */
.repo-group {
  margin-bottom: 2rem;
}
.repo-group-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  margin: 0 0 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #eee;
}
.repo-group-title a { text-decoration: none; color: inherit; }
.repo-group-title a:hover { text-decoration: underline; }
.repo-group-count { color: #888; font-size: 0.8125rem; font-weight: 400; margin-left: auto; }

/* Dashboard: repo management (#22) */
.repos-intro { color: #666; margin-bottom: 1.25rem; }
.repo-create {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.repo-create .form-input { flex: 1 1 16rem; width: auto; }
.repo-slug-preview {
  font-size: 0.8125rem;
  color: #888;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.repo-slug-preview span { color: #0066cc; }
.repo-slug-inline {
  border: none;
  border-bottom: 1px dashed #bbb;
  background: transparent;
  color: #0066cc;
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8125rem;
  width: 12ch;
  padding: 0 0.1rem;
}
.repo-slug-inline:focus { outline: none; border-bottom-color: #0066cc; }
.repo-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.repo-card {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 1rem;
}
.repo-card-head { display: flex; align-items: center; gap: 0.75rem; }
.repo-card-cover {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
  background: #f0f0f0;
}
.repo-card-cover-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-weight: 600;
  font-size: 1.25rem;
}
.repo-card-title { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.repo-card-slug { font-size: 0.8125rem; color: #0066cc; text-decoration: none; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.repo-card-slug:hover { text-decoration: underline; }
.repo-card-meta { font-size: 0.75rem; color: #999; }
.repo-card-order { margin-left: auto; display: flex; flex-direction: column; gap: 0.25rem; }
.repo-move-btn {
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 4px;
  width: 26px;
  height: 22px;
  cursor: pointer;
  color: #666;
  line-height: 1;
}
.repo-move-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.repo-card-edit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.repo-field { display: flex; flex-direction: column; gap: 0.25rem; }
.repo-field > span { font-size: 0.75rem; color: #666; }
.repo-field .form-input { width: 100%; }
.repo-card-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}
.repo-save-btn { color: #0066cc; }
.repo-save-btn:hover { background: #f0f0ff; border-color: #0066cc; }
.repo-delete-btn { color: #cc3333; }
.repo-delete-btn:hover { background: #fff0f0; border-color: #cc3333; }
.repo-delete-btn.confirm { background: #cc3333; color: #fff; border-color: #cc3333; }

.file-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.file-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e0e0e0;
  color: #888;
  font-weight: 500;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.file-table td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid #f0f0f0;
}

.file-name {
  font-weight: 500;
  word-break: break-all;
}

.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-public {
  background: #e6f7ee;
  color: #1a7a3a;
}

.badge-private {
  background: #f0f0f0;
  color: #666;
}

/* Dashboard: Profile */
.dash-profile .auth-form {
  max-width: 500px;
}

/* Dashboard: Settings */
.settings-section {
  margin-bottom: 2rem;
}

.settings-section h2 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.settings-label {
  color: #666;
  font-size: 0.9375rem;
}

.settings-value {
  font-size: 0.9375rem;
}

.settings-warning {
  color: #cc3333;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* Prose (Markdown Rendering) */
.prose {
  max-width: 700px;
  margin-bottom: 1rem;
  line-height: 1.75;
}

.prose h1, .prose h2, .prose h3,
.prose h4, .prose h5, .prose h6 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  font-weight: 600;
  line-height: 1.3;
}

.prose h1 { font-size: 1.875rem; }
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.25rem; }

.prose p {
  margin-bottom: 1em;
}

.prose a {
  color: #0066cc;
  text-decoration: underline;
}

.prose ul, .prose ol {
  margin-bottom: 1em;
  padding-left: 1.5rem;
}

.prose li {
  margin-bottom: 0.25em;
}

.prose blockquote {
  border-left: 3px solid #ddd;
  padding-left: 1rem;
  margin: 1em 0;
  color: #666;
  font-style: italic;
}

.prose pre {
  background: #f5f5f5;
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  margin: 1em 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

.prose code {
  background: #f0f0f0;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.875rem;
}

.prose pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
}

.prose th, .prose td {
  border: 1px solid #ddd;
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.prose th {
  background: #f5f5f5;
  font-weight: 600;
}

.prose hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 2em 0;
}

/* File Actions (Dashboard) */
.file-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.file-avatar-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.25rem 0.625rem;
  font-size: 0.8125rem;
  color: #666;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.file-avatar-btn:hover {
  background: #f0f0ff;
  border-color: #0066cc;
  color: #0066cc;
}


/* File Delete Button (Dashboard) */
.file-delete-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.25rem 0.625rem;
  font-size: 0.8125rem;
  color: #cc3333;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.file-delete-btn:hover {
  background: #fff0f0;
  border-color: #cc3333;
}

.file-delete-btn.confirming {
  background: #cc3333;
  color: #fff;
  border-color: #cc3333;
}

.file-delete-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Asset Vault (#19) */
.vault-header {
  margin-bottom: 1.25rem;
}
.vault-subtitle {
  color: #666;
  margin-top: 0.25rem;
  max-width: 42rem;
}
.vault-search {
  display: flex;
  gap: 0.5rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}
.vault-search .form-input {
  width: auto;
  flex: 1 1 12rem;
}
.vault-type-select {
  flex: 0 0 auto;
  min-width: 8rem;
}
.vault-search .form-button {
  flex: 0 0 auto;
  width: auto;
}
.vault-table td {
  vertical-align: middle;
}
.vault-thumb {
  width: 48px;
}
.vault-thumb img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  background: #f0f0f0;
  display: block;
}
.vault-thumb-ext {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: #eee;
  color: #888;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.vault-path {
  color: #888;
  font-size: 0.8125rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.form-button-small {
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.25rem 0.625rem;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.vault-repo {
  font-size: 0.8125rem;
  color: #555;
}
.vault-repo-deleted {
  color: #cc3333;
  font-size: 0.75rem;
}
.vault-restore-btn,
.vault-restore-repo-btn {
  color: #0066cc;
}
.vault-restore-btn:hover,
.vault-restore-repo-btn:hover {
  background: #f0f0ff;
  border-color: #0066cc;
}
.vault-delete-btn {
  color: #cc3333;
}
.vault-delete-btn:hover {
  background: #fff0f0;
  border-color: #cc3333;
}
.vault-delete-btn.confirm {
  background: #cc3333;
  color: #fff;
  border-color: #cc3333;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 0.875rem;
  color: #888;
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: #555;
}

.breadcrumb a:hover {
  color: #1a1a1a;
}

/* Folder Card */

.folder-card-cover {
  background: #000;
}

.folder-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}

.folder-card-cover .folder-link {
  position: relative;
  z-index: 1;
}

.folder-card-cover .folder-name {
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.folder-card-cover .folder-count {
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.folder-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: #1a1a1a;
}

.folder-count {
  font-size: 0.8125rem;
  color: #888;
}

/* Version History */
.version-history {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e0e0e0;
}

.version-history h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: #666;
}

.version-item {
  margin-bottom: 1.5rem;
}

.version-meta {
  font-size: 0.8125rem;
  color: #888;
  display: block;
  margin-bottom: 0.5rem;
}

.version-media {
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
}

.version-media img,
.version-media video {
  max-width: 100%;
  height: auto;
  display: block;
}

.version-download {
  display: block;
  padding: 1rem;
  text-align: center;
  font-size: 0.875rem;
}

/* Version Selector (text file dropdown) */
.version-select {
  padding: 0.375rem 0.75rem;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  background: #fff;
  color: #1a1a1a;
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
}

/* Plain Text Content */
.plain-text-container {
  margin-bottom: 1rem;
}

.plain-text-content {
  background: #f5f5f5;
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: #1a1a1a;
}

/* Owner Actions (post page) */
.owner-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e0e0e0;
}

.owner-actions .owner-btn-delete {
  margin-left: auto;
}

.owner-btn {
  background: none;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.owner-btn:hover {
  background: #f0f0f0;
}

.owner-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.owner-btn-delete {
  color: #cc3333;
}

.owner-btn-delete:hover {
  background: #fff0f0;
  border-color: #cc3333;
}

/* Folder Card (revised for owner actions) */
.folder-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex: 1;
  text-decoration: none;
  color: inherit;
  width: 100%;
  height: 100%;
}

.folder-link:hover {
  text-decoration: none;
}

.folder-card {
  position: relative;
  flex-direction: column;
  gap: 0.5rem;
  background: #f5f5f5;
  cursor: pointer;
}

/* Private file badge on grid */
.grid-item-private {
  opacity: 0.7;
  position: relative;
}

/* Unlisted file indicator on grid */
.grid-item-unlisted {
  opacity: 0.85;
  position: relative;
}

.private-badge {
  position: absolute;
  top: 0.375rem;
  right: 0.375rem;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.6875rem;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
}

.unlisted-badge {
  position: absolute;
  top: 0.375rem;
  right: 0.375rem;
  background: rgba(180, 130, 20, 0.8);
  color: #fff;
  font-size: 0.6875rem;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
}

/* Dashboard badge: unlisted */
.badge-unlisted {
  background: #fef3cd;
  color: #856404;
}

/* Owner select (post page visibility dropdown) */
.owner-select {
  background: none;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-family: inherit;
  cursor: pointer;
  color: #555;
  transition: border-color 0.15s;
}

.owner-select:hover {
  border-color: #999;
}

.owner-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* MARK: Responsive */
@media (max-width: 768px) {
  .hero {
    padding: 3rem 1.5rem;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .post-nav {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .dash-nav {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .dash-stats {
    flex-wrap: wrap;
  }

  .settings-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 2rem 1rem;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .tagline {
    font-size: 1rem;
  }

  .site-nav {
    padding: 0.75rem 1rem;
  }

  .site-nav-links {
    gap: 0.75rem;
  }

  .user-page {
    padding: 1.5rem 1rem;
  }

  .post-page {
    max-width: 100%;
    padding: 1.5rem 1rem;
  }

  .download-page {
    padding: 2rem 1rem;
  }

  .download-card {
    width: 100%;
  }

  .dashboard {
    padding: 0 1rem 2rem;
  }

  .dash-nav-right {
    gap: 0.5rem;
  }

  .file-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .settings-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .auth-card {
    padding: 1.5rem;
  }

  .download-page h1 {
    font-size: 1.75rem;
  }

  .pagination {
    gap: 1rem;
  }
}

/* Waitlist Form */
.waitlist-form {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  margin-top: 1.5rem;
}

.waitlist-form .form-input {
  width: 260px;
}

.waitlist-message {
  margin-top: 1rem;
  font-size: 0.9375rem;
  text-align: center;
}

.waitlist-success {
  color: #22883a;
}

.waitlist-error {
  color: #cc3333;
}

/* Site Footer */
.site-footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #888;
}

.site-footer a {
  color: #888;
}

.site-footer a:hover {
  color: #555;
  text-decoration: none;
}

.site-footer-sep {
  margin: 0 0.5rem;
}

/* Legal Pages (Terms, Privacy) */
.legal-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  line-height: 1.75;
}

.legal-page h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.legal-updated {
  font-size: 0.875rem;
  color: #888;
  margin-bottom: 2rem;
}

.legal-page h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.legal-page p {
  margin-bottom: 1rem;
  color: #444;
}

.legal-page ul {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.legal-page li {
  margin-bottom: 0.375rem;
  color: #444;
}

.legal-page code {
  background: #f0f0f0;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.875rem;
}

.legal-footer-links {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e0e0e0;
  font-size: 0.875rem;
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
  html {
    color: #e0e0e0;
    background: #121212;
  }

  a {
    color: #66aaff;
  }

  .tagline, .description, .bio, .note, .username {
    color: #aaa;
  }

  .grid-item, .media-container {
    background: #2a2a2a;
  }

  .placeholder-content, .empty-state {
    color: #777;
  }

  .download-card {
    background: #1e1e1e;
    border-color: #333;
  }

  .instructions code {
    background: #2a2a2a;
  }

  .avatar-placeholder {
    background: #333;
  }

  .repo-circle-ring {
    border-color: #444;
    background: #1a1a1a;
  }
  .repo-circle:hover .repo-circle-ring { border-color: #777; }
  .repo-circle-selected .repo-circle-ring { border-color: #66aaff; }
  .repo-circle-placeholder {
    background: #2a2a2a;
    color: #999;
  }
  .repo-circle-name { color: #bbb; }
  .repo-circle-selected .repo-circle-name { color: #66aaff; }
  .repo-circle-add .repo-circle-placeholder { color: #66aaff; }
  .repo-circle-all-glyph { color: #aaa; }
  .repo-circle-all.repo-circle-selected .repo-circle-all-glyph { color: #66aaff; }

  .avatar-option {
    background: #2a2a2a;
  }

  .avatar-option:hover {
    border-color: #66aaff;
  }

  .avatar-option-selected {
    border-color: #66aaff;
  }

  .avatar-remove-btn {
    border-color: #444;
    color: #ff6666;
  }

  .avatar-remove-btn:hover {
    background: #3a1a1a;
    border-color: #ff6666;
  }

  .reaction-btn {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
  }

  .reaction-btn:hover {
    background: #333;
  }

  .reaction-btn.active {
    background: #1a2a3a;
    border-color: #446688;
  }

  .site-nav-logo {
    color: #e0e0e0;
  }

  .site-nav-link {
    color: #aaa;
  }

  .site-nav-link:hover {
    color: #e0e0e0;
  }

  .auth-card {
    background: #1e1e1e;
    border-color: #333;
  }

  .auth-subtitle {
    color: #aaa;
  }

  .form-input {
    background: #252525;
    border-color: #444;
    color: #e0e0e0;
  }

  .form-input:focus {
    background: #2a2a2a;
    border-color: #66aaff;
  }

  .form-hint, .form-hint-inline {
    color: #777;
  }

  .form-error {
    color: #ff6666;
  }

  .form-success {
    color: #55cc77;
  }

  .status-ok {
    color: #55cc77;
  }

  .status-error {
    color: #ff6666;
  }

  .dash-nav {
    border-color: #333;
  }

  .dash-logo {
    color: #e0e0e0;
  }

  .dash-username {
    color: #777;
  }

  .dash-link-secondary {
    color: #777;
  }

  .dash-tabs {
    border-color: #333;
  }

  .dash-tab {
    color: #aaa;
  }

  .dash-tab:hover {
    color: #e0e0e0;
  }

  .dash-tab.active {
    color: #66aaff;
    border-bottom-color: #66aaff;
  }

  .stat-label {
    color: #777;
  }

  .dash-empty {
    color: #777;
  }

  .repo-group-title { border-color: #333; }
  .repo-group-count, .repos-intro, .repo-card-meta { color: #999; }
  .repo-card { border-color: #333; }
  .repo-card-cover, .repo-card-cover-empty { background: #2a2a2a; color: #999; }
  .repo-move-btn { background: #1a1a1a; border-color: #444; color: #aaa; }
  .repo-field > span { color: #999; }
  .repo-save-btn { color: #66aaff; }
  .repo-save-btn:hover { background: #1a1a3a; border-color: #66aaff; }
  .repo-delete-btn { color: #ff6666; }
  .repo-delete-btn:hover { background: #3a1a1a; border-color: #ff6666; }
  .repo-delete-btn.confirm { background: #cc3333; color: #fff; border-color: #cc3333; }

  .file-table th {
    border-color: #333;
    color: #777;
  }

  .file-table td {
    border-color: #2a2a2a;
  }

  .badge-public {
    background: #1a3a2a;
    color: #55cc77;
  }

  .badge-private {
    background: #2a2a2a;
    color: #aaa;
  }

  .settings-row {
    border-color: #2a2a2a;
  }

  .settings-label {
    color: #aaa;
  }

  .text-card {
    --text-card-bg: #2a2825;
    background: #2a2825;
    color: #bbb;
  }

  .text-card::after {
    background: linear-gradient(transparent, var(--text-card-bg, #2a2825));
  }

  .text-card-tinted {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.25'/%3E%3C/svg%3E");
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.25);
  }

  .text-card-tint-0 { --text-card-bg: #1e2a36; background-color: #1e2a36; color: #9cb3cc; }
  .text-card-tint-1 { --text-card-bg: #281e36; background-color: #281e36; color: #b39ccc; }
  .text-card-tint-2 { --text-card-bg: #1e3622; background-color: #1e3622; color: #9cccaa; }
  .text-card-tint-3 { --text-card-bg: #36281e; background-color: #36281e; color: #ccb39c; }
  .text-card-tint-4 { --text-card-bg: #361e1e; background-color: #361e1e; color: #cc9c9c; }

  .text-card-accent {
    border-left-color: #b06830;
  }

  .file-icon, .file-icon-name {
    color: #aaa;
  }

  .prose a {
    color: #66aaff;
  }

  .prose blockquote {
    border-color: #444;
    color: #aaa;
  }

  .prose pre {
    background: #2a2a2a;
  }

  .prose code {
    background: #2a2a2a;
  }

  .prose th, .prose td {
    border-color: #444;
  }

  .prose th {
    background: #2a2a2a;
  }

  .prose hr {
    border-color: #444;
  }

  .file-avatar-btn {
    border-color: #444;
    color: #aaa;
  }

  .file-avatar-btn:hover {
    background: #1a1a3a;
    border-color: #66aaff;
    color: #66aaff;
  }

  .file-delete-btn {
    border-color: #444;
    color: #ff6666;
  }

  .file-delete-btn:hover {
    background: #3a1a1a;
    border-color: #ff6666;
  }

  .file-delete-btn.confirming {
    background: #cc3333;
    color: #fff;
    border-color: #cc3333;
  }

  .vault-subtitle {
    color: #999;
  }
  .vault-thumb img {
    background: #2a2a2a;
  }
  .vault-thumb-ext {
    background: #2a2a2a;
    color: #888;
  }
  .vault-path {
    color: #888;
  }
  .form-button-small {
    border-color: #444;
  }
  .vault-repo { color: #aaa; }
  .vault-restore-btn,
  .vault-restore-repo-btn {
    color: #66aaff;
  }
  .vault-restore-btn:hover,
  .vault-restore-repo-btn:hover {
    background: #1a1a3a;
    border-color: #66aaff;
  }
  .vault-delete-btn {
    color: #ff6666;
  }
  .vault-delete-btn:hover {
    background: #3a1a1a;
    border-color: #ff6666;
  }
  .vault-delete-btn.confirm {
    background: #cc3333;
    color: #fff;
    border-color: #cc3333;
  }

  .pagination a {
    color: #aaa;
  }

  .pagination a:hover {
    color: #e0e0e0;
  }

  .pagination-info {
    color: #777;
  }

  .breadcrumb {
    color: #777;
  }

  .breadcrumb a {
    color: #aaa;
  }

  .breadcrumb a:hover {
    color: #e0e0e0;
  }

  .folder-card {
    background: #2a2a2a;
  }

  .folder-card-cover {
    background: #000;
  }

  .folder-name {
    color: #e0e0e0;
  }

  .folder-count {
    color: #777;
  }

  .version-history {
    border-color: #333;
  }

  .version-history h3 {
    color: #aaa;
  }

  .version-meta {
    color: #777;
  }

  .version-media {
    background: #2a2a2a;
  }

  .version-download {
    color: #66aaff;
  }

  .version-select {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
  }

  .plain-text-content {
    background: #2a2a2a;
    color: #e0e0e0;
  }

  .owner-actions {
    border-color: #333;
  }

  .owner-btn {
    border-color: #444;
  }

  .owner-btn:hover {
    background: #333;
  }

  .owner-btn-delete {
    color: #ff6666;
  }

  .owner-btn-delete:hover {
    background: #3a1a1a;
    border-color: #ff6666;
  }

  .private-badge {
    background: rgba(255, 255, 255, 0.2);
  }

  .unlisted-badge {
    background: rgba(180, 130, 20, 0.7);
  }

  .badge-unlisted {
    background: #3a3020;
    color: #e0c060;
  }

  .owner-select {
    background: #2a2a2a;
    border-color: #444;
    color: #aaa;
  }

  .owner-select:hover {
    border-color: #666;
  }

  .waitlist-success {
    color: #55cc77;
  }

  .waitlist-error {
    color: #ff6666;
  }

  .site-footer {
    color: #666;
  }

  .site-footer a {
    color: #666;
  }

  .site-footer a:hover {
    color: #aaa;
  }

  .legal-updated {
    color: #777;
  }

  .legal-page p, .legal-page li {
    color: #bbb;
  }

  .legal-page code {
    background: #2a2a2a;
  }

  .legal-footer-links {
    border-color: #333;
  }
}
