:root {
  --bg: #0b0b0b;
  --surface: #121212;
  --surface-2: #1a1a1a;
  --line: #2e2e2e;
  --text: #f5f5f5;
  --muted: #a5a5a5;
  --accent: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background:
    radial-gradient(circle at 10% -10%, #2b2b2b 0%, transparent 40%),
    radial-gradient(circle at 90% 110%, #252525 0%, transparent 45%),
    var(--bg);
  color: var(--text);
  font-family: "Syne", "Segoe UI", sans-serif;
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(#ffffff15 1px, transparent 0);
  background-size: 3px 3px;
  opacity: 0.25;
  z-index: -1;
}

.site-header {
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding: 1.2rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  margin-top: 1rem;
}

.brand img {
  display: block;
  height: 40px;
  width: auto;
}

.nav {
  display: flex;
  gap: 1rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
  border: 1px solid transparent;
  padding: 0.4rem 0.7rem;
  transition: border-color 180ms ease, color 180ms ease;
}

.nav a:hover {
  color: var(--text);
  border-color: var(--line);
}

main {
  width: min(1120px, 92vw);
  margin: 1rem auto 3rem;
}

.hero {
  border: 1px solid var(--line);
  background: linear-gradient(165deg, #171717 0%, #101010 60%);
  padding: clamp(2rem, 5vw, 4rem);
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: reveal 700ms ease-out both;
}

.kicker,
.label,
.resource-type,
.benefit-number {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-size: 0.78rem;
}

.hero h1 {
  margin: 0.4rem 0 1rem;
  max-width: 16ch;
  font-size: clamp(2.1rem, 6vw, 4.9rem);
  line-height: 0.97;
  text-transform: uppercase;
}

.lead {
  max-width: 58ch;
  color: #d6d6d6;
}

.hero-actions {
  margin-top: 1.8rem;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.btn {
  text-decoration: none;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  transition: transform 180ms ease, background-color 180ms ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-solid {
  color: #101010;
  background: var(--accent);
  border-color: var(--accent);
}

.btn-ghost {
  color: var(--text);
  background: transparent;
}

.section-card {
  margin-top: 1.1rem;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: clamp(1.2rem, 3vw, 2rem);
  animation: reveal 700ms 120ms ease-out both;
}

.section-head h2 {
  margin: 0.3rem 0 1.2rem;
  text-transform: uppercase;
}

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

.resource {
  border: 1px solid var(--line);
  padding: 1rem;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  min-height: 230px;
}

.resource h3 {
  margin: 0.3rem 0;
  text-transform: uppercase;
}

.resource p {
  color: #d0d0d0;
}

.price {
  margin-top: auto;
  font-family: "IBM Plex Mono", monospace;
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
}

.benefits {
  margin-top: 1.1rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  animation: reveal 700ms 220ms ease-out both;
}

.benefit {
  border: 1px solid var(--line);
  background: #111111;
  padding: 1.1rem;
}

.benefit h3 {
  margin: 0.2rem 0 0.4rem;
  text-transform: uppercase;
}

.site-footer {
  width: min(1120px, 92vw);
  margin: 0 auto 1.8rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--text);
  text-decoration: none;
}

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

@media (max-width: 960px) {
  .grid,
  .benefits {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .nav {
    width: 100%;
    flex-wrap: wrap;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Library/Home pages (merged from home.css) */
body.app-shell {
  --bg: #0c0c0c;
  --bg-elevated: #111111;
  --panel: #151515;
  --line: #2a2a2a;
  --text: #efefef;
  --muted: #9d9d9d;
  --placeholder-1: #2e2e2e;
  --placeholder-2: #424242;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Syne", "Segoe UI", sans-serif;
}

body.app-shell * {
  box-sizing: border-box;
}

body.app-shell .topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 72px;
  padding: 0 1rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #101010, #0c0c0c);
  display: grid;
  grid-template-columns: 240px 1fr 140px;
  align-items: center;
  gap: 1rem;
}

body.app-shell .topbar-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

body.app-shell .brand {
  color: var(--text);
  text-decoration: none;
  font-size: 1.45rem;
  letter-spacing: 0.03em;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
}

body.app-shell .brand img {
  display: block;
  height: 38px;
  width: auto;
}

body.app-shell .mode {
  font-family: "IBM Plex Mono", monospace;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  border: 1px solid var(--line);
  padding: 0.24rem 0.45rem;
}

body.app-shell .mode-enterprise {
  color: #7be27f;
  border-color: #2f7d33;
  background: #0f1a10;
}

body.app-shell .search-form {
  display: flex;
  flex: 1;
  max-width: 480px;
  margin: 0;
}

body.app-shell .search {
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  min-height: 42px;
  padding: 0.3rem 0.6rem 0.3rem 0.85rem;
  width: 100%;
}

body.app-shell .search span {
  font-family: "IBM Plex Mono", monospace;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
  margin-right: 0.8rem;
}

body.app-shell .search input {
  flex: 1;
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: #c5c5c5;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
}

body.app-shell .search input::placeholder {
  color: #6c6c6c;
}

body.app-shell .search-submit-btn {
  background: transparent;
  border: 0;
  color: #888888;
  cursor: pointer;
  padding: 0 4px 0 8px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, transform 0.15s ease;
}

body.app-shell .search-submit-btn .search-submit-icon {
  display: inline-block;
  vertical-align: middle;
  width: 16px;
  height: 16px;
  stroke: currentColor;
  pointer-events: none;
}

body.app-shell .search-submit-btn:hover {
  color: #ffffff;
  transform: scale(1.1);
}

body.app-shell .topbar-right {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  position: relative;
  align-items: center;
}

body.app-shell .circle {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #1f1f1f;
}

body.app-shell .circle.ghost {
  background: #171717;
}

body.app-shell .profile-menu-wrap {
  position: relative;
}

body.app-shell .profile-trigger {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #1e1e1e, #111111);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  overflow: hidden;
}

body.app-shell .profile-trigger img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.app-shell .profile-initials {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  line-height: 1;
}

body.app-shell .profile-menu {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  width: min(280px, calc(100vw - 2rem));
  border: 1px solid var(--line);
  background: #111111;
  padding: 0.9rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  display: none;
  z-index: 20;
}

body.app-shell .profile-menu.is-open {
  display: grid;
  gap: 0.65rem;
}

body.app-shell .profile-menu-head {
  display: grid;
  gap: 0.2rem;
}

body.app-shell .profile-menu-name {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

body.app-shell .profile-menu-subtitle {
  margin: 0;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body.app-shell .profile-menu-divider {
  height: 1px;
  background: var(--line);
}

body.app-shell .profile-menu button,
body.app-shell .profile-menu a {
  width: 100%;
  justify-content: center;
  text-align: center;
}

body.app-shell .profile-button {
  cursor: pointer;
}

body.app-shell .profile-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  z-index: 30;
}

body.app-shell .profile-modal.is-open {
  display: flex;
}

body.app-shell .profile-dialog {
  width: min(760px, 100%);
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 28%),
    linear-gradient(180deg, #151515, #101010);
  padding: 1rem;
  display: grid;
  gap: 1rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

body.app-shell .profile-dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

body.app-shell .profile-dialog-head h2 {
  margin: 0.2rem 0 0.35rem;
  text-transform: uppercase;
}

body.app-shell .profile-close {
  cursor: pointer;
}

body.app-shell .profile-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
}

body.app-shell .profile-preview {
  border: 1px solid var(--line);
  background: #0e0e0e;
  padding: 1rem;
  display: grid;
  gap: 0.8rem;
  align-content: start;
}

body.app-shell .profile-preview-avatar {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: linear-gradient(135deg, #202020, #111111);
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 2rem;
  font-weight: 800;
}

body.app-shell .profile-preview-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.app-shell .profile-meta {
  margin: 0;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body.app-shell .profile-form {
  display: grid;
  gap: 0.85rem;
}

body.app-shell .profile-field {
  display: grid;
  gap: 0.35rem;
}

body.app-shell .profile-field > span {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-size: 0.72rem;
}

body.app-shell .profile-field input {
  width: 100%;
  border: 1px solid var(--line);
  background: #0d0d0d;
  color: var(--text);
  padding: 0.8rem 0.85rem;
  font: inherit;
}

body.app-shell .profile-photo-row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

body.app-shell .profile-note {
  margin: 0;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
}

body.app-shell .profile-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

body.app-shell .profile-alert {
  margin: 0;
  color: #ffb0b0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
}

body.app-shell.account-shell .account-main {
  width: min(1120px, 92vw);
  margin: 1rem auto 3rem;
  display: grid;
  gap: 1rem;
}

body.app-shell.account-shell .account-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 28%),
    linear-gradient(160deg, #171717 0%, #101010 100%);
  padding: clamp(1.2rem, 3vw, 2rem);
}

body.app-shell.account-shell .account-hero h1 {
  margin: 0.35rem 0 0.8rem;
  text-transform: uppercase;
  line-height: 0.95;
  font-size: clamp(2rem, 5vw, 4rem);
}

body.app-shell.account-shell .account-card {
  border: 1px solid var(--line);
  background: #111111;
  padding: 1rem;
  display: grid;
  gap: 0.8rem;
  justify-items: center;
  align-content: start;
}

body.app-shell.account-shell .account-avatar,
body.app-shell.account-shell .account-preview-avatar {
  width: 180px;
  height: 180px;
  border-radius: 999px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: linear-gradient(135deg, #202020, #111111);
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 3rem;
  font-weight: 800;
}

body.app-shell.account-shell .account-avatar img,
body.app-shell.account-shell .account-preview-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.app-shell.account-shell .account-summary {
  text-align: center;
  display: grid;
  gap: 0.2rem;
}

body.app-shell.account-shell .account-summary strong {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

body.app-shell.account-shell .account-summary p,
body.app-shell.account-shell .account-preview-note {
  margin: 0;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
}

body.app-shell.account-shell .account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1rem;
}

body.app-shell.account-shell .account-panel {
  margin-bottom: 0;
}

body.app-shell.account-shell .account-preview {
  display: grid;
  gap: 0.8rem;
  justify-items: center;
}

body.app-shell.account-shell .account-preview-panel {
  align-content: start;
}

body.app-shell.account-shell .account-preview-avatar {
  width: 220px;
  height: 220px;
}

body.app-shell.account-shell .account-preview-note {
  max-width: 24ch;
}

body.app-shell .layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 72px);
}

body.app-shell .sidebar {
  border-right: 1px solid var(--line);
  padding: 1rem 0.65rem;
  background: #0e0e0e;
}

body.app-shell .side-item {
  display: block;
  text-decoration: none;
  color: #c4c4c4;
  padding: 0.7rem 0.8rem;
  margin-bottom: 0.3rem;
  border: 1px solid transparent;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  text-transform: uppercase;
}

body.app-shell .side-item.active,
body.app-shell .side-item:hover {
  border-color: var(--line);
  background: #181818;
  color: var(--text);
}

body.app-shell .feed {
  padding: 1rem;
}

body.app-shell .chips {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.6rem;
}

body.app-shell .chip {
  display: inline-block;
  border: 1px solid var(--line);
  background: #181818;
  color: #cbcbcb;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  text-transform: uppercase;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  text-decoration: none;
}

body.app-shell .chip.active {
  background: #252525;
  color: #efefef;
}

body.app-shell .chip-loading {
  opacity: 0.75;
  cursor: default;
}

body.app-shell .category-header {
  margin: 0.45rem 0 1rem;
  border: 1px solid var(--line);
  background: #111111;
  padding: 1rem;
}

body.app-shell .category-header h1 {
  margin: 0.3rem 0 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

body.app-shell .category-header p {
  margin: 0;
  color: #bdbdbd;
}

body.app-shell .article-panel {
  border: 1px solid var(--line);
  background: #111111;
  padding: 1rem;
  margin-bottom: 1rem;
}

body.app-shell .article-panel h2 {
  margin: 0 0 0.9rem;
  text-transform: uppercase;
  font-size: 1.1rem;
}

body.app-shell .article-list {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.app-shell .article-doc-card {
  min-height: auto;
  border: 1px solid var(--line);
  background: #161616;
}

body.app-shell .article-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

body.app-shell .article-thumb {
  overflow: hidden;
  background: #111111;
  animation: none;
}

body.app-shell .thumb-preview {
  width: 100%;
  height: 100%;
  border: 0;
  background: #0f0f0f;
  pointer-events: none;
}

body.app-shell .article-card-text {
  padding: 0.65rem 0.7rem 0.75rem;
}

body.app-shell .article-title {
  margin: 0;
  text-transform: uppercase;
  font-size: 0.88rem;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

body.app-shell .article-caption {
  margin: 0.42rem 0 0;
  color: #b5b5b5;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
}

body.app-shell .article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 0.7rem 0.75rem;
}

body.app-shell .action-chip {
  cursor: pointer;
}

body.app-shell .action-icon {
  display: inline-block;
  width: 0.9rem;
  text-align: center;
}

body.app-shell .action-icon-on {
  display: none;
}

body.app-shell .action-chip.is-active,
body.app-shell .viewer-action.is-active {
  background: #2a2a2a;
  color: #ffffff;
  border-color: #4a4a4a;
}

body.app-shell .action-chip.is-active .action-icon-off,
body.app-shell .viewer-action.is-active .action-icon-off {
  display: none;
}

body.app-shell .action-chip.is-active .action-icon-on,
body.app-shell .viewer-action.is-active .action-icon-on {
  display: inline-block;
}

body.app-shell .viewer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.7rem 0.8rem 0;
}

body.app-shell .viewer-action {
  cursor: pointer;
}

body.app-shell .pdf-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.65rem 0.8rem 0;
  align-items: center;
}

body.app-shell .pdf-tool {
  cursor: pointer;
}

body.app-shell .pdf-tool:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

body.app-shell .pdf-indicator {
  color: #f0f0f0;
}

body.app-shell .category-empty {
  margin: 0;
  color: #bdbdbd;
}

body.app-shell .pdf-viewer-wrap {
  min-height: calc(100vh - 72px);
  padding: 0.8rem;
  display: grid;
  gap: 0.6rem;
}

body.app-shell .pdf-canvas-shell {
  width: 100%;
  min-height: 68vh;
  border: 1px solid var(--line);
  background: #0f0f0f;
  display: grid;
  place-items: start center;
  padding: 0.8rem;
  overflow: auto;
}

body.app-shell .pdf-canvas {
  display: block;
  background: #ffffff;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

body.app-shell .pdf-status {
  margin: 0;
  min-height: 1.1rem;
  color: #bdbdbd;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body.app-shell .pdf-status.is-error {
  color: #ff9f9f;
}

body.app-shell .doc-grid {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

body.app-shell.manager-shell .manager-main {
  width: min(1280px, 92vw);
  margin: 1rem auto 3rem;
  display: grid;
  gap: 1rem;
}

body.app-shell.manager-shell .manager-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 30%),
    linear-gradient(160deg, #171717 0%, #101010 100%);
  padding: clamp(1.2rem, 3vw, 2rem);
}

body.app-shell.manager-shell .manager-hero h1 {
  margin: 0.35rem 0 0.8rem;
  text-transform: uppercase;
  line-height: 0.95;
  font-size: clamp(2rem, 5vw, 4rem);
}

body.app-shell.manager-shell .scope-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1.1rem;
}

body.app-shell.manager-shell .manager-tab {
  cursor: pointer;
}

body.app-shell.manager-shell .manager-tab.active {
  background: #2a2a2a;
  color: #fff;
  border-color: #474747;
}

body.app-shell.manager-shell .stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

body.app-shell.manager-shell .stat-card {
  border: 1px solid var(--line);
  background: rgba(18, 18, 18, 0.9);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 110px;
  justify-content: space-between;
}

body.app-shell.manager-shell .stat-value {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1;
}

body.app-shell.manager-shell .stat-label {
  margin-top: 0.45rem;
  font-family: "IBM Plex Mono", monospace;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

body.app-shell.manager-shell .manager-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 1rem;
}

body.app-shell.manager-shell .manager-panel {
  margin-bottom: 0;
}

body.app-shell.manager-shell .upload-form {
  display: grid;
  gap: 0.85rem;
}

body.app-shell.manager-shell .manager-field {
  display: grid;
  gap: 0.35rem;
}

body.app-shell.manager-shell .manager-field > span,
body.app-shell.manager-shell .manager-field-inline > span {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: var(--muted);
}

body.app-shell.manager-shell .manager-field input,
body.app-shell.manager-shell .manager-field select {
  width: 100%;
  border: 1px solid var(--line);
  background: #0d0d0d;
  color: var(--text);
  padding: 0.8rem 0.85rem;
  font: inherit;
}

body.app-shell.manager-shell .manager-field-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

body.app-shell.manager-shell .manager-field-inline label {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  border: 1px solid var(--line);
  background: #0e0e0e;
  padding: 0.6rem 0.75rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
}

body.app-shell.manager-shell .manager-field-inline input {
  margin: 0;
}

body.app-shell.manager-shell .manager-actions-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  align-items: center;
}

body.app-shell.manager-shell .manager-status {
  margin: 0;
  color: #d7d7d7;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
}

body.app-shell.manager-shell .manager-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
}

body.app-shell.manager-shell .manager-meta {
  margin: 0;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body.app-shell.manager-shell .manager-doc-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

body.app-shell.manager-shell .manager-doc-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
}

body.app-shell.manager-shell .manager-doc-head {
  padding-bottom: 0.45rem;
}

body.app-shell.manager-shell .manager-badges {
  display: flex;
  gap: 0.35rem;
  padding: 0 0.7rem 0.5rem;
}

body.app-shell.manager-shell .visibility-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  font-size: 0.68rem;
}

body.app-shell.manager-shell .visibility-badge.is-public {
  background: rgba(67, 154, 108, 0.15);
  color: #9be3bb;
}

body.app-shell.manager-shell .visibility-badge.is-private {
  background: rgba(154, 67, 67, 0.18);
  color: #ffb0b0;
}

body.app-shell.manager-shell .manager-doc-meta {
  display: grid;
  gap: 0.2rem;
  padding: 0 0.7rem 0.65rem;
  color: #b9b9b9;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
}

body.app-shell.manager-shell .manager-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 0.7rem 0.75rem;
}

body.app-shell.manager-shell .manager-action {
  cursor: pointer;
}

body.app-shell.manager-shell .manager-empty {
  margin: 0;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
}

body.app-shell.manager-shell-plain,
body.app-shell.manager-shell-plain * {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  letter-spacing: normal;
  text-transform: none;
}

body.app-shell.manager-shell-plain {
  background: #f4f4f4;
  color: #1f1f1f;
}

body.app-shell.manager-shell-plain .topbar {
  background: #ffffff;
  border-bottom: 1px solid #d8d8d8;
}

body.app-shell.manager-shell-plain .mode,
body.app-shell.manager-shell-plain .mode-enterprise {
  background: #efefef;
  border: 1px solid #d4d4d4;
  color: #333333;
}

body.app-shell.manager-shell-plain .search {
  background: #ffffff;
  border: 1px solid #d8d8d8;
}

body.app-shell.manager-shell-plain .search span,
body.app-shell.manager-shell-plain .search input::placeholder {
  color: #666666;
}

body.app-shell.manager-shell-plain .chip,
body.app-shell.manager-shell-plain .btn,
body.app-shell.manager-shell-plain .manager-field-inline label {
  background: #ffffff;
  border: 1px solid #cfcfcf;
  color: #2a2a2a;
  border-radius: 6px;
  text-transform: none;
  font-size: 0.85rem;
}

body.app-shell.manager-shell-plain .btn-solid {
  background: #1f1f1f;
  color: #ffffff;
  border-color: #1f1f1f;
}

body.app-shell.manager-shell-plain .btn:hover {
  transform: none;
}

body.app-shell.manager-shell-plain .manager-main,
body.app-shell.manager-shell-plain .manager-hero,
body.app-shell.manager-shell-plain .manager-grid,
body.app-shell.manager-shell-plain .article-panel,
body.app-shell.manager-shell-plain .stat-card,
body.app-shell.manager-shell-plain .manager-doc-card,
body.app-shell.manager-shell-plain .profile-preview {
  background: #ffffff;
  border: 1px solid #d8d8d8;
  box-shadow: none;
}

body.app-shell.manager-shell-plain .manager-hero {
  background: #ffffff;
}

body.app-shell.manager-shell-plain .manager-hero h1,
body.app-shell.manager-shell-plain .article-title,
body.app-shell.manager-shell-plain .article-panel h2,
body.app-shell.manager-shell-plain .stat-value {
  text-transform: none;
  color: #1f1f1f;
}

body.app-shell.manager-shell-plain .kicker,
body.app-shell.manager-shell-plain .manager-meta,
body.app-shell.manager-shell-plain .stat-label,
body.app-shell.manager-shell-plain .article-caption,
body.app-shell.manager-shell-plain .manager-doc-meta,
body.app-shell.manager-shell-plain .manager-field > span,
body.app-shell.manager-shell-plain .manager-field-inline > span,
body.app-shell.manager-shell-plain .manager-status {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  color: #606060;
  text-transform: none;
  letter-spacing: normal;
}

body.app-shell.manager-shell-plain .manager-field input,
body.app-shell.manager-shell-plain .manager-field select {
  background: #ffffff;
  border: 1px solid #cfcfcf;
  color: #1f1f1f;
}

body.app-shell.manager-shell-plain .visibility-badge {
  border-radius: 4px;
  font-size: 0.75rem;
  text-transform: none;
}

body.app-shell.manager-shell-plain .visibility-badge.is-public {
  background: #e8f5e9;
  color: #2e7d32;
}

body.app-shell.manager-shell-plain .visibility-badge.is-private {
  background: #fdecea;
  color: #b71c1c;
}

body.app-shell .doc-card {
  min-height: 200px;
}

body.app-shell .thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  background: linear-gradient(
    100deg,
    var(--placeholder-1) 20%,
    var(--placeholder-2) 40%,
    var(--placeholder-1) 60%
  );
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
}

body.app-shell .meta {
  margin-top: 0.62rem;
}

body.app-shell .lines {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

body.app-shell .line {
  display: block;
  height: 9px;
  border-radius: 100px;
  background: linear-gradient(
    100deg,
    var(--placeholder-1) 10%,
    var(--placeholder-2) 40%,
    var(--placeholder-1) 70%
  );
  background-size: 200% 100%;
  animation: shimmer 2.2s linear infinite;
}

body.app-shell .w-92 {
  width: 92%;
}

body.app-shell .w-90 {
  width: 90%;
}

body.app-shell .w-88 {
  width: 88%;
}

body.app-shell .w-86 {
  width: 86%;
}

body.app-shell .w-85 {
  width: 85%;
}

body.app-shell .w-82 {
  width: 82%;
}

body.app-shell .w-80 {
  width: 80%;
}

body.app-shell .w-78 {
  width: 78%;
}

body.app-shell .w-70 {
  width: 70%;
}

body.app-shell .w-66 {
  width: 66%;
}

body.app-shell .w-64 {
  width: 64%;
}

body.app-shell .w-63 {
  width: 63%;
}

body.app-shell .w-60 {
  width: 60%;
}

body.app-shell .w-58 {
  width: 58%;
}

body.app-shell .w-57 {
  width: 57%;
}

body.app-shell .w-52 {
  width: 52%;
}

body.app-shell .w-50 {
  width: 50%;
}

body.app-shell .w-48 {
  width: 48%;
}

body.app-shell .w-46 {
  width: 46%;
}

body.app-shell .w-45 {
  width: 45%;
}

body.app-shell .w-44 {
  width: 44%;
}

body.app-shell .w-42 {
  width: 42%;
}

body.app-shell .w-40 {
  width: 40%;
}

body.app-shell .w-36 {
  width: 36%;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@media (max-width: 1200px) {
  body.app-shell .article-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.app-shell .doc-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  body.app-shell .topbar {
    grid-template-columns: 1fr;
    height: auto;
    padding: 0.7rem;
  }

  body.app-shell .topbar-right {
    justify-content: flex-start;
  }

  body.app-shell .layout {
    grid-template-columns: 1fr;
  }

  body.app-shell .sidebar {
    display: flex;
    overflow-x: auto;
    gap: 0.45rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0.65rem;
  }

  body.app-shell .side-item {
    margin: 0;
    white-space: nowrap;
  }

  body.app-shell .feed {
    padding-top: 0.75rem;
  }
}

@media (max-width: 700px) {
  body.app-shell .article-list {
    grid-template-columns: 1fr;
  }

  body.app-shell .pdf-toolbar {
    padding-top: 0.55rem;
  }

  body.app-shell .pdf-canvas-shell {
    min-height: 56vh;
    padding: 0.45rem;
  }

  body.app-shell .doc-grid {
    grid-template-columns: 1fr;
  }

  body.app-shell .profile-grid {
    grid-template-columns: 1fr;
  }

  body.app-shell.manager-shell .manager-hero,
  body.app-shell.manager-shell .manager-grid {
    grid-template-columns: 1fr;
  }

  body.app-shell.manager-shell .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Auth/Login page */
body.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.auth-header {
  width: 100%;
  justify-content: center;
}

.auth-main {
  flex: 1;
  width: 100%;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.auth-card {
  width: min(620px, calc(100vw - 2rem));
  border: 0;
  background: transparent;
  padding: 0;
  animation: reveal 650ms ease-out both;
}

.auth-card h1 {
  margin: 0.35rem 0 0.8rem;
  text-transform: uppercase;
  line-height: 1.05;
}

.auth-lead {
  margin: 0;
  color: #cdcdcd;
}

.auth-field {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.45rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--muted);
}

.auth-card input {
  width: 100%;
  min-height: 44px;
  background: #111111;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.6rem 0.75rem;
  font-family: "IBM Plex Mono", monospace;
}

.auth-card input:focus {
  outline: 2px solid #6a6a6a;
  outline-offset: 1px;
}

.auth-collapsible {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-10px);
  transition:
    max-height 320ms ease,
    opacity 220ms ease,
    transform 320ms ease,
    margin-top 320ms ease;
  margin-top: 0;
}

.auth-collapsible.is-open {
  max-height: 140px;
  opacity: 1;
  transform: translateY(0);
  margin-top: 0.55rem;
}

.auth-collapsible-confirm {
  transition-delay: 70ms;
}

.auth-status {
  min-height: 1.2em;
  margin: 0.85rem 0 0;
  color: #9bd8a2;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
}

.auth-status.is-error {
  color: #ff9d9d;
}

.auth-actions {
  margin-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.auth-actions button {
  cursor: pointer;
}

.auth-actions button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-hidden {
  display: none;
}

.auth-code-input {
  letter-spacing: 0.35em;
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
}

