/* Hytam Tech — Terminal tmux Pure CSS & 6 WCAG-AA Themes */

:root,
.theme-hytam {
  --bg: #000000;
  --bg-pane: #080808;
  --bg-elevated: #141416;
  --fg: #f4f4f5;
  --fg-muted: #9a9aa2;
  --accent: #ffffff;
  --accent-2: #ef4444;
  --warn: #d4d4d8;
  --danger: #ff4d4d;
  --border: #242428;
  --border-active: #ef4444;
  --status-bg: #0c0c0e;
  --status-fg: #e4e4e7;
  --session-bg: #ef4444;
  --session-fg: #050505;
}

.theme-tokyo-night {
  --bg: #16161e;
  --bg-pane: #1a1b26;
  --bg-elevated: #24283b;
  --fg: #c0caf5;
  --fg-muted: #9aa5ce;
  --accent: #7aa2f7;
  --accent-2: #9ece6a;
  --warn: #e0af68;
  --danger: #f7768e;
  --border: #414868;
  --border-active: #7aa2f7;
  --status-bg: #1f2335;
  --status-fg: #c0caf5;
  --session-bg: #9ece6a;
  --session-fg: #15161e;
}

.theme-gruvbox {
  --bg: #1d2021;
  --bg-pane: #282828;
  --bg-elevated: #3c3836;
  --fg: #ebdbb2;
  --fg-muted: #bdae93;
  --accent: #fe8019;
  --accent-2: #b8bb26;
  --warn: #fabd2f;
  --danger: #fb4934;
  --border: #504945;
  --border-active: #fe8019;
  --status-bg: #32302f;
  --status-fg: #ebdbb2;
  --session-bg: #b8bb26;
  --session-fg: #1d2021;
}

.theme-catppuccin {
  --bg: #181825;
  --bg-pane: #1e1e2e;
  --bg-elevated: #313244;
  --fg: #cdd6f4;
  --fg-muted: #a6adc8;
  --accent: #cba6f7;
  --accent-2: #a6e3a1;
  --warn: #f9e2af;
  --danger: #f38ba8;
  --border: #45475a;
  --border-active: #cba6f7;
  --status-bg: #181825;
  --status-fg: #cdd6f4;
  --session-bg: #a6e3a1;
  --session-fg: #11111b;
}

.theme-dracula {
  --bg: #1e1f29;
  --bg-pane: #282a36;
  --bg-elevated: #383a4a;
  --fg: #f8f8f2;
  --fg-muted: #bd93f9;
  --accent: #ff79c6;
  --accent-2: #50fa7b;
  --warn: #f1fa8c;
  --danger: #ff5555;
  --border: #44475a;
  --border-active: #ff79c6;
  --status-bg: #21222c;
  --status-fg: #f8f8f2;
  --session-bg: #50fa7b;
  --session-fg: #1e1f29;
}

.theme-solarized {
  --bg: #00212b;
  --bg-pane: #002b36;
  --bg-elevated: #073642;
  --fg: #eee8d5;
  --fg-muted: #93a1a1;
  --accent: #2aa198;
  --accent-2: #859900;
  --warn: #b58900;
  --danger: #dc322f;
  --border: #586e75;
  --border-active: #2aa198;
  --status-bg: #073642;
  --status-fg: #eee8d5;
  --session-bg: #859900;
  --session-fg: #00212b;
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.55;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-2);
  text-decoration-color: var(--accent-2);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 50;
  padding: 0.4rem 0.75rem;
  background: var(--bg-elevated);
  color: var(--accent);
  border: 2px solid var(--accent-2);
  text-decoration: none;
  font-weight: 700;
}

.skip-link:focus-visible {
  left: 0.5rem;
}

.tmux-viewport {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding: 0.5rem;
  gap: 0.5rem;
  background: var(--bg);
}

.tmux-panes {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
}

.tmux-split {
  display: flex;
  flex: 1 1 0;
  gap: 0.5rem;
  min-width: 0;
  min-height: 0;
}

.tmux-split--lr {
  flex-direction: row;
}

.tmux-split--tb {
  flex-direction: column;
}

.tmux-pane {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  background: var(--bg-pane);
  border: 2px solid var(--border);
  padding: 1rem 1.25rem;
  overflow: auto;
  position: relative;
}

.tmux-muted {
  color: var(--fg-muted);
}

kbd {
  font: inherit;
  color: var(--accent-2);
  border: 1px solid var(--border);
  padding: 0 0.3rem;
}

.tmux-cursor {
  animation: tmux-blink 1s steps(1) infinite;
}

@keyframes tmux-blink {
  50% {
    opacity: 0;
  }
}

.tmux-pane--active {
  border-color: var(--border-active);
}

.tmux-prompt {
  color: var(--accent-2);
  margin: 0 0 0.75rem 0;
  font-weight: 600;
}

.tmux-ascii {
  color: var(--accent);
  margin: 0 0 0.75rem 0;
  overflow-x: auto;
  line-height: 1.1;
}

.tmux-tagline {
  color: var(--warn);
  font-weight: 700;
  margin: 0 0 1rem 0;
}

.tmux-nav-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: grid;
  gap: 0.25rem;
  width: fit-content;
  max-width: 100%;
}

.home-heading {
  margin: 0 0 0.15rem 0;
}

.home-subtitle {
  margin: 0 0 0.9rem 0;
  color: var(--fg-muted);
}

.home-motd {
  margin: 0 0 0.75rem 0;
  color: var(--fg-muted);
  font-size: 0.84rem;
}

.home-menu-item {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.25rem 0.5rem;
  text-decoration: none;
  border-left: 2px solid transparent;
}

.home-menu-item:hover,
.home-menu-item:focus-visible {
  background: var(--bg-elevated);
  border-left-color: var(--accent-2);
}

.home-menu-key {
  color: var(--accent-2);
  font-weight: 700;
}

.home-menu-desc {
  color: var(--fg-muted);
}

.home-menu-item:hover .home-menu-desc,
.home-menu-item:focus-visible .home-menu-desc {
  color: var(--fg);
}

.home-prompt-btn {
  margin-top: 1rem;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--accent-2);
  font-weight: 700;
  cursor: pointer;
}

.tmux-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--status-bg);
  color: var(--status-fg);
  border: 1px solid var(--border);
  padding: 0.25rem 0.5rem;
  font-size: 0.9rem;
}

.tmux-status-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  overflow-x: auto;
}

.tmux-session-badge {
  background: var(--session-bg);
  color: var(--session-fg);
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
}

.tmux-windows {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.tmux-win-tab {
  color: var(--fg-muted);
  text-decoration: none;
  padding: 0.1rem 0.45rem;
}

.tmux-win-tab--active,
.tmux-win-tab[aria-current="page"] {
  background: var(--bg-elevated);
  color: var(--accent);
  font-weight: 700;
}

.tmux-status-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
  color: var(--fg-muted);
}

.tmux-status-logo {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 3px;
  display: block;
  object-fit: contain;
}

.tmux-status-keys {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: none;
}

.tmux-notice {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--warn);
}

.tmux-vkey {
  font: inherit;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.1rem 0.45rem;
  cursor: pointer;
  white-space: nowrap;
}

.tmux-vkey:hover {
  border-color: var(--accent);
}

.tmux-vkey--armed {
  background: var(--warn);
  border-color: var(--warn);
  color: var(--session-fg);
}

.tmux-hints {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-elevated);
  border: 2px solid var(--border-active);
  padding: 0.4rem 0.5rem;
}

.tmux-hints-title {
  color: var(--warn);
  font-weight: 700;
}

.tmux-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.65);
}

.tmux-overlay--solid {
  background: var(--bg);
}

.tmux-dialog {
  width: min(44rem, 94vw);
  max-height: 82vh;
  overflow: auto;
  background: var(--bg-elevated);
  border: 2px solid var(--border-active);
  padding: 1rem 1.25rem;
}

.tmux-dialog h2 {
  margin: 0 0 0.75rem 0;
  color: var(--accent);
}

.tmux-keylist {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 1.25rem;
}

@media (max-width: 640px) {
  .tmux-keylist {
    grid-template-columns: 1fr;
  }
}

.crt-enabled .tmux-viewport::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.08) 0px,
    rgba(0, 0, 0, 0.08) 1px,
    transparent 1px,
    transparent 3px
  );
}

@media (prefers-reduced-motion: reduce) {
  .crt-enabled .tmux-viewport::after {
    display: none;
  }

  .tmux-cursor {
    animation: none;
  }
}

@media (max-width: 768px) {
  .tmux-viewport {
    padding: 0.25rem;
  }

  .tmux-status-right {
    display: none;
  }

  /* Phones show one pane at a time: the focused one. */
  .tmux-split {
    gap: 0;
  }

  .tmux-split .tmux-pane:not(.tmux-pane--active) {
    display: none;
  }

  .tmux-notice {
    display: none;
  }
}

/* --- Window 1:members (htop + detail + neofetch) --- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tmux-danger {
  color: var(--danger);
}

.members-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.members-grep {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 14rem;
}

.members-grep input {
  flex: 1 1 auto;
  min-width: 8rem;
  font: inherit;
  color: var(--fg);
  background: var(--bg-pane);
  border: 1px solid var(--border);
  padding: 0.2rem 0.5rem;
}

.members-sort-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.members-page {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.members-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 0.75rem;
  flex: 1 1 auto;
  align-items: stretch;
}

.members-list-pane,
.member-detail {
  background: var(--bg-pane);
  border: 1px solid var(--border);
  padding: 0.75rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.htop-meters {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.htop-meter-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
}

.htop-meter-label {
  min-width: 2.5rem;
  color: var(--accent-2);
  font-weight: 700;
}

.htop-meter-wide {
  flex: 1 1 auto;
  height: 0.6rem;
  accent-color: var(--accent-2);
}

.htop-header {
  margin: 0 0 0.5rem 0;
  padding: 0.25rem 0.5rem;
  background: var(--session-bg);
  color: var(--session-fg);
  font-weight: 700;
  font-size: 0.85rem;
}

.htop-scroll {
  overflow-x: auto;
}

.htop-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.htop-table th {
  text-align: left;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border);
  padding: 0.3rem 0.45rem;
  white-space: nowrap;
}

.htop-table td {
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid var(--bg-elevated);
  vertical-align: middle;
}

.htop-table tbody tr:hover {
  background: var(--bg-elevated);
}

.htop-row--selected {
  background: var(--bg-elevated);
  box-shadow: inset 3px 0 0 var(--accent-2);
}

.htop-footer {
  margin-top: auto;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.htop-num {
  color: var(--fg-muted);
  white-space: nowrap;
}

.htop-user {
  white-space: nowrap;
  font-weight: 600;
}

.htop-cpu {
  white-space: nowrap;
}

.htop-meter {
  width: 3.5rem;
  height: 0.55rem;
  margin-left: 0.35rem;
  vertical-align: middle;
  accent-color: var(--accent-2);
}

.htop-cmd {
  color: var(--fg-muted);
  max-width: 24rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-card-head {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.member-avatar-img {
  border: 2px solid var(--border-active);
  border-radius: 50%;
  background: var(--bg-elevated);
  object-fit: cover;
  flex: none;
}

.member-avatar-ascii {
  margin: 0;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border-active);
  background: var(--bg-elevated);
  color: var(--accent-2);
  line-height: 1.2;
  flex: none;
}

.member-name {
  margin: 0 0 0.2rem 0;
  color: var(--accent);
  font-size: 1.1rem;
}

.member-status {
  margin: 0.25rem 0 0 0;
  color: var(--warn);
}

.member-bio {
  margin: 0.75rem 0;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--accent-2);
  background: var(--bg-elevated);
}

.member-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.75rem 0;
}

.member-chip {
  font-size: 0.82rem;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--accent-2);
}

.member-links {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.neofetch-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}

.neofetch-specs {
  margin: 0;
  display: grid;
  gap: 0.25rem;
}

.neofetch-specs div {
  display: flex;
  gap: 0.5rem;
}

.neofetch-specs dt {
  min-width: 4.5rem;
  color: var(--accent);
  font-weight: 700;
}

.neofetch-specs dd {
  margin: 0;
}

.neofetch-swatches {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.75rem;
}

.swatch {
  width: 1.5rem;
  height: 0.75rem;
  display: inline-block;
}

.swatch--1 { background: var(--bg-elevated); }
.swatch--2 { background: var(--danger); }
.swatch--3 { background: var(--accent-2); }
.swatch--4 { background: var(--warn); }
.swatch--5 { background: var(--accent); }
.swatch--6 { background: var(--fg); }

.neofetch-logo {
  margin: 0;
  color: var(--fg);
  font-size: clamp(3.5px, 0.36vw, 5.5px);
  line-height: 1.0;
  white-space: pre;
  flex: none;
}

.neofetch-title {
  margin: 0;
  color: var(--accent-2);
  font-weight: 700;
}

.neofetch-sep {
  margin: 0 0 0.4rem 0;
  color: var(--fg-muted);
}

.neofetch-palette {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.25rem;
}

/* --- Window 2:repos (git log --oneline + tree) --- */

.repos-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.repos-status-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem 0;
  color: var(--fg-muted);
}

.source-badge {
  color: var(--accent-2);
  font-weight: 700;
}

.repo-log-list,
.repo-tree-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.6rem;
}

.repo-log-item {
  padding: 0.65rem 0.85rem;
  background: var(--bg-elevated);
  border-left: 3px solid var(--border-active);
}

.repo-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.repo-date {
  color: var(--fg-muted);
  font-size: 0.85rem;
}

.repo-name {
  font-weight: 700;
}

.repo-stars {
  color: var(--warn);
  font-size: 0.88rem;
}

.repo-desc {
  margin: 0.35rem 0 0 0;
  color: var(--fg-muted);
}

.repo-tree-root {
  margin: 0 0 0.4rem 0;
  font-weight: 700;
  color: var(--accent-2);
}

.repo-tree-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0;
}

/* --- Phase 5: Command Palette, Boot Sequence, & Matrix --- */

.palette-dialog {
  width: min(46rem, 94vw);
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.palette-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.palette-head h2 {
  margin: 0;
}

.palette-log {
  max-height: 40vh;
  overflow-y: auto;
  background: var(--bg-pane);
  border: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
  display: grid;
  gap: 0.5rem;
}

.palette-cmd {
  margin: 0;
  color: var(--accent-2);
  font-weight: 700;
}

.palette-out {
  margin: 0.2rem 0 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--fg);
}

.palette-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-pane);
  border: 1px solid var(--border-active);
  padding: 0.35rem 0.5rem;
}

.palette-prompt-label {
  color: var(--accent-2);
  font-weight: 700;
}

.palette-input {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  color: var(--fg);
  background: transparent;
  border: 0;
  outline: none;
}

.palette-input:focus,
.palette-input:focus-visible {
  outline: none;
}

.palette-form:focus-within {
  border-color: var(--accent-2);
}

.palette-themes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.boot-box {
  width: min(42rem, 92vw);
}

.boot-log {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 1rem 0;
  display: grid;
  gap: 0.3rem;
}

.boot-ok {
  color: var(--accent-2);
  font-weight: 700;
}

.boot-fail {
  color: var(--danger);
  font-weight: 700;
}

.matrix-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  overflow: hidden;
}

.matrix-streams {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
  width: 100%;
  flex: 1 1 auto;
  overflow: hidden;
}

.matrix-col {
  margin: 0;
  color: var(--accent-2);
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 0.2rem;
  animation: matrix-fall 4s linear infinite;
}

.matrix-close {
  position: relative;
  z-index: 1;
  background: var(--bg-elevated);
}

@keyframes matrix-fall {
  0% {
    transform: translateY(-20%);
  }
  100% {
    transform: translateY(20%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .matrix-col {
    animation: none;
  }
}

/* --- Enriched Member Detail: Live GitHub Card + Crimson Heatmap --- */

.member-detail-inner {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  height: 100%;
}

.gh-card-section,
.heatmap-section {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.gh-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.5rem;
}

.gh-stat-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.4rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.gh-stat-val {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
}

.gh-stat-lbl {
  color: var(--fg-muted);
  font-size: 0.76rem;
}

.gh-meta-line,
.gh-bio {
  margin: 0.35rem 0;
  font-size: 0.86rem;
}

.gh-top-repos {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
  display: grid;
  gap: 0.35rem;
}

.gh-top-repo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.5rem;
  background: var(--bg-elevated);
  border-left: 2px solid var(--border-active);
}

.heatmap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  grid-template-rows: repeat(7, 0.72rem);
  grid-auto-flow: column;
  gap: 3px;
}

.heat-cell {
  display: block;
  width: 0.72rem;
  height: 0.72rem;
  border: 1px solid var(--border);
}

.heatmap-grid .heat-cell {
  width: 100%;
  height: 100%;
}

.heat-0 { background: var(--bg-pane); }
.heat-1 { background: #450a0a; border-color: #7f1d1d; }
.heat-2 { background: #7f1d1d; border-color: #991b1b; }
.heat-3 { background: #b91c1c; border-color: #dc2626; }
.heat-4 { background: var(--accent-2); border-color: var(--accent-2); }

.member-actions {
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.member-actions .tmux-vkey {
  text-decoration: none;
}

/* --- Phase 6: About, Memes, Contribute & Security --- */

.doc-toolbar,
.meme-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.doc-toolbar .tmux-vkey {
  text-decoration: none;
}

.md-body {
  max-width: 58rem;
  line-height: 1.65;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(20rem, 0.9fr);
  gap: 1rem;
  align-items: start;
}

.about-main {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.about-aside {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.about-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-active);
  padding: 0.75rem 0.9rem;
}

.about-kv {
  margin: 0.6rem 0 0 0;
  display: grid;
  gap: 0.35rem;
  font-size: 0.86rem;
}

.about-kv div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.about-kv dt {
  color: var(--fg-muted);
}

.about-kv dd {
  margin: 0;
  text-align: right;
}

.about-timeline {
  list-style: none;
  padding: 0;
  margin: 0.35rem 0 0 0;
  display: grid;
  gap: 0.45rem;
  font-size: 0.86rem;
}

.about-timeline li {
  display: flex;
  gap: 0.55rem;
  align-items: baseline;
}

.about-hash {
  color: var(--accent-2);
  font-weight: 700;
  flex-shrink: 0;
}

.about-quota-label {
  min-width: 4.5rem;
}

.about-quota-val {
  min-width: 7.5rem;
  text-align: right;
  color: var(--fg-muted);
  font-size: 0.8rem;
}

.contribute-page .doc-toolbar {
  margin-bottom: 0.5rem;
  padding: 0.4rem 0.65rem;
}

.contribute-page .repos-status-line {
  margin: 0;
}

.contribute-page .md-body {
  line-height: 1.5;
}

.contribute-page .md-body h1,
.contribute-page .md-body h2,
.contribute-page .md-body h3 {
  margin: 0.65rem 0 0.35rem 0;
}

.contribute-page .md-body p,
.contribute-page .md-body ol,
.contribute-page .md-body ul {
  margin: 0.35rem 0;
}

.contribute-page .md-body pre {
  margin: 0.4rem 0;
  padding: 0.5rem 0.7rem;
}

.md-body h1,
.md-body h2,
.md-body h3 {
  color: var(--accent);
  margin: 1.1rem 0 0.5rem 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
}

.md-body code {
  background: var(--bg-elevated);
  color: var(--accent-2);
  padding: 0.1rem 0.35rem;
}

.md-body pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.75rem;
  overflow-x: auto;
}

.md-body pre code {
  padding: 0;
  background: transparent;
}

.md-body blockquote {
  margin: 0.75rem 0;
  padding: 0.4rem 0.75rem;
  border-left: 3px solid var(--accent-2);
  background: var(--bg-elevated);
}

.meme-cowsay {
  margin: 0 0 0.85rem 0;
  padding: 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-active);
  color: var(--accent-2);
  overflow-x: auto;
}

.meme-feed {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(24rem, 100%), 1fr));
  gap: 0.75rem;
}

.meme-entry {
  padding: 0.75rem 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-active);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: border-color 120ms ease;
}

.meme-entry:hover {
  border-color: var(--border-active);
}

.meme-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.meme-title {
  color: var(--accent);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meme-body {
  margin: 0.35rem 0 0 0;
}

.meme-ascii {
  margin: 0.5rem 0 0 0;
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--fg-muted);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: hidden;
}

.meme-img-btn {
  margin-top: auto;
  padding: 0;
  width: 100%;
  display: block;
  background: var(--bg-pane);
  border: 1px solid var(--border);
  cursor: zoom-in;
}

.meme-img-btn:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.meme-img {
  display: block;
  width: 100%;
  height: 16rem;
  object-fit: contain;
  background: var(--bg-pane);
}

.meme-lightbox {
  width: min(56rem, 94vw);
  max-width: none;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.meme-lightbox-img {
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
  background: var(--bg-pane);
  border: 1px solid var(--border);
}

.gallery-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(17.5rem, 100%), 1fr));
  gap: 0.75rem;
}

.gallery-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: border-color 120ms ease;
  overflow: hidden;
}

.gallery-card:hover {
  border-color: var(--border-active);
}

.gallery-btn {
  all: unset;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
  box-sizing: border-box;
}

.gallery-btn:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: -2px;
}

.gallery-frame {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-pane);
  border-bottom: 1px solid var(--border);
}

.gallery-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.gallery-card:hover .gallery-img {
  transform: scale(1.03);
}

@media (prefers-reduced-motion: reduce) {
  .gallery-img {
    transition: none;
  }
  .gallery-card:hover .gallery-img {
    transform: none;
  }
}

.gallery-caption {
  padding: 0.55rem 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.84rem;
}

.gallery-num {
  color: var(--accent-2);
  font-weight: 700;
  flex-shrink: 0;
}

.gallery-title {
  color: var(--accent);
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-grid {
  position: relative;
  min-height: 100%;
}

.home-copy {
  position: relative;
  z-index: 1;
  padding: 0.5rem 0 0 1rem;
}

.home-status-box {
  margin: 1rem 0 0 0;
  padding: 0.6rem 0.9rem;
  width: fit-content;
  max-width: min(44rem, 100%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent-2);
}

.home-status-title {
  margin: 0 0 0.4rem 0;
  color: var(--accent-2);
  font-weight: 700;
  font-size: 0.85rem;
}

.home-status-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, auto));
  gap: 0.25rem 1.75rem;
  font-size: 0.88rem;
}

.home-status-grid div {
  display: flex;
  gap: 0.5rem;
}

.home-status-grid dt {
  min-width: 3.75rem;
  color: var(--fg-muted);
}

.home-status-grid dd {
  margin: 0;
}

.home-status-wide {
  grid-column: 1 / -1;
}

.home-art {
  position: absolute;
  inset: -1rem -1.25rem -1rem 0;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.home-mascot-img {
  display: block;
  height: 95%;
  width: auto;
  max-width: none;
  transform: translate(12%, 2px);
  user-select: none;
  pointer-events: none;
}

@media (max-width: 960px) {
  .home-copy {
    padding: 0;
  }

  .home-status-grid {
    grid-template-columns: 1fr;
  }

  .home-art {
    position: static;
    inset: auto;
    margin: 1rem 0 0 0;
    justify-content: center;
  }

  .home-mascot-img {
    height: auto;
    max-width: 100%;
    max-height: 50vh;
    transform: none;
  }

  .members-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }
}

* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  display: none;
}

/* --- Linux / Hyprland-style compositor micro-animations --- */

@keyframes tmux-pane-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tmux-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes tmux-pop-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes tmux-slide-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tmux-pane > section {
  animation: tmux-pane-in 360ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tmux-win-tab {
  position: relative;
  transition:
    background-color 240ms ease,
    color 240ms ease,
    transform 120ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tmux-win-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent-2);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tmux-win-tab:hover::after,
.tmux-win-tab--active::after {
  transform: scaleX(1);
}

.tmux-win-tab:active,
.tmux-vkey:active {
  transform: translateY(1px);
}

.tmux-vkey {
  transition:
    background-color 220ms ease,
    border-color 220ms ease,
    color 220ms ease,
    transform 120ms cubic-bezier(0.16, 1, 0.3, 1);
}

.home-menu-item {
  transition:
    transform 260ms cubic-bezier(0.16, 1, 0.3, 1),
    color 240ms ease,
    border-color 240ms ease;
}

.home-menu-item:hover {
  transform: translateX(6px);
}

.about-card {
  transition: border-color 240ms ease;
}

.about-card:hover {
  border-color: var(--border-active);
}

.tmux-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  animation: tmux-fade-in 240ms ease-out both;
}

.tmux-dialog,
.meme-lightbox {
  will-change: transform, opacity;
  animation: tmux-pop-in 300ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.tmux-hints {
  will-change: transform, opacity;
  animation: tmux-slide-up 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .tmux-pane > section,
  .tmux-overlay,
  .tmux-dialog,
  .meme-lightbox,
  .tmux-hints {
    animation: none !important;
  }

  .tmux-win-tab,
  .tmux-win-tab::after,
  .tmux-vkey,
  .home-menu-item,
  .about-card {
    transition: none !important;
  }

  .tmux-win-tab:active,
  .tmux-vkey:active,
  .home-menu-item:hover {
    transform: none !important;
  }
}

/* --- Mobile-only polish (<= 768px; desktop untouched) --- */

@media (max-width: 768px) {
  .tmux-pane {
    padding: 0.75rem 0.8rem;
    font-size: 0.9rem;
  }

  .tmux-ascii {
    font-size: clamp(0.26rem, 1.75vw, 0.52rem);
    line-height: 1.05;
    overflow: hidden;
    margin: 0.4rem 0 0.6rem 0;
  }

  .home-grid {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .home-copy {
    display: contents;
  }

  .home-copy > * {
    order: 3;
  }

  .home-copy > .tmux-prompt,
  .home-copy > .tmux-ascii,
  .home-copy > .home-motd {
    order: 1;
  }

  .home-art {
    order: 2;
    position: static;
    inset: auto;
    margin: 0.4rem 0 0.5rem 0;
    padding: 0.25rem 0 0 0;
    opacity: 1;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    border-bottom: 1px solid var(--border);
  }

  .home-mascot-img {
    height: 12.5rem;
    width: auto;
    max-width: 100%;
    max-height: none;
    object-fit: contain;
    transform: none;
  }

  .home-heading {
    font-size: 1.35rem;
  }

  .home-menu-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.45rem 0.6rem;
    border-left: 2px solid var(--border);
  }

  .home-menu-key {
    min-width: 0;
  }

  .home-status-box {
    width: 100%;
    max-width: 100%;
  }

  .tmux-status-bar {
    height: auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.45rem;
    padding: 0.4rem 0.5rem max(0.4rem, env(safe-area-inset-bottom));
  }

  .tmux-status-left {
    display: contents;
  }

  .tmux-windows {
    order: 1;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.25rem;
    overflow: visible;
  }

  .tmux-win-tab {
    text-align: center;
    font-size: 0.76rem;
    padding: 0.24rem 0.25rem;
    background: var(--bg-pane);
    border: 1px solid var(--border);
  }

  .tmux-win-tab--active {
    border-color: var(--border-active);
  }

  .tmux-session-badge {
    order: 2;
    font-size: 0.76rem;
    padding: 0.12rem 0.4rem;
  }

  .tmux-status-right {
    display: flex;
    order: 3;
    font-size: 0.76rem;
    margin-right: auto;
    gap: 0.4rem;
  }

  .tmux-status-keys {
    order: 4;
    gap: 0.25rem;
  }

  .tmux-status-keys .tmux-vkey {
    padding: 0.18rem 0.42rem;
    font-size: 0.76rem;
  }

  .htop-table {
    width: 100%;
    table-layout: fixed;
  }

  .htop-table th:nth-child(1),
  .htop-table td:nth-child(1),
  .htop-table th:nth-child(4),
  .htop-table td:nth-child(4),
  .htop-table th:nth-child(5),
  .htop-table td:nth-child(5) {
    display: none;
  }

  .htop-table th:nth-child(2),
  .htop-table td:nth-child(2) {
    width: 58%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .htop-table th:nth-child(3),
  .htop-table td:nth-child(3) {
    width: 42%;
  }

  .htop-footer {
    font-size: 0.74rem;
    gap: 0.35rem;
  }

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

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .gallery-caption {
    padding: 0.4rem 0.45rem;
    font-size: 0.75rem;
  }

  .gallery-caption .member-chip {
    display: none;
  }

  .doc-toolbar,
  .meme-toolbar,
  .members-toolbar {
    padding: 0.45rem 0.55rem;
    gap: 0.45rem;
  }

  .meme-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }

  .meme-toolbar .members-sort-group {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.1rem;
  }

  .meme-toolbar .tmux-vkey {
    flex-shrink: 0;
    font-size: 0.78rem;
  }

  .about-kv div {
    flex-direction: column;
    gap: 0.1rem;
  }

  .about-kv dd {
    text-align: left;
  }

  .meme-lightbox {
    width: 94vw;
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .meme-lightbox .palette-head {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .meme-lightbox-img {
    max-height: 56vh;
  }
}
